freebsd-dev/sys/netipsec
Gleb Smirnoff fcb3f813f3 netinet*: remove PRC_ constants and streamline ICMP processing
In the original design of the network stack from the protocol control
input method pr_ctlinput was used notify the protocols about two very
different kinds of events: internal system events and receival of an
ICMP messages from outside.  These events were coded with PRC_ codes.
Today these methods are removed from the protosw(9) and are isolated
to IPv4 and IPv6 stacks and are called only from icmp*_input().  The
PRC_ codes now just create a shim layer between ICMP codes and errors
or actions taken by protocols.

- Change ipproto_ctlinput_t to pass just pointer to ICMP header.  This
  allows protocols to not deduct it from the internal IP header.
- Change ip6proto_ctlinput_t to pass just struct ip6ctlparam pointer.
  It has all the information needed to the protocols.  In the structure,
  change ip6c_finaldst fields to sockaddr_in6.  The reason is that
  icmp6_input() already has this address wrapped in sockaddr, and the
  protocols want this address as sockaddr.
- For UDP tunneling control input, as well as for IPSEC control input,
  change the prototypes to accept a transparent union of either ICMP
  header pointer or struct ip6ctlparam pointer.
- In icmp_input() and icmp6_input() do only validation of ICMP header and
  count bad packets.  The translation of ICMP codes to errors/actions is
  done by protocols.
- Provide icmp_errmap() and icmp6_errmap() as substitute to inetctlerrmap,
  inet6ctlerrmap arrays.
- In protocol ctlinput methods either trust what icmp_errmap() recommend,
  or do our own logic based on the ICMP header.

Differential revision:	https://reviews.freebsd.org/D36731
2022-10-03 20:53:04 -07:00
..
ah_var.h
ah.h
esp_var.h
esp.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
ipcomp_var.h
ipcomp.h
ipsec6.h netipsec: move specific ipsecmethods declarations to ipsec_support.h 2022-10-03 20:53:04 -07:00
ipsec_input.c netinet*: remove PRC_ constants and streamline ICMP processing 2022-10-03 20:53:04 -07:00
ipsec_mbuf.c Fix unused variable warning in ipsec_mbuf.c 2022-07-21 22:12:01 +02:00
ipsec_mod.c ipsec: Handle ICMP NEEDFRAG message. 2021-08-09 12:01:46 +02:00
ipsec_output.c netipsec: move specific ipsecmethods declarations to ipsec_support.h 2022-10-03 20:53:04 -07:00
ipsec_pcb.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
ipsec_support.h netinet*: remove PRC_ constants and streamline ICMP processing 2022-10-03 20:53:04 -07:00
ipsec.c ipsec: replace SECASVAR mtx by rmlock 2022-07-19 05:27:20 +02:00
ipsec.h netipsec: move specific ipsecmethods declarations to ipsec_support.h 2022-10-03 20:53:04 -07:00
key_debug.c Fix unused variable warning in netipsec's key_debug.c 2022-07-26 21:25:09 +02:00
key_debug.h
key_var.h
key.c keysock: do not use raw socket code 2022-08-11 09:19:36 -07:00
key.h netipsec: use SYSINIT(9) instead of dom_init/dom_destroy 2022-01-03 10:15:21 -08:00
keydb.h ipsec: replace SECASVAR mtx by rmlock 2022-07-19 05:27:20 +02:00
keysock.c protosw: refactor protosw and domain static declaration and load 2022-08-17 11:50:32 -07:00
keysock.h keysock: do not use raw socket code 2022-08-11 09:19:36 -07:00
subr_ipsec.c ipsec: Handle ICMP NEEDFRAG message. 2021-08-09 12:01:46 +02:00
udpencap.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
xform_ah.c ipsec: replace SECASVAR mtx by rmlock 2022-07-19 05:27:20 +02:00
xform_esp.c ipsec: replace SECASVAR mtx by rmlock 2022-07-19 05:27:20 +02:00
xform_ipcomp.c ipsec: replace SECASVAR mtx by rmlock 2022-07-19 05:27:20 +02:00
xform_tcp.c syncache: accept packet with no SA when TCP_MD5SIG is set 2022-01-08 16:32:14 -09:00
xform.h Simplify IPsec transform-specific teardown. 2020-06-25 23:59:16 +00:00