diff options
Diffstat (limited to 'sys/netinet6/ip6_output.c')
-rw-r--r-- | sys/netinet6/ip6_output.c | 119 |
1 files changed, 34 insertions, 85 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 01e86b0..9f2f8eb 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -177,16 +177,13 @@ static int copypktopts __P((struct ip6_pktopts *, struct ip6_pktopts *, int)); * type of "mtu": rt_rmx.rmx_mtu is u_long, ifnet.ifr_mtu is int, and * nd_ifinfo.linkmtu is u_int32_t. so we use u_long to hold largest one, * which is rt_rmx.rmx_mtu. + * + * ifpp - XXX: just for statistics */ int -ip6_output(m0, opt, ro, flags, im6o, ifpp, inp) - struct mbuf *m0; - struct ip6_pktopts *opt; - struct route_in6 *ro; - int flags; - struct ip6_moptions *im6o; - struct ifnet **ifpp; /* XXX: just for statistics */ - struct inpcb *inp; +ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, + struct route_in6 *ro, int flags, struct ip6_moptions *im6o, + struct ifnet **ifpp, struct inpcb *inp) { struct ip6_hdr *ip6, *mhip6; struct ifnet *ifp, *origifp; @@ -1096,10 +1093,7 @@ bad: } static int -ip6_copyexthdr(mp, hdr, hlen) - struct mbuf **mp; - caddr_t hdr; - int hlen; +ip6_copyexthdr(struct mbuf **mp, caddr_t hdr, int hlen) { struct mbuf *m; @@ -1129,9 +1123,7 @@ ip6_copyexthdr(mp, hdr, hlen) * Insert jumbo payload option. */ static int -ip6_insert_jumboopt(exthdrs, plen) - struct ip6_exthdrs *exthdrs; - u_int32_t plen; +ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen) { struct mbuf *mopt; u_char *optbuf; @@ -1226,10 +1218,8 @@ ip6_insert_jumboopt(exthdrs, plen) * Insert fragment header and copy unfragmentable header portions. */ static int -ip6_insertfraghdr(m0, m, hlen, frghdrp) - struct mbuf *m0, *m; - int hlen; - struct ip6_frag **frghdrp; +ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, + struct ip6_frag **frghdrp) { struct mbuf *n, *mlast; @@ -1269,12 +1259,9 @@ ip6_insertfraghdr(m0, m, hlen, frghdrp) } static int -ip6_getpmtu(ro_pmtu, ro, ifp, dst, mtup, alwaysfragp) - struct route_in6 *ro_pmtu, *ro; - struct ifnet *ifp; - struct in6_addr *dst; - u_long *mtup; - int *alwaysfragp; +ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, + struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, + int *alwaysfragp) { u_int32_t mtu = 0; int alwaysfrag = 0; @@ -1355,9 +1342,7 @@ ip6_getpmtu(ro_pmtu, ro, ifp, dst, mtup, alwaysfragp) * IP6 socket option processing. */ int -ip6_ctloutput(so, sopt) - struct socket *so; - struct sockopt *sopt; +ip6_ctloutput(struct socket *so, struct sockopt *sopt) { int privileged, optdatalen, uproto; void *optdata; @@ -2032,9 +2017,7 @@ do { \ } int -ip6_raw_ctloutput(so, sopt) - struct socket *so; - struct sockopt *sopt; +ip6_raw_ctloutput(struct socket *so, struct sockopt *sopt) { int error = 0, optval, optlen; const int icmp6off = offsetof(struct icmp6_hdr, icmp6_cksum); @@ -2112,11 +2095,8 @@ ip6_raw_ctloutput(so, sopt) * specifying behavior of outgoing packets. */ static int -ip6_pcbopts(pktopt, m, so, sopt) - struct ip6_pktopts **pktopt; - struct mbuf *m; - struct socket *so; - struct sockopt *sopt; +ip6_pcbopts(struct ip6_pktopts **pktopt, struct mbuf *m, + struct socket *so, struct sockopt *sopt) { struct ip6_pktopts *opt = *pktopt; int error = 0; @@ -2163,8 +2143,7 @@ ip6_pcbopts(pktopt, m, so, sopt) * the struct. */ void -ip6_initpktopts(opt) - struct ip6_pktopts *opt; +ip6_initpktopts(struct ip6_pktopts *opt) { bzero(opt, sizeof(*opt)); @@ -2175,11 +2154,8 @@ ip6_initpktopts(opt) } static int -ip6_pcbopt(optname, buf, len, pktopt, priv, uproto) - int optname, len, priv; - u_char *buf; - struct ip6_pktopts **pktopt; - int uproto; +ip6_pcbopt(int optname, u_char *buf, int len, struct ip6_pktopts **pktopt, + int priv, int uproto) { struct ip6_pktopts *opt; @@ -2194,10 +2170,7 @@ ip6_pcbopt(optname, buf, len, pktopt, priv, uproto) } static int -ip6_getpcbopt(pktopt, optname, sopt) - struct ip6_pktopts *pktopt; - struct sockopt *sopt; - int optname; +ip6_getpcbopt(struct ip6_pktopts *pktopt, int optname, struct sockopt *sopt) { void *optdata = NULL; int optdatalen = 0; @@ -2295,9 +2268,7 @@ ip6_getpcbopt(pktopt, optname, sopt) } void -ip6_clearpktopts(pktopt, optname) - struct ip6_pktopts *pktopt; - int optname; +ip6_clearpktopts(struct ip6_pktopts *pktopt, int optname) { if (pktopt == NULL) return; @@ -2358,9 +2329,7 @@ do {\ } while (/*CONSTCOND*/ 0) static int -copypktopts(dst, src, canwait) - struct ip6_pktopts *dst, *src; - int canwait; +copypktopts(struct ip6_pktopts *dst, struct ip6_pktopts *src, int canwait) { if (dst == NULL || src == NULL) { printf("ip6_clearpktopts: invalid argument\n"); @@ -2403,9 +2372,7 @@ copypktopts(dst, src, canwait) #undef PKTOPT_EXTHDRCPY struct ip6_pktopts * -ip6_copypktopts(src, canwait) - struct ip6_pktopts *src; - int canwait; +ip6_copypktopts(struct ip6_pktopts *src, int canwait) { int error; struct ip6_pktopts *dst; @@ -2424,8 +2391,7 @@ ip6_copypktopts(src, canwait) } void -ip6_freepcbopts(pktopt) - struct ip6_pktopts *pktopt; +ip6_freepcbopts(struct ip6_pktopts *pktopt) { if (pktopt == NULL) return; @@ -2439,10 +2405,7 @@ ip6_freepcbopts(pktopt) * Set the IP6 multicast options in response to user setsockopt(). */ static int -ip6_setmoptions(optname, im6op, m) - int optname; - struct ip6_moptions **im6op; - struct mbuf *m; +ip6_setmoptions(int optname, struct ip6_moptions **im6op, struct mbuf *m) { int error = 0; u_int loop, ifindex; @@ -2744,10 +2707,7 @@ ip6_setmoptions(optname, im6op, m) * Return the IP6 multicast options in response to user getsockopt(). */ static int -ip6_getmoptions(optname, im6o, mp) - int optname; - struct ip6_moptions *im6o; - struct mbuf **mp; +ip6_getmoptions(int optname, struct ip6_moptions *im6o, struct mbuf **mp) { u_int *hlim, *loop, *ifindex; @@ -2791,8 +2751,7 @@ ip6_getmoptions(optname, im6o, mp) * Discard the IP6 multicast options. */ void -ip6_freemoptions(im6o) - struct ip6_moptions *im6o; +ip6_freemoptions(struct ip6_moptions *im6o) { struct in6_multi_mship *imm; @@ -2812,10 +2771,8 @@ ip6_freemoptions(im6o) * Set IPv6 outgoing packet options based on advanced API. */ int -ip6_setpktopts(control, opt, stickyopt, priv, uproto) - struct mbuf *control; - struct ip6_pktopts *opt, *stickyopt; - int priv, uproto; +ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt, + struct ip6_pktopts *stickyopt, int priv, int uproto) { struct cmsghdr *cm = 0; @@ -2878,10 +2835,8 @@ ip6_setpktopts(control, opt, stickyopt, priv, uproto) * "sticky=1, cmsg=1": RFC2292 socket option */ static int -ip6_setpktopt(optname, buf, len, opt, priv, sticky, cmsg, uproto) - int optname, len, priv, sticky, cmsg, uproto; - u_char *buf; - struct ip6_pktopts *opt; +ip6_setpktopt(int optname, u_char *buf, int len, struct ip6_pktopts *opt, + int priv, int sticky, int cmsg, int uproto) { int minmtupolicy, preftemp; @@ -3264,10 +3219,7 @@ ip6_setpktopt(optname, buf, len, opt, priv, sticky, cmsg, uproto) * pointer that might NOT be &loif -- easier than replicating that code here. */ void -ip6_mloopback(ifp, m, dst) - struct ifnet *ifp; - struct mbuf *m; - struct sockaddr_in6 *dst; +ip6_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in6 *dst) { struct mbuf *copym; struct ip6_hdr *ip6; @@ -3310,9 +3262,7 @@ ip6_mloopback(ifp, m, dst) * Chop IPv6 header off from the payload. */ static int -ip6_splithdr(m, exthdrs) - struct mbuf *m; - struct ip6_exthdrs *exthdrs; +ip6_splithdr(struct mbuf *m, struct ip6_exthdrs *exthdrs) { struct mbuf *mh; struct ip6_hdr *ip6; @@ -3341,8 +3291,7 @@ ip6_splithdr(m, exthdrs) * Compute IPv6 extension header length. */ int -ip6_optlen(in6p) - struct in6pcb *in6p; +ip6_optlen(struct in6pcb *in6p) { int len; |