Commit Graph

18 Commits

Author SHA1 Message Date
Elliot Glaysher
8255fc0e8c natpmp: formatting and cleanup old pmp handle 2020-08-20 20:23:25 -04:00
Elliot Glaysher
15f0df81f1 natpmp: when reopening laptop, reestablish a connection to the router. 2020-08-20 15:47:02 -04:00
Elliot Glaysher
88428961dd natpmp: also detect 172.16.0/0/12 ips as private. 2020-08-19 14:02:03 -04:00
Elliot Glaysher
1401d7bc5c natpmp: fix error handling and don't die on errors in getpubliaddress
This fixes a case where the natpmp async could pure () instead of
recursing, which would lock ames. This also adds some more error
handling on the haskell side of things and disables the raw fprintfs
in the c bindings layer.
2020-08-19 12:53:59 -04:00
Elliot Glaysher
60e2ae02a2 natpmp: cleanup by using a tristate 2020-08-18 15:43:31 -04:00
Elliot Glaysher
dca4344a45 natpmp: By default, only try to talk to the router on private ips.
Since startup hangs for seconds when you are not behind a router,
but still attempt to ask one to open ports for you, by default,
only try to contact the router if the local ip is 192.168.*.* or
10.*.*.*.

Also make port forwarding force on/off.
2020-08-18 12:22:45 -04:00
Elliot Glaysher
81e3a8f927 natpmp: cleanups for ~master-morzod 2020-08-17 10:58:48 -04:00
Elliot Glaysher
14d1b59117 natpmp: even more cleanup 2020-08-14 10:23:39 -04:00
Elliot Glaysher
b4878a8b03 natpmp: Separate out the PortThreadMsgs from the heap actions. 2020-08-13 13:36:20 -04:00
Elliot Glaysher
a3336fde41 natpmp: more nits 2020-08-13 11:52:42 -04:00
Elliot Glaysher
1183ac0b22 natpmp: checkpoint while addressing comments 2020-08-13 11:12:26 -04:00
Elliot Glaysher
3e6fd0f8e8 natpmp: ~pilfer style nits 2020-08-13 10:08:02 -04:00
Elliot Glaysher
2e66ae10ec natpmp: use MonadIO in the bindings to remove unsightly "io $" 2020-08-10 13:15:03 -04:00
Elliot Glaysher
4d8c6ad09a nat-pmp: improve error and diagnostic messages 2020-08-10 13:02:13 -04:00
Elliot Glaysher
149565cd97 king: get tests passing after nat-pmp changes 2020-08-07 13:04:57 -04:00
Elliot Glaysher
6368aa2b02 king: Turn NAT-PMP on by default, with a flag to disable.
Also: error checking.
2020-08-07 12:42:00 -04:00
Elliot Glaysher
a3e33644a9 king: port forward ames traffic behind a NAT.
Tested with a comet trying to receive traffic from a planet in the
cloud. (h/t ~master-morzod)
2020-08-06 16:26:22 -04:00
Elliot Glaysher
86b445b7cb king: First attempt at integration with NATPMP.
This sets up a separate thread to handle scheduling of lease
renewals.
2020-08-05 15:33:37 -04:00