diff options
-rw-r--r-- | sys/net/if_gif.c | 3 | ||||
-rw-r--r-- | sys/net/if_stf.c | 5 | ||||
-rw-r--r-- | sys/netinet/igmp.c | 4 | ||||
-rw-r--r-- | sys/netinet/igmp_var.h | 2 | ||||
-rw-r--r-- | sys/netinet/in_gif.c | 5 | ||||
-rw-r--r-- | sys/netinet/in_gif.h | 2 | ||||
-rw-r--r-- | sys/netinet/in_proto.c | 8 | ||||
-rw-r--r-- | sys/netinet/ip_divert.c | 2 | ||||
-rw-r--r-- | sys/netinet/ip_encap.c | 17 | ||||
-rw-r--r-- | sys/netinet/ip_icmp.c | 6 | ||||
-rw-r--r-- | sys/netinet/ip_icmp.h | 2 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 16 | ||||
-rw-r--r-- | sys/netinet/ip_mroute.c | 19 | ||||
-rw-r--r-- | sys/netinet/ip_var.h | 8 | ||||
-rw-r--r-- | sys/netinet/raw_ip.c | 5 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 6 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 6 | ||||
-rw-r--r-- | sys/netinet/tcp_var.h | 2 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 4 | ||||
-rw-r--r-- | sys/netinet/udp_var.h | 2 | ||||
-rw-r--r-- | sys/netinet6/ah_input.c | 7 | ||||
-rw-r--r-- | sys/netinet6/esp_input.c | 7 | ||||
-rw-r--r-- | sys/netinet6/ipcomp_input.c | 7 |
23 files changed, 70 insertions, 75 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 8ad2c37..1bd3c5f 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -62,7 +62,6 @@ #include <netinet/in_var.h> #include <netinet/in_gif.h> #include <netinet/ip_var.h> -#include <netinet/ipprotosw.h> #endif /* INET */ #ifdef INET6 @@ -101,7 +100,7 @@ static int gif_encapcheck __P((const struct mbuf *, int, int, void *)); #ifdef INET extern struct domain inetdomain; -struct ipprotosw in_gif_protosw = +struct protosw in_gif_protosw = { SOCK_RAW, &inetdomain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR, in_gif_input, rip_output, 0, rip_ctloutput, 0, diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index e9addd9..e6947a1 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -98,7 +98,6 @@ #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> -#include <netinet/ipprotosw.h> #include <netinet/ip_var.h> #include <netinet/in_var.h> @@ -134,7 +133,7 @@ static MALLOC_DEFINE(M_STF, "stf", "6to4 Tunnel Interface"); static int ip_stf_ttl = 40; extern struct domain inetdomain; -struct ipprotosw in_stf_protosw = +struct protosw in_stf_protosw = { SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, in_stf_input, rip_output, 0, rip_ctloutput, 0, @@ -550,7 +549,7 @@ in_stf_input(m, va_alist) va_start(ap, m); off = va_arg(ap, int); - proto = va_arg(ap, int); + proto = mtod(m, struct ip *)->ip_p; va_end(ap); if (proto != IPPROTO_IPV6) { diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 6e485ad..1b90578 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -148,9 +148,9 @@ find_rti(ifp) } void -igmp_input(m, off, proto) +igmp_input(m, off) register struct mbuf *m; - int off, proto; + int off; { register int iphlen = off; register struct igmp *igmp; diff --git a/sys/netinet/igmp_var.h b/sys/netinet/igmp_var.h index 5688f24..d9c9490 100644 --- a/sys/netinet/igmp_var.h +++ b/sys/netinet/igmp_var.h @@ -86,7 +86,7 @@ struct igmpstat { #define IGMP_AGE_THRESHOLD 540 void igmp_init __P((void)); -void igmp_input __P((struct mbuf *, int, int)); +void igmp_input __P((struct mbuf *, int)); void igmp_joingroup __P((struct in_multi *)); void igmp_leavegroup __P((struct in_multi *)); void igmp_fasttimo __P((void)); diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index f010bbf..46c10e0 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -202,17 +202,18 @@ in_gif_output(ifp, family, m, rt) } void -in_gif_input(m, off, proto) +in_gif_input(m, off) struct mbuf *m; int off; - int proto; { struct ifnet *gifp = NULL; struct ip *ip; int af; u_int8_t otos; + int proto; ip = mtod(m, struct ip *); + proto = ip->ip_p; gifp = (struct ifnet *)encap_getarg(m); diff --git a/sys/netinet/in_gif.h b/sys/netinet/in_gif.h index 99e6cd6..387bff0 100644 --- a/sys/netinet/in_gif.h +++ b/sys/netinet/in_gif.h @@ -37,7 +37,7 @@ extern int ip_gif_ttl; -void in_gif_input __P((struct mbuf *, int off, int proto)); +void in_gif_input __P((struct mbuf *, int off)); int in_gif_output __P((struct ifnet *, int, struct mbuf *, struct rtentry *)); int gif_encapcheck4 __P((const struct mbuf *, int, int, void *)); diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index 8e19332..f1a0934 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -63,8 +63,6 @@ #include <netinet/udp_var.h> #include <netinet/ip_encap.h> -#include <netinet/ipprotosw.h> - /* * TCP/IP protocol family: IP, ICMP, UDP, TCP. */ @@ -90,7 +88,7 @@ extern struct domain inetdomain; static struct pr_usrreqs nousrreqs; -struct ipprotosw inetsw[] = { +struct protosw inetsw[] = { { 0, &inetdomain, 0, 0, 0, 0, 0, 0, 0, @@ -207,8 +205,8 @@ extern int in_inithead __P((void **, int)); struct domain inetdomain = { AF_INET, "internet", 0, 0, 0, - (struct protosw *)inetsw, - (struct protosw *)&inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0, + inetsw, + &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0, in_inithead, 32, sizeof(struct sockaddr_in) }; diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 665558f..a571271 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -128,7 +128,7 @@ div_init(void) * with that protocol number to enter the system from the outside. */ void -div_input(struct mbuf *m, int off, int proto) +div_input(struct mbuf *m, int off) { ipstat.ips_noproto++; m_freem(m); diff --git a/sys/netinet/ip_encap.c b/sys/netinet/ip_encap.c index f5263cb..2caeeac 100644 --- a/sys/netinet/ip_encap.c +++ b/sys/netinet/ip_encap.c @@ -77,7 +77,6 @@ #include <netinet/ip.h> #include <netinet/ip_var.h> #include <netinet/ip_encap.h> -#include <netinet/ipprotosw.h> #ifdef INET6 #include <netinet/ip6.h> @@ -138,17 +137,17 @@ encap4_input(m, va_alist) int off, proto; struct ip *ip; struct sockaddr_in s, d; - const struct ipprotosw *psw; + const struct protosw *psw; struct encaptab *ep, *match; va_list ap; int prio, matchprio; va_start(ap, m); off = va_arg(ap, int); - proto = va_arg(ap, int); va_end(ap); ip = mtod(m, struct ip *); + proto = ip->ip_p; bzero(&s, sizeof(s)); s.sin_family = AF_INET; @@ -205,17 +204,23 @@ encap4_input(m, va_alist) if (match) { /* found a match, "match" has the best one */ - psw = (const struct ipprotosw *)match->psw; + psw = match->psw; if (psw && psw->pr_input) { encap_fillarg(m, match); - (*psw->pr_input)(m, off, proto); + (*psw->pr_input)(m, off); } else m_freem(m); return; } + /* for backward compatibility - messy... */ + if (proto == IPPROTO_IPV4) { + ipip_input(m, off); + return; + } + /* last resort: inject to raw socket */ - rip_input(m, off, proto); + rip_input(m, off); } #endif diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 4b20dd0..ac38d9d 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -230,9 +230,9 @@ static struct sockaddr_in icmpgw = { sizeof (struct sockaddr_in), AF_INET }; * Process a received ICMP message. */ void -icmp_input(m, off, proto) +icmp_input(m, off) register struct mbuf *m; - int off, proto; + int off; { int hlen = off; register struct icmp *icp; @@ -576,7 +576,7 @@ reflect: } raw: - rip_input(m, off, proto); + rip_input(m, off); return; freeit: diff --git a/sys/netinet/ip_icmp.h b/sys/netinet/ip_icmp.h index b7d5400..401c7ed 100644 --- a/sys/netinet/ip_icmp.h +++ b/sys/netinet/ip_icmp.h @@ -186,7 +186,7 @@ struct icmp { #ifdef _KERNEL void icmp_error __P((struct mbuf *, int, int, n_long, struct ifnet *)); -void icmp_input __P((struct mbuf *, int, int)); +void icmp_input __P((struct mbuf *, int)); #endif #endif diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index d2f14da..4da9103 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -75,8 +75,6 @@ #include <netinet/ip_icmp.h> #include <machine/in_cksum.h> -#include <netinet/ipprotosw.h> - #include <sys/socketvar.h> #include <netinet/ip_fw.h> @@ -153,7 +151,7 @@ static int ipprintfs = 0; #endif extern struct domain inetdomain; -extern struct ipprotosw inetsw[]; +extern struct protosw inetsw[]; u_char ip_protox[IPPROTO_MAX]; static int ipqmaxlen = IFQ_MAXLEN; struct in_ifaddrhead in_ifaddrhead; /* first inet address */ @@ -236,17 +234,17 @@ static void ipintr __P((void)); void ip_init() { - register struct ipprotosw *pr; + register struct protosw *pr; register int i; TAILQ_INIT(&in_ifaddrhead); - pr = (struct ipprotosw *)pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); + pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); if (pr == 0) panic("ip_init"); for (i = 0; i < IPPROTO_MAX; i++) ip_protox[i] = pr - inetsw; - for (pr = (struct ipprotosw *)inetdomain.dom_protosw; - pr < (struct ipprotosw *)inetdomain.dom_protoswNPROTOSW; pr++) + for (pr = inetdomain.dom_protosw; + pr < inetdomain.dom_protoswNPROTOSW; pr++) if (pr->pr_domain->dom_family == PF_INET && pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW) ip_protox[pr->pr_protocol] = pr - inetsw; @@ -819,9 +817,9 @@ found: */ ipstat.ips_delivered++; { - int off = hlen, nh = ip->ip_p; + int off = hlen; - (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, off, nh); + (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, off); #ifdef IPFIREWALL_FORWARD ip_fw_fwd_addr = NULL; /* tcp needed it */ #endif diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 2d7d2c3..6868aa6 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -37,7 +37,6 @@ #include <netinet/igmp.h> #include <netinet/ip_encap.h> #include <netinet/ip_mroute.h> -#include <netinet/ipprotosw.h> #include <netinet/udp.h> #include <machine/in_cksum.h> @@ -108,10 +107,9 @@ _mrt_ioctl(int req, caddr_t data) int (*mrt_ioctl)(int, caddr_t) = _mrt_ioctl; void -rsvp_input(m, off, proto) /* XXX must fixup manually */ +rsvp_input(m, off) /* XXX must fixup manually */ struct mbuf *m; int off; - int proto; { /* Can still get packets with rsvp_on = 0 if there is a local member * of the group to which the RSVP packet is addressed. But in this @@ -125,15 +123,15 @@ rsvp_input(m, off, proto) /* XXX must fixup manually */ if (ip_rsvpd != NULL) { if (rsvpdebug) printf("rsvp_input: Sending packet up old-style socket\n"); - rip_input(m, off, proto); + rip_input(m, off); return; } /* Drop the packet */ m_freem(m); } -void ipip_input(struct mbuf *m, int off, int proto) { /* XXX must fixup manually */ - rip_input(m, off, proto); +void ipip_input(struct mbuf *m, int off) { /* XXX must fixup manually */ + rip_input(m, off); } int (*legal_vif_num)(int) = 0; @@ -708,7 +706,7 @@ mroute_encapcheck(const struct mbuf *m, int off, int proto, void *arg) * claimed). */ static void -mroute_encap_input(struct mbuf *m, int off, int proto) +mroute_encap_input(struct mbuf *m, int off) { struct ip *ip = mtod(m, struct ip *); int hlen = ip->ip_hl << 2; @@ -732,7 +730,7 @@ mroute_encap_input(struct mbuf *m, int off, int proto) } extern struct domain inetdomain; -static struct ipprotosw mroute_encap_protosw = +static struct protosw mroute_encap_protosw = { SOCK_RAW, &inetdomain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR, mroute_encap_input, 0, 0, rip_ctloutput, 0, @@ -2108,10 +2106,9 @@ ip_rsvp_force_done(so) } void -rsvp_input(m, off, proto) +rsvp_input(m, off) struct mbuf *m; int off; - int proto; { int vifi; register struct ip *ip = mtod(m, struct ip *); @@ -2156,7 +2153,7 @@ rsvp_input(m, off, proto) if (ip_rsvpd != NULL) { if (rsvpdebug) printf("rsvp_input: Sending packet up old-style socket\n"); - rip_input(m, off, proto); /* xxx */ + rip_input(m, off); /* xxx */ } else { if (rsvpdebug && vifi == numvifs) printf("rsvp_input: Can't find vif for packet.\n"); diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index b318a1c..2a84b38 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -177,10 +177,10 @@ u_int16_t int rip_ctloutput __P((struct socket *, struct sockopt *)); void rip_ctlinput __P((int, struct sockaddr *, void *)); void rip_init __P((void)); -void rip_input __P((struct mbuf *, int, int)); +void rip_input __P((struct mbuf *, int)); int rip_output __P((struct mbuf *, struct socket *, u_long)); -void ipip_input __P((struct mbuf *, int, int)); -void rsvp_input __P((struct mbuf *, int, int)); +void ipip_input __P((struct mbuf *, int)); +void rsvp_input __P((struct mbuf *, int)); int ip_rsvp_init __P((struct socket *)); int ip_rsvp_done __P((void)); int ip_rsvp_vif_init __P((struct socket *, struct sockopt *)); @@ -189,7 +189,7 @@ void ip_rsvp_force_done __P((struct socket *)); #ifdef IPDIVERT void div_init __P((void)); -void div_input __P((struct mbuf *, int, int)); +void div_input __P((struct mbuf *, int)); void divert_packet __P((struct mbuf *, int, int)); extern struct pr_usrreqs div_usrreqs; extern u_int16_t ip_divert_cookie; diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index d986839..7a1c9a1 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -112,14 +112,15 @@ static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET }; * mbuf chain. */ void -rip_input(m, off, proto) +rip_input(m, off) struct mbuf *m; - int off, proto; + int off; { register struct ip *ip = mtod(m, struct ip *); register struct inpcb *inp; struct inpcb *last = 0; struct mbuf *opts = 0; + int proto = ip->ip_p; ripsrc.sin_addr = ip->ip_src; LIST_FOREACH(inp, &ripcb, inp_list) { diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 38f4a3e..e093896 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -322,15 +322,15 @@ tcp6_input(mp, offp, proto) return IPPROTO_DONE; } - tcp_input(m, *offp, proto); + tcp_input(m, *offp); return IPPROTO_DONE; } #endif void -tcp_input(m, off0, proto) +tcp_input(m, off0) register struct mbuf *m; - int off0, proto; + int off0; { register struct tcphdr *th; register struct ip *ip = NULL; diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 38f4a3e..e093896 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -322,15 +322,15 @@ tcp6_input(mp, offp, proto) return IPPROTO_DONE; } - tcp_input(m, *offp, proto); + tcp_input(m, *offp); return IPPROTO_DONE; } #endif void -tcp_input(m, off0, proto) +tcp_input(m, off0) register struct mbuf *m; - int off0, proto; + int off0; { register struct tcphdr *th; register struct ip *ip = NULL; diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 40bc7e9..9c2803f 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -384,7 +384,7 @@ void tcp_fasttimo __P((void)); struct rmxp_tao * tcp_gettaocache __P((struct inpcb *)); void tcp_init __P((void)); -void tcp_input __P((struct mbuf *, int, int)); +void tcp_input __P((struct mbuf *, int)); void tcp_mss __P((struct tcpcb *, int)); int tcp_mssopt __P((struct tcpcb *)); void tcp_drop_syn_sent __P((struct inpcb *, int)); diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 157057b..ab18872 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -149,9 +149,9 @@ udp_init() } void -udp_input(m, off, proto) +udp_input(m, off) register struct mbuf *m; - int off, proto; + int off; { int iphlen = off; register struct ip *ip; diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index b0b2667..ca43eef 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -105,7 +105,7 @@ extern int log_in_vain; void udp_ctlinput __P((int, struct sockaddr *, void *)); void udp_init __P((void)); -void udp_input __P((struct mbuf *, int, int)); +void udp_input __P((struct mbuf *, int)); void udp_notify __P((struct inpcb *inp, int errno)); int udp_shutdown __P((struct socket *so)); diff --git a/sys/netinet6/ah_input.c b/sys/netinet6/ah_input.c index 070883e..4ee2a99 100644 --- a/sys/netinet6/ah_input.c +++ b/sys/netinet6/ah_input.c @@ -94,8 +94,7 @@ #define IPLEN_FLIPPED #ifdef INET -#include <netinet/ipprotosw.h> -extern struct ipprotosw inetsw[]; +extern struct protosw inetsw[]; void #if __STDC__ @@ -122,7 +121,7 @@ ah4_input(m, va_alist) va_start(ap, m); off = va_arg(ap, int); - proto = va_arg(ap, int); + proto = mtod(m, struct ip *)->ip_p; va_end(ap); #ifndef PULLDOWN_TEST @@ -550,7 +549,7 @@ ah4_input(m, va_alist) ipsecstat.in_polvio++; goto fail; } - (*inetsw[ip_protox[nxt]].pr_input)(m, off, nxt); + (*inetsw[ip_protox[nxt]].pr_input)(m, off); } else m_freem(m); m = NULL; diff --git a/sys/netinet6/esp_input.c b/sys/netinet6/esp_input.c index 4542f13..af12ec0 100644 --- a/sys/netinet6/esp_input.c +++ b/sys/netinet6/esp_input.c @@ -97,8 +97,7 @@ ? sizeof(struct newesp) : sizeof(struct esp)) #ifdef INET -#include <netinet/ipprotosw.h> -extern struct ipprotosw inetsw[]; +extern struct protosw inetsw[]; void #if __STDC__ @@ -125,7 +124,7 @@ esp4_input(m, va_alist) va_start(ap, m); off = va_arg(ap, int); - proto = va_arg(ap, int); + proto = mtod(m, struct ip *)->ip_p; va_end(ap); /* sanity check for alignment. */ @@ -445,7 +444,7 @@ noreplaycheck: ipsecstat.in_polvio++; goto bad; } - (*inetsw[ip_protox[nxt]].pr_input)(m, off, nxt); + (*inetsw[ip_protox[nxt]].pr_input)(m, off); } else m_freem(m); m = NULL; diff --git a/sys/netinet6/ipcomp_input.c b/sys/netinet6/ipcomp_input.c index 0a6e2f5..f3143d2 100644 --- a/sys/netinet6/ipcomp_input.c +++ b/sys/netinet6/ipcomp_input.c @@ -83,8 +83,7 @@ #define IPLEN_FLIPPED #ifdef INET -#include <netinet/ipprotosw.h> -extern struct ipprotosw inetsw[]; +extern struct protosw inetsw[]; void #if __STDC__ @@ -110,7 +109,7 @@ ipcomp4_input(m, va_alist) va_start(ap, m); off = va_arg(ap, int); - proto = va_arg(ap, int); + proto = mtod(m, struct ip *)->ip_p; va_end(ap); if (m->m_pkthdr.len < off + sizeof(struct ipcomp)) { @@ -231,7 +230,7 @@ ipcomp4_input(m, va_alist) ipsecstat.in_polvio++; goto fail; } - (*inetsw[ip_protox[nxt]].pr_input)(m, off, nxt); + (*inetsw[ip_protox[nxt]].pr_input)(m, off); } else m_freem(m); m = NULL; |