plan9fox/sys/man/3
cinap_lenrek d2a7d88662 devip: implement network address translation routes
This adds a new route "t"-flag that enables network address translation,
replacing the source address (and local port) of a forwarded packet to
one of the outgoing interface.

The state for a translation is kept in a new Translation structure,
which contains two Iphash entries, so it can be inserted into the
per protocol 4-tuple hash table, requiering no extra lookups.

Translations have a low overhead (~200 bytes on amd64),
so we can have many of them. They get reused after 5 minutes
of inactivity or when the per protocol limit of 1000 entries
is reached (then the one with longest inactivity is reused).

The protocol needs to export a "forward" function that is responsible
for modifying the forwarded packet, and then handle translations in
its input function for iphash hits with Iphash.trans != 0.

This patch also fixes a few minor things found during development:

- Include the Iphash in the Conv structure, avoiding estra malloc
- Fix ttl exceeded check (ttl < 1 -> ttl <= 1)
- Router should not reply with ttl exceeded for multicast flows
- Extra checks for icmp advice to avoid protocol confusions.
2022-03-12 20:53:17 +00:00
..
0intro /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
aoe /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
apm /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
arch minor man page typos 2021-04-08 21:42:31 +02:00
audio mainly just spelling and typos 2021-11-01 20:49:43 +00:00
bridge devbridge: implement experimental vlan support 2022-02-16 22:38:03 +00:00
cap /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
cmd man page fixes (thanks stuart morrow) 2021-08-24 21:45:37 +00:00
cons devsons: remove #c/pgrpid 2020-12-19 14:59:19 +01:00
draw draw(3): typo dp 2020-04-13 00:33:26 +02:00
dup /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
env devenv: allow environment total size of up to 1MB 2022-01-23 21:33:58 +00:00
ether ether: allow spoofing of source mac address for bridges; used by vmx 2017-12-15 22:22:29 +01:00
flash man pages: SYNOPSYS typo 2018-03-20 18:24:26 +01:00
floppy /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
fs /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
i82365 /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
ip devip: implement network address translation routes 2022-03-12 20:53:17 +00:00
kbd kbd(1): revert repeat/delay change 2020-04-01 11:42:35 +02:00
kprof /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
loopback devloopback: reassign device letter from #X to #λ to avoid collision with devvmx 2018-02-25 19:06:37 +01:00
lpt /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
mnt /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
mouse mouse(3): mousein is NOT exclusive, see 30907f1d00 2021-07-09 14:40:23 +00:00
pipe /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
pnp /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
proc /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
root /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
rtc /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
sd /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
sdahci sdahci(3): correct device name for top level control messages (thanks joe9) 2018-09-11 00:23:35 -07:00
sdaoe /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
sdloop sdloop(3): import sdloop driver (thanks erik) 2018-08-10 08:08:38 -07:00
sdp /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
segment segment(3): restore missing phrase 2021-06-27 00:18:49 +00:00
shr /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
srv /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
swap /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
tls /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
twsi twsi(3): fix wrong unicode codepoint in manpage 2018-02-11 21:54:10 +00:00
uart /sys/man/*/*: fix perms (sorry) 2017-12-11 19:58:06 -05:00
usb man page fixes (thanks stuart morrow) 2021-08-24 21:45:37 +00:00
vga devvga: implement screen tilting, remove panning and overlays 2020-12-27 23:08:59 +01:00
vmx [9front] [PATCH] fix small typo in vmx(3) 2021-03-06 22:52:00 +01:00