David Anderson
0ed9f62ed0
tstest/natlab: provide inbound interface to HandlePacket.
...
Requires a bunch of refactoring so that Networks only ever
refer to Interfaces that have been attached to them, and
Interfaces know about both their Network and Machine.
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-10 20:08:48 -07:00
Brad Fitzpatrick
6c74065053
wgengine/magicsock, tstest/natlab: start hooking up natlab to magicsock
...
Also adds ephemeral port support to natlab.
Work in progress.
Pairing with @danderson.
2020-07-10 14:32:58 -07:00
David Anderson
0aea087766
tstest/natlab: add PacketHandler and Inject.
...
Together, they can be used to plug custom packet processors into
Machines.
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-02 21:51:09 -07:00
David Anderson
73db7e99ab
tstest/natlab: make Machine constructible directly.
...
This is a prelude to adding more fields, which would otherwise
become more unnamed function params.
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-02 21:51:09 -07:00
David Anderson
d94593e884
tstest/natlab: unregister conn4 if registration of conn6 fails.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-03 02:27:31 +00:00
David Anderson
d7bc4ec029
tstest/natlab: use common helper for conn registration.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-03 02:26:54 +00:00
David Anderson
80a14c49c6
tstest/natlab: add comments to conns4/conns6.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-03 02:23:01 +00:00
David Anderson
c53b154171
tstest/natlab: use &Network in test.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-03 02:22:06 +00:00
David Anderson
622c0d0cb3
tstest/natlab: print trace data when NATLAB_TRACE is set.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-03 02:10:41 +00:00
David Anderson
1d4f9852a7
tstest/natlab: correctly handle dual-stacked PacketConns.
...
Adds a test with multiple networks, one of which is v4-only.
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-02 19:09:31 -07:00
David Anderson
771eb05bcb
tstest/natlab: first network attached becomes the default route.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-03 01:03:05 +00:00
David Anderson
f2e5da916a
tstest/natlab: allow sensible default construction of networks.
...
Add a test for LAN->LAN traffic.
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-07-03 00:53:24 +00:00
Brad Fitzpatrick
97910ce712
tstest/natlab: remove unused PacketConner type
2020-07-02 14:50:04 -07:00
Brad Fitzpatrick
14b4213c17
tstest/natlab: add missing tests from earlier commits
...
Now you can actually see that packet delivery works.
Pairing with @danderson
2020-07-02 14:19:43 -07:00
Brad Fitzpatrick
3f4f1cfe66
tstest/natlab: basic NAT-free packet delivery works
...
Pairing with @danderson
2020-07-02 14:18:36 -07:00
Brad Fitzpatrick
a477e70632
tstest/natlab: network address allocation
...
Pairing with @danderson
2020-07-02 13:39:41 -07:00
Brad Fitzpatrick
bb1a9e4700
tstest/natlab: bit more of in-memory network testing package
...
Pairing with @danderson
2020-07-02 13:02:13 -07:00
Brad Fitzpatrick
23c93da942
tstest/natlab: start of in-memory network testing package
...
Pairing with @danderson
2020-07-02 12:36:12 -07:00