From d5e3406d066bf9800a6fc7783e12c2ca49eda77c Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Thu, 21 Jul 2005 15:06:32 +0000 Subject: [PATCH] be consistent on naming advanced API functions; use ip6_XXXpktopt(s). Submitted by: Keiichi SHIMA Obtained from: KAME --- sys/netinet6/ip6_output.c | 20 ++++++++++---------- sys/netinet6/ip6_var.h | 6 +++--- sys/netinet6/mld6.c | 2 +- sys/netinet6/raw_ip6.c | 7 +++---- 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 3923c75e089e..a9ffbef69061 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 227f75edbe7e..7f2a8624ce13 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 5e90d0558c5d..5cd7cf6f75f2 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 cf0e548589f2..581cb355acc3 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 8f3b1af7174f..8c4e93d3a593 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; }