Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon #11901

Merged
merged 2 commits into from
Apr 28, 2024

Conversation

bradfitz
Copy link
Member

In prep for most of the package funcs in net/interfaces to become
methods in a long-lived netmon.Monitor that can cache things. (Many
of the funcs are very heavy to call regularly, whereas the long-lived
netmon.Monitor can subscribe to things from the OS and remember
answers to questions it's asked regularly later)

Updates tailscale/corp#10910
Updates tailscale/corp#18960
Updates #7967
Updates #3299

... in prep for merging the net/interfaces package into net/netmon.

This is a no-op change that updates a bunch of the API signatures ahead of
a future change to actually move things (and remove the type alias)

Updates tailscale/corp#10910
Updates tailscale/corp#18960
Updates #7967
Updates #3299

Change-Id: I477613388f09389214db0d77ccf24a65bff2199c
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz bradfitz requested a review from maisem April 28, 2024 04:20
@bradfitz bradfitz force-pushed the bradfitz/interface_into_netmon_step1_alias branch 3 times, most recently from 991383b to 5ea166d Compare April 28, 2024 04:25
@@ -389,7 +388,7 @@ const numIncrementalRegions = 3

// makeProbePlan generates the probe plan for a DERPMap, given the most
// recent report and whether IPv6 is configured on an interface.
func makeProbePlan(dm *tailcfg.DERPMap, ifState *interfaces.State, last *Report) (plan probePlan) {
func makeProbePlan(dm *tailcfg.DERPMap, ifState *netmon.State, last *Report) (plan probePlan) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename to netmon.InterfaceState?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of the motivation of the move is that interfaces.State isn't just interface state, though... it also has routing state: the default route. And maybe more in the future (folding in the net/routetable stuff?). So just "State" (network state... interfaces + routes + whatever else) seemed fitting. And shorter.

…etmon

In prep for most of the package funcs in net/interfaces to become
methods in a long-lived netmon.Monitor that can cache things.  (Many
of the funcs are very heavy to call regularly, whereas the long-lived
netmon.Monitor can subscribe to things from the OS and remember
answers to questions it's asked regularly later)

Updates tailscale/corp#10910
Updates tailscale/corp#18960
Updates #7967
Updates #3299

Change-Id: Ie4e8dedb70136af2d611b990b865a822cd1797e5
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz bradfitz force-pushed the bradfitz/interface_into_netmon_step1_alias branch from 5ea166d to e04e877 Compare April 28, 2024 13:52
@bradfitz bradfitz merged commit b9adbe2 into main Apr 28, 2024
46 of 48 checks passed
@bradfitz bradfitz deleted the bradfitz/interface_into_netmon_step1_alias branch April 28, 2024 14:34
kari-ts added a commit to tailscale/tailscale-android that referenced this pull request May 1, 2024
Update net/interfaces to netmon per tailscale/tailscale#11901

Signed-off-by: kari-ts <kari@tailscale.com>
kari-ts added a commit to tailscale/tailscale-android that referenced this pull request May 2, 2024
Update net/interfaces to netmon per tailscale/tailscale#11901

Signed-off-by: kari-ts <kari@tailscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants