freebsd-nq/sys/netinet
Luigi Rizzo 2b25acc158 Remove (almost all) global variables that were used to hold
packet forwarding state ("annotations") during ip processing.
The code is considerably cleaner now.

The variables removed by this change are:

        ip_divert_cookie        used by divert sockets
        ip_fw_fwd_addr          used for transparent ip redirection
        last_pkt                used by dynamic pipes in dummynet

Removal of the first two has been done by carrying the annotations
into volatile structs prepended to the mbuf chains, and adding
appropriate code to add/remove annotations in the routines which
make use of them, i.e. ip_input(), ip_output(), tcp_input(),
bdg_forward(), ether_demux(), ether_output_frame(), div_output().

On passing, remove a bug in divert handling of fragmented packet.
Now it is the fragment at offset 0 which sets the divert status of
the whole packet, whereas formerly it was the last incoming fragment
to decide.

Removal of last_pkt required a change in the interface of ip_fw_chk()
and dummynet_io(). On passing, use the same mechanism for dummynet
annotations and for divert/forward annotations.

option IPFIREWALL_FORWARD is effectively useless, the code to
implement it is very small and is now in by default to avoid the
obfuscation of conditionally compiled code.

NOTES:
 * there is at least one global variable left, sro_fwd, in ip_output().
   I am not sure if/how this can be removed.

 * I have deliberately avoided gratuitous style changes in this commit
   to avoid cluttering the diffs. Minor stule cleanup will likely be
   necessary

 * this commit only focused on the IP layer. I am sure there is a
   number of global variables used in the TCP and maybe UDP stack.

 * despite the number of files touched, there are absolutely no API's
   or data structures changed by this commit (except the interfaces of
   ip_fw_chk() and dummynet_io(), which are internal anyways), so
   an MFC is quite safe and unintrusive (and desirable, given the
   improved readability of the code).

MFC after: 10 days
2002-06-22 11:51:02 +00:00
..
libalias Avoid unintentional trigraph. 2002-05-30 20:53:45 +00:00
accf_data.c Remove so*_locked(), which were backed out by mistake. 2002-06-18 07:42:02 +00:00
accf_http.c Remove so*_locked(), which were backed out by mistake. 2002-06-18 07:42:02 +00:00
icmp6.h Revised MLD-related definitions 2002-05-06 16:28:25 +00:00
icmp_var.h
if_atm.c - Change the newly turned INVARIANTS #ifdef blocks (they were changed from 2002-05-21 18:52:24 +00:00
if_atm.h
if_ether.c Solve the 'unregistered netisr 18' information notice with a sledgehammer. 2002-06-20 01:27:40 +00:00
if_ether.h
igmp_var.h
igmp.c s/demon/daemon/ 2002-05-12 00:22:38 +00:00
igmp.h
in_cksum.c
in_gif.c
in_gif.h
in_pcb.c Notify functions can destroy the pcb, so they have to return an 2002-06-14 08:35:21 +00:00
in_pcb.h Notify functions can destroy the pcb, so they have to return an 2002-06-14 08:35:21 +00:00
in_proto.c
in_rmx.c
in_systm.h
in_var.h
in.c Lock up inpcb. 2002-06-10 20:05:46 +00:00
in.h Remove some duplicate types that should have been removed as part of 2002-05-11 23:28:51 +00:00
ip6.h
ip_divert.c Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
ip_dummynet.c Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
ip_dummynet.h Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
ip_ecn.c
ip_ecn.h
ip_encap.c
ip_encap.h
ip_flow.c
ip_flow.h
ip_fw.c Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
ip_fw.h Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
ip_icmp.c
ip_icmp.h
ip_id.c
ip_input.c Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
ip_mroute.c Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
ip_mroute.h
ip_output.c Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
ip_var.h Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
ip.h
ipprotosw.h
raw_ip.c Remember to initialize the control block head mutex. 2002-06-11 10:58:57 +00:00
tcp_debug.c
tcp_debug.h
tcp_fsm.h
tcp_input.c Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
tcp_output.c Re-commit w/fix: 2002-06-14 03:08:05 +00:00
tcp_reass.c Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
tcp_seq.h
tcp_subr.c TCP notify functions can change the pcb list. 2002-06-21 22:52:48 +00:00
tcp_syncache.c Re-commit w/fix: 2002-06-14 03:08:05 +00:00
tcp_timer.c Lock up inpcb. 2002-06-10 20:05:46 +00:00
tcp_timer.h
tcp_timewait.c TCP notify functions can change the pcb list. 2002-06-21 22:52:48 +00:00
tcp_usrreq.c Because we're holding an exclusive write lock on the head, references to 2002-06-13 23:14:58 +00:00
tcp_var.h Notify functions can destroy the pcb, so they have to return an 2002-06-14 08:35:21 +00:00
tcp.h
tcpip.h
udp_usrreq.c Fix logic which resulted in missing a call to INP_UNLOCK(). 2002-06-21 22:54:16 +00:00
udp_var.h Notify functions can destroy the pcb, so they have to return an 2002-06-14 08:35:21 +00:00
udp.h