-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iroh-net): Upnp port mapping (#1117)
* add igd * add log, use types for readability * request mapping * fix code placement + comments * filling in the gaps * some cleanup and refactor * debugging * debug cleanning * merge cleanup * easy doctor appointment * debug cleanning * use non zero to ensure port to map is positive * spelling * follow iroh code style * log when probe fails * update comment * more logs, use localhost * add portmap metrics to iroh-metrics * use portmap metrics * add client * wip: closing for the day * wip * more wip * connecting stuff * coding with the heart lol * fixes * customize timeout of portmapping doctor command * on_change for portmap * improve docs and logs * add mapping struct that handles maintenance * add waker * improve debug logs * connect with mapping thing * partially connect current mapping stream * simplify mapping handling and add a sanity test * remove hardcoded mapping half life * remove unused field * ensure external port is non zero * simplify test types, reduce test timeout * add external addr fn to mapping * rework getting a new upnp mapping to reuse a known gateway and or known external port * connect expiry and renew events * split client functions * update doctor command * add service channel capacity * remove unnecesary change * leverage derive_more and the utils mod * remove yet one more unnecesary clone * Revert "remove yet one more unnecesary clone" might be controversial since technically the probe starts before the report This reverts commit f558246. * misc spelling * misc docs * cleanup * more cleanup * simplify logic updating a probe * appease clippy * expand comment * expand metrics * self review * improve doctor docs * unflatten portmap probe * get interfaces * get interfaces using dep already here
- Loading branch information
1 parent
b14049e
commit 701e9b7
Showing
13 changed files
with
1,172 additions
and
148 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ mod service; | |
pub mod iroh; | ||
pub mod magicsock; | ||
pub mod netcheck; | ||
pub mod portmap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
super::make_metric_recorders! { | ||
Portmap, | ||
|
||
/* | ||
* General port mapping metrics | ||
*/ | ||
ProbesStarted: Counter: "Number of probing tasks started.", | ||
LocalPortUpdates: Counter: "Number of updates to the local port.", | ||
MappingAttempts: Counter: "Number of mapping tasks started.", | ||
MappingFailures: Counter: "Number of failed mapping tasks", | ||
ExternalAddressUpdated: Counter: "Number of times the external address obtained via port mapping was updated.", | ||
|
||
/* | ||
* UPnP metrics | ||
*/ | ||
UpnpProbes: Counter: "Number of UPnP probes executed.", | ||
UpnpProbesFailed: Counter: "Number of failed Upnp probes", | ||
UpnpAvailable: Counter: "Number of UPnP probes that found it available.", | ||
UpnpGatewayUpdated: Counter: "Number of UPnP probes that resulted in a gateway different to the previous one.", | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.