diff options
author | ume <ume@FreeBSD.org> | 2005-07-21 15:06:32 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2005-07-21 15:06:32 +0000 |
commit | 166d2715986457830d3ccf66200e645cc17cd9ce (patch) | |
tree | c205175def2910c62565e68947ec3acdaae0dbec /sys | |
parent | 8da52394ef9dd24884bcd42ff3f3ce3ac9fc62c9 (diff) | |
download | FreeBSD-src-166d2715986457830d3ccf66200e645cc17cd9ce.zip FreeBSD-src-166d2715986457830d3ccf66200e645cc17cd9ce.tar.gz |
be consistent on naming advanced API functions; use ip6_XXXpktopt(s).
Submitted by: Keiichi SHIMA <keiichi__at__iijlab.net>
Obtained from: KAME
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet6/ip6_output.c | 20 | ||||
-rw-r--r-- | sys/netinet6/ip6_var.h | 6 | ||||
-rw-r--r-- | sys/netinet6/mld6.c | 2 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 7 | ||||
-rw-r--r-- | sys/netinet6/udp6_output.c | 4 |
5 files changed, 19 insertions, 20 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 3923c75..a9ffbef 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -127,7 +127,7 @@ static int ip6_pcbopt __P((int, u_char *, int, struct ip6_pktopts **, static int ip6_pcbopts __P((struct ip6_pktopts **, struct mbuf *, struct socket *, struct sockopt *)); static int ip6_getpcbopt __P((struct ip6_pktopts *, int, struct sockopt *)); -static int ip6_setpktoption __P((int, u_char *, int, struct ip6_pktopts *, int, +static int ip6_setpktopt __P((int, u_char *, int, struct ip6_pktopts *, int, int, int, int)); static int ip6_setmoptions __P((int, struct ip6_moptions **, struct mbuf *)); @@ -2358,7 +2358,7 @@ ip6_pcbopts(pktopt, m, so, sopt) /* set options specified by user. */ if (td && !suser(td)) priv = 1; - if ((error = ip6_setpktoptions(m, opt, NULL, priv, 1, + if ((error = ip6_setpktopts(m, opt, NULL, priv, 1, so->so_proto->pr_protocol)) != 0) { ip6_clearpktopts(opt, -1); /* XXX: discard all options */ free(opt, M_IP6OPT); @@ -2373,7 +2373,7 @@ ip6_pcbopts(pktopt, m, so, sopt) * the struct. */ void -init_ip6pktopts(opt) +ip6_initpktopts(opt) struct ip6_pktopts *opt; { @@ -2396,12 +2396,12 @@ ip6_pcbopt(optname, buf, len, pktopt, priv, uproto) if (*pktopt == NULL) { *pktopt = malloc(sizeof(struct ip6_pktopts), M_IP6OPT, M_WAITOK); - init_ip6pktopts(*pktopt); + ip6_initpktopts(*pktopt); (*pktopt)->needfree = 1; } opt = *pktopt; - return (ip6_setpktoption(optname, buf, len, opt, priv, 1, 0, uproto)); + return (ip6_setpktopt(optname, buf, len, opt, priv, 1, 0, uproto)); } static int @@ -2998,7 +2998,7 @@ ip6_freemoptions(im6o) * Set IPv6 outgoing packet options based on advanced API. */ int -ip6_setpktoptions(control, opt, stickyopt, priv, needcopy, uproto) +ip6_setpktopts(control, opt, stickyopt, priv, needcopy, uproto) struct mbuf *control; struct ip6_pktopts *opt, *stickyopt; int priv, needcopy, uproto; @@ -3023,7 +3023,7 @@ ip6_setpktoptions(control, opt, stickyopt, priv, needcopy, uproto) RT_UNLOCK(opt->ip6po_nextroute.ro_rt); } } else - init_ip6pktopts(opt); + ip6_initpktopts(opt); opt->needfree = needcopy; /* @@ -3046,7 +3046,7 @@ ip6_setpktoptions(control, opt, stickyopt, priv, needcopy, uproto) if (cm->cmsg_level != IPPROTO_IPV6) continue; - error = ip6_setpktoption(cm->cmsg_type, CMSG_DATA(cm), + error = ip6_setpktopt(cm->cmsg_type, CMSG_DATA(cm), cm->cmsg_len - CMSG_LEN(0), opt, priv, needcopy, 1, uproto); if (error) return (error); @@ -3065,7 +3065,7 @@ ip6_setpktoptions(control, opt, stickyopt, priv, needcopy, uproto) * "sticky=1, cmsg=1": RFC2292 socket option */ static int -ip6_setpktoption(optname, buf, len, opt, priv, sticky, cmsg, uproto) +ip6_setpktopt(optname, buf, len, opt, priv, sticky, cmsg, uproto) int optname, len, priv, sticky, cmsg, uproto; u_char *buf; struct ip6_pktopts *opt; @@ -3074,7 +3074,7 @@ ip6_setpktoption(optname, buf, len, opt, priv, sticky, cmsg, uproto) if (!sticky && !cmsg) { #ifdef DIAGNOSTIC - printf("ip6_setpktoption: impossible case\n"); + printf("ip6_setpktopt: impossible case\n"); #endif return (EINVAL); } diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 227f75e..7f2a862 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -366,9 +366,9 @@ int ip6_output __P((struct mbuf *, struct ip6_pktopts *, struct inpcb *)); int ip6_ctloutput __P((struct socket *, struct sockopt *)); int ip6_raw_ctloutput __P((struct socket *, struct sockopt *)); -void init_ip6pktopts __P((struct ip6_pktopts *)); -int ip6_setpktoptions __P((struct mbuf *, struct ip6_pktopts *, - struct ip6_pktopts *, int, int, int)); +void ip6_initpktopts __P((struct ip6_pktopts *)); +int ip6_setpktopts __P((struct mbuf *, struct ip6_pktopts *, + struct ip6_pktopts *, int, int, int)); void ip6_clearpktopts __P((struct ip6_pktopts *, int)); struct ip6_pktopts *ip6_copypktopts __P((struct ip6_pktopts *, int)); int ip6_optlen __P((struct inpcb *)); diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 5e90d05..5cd7cf6 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -126,7 +126,7 @@ mld6_init() hbh_buf[5] = IP6OPT_RTALERT_LEN - 2; bcopy((caddr_t)&rtalert_code, &hbh_buf[6], sizeof(u_int16_t)); - init_ip6pktopts(&ip6_opts); + ip6_initpktopts(&ip6_opts); ip6_opts.ip6po_hbh = hbh; } diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index cf0e548..581cb35 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -346,9 +346,8 @@ rip6_output(m, va_alist) priv = 1; dst = &dstsock->sin6_addr; if (control) { - if ((error = ip6_setpktoptions(control, &opt, - stickyopt, priv, 0, - so->so_proto->pr_protocol)) + if ((error = ip6_setpktopts(control, &opt, + stickyopt, priv, 0, so->so_proto->pr_protocol)) != 0) { goto bad; } @@ -394,7 +393,7 @@ rip6_output(m, va_alist) /* * XXX Boundary check is assumed to be already done in - * ip6_setpktoptions(). + * ip6_setpktopts(). */ if (in6p->in6p_outputopts && (pi = in6p->in6p_outputopts->ip6po_pktinfo) && diff --git a/sys/netinet6/udp6_output.c b/sys/netinet6/udp6_output.c index 8f3b1af..8c4e93d 100644 --- a/sys/netinet6/udp6_output.c +++ b/sys/netinet6/udp6_output.c @@ -140,8 +140,8 @@ udp6_output(in6p, m, addr6, control, td) if (td && !suser(td)) priv = 1; if (control) { - if ((error = ip6_setpktoptions(control, &opt, stickyopt, priv, - 0, IPPROTO_UDP)) != 0) + if ((error = ip6_setpktopts(control, &opt, + stickyopt, priv, 0, IPPROTO_UDP)) != 0) goto release; in6p->in6p_outputopts = &opt; } |