ANSIfy[1] plus some style cleanup nearby.
Discussed with: gnn, rwatson Submitted by: Karl Sj?dahl - dunceor <dunceor gmail com> [1] Approved by: re (rwatson)
This commit is contained in:
parent
a22fb0da42
commit
1272577e22
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=171259
@ -57,9 +57,7 @@
|
||||
* Destination options header processing.
|
||||
*/
|
||||
int
|
||||
dest6_input(mp, offp, proto)
|
||||
struct mbuf **mp;
|
||||
int *offp, proto;
|
||||
dest6_input(struct mbuf **mp, int *offp, int proto)
|
||||
{
|
||||
struct mbuf *m = *mp;
|
||||
int off = *offp, dstoptlen, optlen;
|
||||
|
@ -94,7 +94,7 @@ frag6_change(void *tag)
|
||||
}
|
||||
|
||||
void
|
||||
frag6_init()
|
||||
frag6_init(void)
|
||||
{
|
||||
|
||||
ip6_maxfragpackets = nmbclusters / 4;
|
||||
@ -140,9 +140,7 @@ frag6_init()
|
||||
* Fragment input
|
||||
*/
|
||||
int
|
||||
frag6_input(mp, offp, proto)
|
||||
struct mbuf **mp;
|
||||
int *offp, proto;
|
||||
frag6_input(struct mbuf **mp, int *offp, int proto)
|
||||
{
|
||||
struct mbuf *m = *mp, *t;
|
||||
struct ip6_hdr *ip6;
|
||||
@ -583,8 +581,7 @@ frag6_input(mp, offp, proto)
|
||||
* associated datagrams.
|
||||
*/
|
||||
void
|
||||
frag6_freef(q6)
|
||||
struct ip6q *q6;
|
||||
frag6_freef(struct ip6q *q6)
|
||||
{
|
||||
struct ip6asfrag *af6, *down6;
|
||||
|
||||
@ -628,8 +625,7 @@ frag6_freef(q6)
|
||||
* Like insque, but pointers in middle of structure.
|
||||
*/
|
||||
void
|
||||
frag6_enq(af6, up6)
|
||||
struct ip6asfrag *af6, *up6;
|
||||
frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6)
|
||||
{
|
||||
|
||||
IP6Q_LOCK_ASSERT();
|
||||
@ -644,8 +640,7 @@ frag6_enq(af6, up6)
|
||||
* To frag6_enq as remque is to insque.
|
||||
*/
|
||||
void
|
||||
frag6_deq(af6)
|
||||
struct ip6asfrag *af6;
|
||||
frag6_deq(struct ip6asfrag *af6)
|
||||
{
|
||||
|
||||
IP6Q_LOCK_ASSERT();
|
||||
@ -655,8 +650,7 @@ frag6_deq(af6)
|
||||
}
|
||||
|
||||
void
|
||||
frag6_insque(new, old)
|
||||
struct ip6q *new, *old;
|
||||
frag6_insque(struct ip6q *new, struct ip6q *old)
|
||||
{
|
||||
|
||||
IP6Q_LOCK_ASSERT();
|
||||
@ -668,8 +662,7 @@ frag6_insque(new, old)
|
||||
}
|
||||
|
||||
void
|
||||
frag6_remque(p6)
|
||||
struct ip6q *p6;
|
||||
frag6_remque(struct ip6q *p6)
|
||||
{
|
||||
|
||||
IP6Q_LOCK_ASSERT();
|
||||
@ -684,7 +677,7 @@ frag6_remque(p6)
|
||||
* queue, discard it.
|
||||
*/
|
||||
void
|
||||
frag6_slowtimo()
|
||||
frag6_slowtimo(void)
|
||||
{
|
||||
struct ip6q *q6;
|
||||
|
||||
@ -738,7 +731,7 @@ frag6_slowtimo()
|
||||
* Drain off all datagram fragments.
|
||||
*/
|
||||
void
|
||||
frag6_drain()
|
||||
frag6_drain(void)
|
||||
{
|
||||
|
||||
if (IP6Q_TRYLOCK() == 0)
|
||||
|
@ -131,15 +131,14 @@ static int icmp6_notify_error __P((struct mbuf **, int, int, int));
|
||||
|
||||
|
||||
void
|
||||
icmp6_init()
|
||||
icmp6_init(void)
|
||||
{
|
||||
|
||||
mld6_init();
|
||||
}
|
||||
|
||||
static void
|
||||
icmp6_errcount(stat, type, code)
|
||||
struct icmp6errstat *stat;
|
||||
int type, code;
|
||||
icmp6_errcount(struct icmp6errstat *stat, int type, int code)
|
||||
{
|
||||
switch (type) {
|
||||
case ICMP6_DST_UNREACH:
|
||||
@ -199,10 +198,8 @@ icmp6_errcount(stat, type, code)
|
||||
* may not contain enough scope zone information.
|
||||
*/
|
||||
void
|
||||
icmp6_error2(m, type, code, param, ifp)
|
||||
struct mbuf *m;
|
||||
int type, code, param;
|
||||
struct ifnet *ifp;
|
||||
icmp6_error2(struct mbuf *m, int type, int code, int param,
|
||||
struct ifnet *ifp)
|
||||
{
|
||||
struct ip6_hdr *ip6;
|
||||
|
||||
@ -233,9 +230,7 @@ icmp6_error2(m, type, code, param, ifp)
|
||||
* Generate an error packet of type error in response to bad IP6 packet.
|
||||
*/
|
||||
void
|
||||
icmp6_error(m, type, code, param)
|
||||
struct mbuf *m;
|
||||
int type, code, param;
|
||||
icmp6_error(struct mbuf *m, int type, int code, int param)
|
||||
{
|
||||
struct ip6_hdr *oip6, *nip6;
|
||||
struct icmp6_hdr *icmp6;
|
||||
@ -389,9 +384,7 @@ icmp6_error(m, type, code, param)
|
||||
* Process a received ICMP6 message.
|
||||
*/
|
||||
int
|
||||
icmp6_input(mp, offp, proto)
|
||||
struct mbuf **mp;
|
||||
int *offp, proto;
|
||||
icmp6_input(struct mbuf **mp, int *offp, int proto)
|
||||
{
|
||||
struct mbuf *m = *mp, *n;
|
||||
struct ip6_hdr *ip6, *nip6;
|
||||
@ -862,9 +855,7 @@ icmp6_input(mp, offp, proto)
|
||||
}
|
||||
|
||||
static int
|
||||
icmp6_notify_error(mp, off, icmp6len, code)
|
||||
struct mbuf **mp;
|
||||
int off, icmp6len, code;
|
||||
icmp6_notify_error(struct mbuf **mp, int off, int icmp6len, int code)
|
||||
{
|
||||
struct mbuf *m = *mp;
|
||||
struct icmp6_hdr *icmp6;
|
||||
@ -1095,9 +1086,7 @@ icmp6_notify_error(mp, off, icmp6len, code)
|
||||
}
|
||||
|
||||
void
|
||||
icmp6_mtudisc_update(ip6cp, validated)
|
||||
struct ip6ctlparam *ip6cp;
|
||||
int validated;
|
||||
icmp6_mtudisc_update(struct ip6ctlparam *ip6cp, int validated)
|
||||
{
|
||||
struct in6_addr *dst = ip6cp->ip6c_finaldst;
|
||||
struct icmp6_hdr *icmp6 = ip6cp->ip6c_icmp6;
|
||||
@ -1153,9 +1142,7 @@ icmp6_mtudisc_update(ip6cp, validated)
|
||||
*/
|
||||
#define hostnamelen strlen(hostname)
|
||||
static struct mbuf *
|
||||
ni6_input(m, off)
|
||||
struct mbuf *m;
|
||||
int off;
|
||||
ni6_input(struct mbuf *m, int off)
|
||||
{
|
||||
struct icmp6_nodeinfo *ni6, *nni6;
|
||||
struct mbuf *n = NULL;
|
||||
@ -1474,12 +1461,11 @@ ni6_input(m, off)
|
||||
*
|
||||
* XXX names with less than 2 dots (like "foo" or "foo.section") will be
|
||||
* treated as truncated name (two \0 at the end). this is a wild guess.
|
||||
*
|
||||
* old - return pascal string if non-zero
|
||||
*/
|
||||
static struct mbuf *
|
||||
ni6_nametodns(name, namelen, old)
|
||||
const char *name;
|
||||
int namelen;
|
||||
int old; /* return pascal string if non-zero */
|
||||
ni6_nametodns(const char *name, int namelen, int old)
|
||||
{
|
||||
struct mbuf *m;
|
||||
char *cp, *ep;
|
||||
@ -1576,11 +1562,7 @@ ni6_nametodns(name, namelen, old)
|
||||
* XXX upper/lowercase match (see RFC2065)
|
||||
*/
|
||||
static int
|
||||
ni6_dnsmatch(a, alen, b, blen)
|
||||
const char *a;
|
||||
int alen;
|
||||
const char *b;
|
||||
int blen;
|
||||
ni6_dnsmatch(const char *a, int alen, const char *b, int blen)
|
||||
{
|
||||
const char *a0, *b0;
|
||||
int l;
|
||||
@ -1640,11 +1622,8 @@ ni6_dnsmatch(a, alen, b, blen)
|
||||
* calculate the number of addresses to be returned in the node info reply.
|
||||
*/
|
||||
static int
|
||||
ni6_addrs(ni6, m, ifpp, subj)
|
||||
struct icmp6_nodeinfo *ni6;
|
||||
struct mbuf *m;
|
||||
struct ifnet **ifpp;
|
||||
struct in6_addr *subj;
|
||||
ni6_addrs(struct icmp6_nodeinfo *ni6, struct mbuf *m, struct ifnet **ifpp,
|
||||
struct in6_addr *subj)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct in6_ifaddr *ifa6;
|
||||
@ -1734,10 +1713,8 @@ ni6_addrs(ni6, m, ifpp, subj)
|
||||
}
|
||||
|
||||
static int
|
||||
ni6_store_addrs(ni6, nni6, ifp0, resid)
|
||||
struct icmp6_nodeinfo *ni6, *nni6;
|
||||
struct ifnet *ifp0;
|
||||
int resid;
|
||||
ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
|
||||
struct ifnet *ifp0, int resid)
|
||||
{
|
||||
struct ifnet *ifp = ifp0 ? ifp0 : TAILQ_FIRST(&ifnet);
|
||||
struct in6_ifaddr *ifa6;
|
||||
@ -1876,9 +1853,7 @@ ni6_store_addrs(ni6, nni6, ifp0, resid)
|
||||
* XXX almost dup'ed code with rip6_input.
|
||||
*/
|
||||
static int
|
||||
icmp6_rip6_input(mp, off)
|
||||
struct mbuf **mp;
|
||||
int off;
|
||||
icmp6_rip6_input(struct mbuf **mp, int off)
|
||||
{
|
||||
struct mbuf *m = *mp;
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
@ -2040,9 +2015,7 @@ icmp6_rip6_input(mp, off)
|
||||
* OFF points to the icmp6 header, counted from the top of the mbuf.
|
||||
*/
|
||||
void
|
||||
icmp6_reflect(m, off)
|
||||
struct mbuf *m;
|
||||
size_t off;
|
||||
icmp6_reflect(struct mbuf *m, size_t off)
|
||||
{
|
||||
struct ip6_hdr *ip6;
|
||||
struct icmp6_hdr *icmp6;
|
||||
@ -2200,17 +2173,15 @@ icmp6_reflect(m, off)
|
||||
}
|
||||
|
||||
void
|
||||
icmp6_fasttimo()
|
||||
icmp6_fasttimo(void)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static const char *
|
||||
icmp6_redirect_diag(src6, dst6, tgt6)
|
||||
struct in6_addr *src6;
|
||||
struct in6_addr *dst6;
|
||||
struct in6_addr *tgt6;
|
||||
icmp6_redirect_diag(struct in6_addr *src6, struct in6_addr *dst6,
|
||||
struct in6_addr *tgt6)
|
||||
{
|
||||
static char buf[1024];
|
||||
char ip6bufs[INET6_ADDRSTRLEN];
|
||||
@ -2223,9 +2194,7 @@ icmp6_redirect_diag(src6, dst6, tgt6)
|
||||
}
|
||||
|
||||
void
|
||||
icmp6_redirect_input(m, off)
|
||||
struct mbuf *m;
|
||||
int off;
|
||||
icmp6_redirect_input(struct mbuf *m, int off)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
@ -2432,9 +2401,7 @@ icmp6_redirect_input(m, off)
|
||||
}
|
||||
|
||||
void
|
||||
icmp6_redirect_output(m0, rt)
|
||||
struct mbuf *m0;
|
||||
struct rtentry *rt;
|
||||
icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt)
|
||||
{
|
||||
struct ifnet *ifp; /* my outgoing interface */
|
||||
struct in6_addr *ifp_ll6;
|
||||
@ -2718,9 +2685,7 @@ noredhdropt:;
|
||||
* ICMPv6 socket option processing.
|
||||
*/
|
||||
int
|
||||
icmp6_ctloutput(so, sopt)
|
||||
struct socket *so;
|
||||
struct sockopt *sopt;
|
||||
icmp6_ctloutput(struct socket *so, struct sockopt *sopt)
|
||||
{
|
||||
int error = 0;
|
||||
int optlen;
|
||||
@ -2795,12 +2760,14 @@ icmp6_ctloutput(so, sopt)
|
||||
* limitation.
|
||||
*
|
||||
* XXX per-destination/type check necessary?
|
||||
*
|
||||
* dst - not used at this moment
|
||||
* type - not used at this moment
|
||||
* code - not used at this moment
|
||||
*/
|
||||
static int
|
||||
icmp6_ratelimit(dst, type, code)
|
||||
const struct in6_addr *dst; /* not used at this moment */
|
||||
const int type; /* not used at this moment */
|
||||
const int code; /* not used at this moment */
|
||||
icmp6_ratelimit(const struct in6_addr *dst, const int type,
|
||||
const int code)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -277,9 +277,7 @@ in6_ifremloop(struct ifaddr *ifa)
|
||||
}
|
||||
|
||||
int
|
||||
in6_mask2len(mask, lim0)
|
||||
struct in6_addr *mask;
|
||||
u_char *lim0;
|
||||
in6_mask2len(struct in6_addr *mask, u_char *lim0)
|
||||
{
|
||||
int x = 0, y;
|
||||
u_char *lim = lim0, *p;
|
||||
@ -318,12 +316,8 @@ in6_mask2len(mask, lim0)
|
||||
#define ia62ifa(ia6) (&((ia6)->ia_ifa))
|
||||
|
||||
int
|
||||
in6_control(so, cmd, data, ifp, td)
|
||||
struct socket *so;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
struct ifnet *ifp;
|
||||
struct thread *td;
|
||||
in6_control(struct socket *so, u_long cmd, caddr_t data,
|
||||
struct ifnet *ifp, struct thread *td)
|
||||
{
|
||||
struct in6_ifreq *ifr = (struct in6_ifreq *)data;
|
||||
struct in6_ifaddr *ia = NULL;
|
||||
@ -795,11 +789,8 @@ in6_control(so, cmd, data, ifp, td)
|
||||
* XXX: should this be performed under splnet()?
|
||||
*/
|
||||
int
|
||||
in6_update_ifa(ifp, ifra, ia, flags)
|
||||
struct ifnet *ifp;
|
||||
struct in6_aliasreq *ifra;
|
||||
struct in6_ifaddr *ia;
|
||||
int flags;
|
||||
in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
||||
struct in6_ifaddr *ia, int flags)
|
||||
{
|
||||
int error = 0, hostIsNew = 0, plen = -1;
|
||||
struct in6_ifaddr *oia;
|
||||
@ -1326,8 +1317,7 @@ in6_update_ifa(ifp, ifra, ia, flags)
|
||||
}
|
||||
|
||||
void
|
||||
in6_purgeaddr(ifa)
|
||||
struct ifaddr *ifa;
|
||||
in6_purgeaddr(struct ifaddr *ifa)
|
||||
{
|
||||
struct ifnet *ifp = ifa->ifa_ifp;
|
||||
struct in6_ifaddr *ia = (struct in6_ifaddr *) ifa;
|
||||
@ -1371,9 +1361,7 @@ in6_purgeaddr(ifa)
|
||||
}
|
||||
|
||||
static void
|
||||
in6_unlink_ifa(ia, ifp)
|
||||
struct in6_ifaddr *ia;
|
||||
struct ifnet *ifp;
|
||||
in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp)
|
||||
{
|
||||
struct in6_ifaddr *oia;
|
||||
int s = splnet();
|
||||
@ -1426,8 +1414,7 @@ in6_unlink_ifa(ia, ifp)
|
||||
}
|
||||
|
||||
void
|
||||
in6_purgeif(ifp)
|
||||
struct ifnet *ifp;
|
||||
in6_purgeif(struct ifnet *ifp)
|
||||
{
|
||||
struct ifaddr *ifa, *nifa;
|
||||
|
||||
@ -1465,12 +1452,8 @@ in6_purgeif(ifp)
|
||||
* address encoding scheme. (see figure on page 8)
|
||||
*/
|
||||
static int
|
||||
in6_lifaddr_ioctl(so, cmd, data, ifp, td)
|
||||
struct socket *so;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
struct ifnet *ifp;
|
||||
struct thread *td;
|
||||
in6_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data,
|
||||
struct ifnet *ifp, struct thread *td)
|
||||
{
|
||||
struct if_laddrreq *iflr = (struct if_laddrreq *)data;
|
||||
struct ifaddr *ifa;
|
||||
@ -1703,11 +1686,8 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, td)
|
||||
* and routing table entry.
|
||||
*/
|
||||
static int
|
||||
in6_ifinit(ifp, ia, sin6, newhost)
|
||||
struct ifnet *ifp;
|
||||
struct in6_ifaddr *ia;
|
||||
struct sockaddr_in6 *sin6;
|
||||
int newhost;
|
||||
in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
|
||||
struct sockaddr_in6 *sin6, int newhost)
|
||||
{
|
||||
int error = 0, plen, ifacount = 0;
|
||||
int s = splimp();
|
||||
@ -1811,11 +1791,8 @@ in6_ifinit(ifp, ia, sin6, newhost)
|
||||
}
|
||||
|
||||
struct in6_multi_mship *
|
||||
in6_joingroup(ifp, addr, errorp, delay)
|
||||
struct ifnet *ifp;
|
||||
struct in6_addr *addr;
|
||||
int *errorp;
|
||||
int delay;
|
||||
in6_joingroup(struct ifnet *ifp, struct in6_addr *addr,
|
||||
int *errorp, int delay)
|
||||
{
|
||||
struct in6_multi_mship *imm;
|
||||
|
||||
@ -1834,8 +1811,7 @@ in6_joingroup(ifp, addr, errorp, delay)
|
||||
}
|
||||
|
||||
int
|
||||
in6_leavegroup(imm)
|
||||
struct in6_multi_mship *imm;
|
||||
in6_leavegroup(struct in6_multi_mship *imm)
|
||||
{
|
||||
|
||||
if (imm->i6mm_maddr)
|
||||
@ -1848,9 +1824,7 @@ in6_leavegroup(imm)
|
||||
* Find an IPv6 interface link-local address specific to an interface.
|
||||
*/
|
||||
struct in6_ifaddr *
|
||||
in6ifa_ifpforlinklocal(ifp, ignoreflags)
|
||||
struct ifnet *ifp;
|
||||
int ignoreflags;
|
||||
in6ifa_ifpforlinklocal(struct ifnet *ifp, int ignoreflags)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
|
||||
@ -1873,9 +1847,7 @@ in6ifa_ifpforlinklocal(ifp, ignoreflags)
|
||||
* find the internet address corresponding to a given interface and address.
|
||||
*/
|
||||
struct in6_ifaddr *
|
||||
in6ifa_ifpwithaddr(ifp, addr)
|
||||
struct ifnet *ifp;
|
||||
struct in6_addr *addr;
|
||||
in6ifa_ifpwithaddr(struct ifnet *ifp, struct in6_addr *addr)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
|
||||
@ -1955,8 +1927,7 @@ ip6_sprintf(char *ip6buf, const struct in6_addr *addr)
|
||||
}
|
||||
|
||||
int
|
||||
in6_localaddr(in6)
|
||||
struct in6_addr *in6;
|
||||
in6_localaddr(struct in6_addr *in6)
|
||||
{
|
||||
struct in6_ifaddr *ia;
|
||||
|
||||
@ -1974,8 +1945,7 @@ in6_localaddr(in6)
|
||||
}
|
||||
|
||||
int
|
||||
in6_is_addr_deprecated(sa6)
|
||||
struct sockaddr_in6 *sa6;
|
||||
in6_is_addr_deprecated(struct sockaddr_in6 *sa6)
|
||||
{
|
||||
struct in6_ifaddr *ia;
|
||||
|
||||
@ -1996,8 +1966,7 @@ in6_is_addr_deprecated(sa6)
|
||||
* hard coding...
|
||||
*/
|
||||
int
|
||||
in6_matchlen(src, dst)
|
||||
struct in6_addr *src, *dst;
|
||||
in6_matchlen(struct in6_addr *src, struct in6_addr *dst)
|
||||
{
|
||||
int match = 0;
|
||||
u_char *s = (u_char *)src, *d = (u_char *)dst;
|
||||
@ -2017,9 +1986,7 @@ struct in6_addr *src, *dst;
|
||||
|
||||
/* XXX: to be scope conscious */
|
||||
int
|
||||
in6_are_prefix_equal(p1, p2, len)
|
||||
struct in6_addr *p1, *p2;
|
||||
int len;
|
||||
in6_are_prefix_equal(struct in6_addr *p1, struct in6_addr *p2, int len)
|
||||
{
|
||||
int bytelen, bitlen;
|
||||
|
||||
@ -2044,9 +2011,7 @@ in6_are_prefix_equal(p1, p2, len)
|
||||
}
|
||||
|
||||
void
|
||||
in6_prefixlen2mask(maskp, len)
|
||||
struct in6_addr *maskp;
|
||||
int len;
|
||||
in6_prefixlen2mask(struct in6_addr *maskp, int len)
|
||||
{
|
||||
u_char maskarray[8] = {0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff};
|
||||
int bytelen, bitlen, i;
|
||||
@ -2072,9 +2037,7 @@ in6_prefixlen2mask(maskp, len)
|
||||
* found, return the first valid address from designated IF.
|
||||
*/
|
||||
struct in6_ifaddr *
|
||||
in6_ifawithifp(ifp, dst)
|
||||
struct ifnet *ifp;
|
||||
struct in6_addr *dst;
|
||||
in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
|
||||
{
|
||||
int dst_scope = in6_addrscope(dst), blen = -1, tlen;
|
||||
struct ifaddr *ifa;
|
||||
@ -2154,8 +2117,7 @@ in6_ifawithifp(ifp, dst)
|
||||
* perform DAD when interface becomes IFF_UP.
|
||||
*/
|
||||
void
|
||||
in6_if_up(ifp)
|
||||
struct ifnet *ifp;
|
||||
in6_if_up(struct ifnet *ifp)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
struct in6_ifaddr *ia;
|
||||
@ -2183,8 +2145,7 @@ in6_if_up(ifp)
|
||||
}
|
||||
|
||||
int
|
||||
in6if_do_dad(ifp)
|
||||
struct ifnet *ifp;
|
||||
in6if_do_dad(struct ifnet *ifp)
|
||||
{
|
||||
if ((ifp->if_flags & IFF_LOOPBACK) != 0)
|
||||
return (0);
|
||||
@ -2224,7 +2185,7 @@ in6if_do_dad(ifp)
|
||||
* to in6_maxmtu.
|
||||
*/
|
||||
void
|
||||
in6_setmaxmtu()
|
||||
in6_setmaxmtu(void)
|
||||
{
|
||||
unsigned long maxmtu = 0;
|
||||
struct ifnet *ifp;
|
||||
@ -2252,8 +2213,7 @@ in6_setmaxmtu()
|
||||
* consistent, and those really are as of August 2004.
|
||||
*/
|
||||
int
|
||||
in6_if2idlen(ifp)
|
||||
struct ifnet *ifp;
|
||||
in6_if2idlen(struct ifnet *ifp)
|
||||
{
|
||||
switch (ifp->if_type) {
|
||||
case IFT_ETHER: /* RFC2464 */
|
||||
@ -2304,8 +2264,7 @@ in6_if2idlen(ifp)
|
||||
}
|
||||
|
||||
void *
|
||||
in6_domifattach(ifp)
|
||||
struct ifnet *ifp;
|
||||
in6_domifattach(struct ifnet *ifp)
|
||||
{
|
||||
struct in6_ifextra *ext;
|
||||
|
||||
@ -2327,9 +2286,7 @@ in6_domifattach(ifp)
|
||||
}
|
||||
|
||||
void
|
||||
in6_domifdetach(ifp, aux)
|
||||
struct ifnet *ifp;
|
||||
void *aux;
|
||||
in6_domifdetach(struct ifnet *ifp, void *aux)
|
||||
{
|
||||
struct in6_ifextra *ext = (struct in6_ifextra *)aux;
|
||||
|
||||
@ -2347,6 +2304,7 @@ in6_domifdetach(ifp, aux)
|
||||
void
|
||||
in6_sin6_2_sin(struct sockaddr_in *sin, struct sockaddr_in6 *sin6)
|
||||
{
|
||||
|
||||
bzero(sin, sizeof(*sin));
|
||||
sin->sin_len = sizeof(struct sockaddr_in);
|
||||
sin->sin_family = AF_INET;
|
||||
|
@ -355,7 +355,6 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
|
||||
(IN6_IS_ADDR_MC_LINKLOCAL(a)) || \
|
||||
(IN6_IS_ADDR_MC_INTFACELOCAL(a)))
|
||||
|
||||
|
||||
#define IFA6_IS_DEPRECATED(a) \
|
||||
((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \
|
||||
(u_int32_t)((time_second - (a)->ia6_updatetime)) > \
|
||||
|
@ -84,7 +84,6 @@
|
||||
* len is a total length of a transport segment.
|
||||
* (e.g. TCP header + TCP payload)
|
||||
*/
|
||||
|
||||
int
|
||||
in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
|
||||
{
|
||||
|
@ -81,10 +81,9 @@ struct ip6protosw in6_gif_protosw =
|
||||
};
|
||||
|
||||
int
|
||||
in6_gif_output(ifp, family, m)
|
||||
struct ifnet *ifp;
|
||||
int family; /* family of the packet to be encapsulate. */
|
||||
struct mbuf *m;
|
||||
in6_gif_output(struct ifnet *ifp,
|
||||
int family, /* family of the packet to be encapsulate */
|
||||
struct mbuf *m)
|
||||
{
|
||||
struct gif_softc *sc = ifp->if_softc;
|
||||
struct sockaddr_in6 *dst = (struct sockaddr_in6 *)&sc->gif_ro6.ro_dst;
|
||||
@ -243,9 +242,7 @@ in6_gif_output(ifp, family, m)
|
||||
}
|
||||
|
||||
int
|
||||
in6_gif_input(mp, offp, proto)
|
||||
struct mbuf **mp;
|
||||
int *offp, proto;
|
||||
in6_gif_input(struct mbuf **mp, int *offp, int proto)
|
||||
{
|
||||
struct mbuf *m = *mp;
|
||||
struct ifnet *gifp = NULL;
|
||||
@ -334,10 +331,8 @@ in6_gif_input(mp, offp, proto)
|
||||
* validate outer address.
|
||||
*/
|
||||
static int
|
||||
gif_validate6(ip6, sc, ifp)
|
||||
const struct ip6_hdr *ip6;
|
||||
struct gif_softc *sc;
|
||||
struct ifnet *ifp;
|
||||
gif_validate6(const struct ip6_hdr *ip6, struct gif_softc *sc,
|
||||
struct ifnet *ifp)
|
||||
{
|
||||
struct sockaddr_in6 *src, *dst;
|
||||
|
||||
@ -390,11 +385,7 @@ gif_validate6(ip6, sc, ifp)
|
||||
* sanity check for arg should have been done in the caller.
|
||||
*/
|
||||
int
|
||||
gif_encapcheck6(m, off, proto, arg)
|
||||
const struct mbuf *m;
|
||||
int off;
|
||||
int proto;
|
||||
void *arg;
|
||||
gif_encapcheck6(const struct mbuf *m, int off, int proto, void *arg)
|
||||
{
|
||||
struct ip6_hdr ip6;
|
||||
struct gif_softc *sc;
|
||||
@ -411,8 +402,7 @@ gif_encapcheck6(m, off, proto, arg)
|
||||
}
|
||||
|
||||
int
|
||||
in6_gif_attach(sc)
|
||||
struct gif_softc *sc;
|
||||
in6_gif_attach(struct gif_softc *sc)
|
||||
{
|
||||
sc->encap_cookie6 = encap_attach_func(AF_INET6, -1, gif_encapcheck,
|
||||
(void *)&in6_gif_protosw, sc);
|
||||
@ -422,8 +412,7 @@ in6_gif_attach(sc)
|
||||
}
|
||||
|
||||
int
|
||||
in6_gif_detach(sc)
|
||||
struct gif_softc *sc;
|
||||
in6_gif_detach(struct gif_softc *sc)
|
||||
{
|
||||
int error;
|
||||
|
||||
|
@ -95,11 +95,11 @@ static void in6_purgemaddrs __P((struct ifnet *));
|
||||
* The goal here is to get an interface identifier that is
|
||||
* (1) random enough and (2) does not change across reboot.
|
||||
* We currently use MD5(hostname) for it.
|
||||
*
|
||||
* in6 - upper 64bits are preserved
|
||||
*/
|
||||
static int
|
||||
get_rand_ifid(ifp, in6)
|
||||
struct ifnet *ifp;
|
||||
struct in6_addr *in6; /* upper 64bits are preserved */
|
||||
get_rand_ifid(struct ifnet *ifp, struct in6_addr *in6)
|
||||
{
|
||||
MD5_CTX ctxt;
|
||||
u_int8_t digest[16];
|
||||
@ -131,15 +131,13 @@ get_rand_ifid(ifp, in6)
|
||||
}
|
||||
|
||||
static int
|
||||
generate_tmp_ifid(seed0, seed1, ret)
|
||||
u_int8_t *seed0, *ret;
|
||||
const u_int8_t *seed1;
|
||||
generate_tmp_ifid(u_int8_t *seed0, const u_int8_t *seed1, u_int8_t *ret)
|
||||
{
|
||||
MD5_CTX ctxt;
|
||||
u_int8_t seed[16], digest[16], nullbuf[8];
|
||||
u_int32_t val32;
|
||||
|
||||
/* If there's no hisotry, start with a random seed. */
|
||||
/* If there's no history, start with a random seed. */
|
||||
bzero(nullbuf, sizeof(nullbuf));
|
||||
if (bcmp(nullbuf, seed0, sizeof(nullbuf)) == 0) {
|
||||
int i;
|
||||
@ -214,11 +212,11 @@ generate_tmp_ifid(seed0, seed1, ret)
|
||||
/*
|
||||
* Get interface identifier for the specified interface.
|
||||
* XXX assumes single sockaddr_dl (AF_LINK address) per an interface
|
||||
*
|
||||
* in6 - upper 64bits are preserved
|
||||
*/
|
||||
int
|
||||
in6_get_hw_ifid(ifp, in6)
|
||||
struct ifnet *ifp;
|
||||
struct in6_addr *in6; /* upper 64bits are preserved */
|
||||
in6_get_hw_ifid(struct ifnet *ifp, struct in6_addr *in6)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
struct sockaddr_dl *sdl;
|
||||
@ -347,12 +345,12 @@ in6_get_hw_ifid(ifp, in6)
|
||||
* Get interface identifier for the specified interface. If it is not
|
||||
* available on ifp0, borrow interface identifier from other information
|
||||
* sources.
|
||||
*
|
||||
* altifp - secondary EUI64 source
|
||||
*/
|
||||
static int
|
||||
get_ifid(ifp0, altifp, in6)
|
||||
struct ifnet *ifp0;
|
||||
struct ifnet *altifp; /* secondary EUI64 source */
|
||||
struct in6_addr *in6;
|
||||
get_ifid(struct ifnet *ifp0, struct ifnet *altifp,
|
||||
struct in6_addr *in6)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
|
||||
@ -411,10 +409,11 @@ get_ifid(ifp0, altifp, in6)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* altifp - secondary EUI64 source
|
||||
*/
|
||||
static int
|
||||
in6_ifattach_linklocal(ifp, altifp)
|
||||
struct ifnet *ifp;
|
||||
struct ifnet *altifp; /* secondary EUI64 source */
|
||||
in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp)
|
||||
{
|
||||
struct in6_ifaddr *ia;
|
||||
struct in6_aliasreq ifra;
|
||||
@ -526,9 +525,11 @@ in6_ifattach_linklocal(ifp, altifp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* ifp - must be IFT_LOOP
|
||||
*/
|
||||
static int
|
||||
in6_ifattach_loopback(ifp)
|
||||
struct ifnet *ifp; /* must be IFT_LOOP */
|
||||
in6_ifattach_loopback(struct ifnet *ifp)
|
||||
{
|
||||
struct in6_aliasreq ifra;
|
||||
int error;
|
||||
@ -588,11 +589,8 @@ in6_ifattach_loopback(ifp)
|
||||
* when ifp == NULL, the caller is responsible for filling scopeid.
|
||||
*/
|
||||
int
|
||||
in6_nigroup(ifp, name, namelen, in6)
|
||||
struct ifnet *ifp;
|
||||
const char *name;
|
||||
int namelen;
|
||||
struct in6_addr *in6;
|
||||
in6_nigroup(struct ifnet *ifp, const char *name, int namelen,
|
||||
struct in6_addr *in6)
|
||||
{
|
||||
const char *p;
|
||||
u_char *q;
|
||||
@ -638,11 +636,11 @@ in6_nigroup(ifp, name, namelen, in6)
|
||||
* XXX multiple loopback interface needs more care. for instance,
|
||||
* nodelocal address needs to be configured onto only one of them.
|
||||
* XXX multiple link-local address case
|
||||
*
|
||||
* altifp - secondary EUI64 source
|
||||
*/
|
||||
void
|
||||
in6_ifattach(ifp, altifp)
|
||||
struct ifnet *ifp;
|
||||
struct ifnet *altifp; /* secondary EUI64 source */
|
||||
in6_ifattach(struct ifnet *ifp, struct ifnet *altifp)
|
||||
{
|
||||
struct in6_ifaddr *ia;
|
||||
struct in6_addr in6;
|
||||
@ -724,8 +722,7 @@ in6_ifattach(ifp, altifp)
|
||||
* from the ifnet list in bsdi.
|
||||
*/
|
||||
void
|
||||
in6_ifdetach(ifp)
|
||||
struct ifnet *ifp;
|
||||
in6_ifdetach(struct ifnet *ifp)
|
||||
{
|
||||
struct in6_ifaddr *ia, *oia;
|
||||
struct ifaddr *ifa, *next;
|
||||
@ -835,11 +832,8 @@ in6_ifdetach(ifp)
|
||||
}
|
||||
|
||||
int
|
||||
in6_get_tmpifid(ifp, retbuf, baseid, generate)
|
||||
struct ifnet *ifp;
|
||||
u_int8_t *retbuf;
|
||||
const u_int8_t *baseid;
|
||||
int generate;
|
||||
in6_get_tmpifid(struct ifnet *ifp, u_int8_t *retbuf,
|
||||
const u_int8_t *baseid, int generate)
|
||||
{
|
||||
u_int8_t nullbuf[8];
|
||||
struct nd_ifinfo *ndi = ND_IFINFO(ifp);
|
||||
@ -863,8 +857,7 @@ in6_get_tmpifid(ifp, retbuf, baseid, generate)
|
||||
}
|
||||
|
||||
void
|
||||
in6_tmpaddrtimer(ignored_arg)
|
||||
void *ignored_arg;
|
||||
in6_tmpaddrtimer(void *ignored_arg)
|
||||
{
|
||||
struct nd_ifinfo *ndi;
|
||||
u_int8_t nullbuf[8];
|
||||
@ -892,8 +885,7 @@ in6_tmpaddrtimer(ignored_arg)
|
||||
}
|
||||
|
||||
static void
|
||||
in6_purgemaddrs(ifp)
|
||||
struct ifnet *ifp;
|
||||
in6_purgemaddrs(struct ifnet *ifp)
|
||||
{
|
||||
struct in6_multi *in6m;
|
||||
struct in6_multi *oin6m;
|
||||
|
@ -108,10 +108,8 @@
|
||||
struct in6_addr zeroin6_addr;
|
||||
|
||||
int
|
||||
in6_pcbbind(inp, nam, cred)
|
||||
register struct inpcb *inp;
|
||||
struct sockaddr *nam;
|
||||
struct ucred *cred;
|
||||
in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam,
|
||||
struct ucred *cred)
|
||||
{
|
||||
struct socket *so = inp->inp_socket;
|
||||
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)NULL;
|
||||
@ -276,12 +274,9 @@ in6_pcbbind(inp, nam, cred)
|
||||
* a bit of a kludge, but cleaning up the internal interfaces would
|
||||
* have forced minor changes in every protocol).
|
||||
*/
|
||||
|
||||
int
|
||||
in6_pcbladdr(inp, nam, plocal_addr6)
|
||||
register struct inpcb *inp;
|
||||
struct sockaddr *nam;
|
||||
struct in6_addr **plocal_addr6;
|
||||
in6_pcbladdr(register struct inpcb *inp, struct sockaddr *nam,
|
||||
struct in6_addr **plocal_addr6)
|
||||
{
|
||||
register struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam;
|
||||
int error = 0;
|
||||
@ -347,10 +342,8 @@ in6_pcbladdr(inp, nam, plocal_addr6)
|
||||
* then pick one.
|
||||
*/
|
||||
int
|
||||
in6_pcbconnect(inp, nam, cred)
|
||||
register struct inpcb *inp;
|
||||
struct sockaddr *nam;
|
||||
struct ucred *cred;
|
||||
in6_pcbconnect(register struct inpcb *inp, struct sockaddr *nam,
|
||||
struct ucred *cred)
|
||||
{
|
||||
struct in6_addr *addr6;
|
||||
register struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam;
|
||||
@ -395,8 +388,7 @@ in6_pcbconnect(inp, nam, cred)
|
||||
}
|
||||
|
||||
void
|
||||
in6_pcbdisconnect(inp)
|
||||
struct inpcb *inp;
|
||||
in6_pcbdisconnect(struct inpcb *inp)
|
||||
{
|
||||
|
||||
INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
|
||||
@ -446,9 +438,7 @@ in6_pcbfree(struct inpcb *inp)
|
||||
}
|
||||
|
||||
struct sockaddr *
|
||||
in6_sockaddr(port, addr_p)
|
||||
in_port_t port;
|
||||
struct in6_addr *addr_p;
|
||||
in6_sockaddr(in_port_t port, struct in6_addr *addr_p)
|
||||
{
|
||||
struct sockaddr_in6 *sin6;
|
||||
|
||||
@ -464,9 +454,7 @@ in6_sockaddr(port, addr_p)
|
||||
}
|
||||
|
||||
struct sockaddr *
|
||||
in6_v4mapsin6_sockaddr(port, addr_p)
|
||||
in_port_t port;
|
||||
struct in_addr *addr_p;
|
||||
in6_v4mapsin6_sockaddr(in_port_t port, struct in_addr *addr_p)
|
||||
{
|
||||
struct sockaddr_in sin;
|
||||
struct sockaddr_in6 *sin6_p;
|
||||
@ -485,9 +473,7 @@ in6_v4mapsin6_sockaddr(port, addr_p)
|
||||
}
|
||||
|
||||
int
|
||||
in6_getsockaddr(so, nam)
|
||||
struct socket *so;
|
||||
struct sockaddr **nam;
|
||||
in6_getsockaddr(struct socket *so, struct sockaddr **nam)
|
||||
{
|
||||
register struct inpcb *inp;
|
||||
struct in6_addr addr;
|
||||
@ -506,9 +492,7 @@ in6_getsockaddr(so, nam)
|
||||
}
|
||||
|
||||
int
|
||||
in6_getpeeraddr(so, nam)
|
||||
struct socket *so;
|
||||
struct sockaddr **nam;
|
||||
in6_getpeeraddr(struct socket *so, struct sockaddr **nam)
|
||||
{
|
||||
struct inpcb *inp;
|
||||
struct in6_addr addr;
|
||||
@ -577,14 +561,10 @@ in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam)
|
||||
* any errors for each matching socket.
|
||||
*/
|
||||
void
|
||||
in6_pcbnotify(pcbinfo, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify)
|
||||
struct inpcbinfo *pcbinfo;
|
||||
struct sockaddr *dst;
|
||||
const struct sockaddr *src;
|
||||
u_int fport_arg, lport_arg;
|
||||
int cmd;
|
||||
void *cmdarg;
|
||||
struct inpcb *(*notify) __P((struct inpcb *, int));
|
||||
in6_pcbnotify(struct inpcbinfo *pcbinfo, struct sockaddr *dst,
|
||||
u_int fport_arg, const struct sockaddr *src, u_int lport_arg,
|
||||
int cmd, void *cmdarg,
|
||||
struct inpcb *(*notify) __P((struct inpcb *, int)))
|
||||
{
|
||||
struct inpcbhead *head;
|
||||
struct inpcb *inp, *ninp;
|
||||
@ -689,11 +669,8 @@ in6_pcbnotify(pcbinfo, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify)
|
||||
* Lookup a PCB based on the local address and port.
|
||||
*/
|
||||
struct inpcb *
|
||||
in6_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
|
||||
struct inpcbinfo *pcbinfo;
|
||||
struct in6_addr *laddr;
|
||||
u_int lport_arg;
|
||||
int wild_okay;
|
||||
in6_pcblookup_local(struct inpcbinfo *pcbinfo, struct in6_addr *laddr,
|
||||
u_int lport_arg, int wild_okay)
|
||||
{
|
||||
register struct inpcb *inp;
|
||||
int matchwild = 3, wildcard;
|
||||
@ -777,9 +754,7 @@ in6_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
|
||||
}
|
||||
|
||||
void
|
||||
in6_pcbpurgeif0(pcbinfo, ifp)
|
||||
struct inpcbinfo *pcbinfo;
|
||||
struct ifnet *ifp;
|
||||
in6_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet *ifp)
|
||||
{
|
||||
struct in6pcb *in6p;
|
||||
struct ip6_moptions *im6o;
|
||||
@ -826,9 +801,9 @@ in6_pcbpurgeif0(pcbinfo, ifp)
|
||||
* (by a redirect), time to try a default gateway again.
|
||||
*/
|
||||
void
|
||||
in6_losing(in6p)
|
||||
struct inpcb *in6p;
|
||||
in6_losing(struct inpcb *in6p)
|
||||
{
|
||||
|
||||
/*
|
||||
* We don't store route pointers in the routing table anymore
|
||||
*/
|
||||
@ -840,9 +815,7 @@ in6_losing(in6p)
|
||||
* and allocate a (hopefully) better one.
|
||||
*/
|
||||
struct inpcb *
|
||||
in6_rtchange(inp, errno)
|
||||
struct inpcb *inp;
|
||||
int errno;
|
||||
in6_rtchange(struct inpcb *inp, int errno)
|
||||
{
|
||||
/*
|
||||
* We don't store route pointers in the routing table anymore
|
||||
@ -854,12 +827,9 @@ in6_rtchange(inp, errno)
|
||||
* Lookup PCB in hash list.
|
||||
*/
|
||||
struct inpcb *
|
||||
in6_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard, ifp)
|
||||
struct inpcbinfo *pcbinfo;
|
||||
struct in6_addr *faddr, *laddr;
|
||||
u_int fport_arg, lport_arg;
|
||||
int wildcard;
|
||||
struct ifnet *ifp;
|
||||
in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in6_addr *faddr,
|
||||
u_int fport_arg, struct in6_addr *laddr, u_int lport_arg,
|
||||
int wildcard, struct ifnet *ifp)
|
||||
{
|
||||
struct inpcbhead *head;
|
||||
register struct inpcb *inp;
|
||||
|
@ -429,7 +429,7 @@ in6_mtutimo(void *rock)
|
||||
|
||||
#if 0
|
||||
void
|
||||
in6_rtqdrain()
|
||||
in6_rtqdrain(void)
|
||||
{
|
||||
struct radix_node_head *rnh = rt_tables[AF_INET6];
|
||||
struct rtqk_arg arg;
|
||||
|
@ -157,14 +157,9 @@ static struct in6_addrpolicy *match_addrsel_policy __P((struct sockaddr_in6 *));
|
||||
} while(0)
|
||||
|
||||
struct in6_addr *
|
||||
in6_selectsrc(dstsock, opts, mopts, ro, laddr, ifpp, errorp)
|
||||
struct sockaddr_in6 *dstsock;
|
||||
struct ip6_pktopts *opts;
|
||||
struct ip6_moptions *mopts;
|
||||
struct route_in6 *ro;
|
||||
struct in6_addr *laddr;
|
||||
struct ifnet **ifpp;
|
||||
int *errorp;
|
||||
in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
|
||||
struct ip6_moptions *mopts, struct route_in6 *ro,
|
||||
struct in6_addr *laddr, struct ifnet **ifpp, int *errorp)
|
||||
{
|
||||
struct in6_addr dst;
|
||||
struct ifnet *ifp = NULL;
|
||||
@ -430,16 +425,14 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, ifpp, errorp)
|
||||
return (&ia->ia_addr.sin6_addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* clone - meaningful only for bsdi and freebsd
|
||||
*/
|
||||
static int
|
||||
selectroute(dstsock, opts, mopts, ro, retifp, retrt, clone, norouteok)
|
||||
struct sockaddr_in6 *dstsock;
|
||||
struct ip6_pktopts *opts;
|
||||
struct ip6_moptions *mopts;
|
||||
struct route_in6 *ro;
|
||||
struct ifnet **retifp;
|
||||
struct rtentry **retrt;
|
||||
int clone; /* meaningful only for bsdi and freebsd. */
|
||||
int norouteok;
|
||||
selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
|
||||
struct ip6_moptions *mopts, struct route_in6 *ro,
|
||||
struct ifnet **retifp, struct rtentry **retrt, int clone,
|
||||
int norouteok)
|
||||
{
|
||||
int error = 0;
|
||||
struct ifnet *ifp = NULL;
|
||||
@ -633,12 +626,8 @@ selectroute(dstsock, opts, mopts, ro, retifp, retrt, clone, norouteok)
|
||||
}
|
||||
|
||||
static int
|
||||
in6_selectif(dstsock, opts, mopts, ro, retifp)
|
||||
struct sockaddr_in6 *dstsock;
|
||||
struct ip6_pktopts *opts;
|
||||
struct ip6_moptions *mopts;
|
||||
struct route_in6 *ro;
|
||||
struct ifnet **retifp;
|
||||
in6_selectif(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
|
||||
struct ip6_moptions *mopts, struct route_in6 *ro, struct ifnet **retifp)
|
||||
{
|
||||
int error;
|
||||
struct route_in6 sro;
|
||||
@ -696,16 +685,15 @@ in6_selectif(dstsock, opts, mopts, ro, retifp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* clone - meaningful only for bsdi and freebsd
|
||||
*/
|
||||
int
|
||||
in6_selectroute(dstsock, opts, mopts, ro, retifp, retrt, clone)
|
||||
struct sockaddr_in6 *dstsock;
|
||||
struct ip6_pktopts *opts;
|
||||
struct ip6_moptions *mopts;
|
||||
struct route_in6 *ro;
|
||||
struct ifnet **retifp;
|
||||
struct rtentry **retrt;
|
||||
int clone; /* meaningful only for bsdi and freebsd. */
|
||||
in6_selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
|
||||
struct ip6_moptions *mopts, struct route_in6 *ro,
|
||||
struct ifnet **retifp, struct rtentry **retrt, int clone)
|
||||
{
|
||||
|
||||
return (selectroute(dstsock, opts, mopts, ro, retifp,
|
||||
retrt, clone, 0));
|
||||
}
|
||||
@ -718,10 +706,9 @@ in6_selectroute(dstsock, opts, mopts, ro, retifp, retrt, clone)
|
||||
* 3. The system default hoplimit.
|
||||
*/
|
||||
int
|
||||
in6_selecthlim(in6p, ifp)
|
||||
struct in6pcb *in6p;
|
||||
struct ifnet *ifp;
|
||||
in6_selecthlim(struct in6pcb *in6p, struct ifnet *ifp)
|
||||
{
|
||||
|
||||
if (in6p && in6p->in6p_hops >= 0)
|
||||
return (in6p->in6p_hops);
|
||||
else if (ifp)
|
||||
@ -751,10 +738,7 @@ in6_selecthlim(in6p, ifp)
|
||||
* share this function by all *bsd*...
|
||||
*/
|
||||
int
|
||||
in6_pcbsetport(laddr, inp, cred)
|
||||
struct in6_addr *laddr;
|
||||
struct inpcb *inp;
|
||||
struct ucred *cred;
|
||||
in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred)
|
||||
{
|
||||
struct socket *so = inp->inp_socket;
|
||||
u_int16_t lport = 0, first, last, *lastport;
|
||||
@ -848,7 +832,7 @@ in6_pcbsetport(laddr, inp, cred)
|
||||
}
|
||||
|
||||
void
|
||||
addrsel_policy_init()
|
||||
addrsel_policy_init(void)
|
||||
{
|
||||
ADDRSEL_LOCK_INIT();
|
||||
ADDRSEL_SXLOCK_INIT();
|
||||
@ -861,8 +845,7 @@ addrsel_policy_init()
|
||||
}
|
||||
|
||||
static struct in6_addrpolicy *
|
||||
lookup_addrsel_policy(key)
|
||||
struct sockaddr_in6 *key;
|
||||
lookup_addrsel_policy(struct sockaddr_in6 *key)
|
||||
{
|
||||
struct in6_addrpolicy *match = NULL;
|
||||
|
||||
@ -905,9 +888,7 @@ in6_src_sysctl(SYSCTL_HANDLER_ARGS)
|
||||
}
|
||||
|
||||
int
|
||||
in6_src_ioctl(cmd, data)
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
in6_src_ioctl(u_long cmd, caddr_t data)
|
||||
{
|
||||
int i;
|
||||
struct in6_addrpolicy ent0;
|
||||
@ -955,14 +936,14 @@ TAILQ_HEAD(addrsel_policyhead, addrsel_policyent);
|
||||
struct addrsel_policyhead addrsel_policytab;
|
||||
|
||||
static void
|
||||
init_policy_queue()
|
||||
init_policy_queue(void)
|
||||
{
|
||||
|
||||
TAILQ_INIT(&addrsel_policytab);
|
||||
}
|
||||
|
||||
static int
|
||||
add_addrsel_policyent(newpolicy)
|
||||
struct in6_addrpolicy *newpolicy;
|
||||
add_addrsel_policyent(struct in6_addrpolicy *newpolicy)
|
||||
{
|
||||
struct addrsel_policyent *new, *pol;
|
||||
|
||||
@ -997,8 +978,7 @@ add_addrsel_policyent(newpolicy)
|
||||
}
|
||||
|
||||
static int
|
||||
delete_addrsel_policyent(key)
|
||||
struct in6_addrpolicy *key;
|
||||
delete_addrsel_policyent(struct in6_addrpolicy *key)
|
||||
{
|
||||
struct addrsel_policyent *pol;
|
||||
|
||||
@ -1028,9 +1008,8 @@ delete_addrsel_policyent(key)
|
||||
}
|
||||
|
||||
static int
|
||||
walk_addrsel_policy(callback, w)
|
||||
int (*callback) __P((struct in6_addrpolicy *, void *));
|
||||
void *w;
|
||||
walk_addrsel_policy(int (*callback) __P((struct in6_addrpolicy *, void *)),
|
||||
void *w)
|
||||
{
|
||||
struct addrsel_policyent *pol;
|
||||
int error = 0;
|
||||
@ -1047,9 +1026,7 @@ walk_addrsel_policy(callback, w)
|
||||
}
|
||||
|
||||
static int
|
||||
dump_addrsel_policyent(pol, arg)
|
||||
struct in6_addrpolicy *pol;
|
||||
void *arg;
|
||||
dump_addrsel_policyent(struct in6_addrpolicy *pol, void *arg)
|
||||
{
|
||||
int error = 0;
|
||||
struct walkarg *w = arg;
|
||||
@ -1060,8 +1037,7 @@ dump_addrsel_policyent(pol, arg)
|
||||
}
|
||||
|
||||
static struct in6_addrpolicy *
|
||||
match_addrsel_policy(key)
|
||||
struct sockaddr_in6 *key;
|
||||
match_addrsel_policy(struct sockaddr_in6 *key)
|
||||
{
|
||||
struct addrsel_policyent *pent;
|
||||
struct in6_addrpolicy *bestpol = NULL, *pol;
|
||||
|
@ -87,11 +87,8 @@ struct route_in6 ip6_forward_rt;
|
||||
* protocol deal with that.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
ip6_forward(m, srcrt)
|
||||
struct mbuf *m;
|
||||
int srcrt;
|
||||
ip6_forward(struct mbuf *m, int srcrt)
|
||||
{
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
struct sockaddr_in6 *dst = NULL;
|
||||
|
@ -152,7 +152,6 @@ static u_int32_t randomid(struct randomtab *);
|
||||
* Do a fast modular exponation, returned value will be in the range
|
||||
* of 0 - (mod-1)
|
||||
*/
|
||||
|
||||
static u_int32_t
|
||||
pmod(u_int32_t gen, u_int32_t expo, u_int32_t mod)
|
||||
{
|
||||
|
@ -140,7 +140,7 @@ static struct mbuf *ip6_pullexthdr __P((struct mbuf *, size_t, int));
|
||||
* All protocols not implemented in kernel go to raw IP6 protocol handler.
|
||||
*/
|
||||
void
|
||||
ip6_init()
|
||||
ip6_init(void)
|
||||
{
|
||||
struct ip6protosw *pr;
|
||||
int i;
|
||||
@ -187,8 +187,7 @@ ip6_init()
|
||||
}
|
||||
|
||||
static void
|
||||
ip6_init2(dummy)
|
||||
void *dummy;
|
||||
ip6_init2(void *dummy)
|
||||
{
|
||||
|
||||
/* nd6_timer_init */
|
||||
@ -210,8 +209,7 @@ SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL);
|
||||
extern struct route_in6 ip6_forward_rt;
|
||||
|
||||
void
|
||||
ip6_input(m)
|
||||
struct mbuf *m;
|
||||
ip6_input(struct mbuf *m)
|
||||
{
|
||||
struct ip6_hdr *ip6;
|
||||
int off = sizeof(struct ip6_hdr), nest;
|
||||
@ -782,9 +780,7 @@ ip6_input(m)
|
||||
* XXX backward compatibility wrapper
|
||||
*/
|
||||
static struct ip6aux *
|
||||
ip6_setdstifaddr(m, ia6)
|
||||
struct mbuf *m;
|
||||
struct in6_ifaddr *ia6;
|
||||
ip6_setdstifaddr(struct mbuf *m, struct in6_ifaddr *ia6)
|
||||
{
|
||||
struct ip6aux *ip6a;
|
||||
|
||||
@ -795,8 +791,7 @@ ip6_setdstifaddr(m, ia6)
|
||||
}
|
||||
|
||||
struct in6_ifaddr *
|
||||
ip6_getdstifaddr(m)
|
||||
struct mbuf *m;
|
||||
ip6_getdstifaddr(struct mbuf *m)
|
||||
{
|
||||
struct ip6aux *ip6a;
|
||||
|
||||
@ -810,13 +805,12 @@ ip6_getdstifaddr(m)
|
||||
/*
|
||||
* Hop-by-Hop options header processing. If a valid jumbo payload option is
|
||||
* included, the real payload length will be stored in plenp.
|
||||
*
|
||||
* rtalertp - XXX: should be stored more smart way
|
||||
*/
|
||||
static int
|
||||
ip6_hopopts_input(plenp, rtalertp, mp, offp)
|
||||
u_int32_t *plenp;
|
||||
u_int32_t *rtalertp; /* XXX: should be stored more smart way */
|
||||
struct mbuf **mp;
|
||||
int *offp;
|
||||
ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp,
|
||||
struct mbuf **mp, int *offp)
|
||||
{
|
||||
struct mbuf *m = *mp;
|
||||
int off = *offp, hbhlen;
|
||||
@ -870,12 +864,8 @@ ip6_hopopts_input(plenp, rtalertp, mp, offp)
|
||||
* opthead + hbhlen is located in continuous memory region.
|
||||
*/
|
||||
int
|
||||
ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp)
|
||||
struct mbuf *m;
|
||||
u_int8_t *opthead;
|
||||
int hbhlen;
|
||||
u_int32_t *rtalertp;
|
||||
u_int32_t *plenp;
|
||||
ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen,
|
||||
u_int32_t *rtalertp, u_int32_t *plenp)
|
||||
{
|
||||
struct ip6_hdr *ip6;
|
||||
int optlen = 0;
|
||||
@ -1007,10 +997,7 @@ ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp)
|
||||
* is not continuous in order to return an ICMPv6 error.
|
||||
*/
|
||||
int
|
||||
ip6_unknown_opt(optp, m, off)
|
||||
u_int8_t *optp;
|
||||
struct mbuf *m;
|
||||
int off;
|
||||
ip6_unknown_opt(u_int8_t *optp, struct mbuf *m, int off)
|
||||
{
|
||||
struct ip6_hdr *ip6;
|
||||
|
||||
@ -1051,9 +1038,7 @@ ip6_unknown_opt(optp, m, off)
|
||||
* very first mbuf on the mbuf chain.
|
||||
*/
|
||||
void
|
||||
ip6_savecontrol(in6p, m, mp)
|
||||
struct inpcb *in6p;
|
||||
struct mbuf *m, **mp;
|
||||
ip6_savecontrol(struct inpcb *in6p, struct mbuf *m, struct mbuf **mp)
|
||||
{
|
||||
#define IS2292(x, y) ((in6p->in6p_flags & IN6P_RFC2292) ? (x) : (y))
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
@ -1286,10 +1271,7 @@ ip6_savecontrol(in6p, m, mp)
|
||||
}
|
||||
|
||||
void
|
||||
ip6_notify_pmtu(in6p, dst, mtu)
|
||||
struct inpcb *in6p;
|
||||
struct sockaddr_in6 *dst;
|
||||
u_int32_t *mtu;
|
||||
ip6_notify_pmtu(struct inpcb *in6p, struct sockaddr_in6 *dst, u_int32_t *mtu)
|
||||
{
|
||||
struct socket *so;
|
||||
struct mbuf *m_mtu;
|
||||
@ -1331,10 +1313,7 @@ ip6_notify_pmtu(in6p, dst, mtu)
|
||||
* contains the result, or NULL on error.
|
||||
*/
|
||||
static struct mbuf *
|
||||
ip6_pullexthdr(m, off, nxt)
|
||||
struct mbuf *m;
|
||||
size_t off;
|
||||
int nxt;
|
||||
ip6_pullexthdr(struct mbuf *m, size_t off, int nxt)
|
||||
{
|
||||
struct ip6_ext ip6e;
|
||||
size_t elen;
|
||||
@ -1394,9 +1373,7 @@ ip6_pullexthdr(m, off, nxt)
|
||||
* we develop `neater' mechanism to process extension headers.
|
||||
*/
|
||||
char *
|
||||
ip6_get_prevhdr(m, off)
|
||||
struct mbuf *m;
|
||||
int off;
|
||||
ip6_get_prevhdr(struct mbuf *m, int off)
|
||||
{
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
|
||||
@ -1435,11 +1412,7 @@ ip6_get_prevhdr(m, off)
|
||||
* get next header offset. m will be retained.
|
||||
*/
|
||||
int
|
||||
ip6_nexthdr(m, off, proto, nxtp)
|
||||
struct mbuf *m;
|
||||
int off;
|
||||
int proto;
|
||||
int *nxtp;
|
||||
ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp)
|
||||
{
|
||||
struct ip6_hdr ip6;
|
||||
struct ip6_ext ip6e;
|
||||
@ -1514,11 +1487,7 @@ ip6_nexthdr(m, off, proto, nxtp)
|
||||
* get offset for the last header in the chain. m will be kept untainted.
|
||||
*/
|
||||
int
|
||||
ip6_lasthdr(m, off, proto, nxtp)
|
||||
struct mbuf *m;
|
||||
int off;
|
||||
int proto;
|
||||
int *nxtp;
|
||||
ip6_lasthdr(struct mbuf *m, int off, int proto, int *nxtp)
|
||||
{
|
||||
int newoff;
|
||||
int nxt;
|
||||
@ -1542,8 +1511,7 @@ ip6_lasthdr(m, off, proto, nxtp)
|
||||
}
|
||||
|
||||
struct ip6aux *
|
||||
ip6_addaux(m)
|
||||
struct mbuf *m;
|
||||
ip6_addaux(struct mbuf *m)
|
||||
{
|
||||
struct m_tag *mtag;
|
||||
|
||||
@ -1560,8 +1528,7 @@ ip6_addaux(m)
|
||||
}
|
||||
|
||||
struct ip6aux *
|
||||
ip6_findaux(m)
|
||||
struct mbuf *m;
|
||||
ip6_findaux(struct mbuf *m)
|
||||
{
|
||||
struct m_tag *mtag;
|
||||
|
||||
@ -1570,8 +1537,7 @@ ip6_findaux(m)
|
||||
}
|
||||
|
||||
void
|
||||
ip6_delaux(m)
|
||||
struct mbuf *m;
|
||||
ip6_delaux(struct mbuf *m)
|
||||
{
|
||||
struct m_tag *mtag;
|
||||
|
||||
|
@ -142,7 +142,6 @@ ip6_ipsec_fwd(struct mbuf *m)
|
||||
*/
|
||||
int
|
||||
ip6_ipsec_input(struct mbuf *m, int nxt)
|
||||
|
||||
{
|
||||
#ifdef IPSEC
|
||||
struct m_tag *mtag;
|
||||
|
@ -407,8 +407,7 @@ X_mrt6_ioctl(int cmd, caddr_t data)
|
||||
* returns the packet, byte, rpf-failure count for the source group provided
|
||||
*/
|
||||
static int
|
||||
get_sg_cnt(req)
|
||||
struct sioc_sg_req6 *req;
|
||||
get_sg_cnt(struct sioc_sg_req6 *req)
|
||||
{
|
||||
struct mf6c *rt;
|
||||
int s;
|
||||
@ -433,8 +432,7 @@ get_sg_cnt(req)
|
||||
* returns the input and output packet and byte counts on the mif provided
|
||||
*/
|
||||
static int
|
||||
get_mif6_cnt(req)
|
||||
struct sioc_mif_req6 *req;
|
||||
get_mif6_cnt(struct sioc_mif_req6 *req)
|
||||
{
|
||||
mifi_t mifi = req->mifi;
|
||||
|
||||
@ -450,8 +448,7 @@ get_mif6_cnt(req)
|
||||
}
|
||||
|
||||
static int
|
||||
set_pim6(i)
|
||||
int *i;
|
||||
set_pim6(int *i)
|
||||
{
|
||||
if ((*i != 1) && (*i != 0))
|
||||
return (EINVAL);
|
||||
@ -465,10 +462,7 @@ set_pim6(i)
|
||||
* Enable multicast routing
|
||||
*/
|
||||
static int
|
||||
ip6_mrouter_init(so, v, cmd)
|
||||
struct socket *so;
|
||||
int v;
|
||||
int cmd;
|
||||
ip6_mrouter_init(struct socket *so, int v, int cmd)
|
||||
{
|
||||
#ifdef MRT6DEBUG
|
||||
if (mrt6debug)
|
||||
@ -603,8 +597,7 @@ static struct sockaddr_in6 sin6 = { sizeof(sin6), AF_INET6 };
|
||||
* Add a mif to the mif table
|
||||
*/
|
||||
static int
|
||||
add_m6if(mifcp)
|
||||
struct mif6ctl *mifcp;
|
||||
add_m6if(struct mif6ctl *mifcp)
|
||||
{
|
||||
struct mif6 *mifp;
|
||||
struct ifnet *ifp;
|
||||
@ -681,8 +674,7 @@ add_m6if(mifcp)
|
||||
* Delete a mif from the mif table
|
||||
*/
|
||||
static int
|
||||
del_m6if(mifip)
|
||||
mifi_t *mifip;
|
||||
del_m6if(mifi_t *mifip)
|
||||
{
|
||||
struct mif6 *mifp = mif6table + *mifip;
|
||||
mifi_t mifi;
|
||||
@ -736,8 +728,7 @@ del_m6if(mifip)
|
||||
* Add an mfc entry
|
||||
*/
|
||||
static int
|
||||
add_m6fc(mfccp)
|
||||
struct mf6cctl *mfccp;
|
||||
add_m6fc(struct mf6cctl *mfccp)
|
||||
{
|
||||
struct mf6c *rt;
|
||||
u_long hash;
|
||||
@ -899,8 +890,7 @@ add_m6fc(mfccp)
|
||||
* collect delay statistics on the upcalls
|
||||
*/
|
||||
static void
|
||||
collate(t)
|
||||
struct timeval *t;
|
||||
collate(struct timeval *t)
|
||||
{
|
||||
u_long d;
|
||||
struct timeval tp;
|
||||
@ -925,8 +915,7 @@ collate(t)
|
||||
* Delete an mfc entry
|
||||
*/
|
||||
static int
|
||||
del_m6fc(mfccp)
|
||||
struct mf6cctl *mfccp;
|
||||
del_m6fc(struct mf6cctl *mfccp)
|
||||
{
|
||||
struct sockaddr_in6 origin;
|
||||
struct sockaddr_in6 mcastgrp;
|
||||
@ -975,11 +964,9 @@ del_m6fc(mfccp)
|
||||
}
|
||||
|
||||
static int
|
||||
socket_send(s, mm, src)
|
||||
struct socket *s;
|
||||
struct mbuf *mm;
|
||||
struct sockaddr_in6 *src;
|
||||
socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in6 *src)
|
||||
{
|
||||
|
||||
if (s) {
|
||||
if (sbappendaddr(&s->so_rcv,
|
||||
(struct sockaddr *)src,
|
||||
@ -1010,7 +997,6 @@ socket_send(s, mm, src)
|
||||
* that if this function is called from somewhere else in the originating
|
||||
* context in the future.
|
||||
*/
|
||||
|
||||
int
|
||||
X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m)
|
||||
{
|
||||
@ -1277,8 +1263,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m)
|
||||
* Call from the Slow Timeout mechanism, every half second.
|
||||
*/
|
||||
static void
|
||||
expire_upcalls(unused)
|
||||
void *unused;
|
||||
expire_upcalls(void *unused)
|
||||
{
|
||||
struct rtdetq *rte;
|
||||
struct mf6c *mfc, **nptr;
|
||||
@ -1338,10 +1323,7 @@ expire_upcalls(unused)
|
||||
* Packet forwarding routine once entry in the cache is made
|
||||
*/
|
||||
static int
|
||||
ip6_mdq(m, ifp, rt)
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct mf6c *rt;
|
||||
ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c *rt)
|
||||
{
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
mifi_t mifi, iif;
|
||||
@ -1519,10 +1501,7 @@ ip6_mdq(m, ifp, rt)
|
||||
}
|
||||
|
||||
static void
|
||||
phyint_send(ip6, mifp, m)
|
||||
struct ip6_hdr *ip6;
|
||||
struct mif6 *mifp;
|
||||
struct mbuf *m;
|
||||
phyint_send(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m)
|
||||
{
|
||||
struct mbuf *mb_copy;
|
||||
struct ifnet *ifp = mifp->m6_ifp;
|
||||
@ -1637,10 +1616,7 @@ phyint_send(ip6, mifp, m)
|
||||
}
|
||||
|
||||
static int
|
||||
register_send(ip6, mif, m)
|
||||
struct ip6_hdr *ip6;
|
||||
struct mif6 *mif;
|
||||
struct mbuf *m;
|
||||
register_send(struct ip6_hdr *ip6, struct mif6 *mif, struct mbuf *m)
|
||||
{
|
||||
struct mbuf *mm;
|
||||
int i, len = m->m_pkthdr.len;
|
||||
@ -1712,9 +1688,7 @@ register_send(ip6, mif, m)
|
||||
* is stripped off, and the inner packet is passed to register_mforward.
|
||||
*/
|
||||
int
|
||||
pim6_input(mp, offp, proto)
|
||||
struct mbuf **mp;
|
||||
int *offp, proto;
|
||||
pim6_input(struct mbuf **mp, int *offp, int proto)
|
||||
{
|
||||
struct pim *pim; /* pointer to a pim struct */
|
||||
struct ip6_hdr *ip6;
|
||||
|
@ -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 @@ skip_ipsec2:;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
@ -110,7 +110,7 @@ static void mld_timeo(struct in6_multi *);
|
||||
static u_long mld_timerresid(struct in6_multi *);
|
||||
|
||||
void
|
||||
mld6_init()
|
||||
mld6_init(void)
|
||||
{
|
||||
static u_int8_t hbh_buf[8];
|
||||
struct ip6_hbh *hbh = (struct ip6_hbh *)hbh_buf;
|
||||
@ -131,8 +131,7 @@ mld6_init()
|
||||
}
|
||||
|
||||
static void
|
||||
mld_starttimer(in6m)
|
||||
struct in6_multi *in6m;
|
||||
mld_starttimer(struct in6_multi *in6m)
|
||||
{
|
||||
struct timeval now;
|
||||
|
||||
@ -151,8 +150,7 @@ mld_starttimer(in6m)
|
||||
}
|
||||
|
||||
static void
|
||||
mld_stoptimer(in6m)
|
||||
struct in6_multi *in6m;
|
||||
mld_stoptimer(struct in6_multi *in6m)
|
||||
{
|
||||
if (in6m->in6m_timer == IN6M_TIMER_UNDEF)
|
||||
return;
|
||||
@ -162,8 +160,7 @@ mld_stoptimer(in6m)
|
||||
}
|
||||
|
||||
static void
|
||||
mld_timeo(in6m)
|
||||
struct in6_multi *in6m;
|
||||
mld_timeo(struct in6_multi *in6m)
|
||||
{
|
||||
int s = splnet();
|
||||
|
||||
@ -184,8 +181,7 @@ mld_timeo(in6m)
|
||||
}
|
||||
|
||||
static u_long
|
||||
mld_timerresid(in6m)
|
||||
struct in6_multi *in6m;
|
||||
mld_timerresid(struct in6_multi *in6m)
|
||||
{
|
||||
struct timeval now, diff;
|
||||
|
||||
@ -209,8 +205,7 @@ mld_timerresid(in6m)
|
||||
}
|
||||
|
||||
void
|
||||
mld6_start_listening(in6m)
|
||||
struct in6_multi *in6m;
|
||||
mld6_start_listening(struct in6_multi *in6m)
|
||||
{
|
||||
struct in6_addr all_in6;
|
||||
int s = splnet();
|
||||
@ -245,8 +240,7 @@ mld6_start_listening(in6m)
|
||||
}
|
||||
|
||||
void
|
||||
mld6_stop_listening(in6m)
|
||||
struct in6_multi *in6m;
|
||||
mld6_stop_listening(struct in6_multi *in6m)
|
||||
{
|
||||
struct in6_addr allnode, allrouter;
|
||||
|
||||
@ -269,9 +263,7 @@ mld6_stop_listening(in6m)
|
||||
}
|
||||
|
||||
void
|
||||
mld6_input(m, off)
|
||||
struct mbuf *m;
|
||||
int off;
|
||||
mld6_input(struct mbuf *m, int off)
|
||||
{
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
struct mld_hdr *mldh;
|
||||
@ -441,10 +433,7 @@ mld6_input(m, off)
|
||||
}
|
||||
|
||||
static void
|
||||
mld6_sendpkt(in6m, type, dst)
|
||||
struct in6_multi *in6m;
|
||||
int type;
|
||||
const struct in6_addr *dst;
|
||||
mld6_sendpkt(struct in6_multi *in6m, int type, const struct in6_addr *dst)
|
||||
{
|
||||
struct mbuf *mh, *md;
|
||||
struct mld_hdr *mldh;
|
||||
@ -544,10 +533,8 @@ mld6_sendpkt(in6m, type, dst)
|
||||
* and the number of source is not 0.
|
||||
*/
|
||||
struct in6_multi *
|
||||
in6_addmulti(maddr6, ifp, errorp, delay)
|
||||
struct in6_addr *maddr6;
|
||||
struct ifnet *ifp;
|
||||
int *errorp, delay;
|
||||
in6_addmulti(struct in6_addr *maddr6, struct ifnet *ifp,
|
||||
int *errorp, int delay)
|
||||
{
|
||||
struct in6_multi *in6m;
|
||||
|
||||
|
@ -120,7 +120,7 @@ struct callout nd6_timer_ch;
|
||||
extern struct callout in6_tmpaddrtimer_ch;
|
||||
|
||||
void
|
||||
nd6_init()
|
||||
nd6_init(void)
|
||||
{
|
||||
static int nd6_init_done = 0;
|
||||
int i;
|
||||
@ -147,8 +147,7 @@ nd6_init()
|
||||
}
|
||||
|
||||
struct nd_ifinfo *
|
||||
nd6_ifattach(ifp)
|
||||
struct ifnet *ifp;
|
||||
nd6_ifattach(struct ifnet *ifp)
|
||||
{
|
||||
struct nd_ifinfo *nd;
|
||||
|
||||
@ -175,8 +174,7 @@ nd6_ifattach(ifp)
|
||||
}
|
||||
|
||||
void
|
||||
nd6_ifdetach(nd)
|
||||
struct nd_ifinfo *nd;
|
||||
nd6_ifdetach(struct nd_ifinfo *nd)
|
||||
{
|
||||
|
||||
free(nd, M_IP6NDP);
|
||||
@ -187,8 +185,7 @@ nd6_ifdetach(nd)
|
||||
* changes, which means we might have to adjust the ND level MTU.
|
||||
*/
|
||||
void
|
||||
nd6_setmtu(ifp)
|
||||
struct ifnet *ifp;
|
||||
nd6_setmtu(struct ifnet *ifp)
|
||||
{
|
||||
|
||||
nd6_setmtu0(ifp, ND_IFINFO(ifp));
|
||||
@ -196,9 +193,7 @@ nd6_setmtu(ifp)
|
||||
|
||||
/* XXX todo: do not maintain copy of ifp->if_mtu in ndi->maxmtu */
|
||||
void
|
||||
nd6_setmtu0(ifp, ndi)
|
||||
struct ifnet *ifp;
|
||||
struct nd_ifinfo *ndi;
|
||||
nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi)
|
||||
{
|
||||
u_int32_t omaxmtu;
|
||||
|
||||
@ -238,10 +233,7 @@ nd6_setmtu0(ifp, ndi)
|
||||
}
|
||||
|
||||
void
|
||||
nd6_option_init(opt, icmp6len, ndopts)
|
||||
void *opt;
|
||||
int icmp6len;
|
||||
union nd_opts *ndopts;
|
||||
nd6_option_init(void *opt, int icmp6len, union nd_opts *ndopts)
|
||||
{
|
||||
|
||||
bzero(ndopts, sizeof(*ndopts));
|
||||
@ -259,8 +251,7 @@ nd6_option_init(opt, icmp6len, ndopts)
|
||||
* Take one ND option.
|
||||
*/
|
||||
struct nd_opt_hdr *
|
||||
nd6_option(ndopts)
|
||||
union nd_opts *ndopts;
|
||||
nd6_option(union nd_opts *ndopts)
|
||||
{
|
||||
struct nd_opt_hdr *nd_opt;
|
||||
int olen;
|
||||
@ -311,8 +302,7 @@ nd6_option(ndopts)
|
||||
* multiple options of the same type.
|
||||
*/
|
||||
int
|
||||
nd6_options(ndopts)
|
||||
union nd_opts *ndopts;
|
||||
nd6_options(union nd_opts *ndopts)
|
||||
{
|
||||
struct nd_opt_hdr *nd_opt;
|
||||
int i = 0;
|
||||
@ -391,9 +381,7 @@ nd6_options(ndopts)
|
||||
* ND6 timer routine to handle ND6 entries
|
||||
*/
|
||||
void
|
||||
nd6_llinfo_settimer(ln, tick)
|
||||
struct llinfo_nd6 *ln;
|
||||
long tick;
|
||||
nd6_llinfo_settimer(struct llinfo_nd6 *ln, long tick)
|
||||
{
|
||||
if (tick < 0) {
|
||||
ln->ln_expire = 0;
|
||||
@ -414,8 +402,7 @@ nd6_llinfo_settimer(ln, tick)
|
||||
}
|
||||
|
||||
static void
|
||||
nd6_llinfo_timer(arg)
|
||||
void *arg;
|
||||
nd6_llinfo_timer(void *arg)
|
||||
{
|
||||
struct llinfo_nd6 *ln;
|
||||
struct rtentry *rt;
|
||||
@ -539,8 +526,7 @@ nd6_llinfo_timer(arg)
|
||||
* ND6 timer routine to expire default route list and prefix list
|
||||
*/
|
||||
void
|
||||
nd6_timer(ignored_arg)
|
||||
void *ignored_arg;
|
||||
nd6_timer(void *ignored_arg)
|
||||
{
|
||||
int s;
|
||||
struct nd_defrouter *dr;
|
||||
@ -663,9 +649,11 @@ nd6_timer(ignored_arg)
|
||||
splx(s);
|
||||
}
|
||||
|
||||
/*
|
||||
* ia6 - deprecated/invalidated temporary address
|
||||
*/
|
||||
static int
|
||||
regen_tmpaddr(ia6)
|
||||
struct in6_ifaddr *ia6; /* deprecated/invalidated temporary address */
|
||||
regen_tmpaddr(struct in6_ifaddr *ia6)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
struct ifnet *ifp;
|
||||
@ -731,8 +719,7 @@ regen_tmpaddr(ia6)
|
||||
* ifp goes away.
|
||||
*/
|
||||
void
|
||||
nd6_purge(ifp)
|
||||
struct ifnet *ifp;
|
||||
nd6_purge(struct ifnet *ifp)
|
||||
{
|
||||
struct llinfo_nd6 *ln, *nln;
|
||||
struct nd_defrouter *dr, *ndr;
|
||||
@ -819,10 +806,7 @@ nd6_purge(ifp)
|
||||
}
|
||||
|
||||
struct rtentry *
|
||||
nd6_lookup(addr6, create, ifp)
|
||||
struct in6_addr *addr6;
|
||||
int create;
|
||||
struct ifnet *ifp;
|
||||
nd6_lookup(struct in6_addr *addr6, int create, struct ifnet *ifp)
|
||||
{
|
||||
struct rtentry *rt;
|
||||
struct sockaddr_in6 sin6;
|
||||
@ -927,9 +911,7 @@ nd6_lookup(addr6, create, ifp)
|
||||
* to not reenter the routing code from within itself.
|
||||
*/
|
||||
static int
|
||||
nd6_is_new_addr_neighbor(addr, ifp)
|
||||
struct sockaddr_in6 *addr;
|
||||
struct ifnet *ifp;
|
||||
nd6_is_new_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp)
|
||||
{
|
||||
struct nd_prefix *pr;
|
||||
struct ifaddr *dstaddr;
|
||||
@ -1003,9 +985,7 @@ nd6_is_new_addr_neighbor(addr, ifp)
|
||||
* XXX: should take care of the destination of a p2p link?
|
||||
*/
|
||||
int
|
||||
nd6_is_addr_neighbor(addr, ifp)
|
||||
struct sockaddr_in6 *addr;
|
||||
struct ifnet *ifp;
|
||||
nd6_is_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp)
|
||||
{
|
||||
|
||||
if (nd6_is_new_addr_neighbor(addr, ifp))
|
||||
@ -1028,9 +1008,7 @@ nd6_is_addr_neighbor(addr, ifp)
|
||||
* that the change is safe.
|
||||
*/
|
||||
static struct llinfo_nd6 *
|
||||
nd6_free(rt, gc)
|
||||
struct rtentry *rt;
|
||||
int gc;
|
||||
nd6_free(struct rtentry *rt, int gc)
|
||||
{
|
||||
struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo, *next;
|
||||
struct in6_addr in6 = ((struct sockaddr_in6 *)rt_key(rt))->sin6_addr;
|
||||
@ -1139,10 +1117,7 @@ nd6_free(rt, gc)
|
||||
* XXX cost-effective methods?
|
||||
*/
|
||||
void
|
||||
nd6_nud_hint(rt, dst6, force)
|
||||
struct rtentry *rt;
|
||||
struct in6_addr *dst6;
|
||||
int force;
|
||||
nd6_nud_hint(struct rtentry *rt, struct in6_addr *dst6, int force)
|
||||
{
|
||||
struct llinfo_nd6 *ln;
|
||||
|
||||
@ -1186,11 +1161,11 @@ nd6_nud_hint(rt, dst6, force)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* info - XXX unused
|
||||
*/
|
||||
void
|
||||
nd6_rtrequest(req, rt, info)
|
||||
int req;
|
||||
struct rtentry *rt;
|
||||
struct rt_addrinfo *info; /* xxx unused */
|
||||
nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info)
|
||||
{
|
||||
struct sockaddr *gate = rt->rt_gateway;
|
||||
struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo;
|
||||
@ -1435,10 +1410,7 @@ nd6_rtrequest(req, rt, info)
|
||||
}
|
||||
|
||||
int
|
||||
nd6_ioctl(cmd, data, ifp)
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
struct ifnet *ifp;
|
||||
nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
|
||||
{
|
||||
struct in6_drlist *drl = (struct in6_drlist *)data;
|
||||
struct in6_oprlist *oprl = (struct in6_oprlist *)data;
|
||||
@ -1670,15 +1642,13 @@ nd6_ioctl(cmd, data, ifp)
|
||||
/*
|
||||
* Create neighbor cache entry and cache link-layer address,
|
||||
* on reception of inbound ND6 packets. (RS/RA/NS/redirect)
|
||||
*
|
||||
* type - ICMP6 type
|
||||
* code - type dependent information
|
||||
*/
|
||||
struct rtentry *
|
||||
nd6_cache_lladdr(ifp, from, lladdr, lladdrlen, type, code)
|
||||
struct ifnet *ifp;
|
||||
struct in6_addr *from;
|
||||
char *lladdr;
|
||||
int lladdrlen;
|
||||
int type; /* ICMP6 type */
|
||||
int code; /* type dependent information */
|
||||
nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
|
||||
int lladdrlen, int type, int code)
|
||||
{
|
||||
struct rtentry *rt = NULL;
|
||||
struct llinfo_nd6 *ln = NULL;
|
||||
@ -1910,8 +1880,7 @@ nd6_cache_lladdr(ifp, from, lladdr, lladdrlen, type, code)
|
||||
}
|
||||
|
||||
static void
|
||||
nd6_slowtimo(ignored_arg)
|
||||
void *ignored_arg;
|
||||
nd6_slowtimo(void *ignored_arg)
|
||||
{
|
||||
struct nd_ifinfo *nd6if;
|
||||
struct ifnet *ifp;
|
||||
@ -1938,12 +1907,8 @@ nd6_slowtimo(ignored_arg)
|
||||
|
||||
#define senderr(e) { error = (e); goto bad;}
|
||||
int
|
||||
nd6_output(ifp, origifp, m0, dst, rt0)
|
||||
struct ifnet *ifp;
|
||||
struct ifnet *origifp;
|
||||
struct mbuf *m0;
|
||||
struct sockaddr_in6 *dst;
|
||||
struct rtentry *rt0;
|
||||
nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0,
|
||||
struct sockaddr_in6 *dst, struct rtentry *rt0)
|
||||
{
|
||||
struct mbuf *m = m0;
|
||||
struct rtentry *rt = rt0;
|
||||
@ -2163,8 +2128,7 @@ nd6_output(ifp, origifp, m0, dst, rt0)
|
||||
#undef senderr
|
||||
|
||||
int
|
||||
nd6_need_cache(ifp)
|
||||
struct ifnet *ifp;
|
||||
nd6_need_cache(struct ifnet *ifp)
|
||||
{
|
||||
/*
|
||||
* XXX: we currently do not make neighbor cache on any interface
|
||||
@ -2199,12 +2163,8 @@ nd6_need_cache(ifp)
|
||||
}
|
||||
|
||||
int
|
||||
nd6_storelladdr(ifp, rt0, m, dst, desten)
|
||||
struct ifnet *ifp;
|
||||
struct rtentry *rt0;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
u_char *desten;
|
||||
nd6_storelladdr(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
|
||||
struct sockaddr *dst, u_char *desten)
|
||||
{
|
||||
struct sockaddr_dl *sdl;
|
||||
struct rtentry *rt;
|
||||
@ -2275,8 +2235,7 @@ nd6_storelladdr(ifp, rt0, m, dst, desten)
|
||||
}
|
||||
|
||||
static void
|
||||
clear_llinfo_pqueue(ln)
|
||||
struct llinfo_nd6 *ln;
|
||||
clear_llinfo_pqueue(struct llinfo_nd6 *ln)
|
||||
{
|
||||
struct mbuf *m_hold, *m_hold_next;
|
||||
|
||||
|
@ -89,9 +89,7 @@ static int dad_maxtry = 15; /* max # of *tries* to transmit DAD packet */
|
||||
* Based on RFC 2462 (duplicate address detection)
|
||||
*/
|
||||
void
|
||||
nd6_ns_input(m, off, icmp6len)
|
||||
struct mbuf *m;
|
||||
int off, icmp6len;
|
||||
nd6_ns_input(struct mbuf *m, int off, int icmp6len)
|
||||
{
|
||||
struct ifnet *ifp = m->m_pkthdr.rcvif;
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
@ -336,13 +334,13 @@ nd6_ns_input(m, off, icmp6len)
|
||||
*
|
||||
* Based on RFC 2461
|
||||
* Based on RFC 2462 (duplicate address detection)
|
||||
*
|
||||
* ln - for source address determination
|
||||
* dad - duplicate address detection
|
||||
*/
|
||||
void
|
||||
nd6_ns_output(ifp, daddr6, taddr6, ln, dad)
|
||||
struct ifnet *ifp;
|
||||
const struct in6_addr *daddr6, *taddr6;
|
||||
struct llinfo_nd6 *ln; /* for source address determination */
|
||||
int dad; /* duplicate address detection */
|
||||
nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6,
|
||||
const struct in6_addr *taddr6, struct llinfo_nd6 *ln, int dad)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct ip6_hdr *ip6;
|
||||
@ -547,9 +545,7 @@ nd6_ns_output(ifp, daddr6, taddr6, ln, dad)
|
||||
* - anycast advertisement delay rule (RFC2461 7.2.7, SHOULD)
|
||||
*/
|
||||
void
|
||||
nd6_na_input(m, off, icmp6len)
|
||||
struct mbuf *m;
|
||||
int off, icmp6len;
|
||||
nd6_na_input(struct mbuf *m, int off, int icmp6len)
|
||||
{
|
||||
struct ifnet *ifp = m->m_pkthdr.rcvif;
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
@ -854,14 +850,14 @@ nd6_na_input(m, off, icmp6len)
|
||||
* the following items are not implemented yet:
|
||||
* - proxy advertisement delay rule (RFC2461 7.2.8, last paragraph, SHOULD)
|
||||
* - anycast advertisement delay rule (RFC2461 7.2.7, SHOULD)
|
||||
*
|
||||
* tlladdr - 1 if include target link-layer address
|
||||
* sdl0 - sockaddr_dl (= proxy NA) or NULL
|
||||
*/
|
||||
void
|
||||
nd6_na_output(ifp, daddr6_0, taddr6, flags, tlladdr, sdl0)
|
||||
struct ifnet *ifp;
|
||||
const struct in6_addr *daddr6_0, *taddr6;
|
||||
u_long flags;
|
||||
int tlladdr; /* 1 if include target link-layer address */
|
||||
struct sockaddr *sdl0; /* sockaddr_dl (= proxy NA) or NULL */
|
||||
nd6_na_output(struct ifnet *ifp, const struct in6_addr *daddr6_0,
|
||||
const struct in6_addr *taddr6, u_long flags, int tlladdr,
|
||||
struct sockaddr *sdl0)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct ip6_hdr *ip6;
|
||||
@ -1025,8 +1021,7 @@ nd6_na_output(ifp, daddr6_0, taddr6, flags, tlladdr, sdl0)
|
||||
}
|
||||
|
||||
caddr_t
|
||||
nd6_ifptomac(ifp)
|
||||
struct ifnet *ifp;
|
||||
nd6_ifptomac(struct ifnet *ifp)
|
||||
{
|
||||
switch (ifp->if_type) {
|
||||
case IFT_ARCNET:
|
||||
@ -1066,8 +1061,7 @@ static struct dadq_head dadq;
|
||||
static int dad_init = 0;
|
||||
|
||||
static struct dadq *
|
||||
nd6_dad_find(ifa)
|
||||
struct ifaddr *ifa;
|
||||
nd6_dad_find(struct ifaddr *ifa)
|
||||
{
|
||||
struct dadq *dp;
|
||||
|
||||
@ -1079,9 +1073,7 @@ nd6_dad_find(ifa)
|
||||
}
|
||||
|
||||
static void
|
||||
nd6_dad_starttimer(dp, ticks)
|
||||
struct dadq *dp;
|
||||
int ticks;
|
||||
nd6_dad_starttimer(struct dadq *dp, int ticks)
|
||||
{
|
||||
|
||||
callout_reset(&dp->dad_timer_ch, ticks,
|
||||
@ -1089,8 +1081,7 @@ nd6_dad_starttimer(dp, ticks)
|
||||
}
|
||||
|
||||
static void
|
||||
nd6_dad_stoptimer(dp)
|
||||
struct dadq *dp;
|
||||
nd6_dad_stoptimer(struct dadq *dp)
|
||||
{
|
||||
|
||||
callout_stop(&dp->dad_timer_ch);
|
||||
@ -1100,9 +1091,7 @@ nd6_dad_stoptimer(dp)
|
||||
* Start Duplicate Address Detection (DAD) for specified interface address.
|
||||
*/
|
||||
void
|
||||
nd6_dad_start(ifa, delay)
|
||||
struct ifaddr *ifa;
|
||||
int delay;
|
||||
nd6_dad_start(struct ifaddr *ifa, int delay)
|
||||
{
|
||||
struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
|
||||
struct dadq *dp;
|
||||
@ -1184,8 +1173,7 @@ nd6_dad_start(ifa, delay)
|
||||
* terminate DAD unconditionally. used for address removals.
|
||||
*/
|
||||
void
|
||||
nd6_dad_stop(ifa)
|
||||
struct ifaddr *ifa;
|
||||
nd6_dad_stop(struct ifaddr *ifa)
|
||||
{
|
||||
struct dadq *dp;
|
||||
|
||||
@ -1206,8 +1194,7 @@ nd6_dad_stop(ifa)
|
||||
}
|
||||
|
||||
static void
|
||||
nd6_dad_timer(ifa)
|
||||
struct ifaddr *ifa;
|
||||
nd6_dad_timer(struct ifaddr *ifa)
|
||||
{
|
||||
int s;
|
||||
struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
|
||||
@ -1311,8 +1298,7 @@ nd6_dad_timer(ifa)
|
||||
}
|
||||
|
||||
void
|
||||
nd6_dad_duplicated(ifa)
|
||||
struct ifaddr *ifa;
|
||||
nd6_dad_duplicated(struct ifaddr *ifa)
|
||||
{
|
||||
struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
|
||||
struct ifnet *ifp;
|
||||
@ -1383,9 +1369,7 @@ nd6_dad_duplicated(ifa)
|
||||
}
|
||||
|
||||
static void
|
||||
nd6_dad_ns_output(dp, ifa)
|
||||
struct dadq *dp;
|
||||
struct ifaddr *ifa;
|
||||
nd6_dad_ns_output(struct dadq *dp, struct ifaddr *ifa)
|
||||
{
|
||||
struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
|
||||
struct ifnet *ifp = ifa->ifa_ifp;
|
||||
@ -1403,8 +1387,7 @@ nd6_dad_ns_output(dp, ifa)
|
||||
}
|
||||
|
||||
static void
|
||||
nd6_dad_ns_input(ifa)
|
||||
struct ifaddr *ifa;
|
||||
nd6_dad_ns_input(struct ifaddr *ifa)
|
||||
{
|
||||
struct in6_ifaddr *ia;
|
||||
struct ifnet *ifp;
|
||||
@ -1454,8 +1437,7 @@ nd6_dad_ns_input(ifa)
|
||||
}
|
||||
|
||||
static void
|
||||
nd6_dad_na_input(ifa)
|
||||
struct ifaddr *ifa;
|
||||
nd6_dad_na_input(struct ifaddr *ifa)
|
||||
{
|
||||
struct dadq *dp;
|
||||
|
||||
|
@ -114,9 +114,7 @@ int ip6_temp_regen_advance = TEMPADDR_REGEN_ADVANCE;
|
||||
* Based on RFC 2461
|
||||
*/
|
||||
void
|
||||
nd6_rs_input(m, off, icmp6len)
|
||||
struct mbuf *m;
|
||||
int off, icmp6len;
|
||||
nd6_rs_input(struct mbuf *m, int off, int icmp6len)
|
||||
{
|
||||
struct ifnet *ifp = m->m_pkthdr.rcvif;
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
@ -200,9 +198,7 @@ nd6_rs_input(m, off, icmp6len)
|
||||
* TODO: ND_RA_FLAG_{OTHER,MANAGED} processing
|
||||
*/
|
||||
void
|
||||
nd6_ra_input(m, off, icmp6len)
|
||||
struct mbuf *m;
|
||||
int off, icmp6len;
|
||||
nd6_ra_input(struct mbuf *m, int off, int icmp6len)
|
||||
{
|
||||
struct ifnet *ifp = m->m_pkthdr.rcvif;
|
||||
struct nd_ifinfo *ndi = ND_IFINFO(ifp);
|
||||
@ -431,9 +427,7 @@ nd6_ra_input(m, off, icmp6len)
|
||||
|
||||
/* tell the change to user processes watching the routing socket. */
|
||||
static void
|
||||
nd6_rtmsg(cmd, rt)
|
||||
int cmd;
|
||||
struct rtentry *rt;
|
||||
nd6_rtmsg(int cmd, struct rtentry *rt)
|
||||
{
|
||||
struct rt_addrinfo info;
|
||||
|
||||
@ -451,8 +445,7 @@ nd6_rtmsg(cmd, rt)
|
||||
}
|
||||
|
||||
void
|
||||
defrouter_addreq(new)
|
||||
struct nd_defrouter *new;
|
||||
defrouter_addreq(struct nd_defrouter *new)
|
||||
{
|
||||
struct sockaddr_in6 def, mask, gate;
|
||||
struct rtentry *newrt = NULL;
|
||||
@ -485,9 +478,7 @@ defrouter_addreq(new)
|
||||
}
|
||||
|
||||
struct nd_defrouter *
|
||||
defrouter_lookup(addr, ifp)
|
||||
struct in6_addr *addr;
|
||||
struct ifnet *ifp;
|
||||
defrouter_lookup(struct in6_addr *addr, struct ifnet *ifp)
|
||||
{
|
||||
struct nd_defrouter *dr;
|
||||
|
||||
@ -506,8 +497,7 @@ defrouter_lookup(addr, ifp)
|
||||
* not be called from anywhere else.
|
||||
*/
|
||||
static void
|
||||
defrouter_delreq(dr)
|
||||
struct nd_defrouter *dr;
|
||||
defrouter_delreq(struct nd_defrouter *dr)
|
||||
{
|
||||
struct sockaddr_in6 def, mask, gate;
|
||||
struct rtentry *oldrt = NULL;
|
||||
@ -536,7 +526,7 @@ defrouter_delreq(dr)
|
||||
* remove all default routes from default router list
|
||||
*/
|
||||
void
|
||||
defrouter_reset()
|
||||
defrouter_reset(void)
|
||||
{
|
||||
struct nd_defrouter *dr;
|
||||
|
||||
@ -551,8 +541,7 @@ defrouter_reset()
|
||||
}
|
||||
|
||||
void
|
||||
defrtrlist_del(dr)
|
||||
struct nd_defrouter *dr;
|
||||
defrtrlist_del(struct nd_defrouter *dr)
|
||||
{
|
||||
struct nd_defrouter *deldr = NULL;
|
||||
struct nd_prefix *pr;
|
||||
@ -613,7 +602,7 @@ defrtrlist_del(dr)
|
||||
* complicated and the possibility of introducing bugs.
|
||||
*/
|
||||
void
|
||||
defrouter_select()
|
||||
defrouter_select(void)
|
||||
{
|
||||
int s = splnet();
|
||||
struct nd_defrouter *dr, *selected_dr = NULL, *installed_dr = NULL;
|
||||
@ -729,8 +718,7 @@ rtpref(struct nd_defrouter *dr)
|
||||
}
|
||||
|
||||
static struct nd_defrouter *
|
||||
defrtrlist_update(new)
|
||||
struct nd_defrouter *new;
|
||||
defrtrlist_update(struct nd_defrouter *new)
|
||||
{
|
||||
struct nd_defrouter *dr, *n;
|
||||
int s = splnet();
|
||||
@ -815,9 +803,7 @@ defrtrlist_update(new)
|
||||
}
|
||||
|
||||
static struct nd_pfxrouter *
|
||||
pfxrtr_lookup(pr, dr)
|
||||
struct nd_prefix *pr;
|
||||
struct nd_defrouter *dr;
|
||||
pfxrtr_lookup(struct nd_prefix *pr, struct nd_defrouter *dr)
|
||||
{
|
||||
struct nd_pfxrouter *search;
|
||||
|
||||
@ -830,9 +816,7 @@ pfxrtr_lookup(pr, dr)
|
||||
}
|
||||
|
||||
static void
|
||||
pfxrtr_add(pr, dr)
|
||||
struct nd_prefix *pr;
|
||||
struct nd_defrouter *dr;
|
||||
pfxrtr_add(struct nd_prefix *pr, struct nd_defrouter *dr)
|
||||
{
|
||||
struct nd_pfxrouter *new;
|
||||
|
||||
@ -848,16 +832,14 @@ pfxrtr_add(pr, dr)
|
||||
}
|
||||
|
||||
static void
|
||||
pfxrtr_del(pfr)
|
||||
struct nd_pfxrouter *pfr;
|
||||
pfxrtr_del(struct nd_pfxrouter *pfr)
|
||||
{
|
||||
LIST_REMOVE(pfr, pfr_entry);
|
||||
free(pfr, M_IP6NDP);
|
||||
}
|
||||
|
||||
struct nd_prefix *
|
||||
nd6_prefix_lookup(key)
|
||||
struct nd_prefixctl *key;
|
||||
nd6_prefix_lookup(struct nd_prefixctl *key)
|
||||
{
|
||||
struct nd_prefix *search;
|
||||
|
||||
@ -874,10 +856,8 @@ nd6_prefix_lookup(key)
|
||||
}
|
||||
|
||||
int
|
||||
nd6_prelist_add(pr, dr, newp)
|
||||
struct nd_prefixctl *pr;
|
||||
struct nd_prefix **newp;
|
||||
struct nd_defrouter *dr;
|
||||
nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr,
|
||||
struct nd_prefix **newp)
|
||||
{
|
||||
struct nd_prefix *new = NULL;
|
||||
int error = 0;
|
||||
@ -935,8 +915,7 @@ nd6_prelist_add(pr, dr, newp)
|
||||
}
|
||||
|
||||
void
|
||||
prelist_remove(pr)
|
||||
struct nd_prefix *pr;
|
||||
prelist_remove(struct nd_prefix *pr)
|
||||
{
|
||||
struct nd_pfxrouter *pfr, *next;
|
||||
int e, s;
|
||||
@ -982,12 +961,13 @@ prelist_remove(pr)
|
||||
pfxlist_onlink_check();
|
||||
}
|
||||
|
||||
/*
|
||||
* dr - may be NULL
|
||||
*/
|
||||
|
||||
static int
|
||||
prelist_update(new, dr, m, mcast)
|
||||
struct nd_prefixctl *new;
|
||||
struct nd_defrouter *dr; /* may be NULL */
|
||||
struct mbuf *m;
|
||||
int mcast;
|
||||
prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr,
|
||||
struct mbuf *m, int mcast)
|
||||
{
|
||||
struct in6_ifaddr *ia6 = NULL, *ia6_match = NULL;
|
||||
struct ifaddr *ifa;
|
||||
@ -1325,8 +1305,7 @@ prelist_update(new, dr, m, mcast)
|
||||
* XXX: lengthy function name...
|
||||
*/
|
||||
static struct nd_pfxrouter *
|
||||
find_pfxlist_reachable_router(pr)
|
||||
struct nd_prefix *pr;
|
||||
find_pfxlist_reachable_router(struct nd_prefix *pr)
|
||||
{
|
||||
struct nd_pfxrouter *pfxrtr;
|
||||
struct rtentry *rt;
|
||||
@ -1537,8 +1516,7 @@ pfxlist_onlink_check()
|
||||
}
|
||||
|
||||
int
|
||||
nd6_prefix_onlink(pr)
|
||||
struct nd_prefix *pr;
|
||||
nd6_prefix_onlink(struct nd_prefix *pr)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
struct ifnet *ifp = pr->ndpr_ifp;
|
||||
@ -1651,8 +1629,7 @@ nd6_prefix_onlink(pr)
|
||||
}
|
||||
|
||||
int
|
||||
nd6_prefix_offlink(pr)
|
||||
struct nd_prefix *pr;
|
||||
nd6_prefix_offlink(struct nd_prefix *pr)
|
||||
{
|
||||
int error = 0;
|
||||
struct ifnet *ifp = pr->ndpr_ifp;
|
||||
@ -1743,9 +1720,7 @@ nd6_prefix_offlink(pr)
|
||||
}
|
||||
|
||||
static struct in6_ifaddr *
|
||||
in6_ifadd(pr, mcast)
|
||||
struct nd_prefixctl *pr;
|
||||
int mcast;
|
||||
in6_ifadd(struct nd_prefixctl *pr, int mcast)
|
||||
{
|
||||
struct ifnet *ifp = pr->ndpr_ifp;
|
||||
struct ifaddr *ifa;
|
||||
@ -1869,10 +1844,11 @@ in6_ifadd(pr, mcast)
|
||||
return (ia); /* this is always non-NULL */
|
||||
}
|
||||
|
||||
/*
|
||||
* ia0 - corresponding public address
|
||||
*/
|
||||
int
|
||||
in6_tmpifadd(ia0, forcegen, delay)
|
||||
const struct in6_ifaddr *ia0; /* corresponding public address */
|
||||
int forcegen, delay;
|
||||
in6_tmpifadd(const struct in6_ifaddr *ia0, int forcegen, int delay)
|
||||
{
|
||||
struct ifnet *ifp = ia0->ia_ifa.ifa_ifp;
|
||||
struct in6_ifaddr *newia, *ia;
|
||||
@ -2039,9 +2015,7 @@ in6_init_address_ltimes(struct nd_prefix *new, struct in6_addrlifetime *lt6)
|
||||
* it shouldn't be called when acting as a router.
|
||||
*/
|
||||
void
|
||||
rt6_flush(gateway, ifp)
|
||||
struct in6_addr *gateway;
|
||||
struct ifnet *ifp;
|
||||
rt6_flush(struct in6_addr *gateway, struct ifnet *ifp)
|
||||
{
|
||||
struct radix_node_head *rnh = rt_tables[AF_INET6];
|
||||
int s = splnet();
|
||||
@ -2059,9 +2033,7 @@ rt6_flush(gateway, ifp)
|
||||
}
|
||||
|
||||
static int
|
||||
rt6_deleteroute(rn, arg)
|
||||
struct radix_node *rn;
|
||||
void *arg;
|
||||
rt6_deleteroute(struct radix_node *rn, void *arg)
|
||||
{
|
||||
#define SIN6(s) ((struct sockaddr_in6 *)s)
|
||||
struct rtentry *rt = (struct rtentry *)rn;
|
||||
@ -2095,8 +2067,7 @@ rt6_deleteroute(rn, arg)
|
||||
}
|
||||
|
||||
int
|
||||
nd6_setdefaultiface(ifindex)
|
||||
int ifindex;
|
||||
nd6_setdefaultiface(int ifindex)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
|
@ -132,9 +132,7 @@ int (*mrt6_ioctl)(int, caddr_t);
|
||||
* mbuf chain.
|
||||
*/
|
||||
int
|
||||
rip6_input(mp, offp, proto)
|
||||
struct mbuf **mp;
|
||||
int *offp, proto;
|
||||
rip6_input(struct mbuf **mp, int *offp, int proto)
|
||||
{
|
||||
struct mbuf *m = *mp;
|
||||
register struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
@ -258,10 +256,7 @@ rip6_input(mp, offp, proto)
|
||||
}
|
||||
|
||||
void
|
||||
rip6_ctlinput(cmd, sa, d)
|
||||
int cmd;
|
||||
struct sockaddr *sa;
|
||||
void *d;
|
||||
rip6_ctlinput(int cmd, struct sockaddr *sa, void *d)
|
||||
{
|
||||
struct ip6_hdr *ip6;
|
||||
struct mbuf *m;
|
||||
@ -481,9 +476,7 @@ rip6_output(m, va_alist)
|
||||
* Raw IPv6 socket option processing.
|
||||
*/
|
||||
int
|
||||
rip6_ctloutput(so, sopt)
|
||||
struct socket *so;
|
||||
struct sockopt *sopt;
|
||||
rip6_ctloutput(struct socket *so, struct sockopt *sopt)
|
||||
{
|
||||
int error;
|
||||
|
||||
|
@ -55,10 +55,12 @@ static int ip6_rthdr0 __P((struct mbuf *, struct ip6_hdr *,
|
||||
|
||||
#endif /* Disable route header processing. */
|
||||
|
||||
/*
|
||||
* proto - is unused
|
||||
*/
|
||||
|
||||
int
|
||||
route6_input(mp, offp, proto)
|
||||
struct mbuf **mp;
|
||||
int *offp, proto; /* proto is unused */
|
||||
route6_input(struct mbuf **mp, int *offp, int proto)
|
||||
{
|
||||
struct ip6_hdr *ip6;
|
||||
struct mbuf *m = *mp;
|
||||
@ -143,10 +145,7 @@ route6_input(mp, offp, proto)
|
||||
*/
|
||||
#if 0
|
||||
static int
|
||||
ip6_rthdr0(m, ip6, rh0)
|
||||
struct mbuf *m;
|
||||
struct ip6_hdr *ip6;
|
||||
struct ip6_rthdr0 *rh0;
|
||||
ip6_rthdr0(struct mbuf *m, struct ip6_hdr *ip6, struct ip6_rthdr0 *rh0)
|
||||
{
|
||||
int addrs, index;
|
||||
struct in6_addr *nextaddr, tmpaddr;
|
||||
|
@ -67,7 +67,7 @@ static struct scope6_id sid_default;
|
||||
(((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->scope6_id)
|
||||
|
||||
void
|
||||
scope6_init()
|
||||
scope6_init(void)
|
||||
{
|
||||
|
||||
SCOPE6_LOCK_INIT();
|
||||
@ -75,8 +75,7 @@ scope6_init()
|
||||
}
|
||||
|
||||
struct scope6_id *
|
||||
scope6_ifattach(ifp)
|
||||
struct ifnet *ifp;
|
||||
scope6_ifattach(struct ifnet *ifp)
|
||||
{
|
||||
struct scope6_id *sid;
|
||||
|
||||
@ -99,17 +98,14 @@ scope6_ifattach(ifp)
|
||||
}
|
||||
|
||||
void
|
||||
scope6_ifdetach(sid)
|
||||
struct scope6_id *sid;
|
||||
scope6_ifdetach(struct scope6_id *sid)
|
||||
{
|
||||
|
||||
free(sid, M_IFADDR);
|
||||
}
|
||||
|
||||
int
|
||||
scope6_set(ifp, idlist)
|
||||
struct ifnet *ifp;
|
||||
struct scope6_id *idlist;
|
||||
scope6_set(struct ifnet *ifp, struct scope6_id *idlist)
|
||||
{
|
||||
int i;
|
||||
int error = 0;
|
||||
@ -176,9 +172,7 @@ scope6_set(ifp, idlist)
|
||||
}
|
||||
|
||||
int
|
||||
scope6_get(ifp, idlist)
|
||||
struct ifnet *ifp;
|
||||
struct scope6_id *idlist;
|
||||
scope6_get(struct ifnet *ifp, struct scope6_id *idlist)
|
||||
{
|
||||
/* We only need to lock the interface's afdata for SID() to work. */
|
||||
IF_AFDATA_LOCK(ifp);
|
||||
@ -202,8 +196,7 @@ scope6_get(ifp, idlist)
|
||||
* Get a scope of the address. Node-local, link-local, site-local or global.
|
||||
*/
|
||||
int
|
||||
in6_addrscope(addr)
|
||||
struct in6_addr *addr;
|
||||
in6_addrscope(struct in6_addr *addr)
|
||||
{
|
||||
int scope;
|
||||
|
||||
@ -261,9 +254,12 @@ in6_addrscope(addr)
|
||||
return IPV6_ADDR_SCOPE_GLOBAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* ifp - note that this might be NULL
|
||||
*/
|
||||
|
||||
void
|
||||
scope6_setdefault(ifp)
|
||||
struct ifnet *ifp; /* note that this might be NULL */
|
||||
scope6_setdefault(struct ifnet *ifp)
|
||||
{
|
||||
/*
|
||||
* Currently, this function just sets the default "interfaces"
|
||||
@ -285,8 +281,7 @@ scope6_setdefault(ifp)
|
||||
}
|
||||
|
||||
int
|
||||
scope6_get_default(idlist)
|
||||
struct scope6_id *idlist;
|
||||
scope6_get_default(struct scope6_id *idlist)
|
||||
{
|
||||
|
||||
SCOPE6_LOCK();
|
||||
@ -297,8 +292,7 @@ scope6_get_default(idlist)
|
||||
}
|
||||
|
||||
u_int32_t
|
||||
scope6_addr2default(addr)
|
||||
struct in6_addr *addr;
|
||||
scope6_addr2default(struct in6_addr *addr)
|
||||
{
|
||||
u_int32_t id;
|
||||
|
||||
@ -328,9 +322,7 @@ scope6_addr2default(addr)
|
||||
* address.
|
||||
*/
|
||||
int
|
||||
sa6_embedscope(sin6, defaultok)
|
||||
struct sockaddr_in6 *sin6;
|
||||
int defaultok;
|
||||
sa6_embedscope(struct sockaddr_in6 *sin6, int defaultok)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
u_int32_t zoneid;
|
||||
@ -366,8 +358,7 @@ sa6_embedscope(sin6, defaultok)
|
||||
* generate standard sockaddr_in6 from embedded form.
|
||||
*/
|
||||
int
|
||||
sa6_recoverscope(sin6)
|
||||
struct sockaddr_in6 *sin6;
|
||||
sa6_recoverscope(struct sockaddr_in6 *sin6)
|
||||
{
|
||||
char ip6buf[INET6_ADDRSTRLEN];
|
||||
u_int32_t zoneid;
|
||||
@ -402,12 +393,11 @@ sa6_recoverscope(sin6)
|
||||
* Determine the appropriate scope zone ID for in6 and ifp. If ret_id is
|
||||
* non NULL, it is set to the zone ID. If the zone ID needs to be embedded
|
||||
* in the in6_addr structure, in6 will be modified.
|
||||
*
|
||||
* ret_id - unnecessary?
|
||||
*/
|
||||
int
|
||||
in6_setscope(in6, ifp, ret_id)
|
||||
struct in6_addr *in6;
|
||||
struct ifnet *ifp;
|
||||
u_int32_t *ret_id; /* unnecessary? */
|
||||
in6_setscope(struct in6_addr *in6, struct ifnet *ifp, u_int32_t *ret_id)
|
||||
{
|
||||
int scope;
|
||||
u_int32_t zoneid = 0;
|
||||
@ -481,8 +471,7 @@ in6_setscope(in6, ifp, ret_id)
|
||||
* is intact; return non 0 if the address is modified.
|
||||
*/
|
||||
int
|
||||
in6_clearscope(in6)
|
||||
struct in6_addr *in6;
|
||||
in6_clearscope(struct in6_addr *in6)
|
||||
{
|
||||
int modified = 0;
|
||||
|
||||
|
@ -61,14 +61,8 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
extern struct protosw inetsw[];
|
||||
|
||||
|
||||
|
||||
|
||||
int
|
||||
sctp6_input(i_pak, offp, proto)
|
||||
struct mbuf **i_pak;
|
||||
int *offp;
|
||||
int proto;
|
||||
sctp6_input(struct mbuf **i_pak, int *offp, int proto)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct ip6_hdr *ip6;
|
||||
@ -259,11 +253,8 @@ sctp6_input(i_pak, offp, proto)
|
||||
|
||||
|
||||
static void
|
||||
sctp6_notify_mbuf(struct sctp_inpcb *inp,
|
||||
struct icmp6_hdr *icmp6,
|
||||
struct sctphdr *sh,
|
||||
struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net)
|
||||
sctp6_notify_mbuf(struct sctp_inpcb *inp, struct icmp6_hdr *icmp6,
|
||||
struct sctphdr *sh, struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
{
|
||||
uint32_t nxtsz;
|
||||
|
||||
@ -336,10 +327,7 @@ sctp6_notify_mbuf(struct sctp_inpcb *inp,
|
||||
|
||||
|
||||
void
|
||||
sctp6_ctlinput(cmd, pktdst, d)
|
||||
int cmd;
|
||||
struct sockaddr *pktdst;
|
||||
void *d;
|
||||
sctp6_ctlinput(int cmd, struct sockaddr *pktdst, void *d)
|
||||
{
|
||||
struct sctphdr sh;
|
||||
struct ip6ctlparam *ip6cp = NULL;
|
||||
|
@ -108,12 +108,8 @@
|
||||
#define udp6s_opackets udps_opackets
|
||||
|
||||
int
|
||||
udp6_output(in6p, m, addr6, control, td)
|
||||
struct in6pcb *in6p;
|
||||
struct mbuf *m;
|
||||
struct mbuf *control;
|
||||
struct sockaddr *addr6;
|
||||
struct thread *td;
|
||||
udp6_output(struct in6pcb *in6p, struct mbuf *m, struct sockaddr *addr6,
|
||||
struct mbuf *control, struct thread *td)
|
||||
{
|
||||
u_int32_t ulen = m->m_pkthdr.len;
|
||||
u_int32_t plen = sizeof(struct udphdr) + ulen;
|
||||
|
@ -155,9 +155,7 @@ udp6_append(struct inpcb *in6p, struct mbuf *n, int off,
|
||||
}
|
||||
|
||||
int
|
||||
udp6_input(mp, offp, proto)
|
||||
struct mbuf **mp;
|
||||
int *offp, proto;
|
||||
udp6_input(struct mbuf **mp, int *offp, int proto)
|
||||
{
|
||||
struct mbuf *m = *mp;
|
||||
register struct ip6_hdr *ip6;
|
||||
@ -354,10 +352,7 @@ udp6_input(mp, offp, proto)
|
||||
}
|
||||
|
||||
void
|
||||
udp6_ctlinput(cmd, sa, d)
|
||||
int cmd;
|
||||
struct sockaddr *sa;
|
||||
void *d;
|
||||
udp6_ctlinput(int cmd, struct sockaddr *sa, void *d)
|
||||
{
|
||||
struct udphdr uh;
|
||||
struct ip6_hdr *ip6;
|
||||
|
Loading…
Reference in New Issue
Block a user