version 1.98.4.1, 2007/07/11 20:11:42 |
version 1.105, 2007/05/06 02:29:33 |
Line 136 static int ip6qmaxlen = IFQ_MAXLEN; |
|
Line 136 static int ip6qmaxlen = IFQ_MAXLEN; |
|
struct in6_ifaddr *in6_ifaddr; |
struct in6_ifaddr *in6_ifaddr; |
struct ifqueue ip6intrq; |
struct ifqueue ip6intrq; |
|
|
extern callout_t in6_tmpaddrtimer_ch; |
extern struct callout in6_tmpaddrtimer_ch; |
|
|
int ip6_forward_srcrt; /* XXX */ |
int ip6_forward_srcrt; /* XXX */ |
int ip6_sourcecheck; /* XXX */ |
int ip6_sourcecheck; /* XXX */ |
Line 202 ip6_init2(void *dummy) |
|
Line 202 ip6_init2(void *dummy) |
|
{ |
{ |
|
|
/* nd6_timer_init */ |
/* nd6_timer_init */ |
callout_init(&nd6_timer_ch, 0); |
callout_init(&nd6_timer_ch); |
callout_reset(&nd6_timer_ch, hz, nd6_timer, NULL); |
callout_reset(&nd6_timer_ch, hz, nd6_timer, NULL); |
|
|
/* timer for regeneranation of temporary addresses randomize ID */ |
/* timer for regeneranation of temporary addresses randomize ID */ |
callout_init(&in6_tmpaddrtimer_ch, 0); |
callout_init(&in6_tmpaddrtimer_ch); |
callout_reset(&in6_tmpaddrtimer_ch, |
callout_reset(&in6_tmpaddrtimer_ch, |
(ip6_temp_preferred_lifetime - ip6_desync_factor - |
(ip6_temp_preferred_lifetime - ip6_desync_factor - |
ip6_temp_regen_advance) * hz, |
ip6_temp_regen_advance) * hz, |
Line 830 ip6_input(struct mbuf *m) |
|
Line 830 ip6_input(struct mbuf *m) |
|
* set/grab in6_ifaddr correspond to IPv6 destination address. |
* set/grab in6_ifaddr correspond to IPv6 destination address. |
*/ |
*/ |
static struct m_tag * |
static struct m_tag * |
ip6_setdstifaddr(struct mbuf *m, struct in6_ifaddr *ia6) |
ip6_setdstifaddr(m, ia6) |
|
struct mbuf *m; |
|
struct in6_ifaddr *ia6; |
{ |
{ |
struct m_tag *mtag; |
struct m_tag *mtag; |
|
|
Line 841 ip6_setdstifaddr(struct mbuf *m, struct |
|
Line 843 ip6_setdstifaddr(struct mbuf *m, struct |
|
} |
} |
|
|
struct in6_ifaddr * |
struct in6_ifaddr * |
ip6_getdstifaddr(struct mbuf *m) |
ip6_getdstifaddr(m) |
|
struct mbuf *m; |
{ |
{ |
struct m_tag *mtag; |
struct m_tag *mtag; |
|
|
Line 855 ip6_getdstifaddr(struct mbuf *m) |
|
Line 858 ip6_getdstifaddr(struct mbuf *m) |
|
/* |
/* |
* Hop-by-Hop options header processing. If a valid jumbo payload option is |
* Hop-by-Hop options header processing. If a valid jumbo payload option is |
* included, the real payload length will be stored in plenp. |
* included, the real payload length will be stored in plenp. |
* |
|
* rtalertp - XXX: should be stored more smart way |
|
*/ |
*/ |
static int |
static int |
ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp, |
ip6_hopopts_input(plenp, rtalertp, mp, offp) |
struct mbuf **mp, int *offp) |
u_int32_t *plenp; |
|
u_int32_t *rtalertp; /* XXX: should be stored more smart way */ |
|
struct mbuf **mp; |
|
int *offp; |
{ |
{ |
struct mbuf *m = *mp; |
struct mbuf *m = *mp; |
int off = *offp, hbhlen; |
int off = *offp, hbhlen; |
Line 904 ip6_hopopts_input(u_int32_t *plenp, u_in |
|
Line 908 ip6_hopopts_input(u_int32_t *plenp, u_in |
|
* opthead + hbhlen is located in continuous memory region. |
* opthead + hbhlen is located in continuous memory region. |
*/ |
*/ |
int |
int |
ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen, |
ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp) |
u_int32_t *rtalertp, u_int32_t *plenp) |
struct mbuf *m; |
|
u_int8_t *opthead; |
|
int hbhlen; |
|
u_int32_t *rtalertp; |
|
u_int32_t *plenp; |
{ |
{ |
struct ip6_hdr *ip6; |
struct ip6_hdr *ip6; |
int optlen = 0; |
int optlen = 0; |
Line 1037 ip6_process_hopopts(struct mbuf *m, u_in |
|
Line 1045 ip6_process_hopopts(struct mbuf *m, u_in |
|
* is not continuous in order to return an ICMPv6 error. |
* is not continuous in order to return an ICMPv6 error. |
*/ |
*/ |
int |
int |
ip6_unknown_opt(u_int8_t *optp, struct mbuf *m, int off) |
ip6_unknown_opt(optp, m, off) |
|
u_int8_t *optp; |
|
struct mbuf *m; |
|
int off; |
{ |
{ |
struct ip6_hdr *ip6; |
struct ip6_hdr *ip6; |
|
|
Line 1079 ip6_unknown_opt(u_int8_t *optp, struct m |
|
Line 1090 ip6_unknown_opt(u_int8_t *optp, struct m |
|
* you are using IP6_EXTHDR_CHECK() not m_pulldown()) |
* you are using IP6_EXTHDR_CHECK() not m_pulldown()) |
*/ |
*/ |
void |
void |
ip6_savecontrol(struct in6pcb *in6p, struct mbuf **mp, |
ip6_savecontrol(in6p, mp, ip6, m) |
struct ip6_hdr *ip6, struct mbuf *m) |
struct in6pcb *in6p; |
|
struct mbuf **mp; |
|
struct ip6_hdr *ip6; |
|
struct mbuf *m; |
{ |
{ |
#ifdef RFC2292 |
#ifdef RFC2292 |
#define IS2292(x, y) ((in6p->in6p_flags & IN6P_RFC2292) ? (x) : (y)) |
#define IS2292(x, y) ((in6p->in6p_flags & IN6P_RFC2292) ? (x) : (y)) |
Line 1337 ip6_notify_pmtu(struct in6pcb *in6p, con |
|
Line 1351 ip6_notify_pmtu(struct in6pcb *in6p, con |
|
* contains the result, or NULL on error. |
* contains the result, or NULL on error. |
*/ |
*/ |
static struct mbuf * |
static struct mbuf * |
ip6_pullexthdr(struct mbuf *m, size_t off, int nxt) |
ip6_pullexthdr(m, off, nxt) |
|
struct mbuf *m; |
|
size_t off; |
|
int nxt; |
{ |
{ |
struct ip6_ext ip6e; |
struct ip6_ext ip6e; |
size_t elen; |
size_t elen; |
Line 1396 ip6_pullexthdr(struct mbuf *m, size_t of |
|
Line 1413 ip6_pullexthdr(struct mbuf *m, size_t of |
|
* we develop `neater' mechanism to process extension headers. |
* we develop `neater' mechanism to process extension headers. |
*/ |
*/ |
u_int8_t * |
u_int8_t * |
ip6_get_prevhdr(struct mbuf *m, int off) |
ip6_get_prevhdr(m, off) |
|
struct mbuf *m; |
|
int off; |
{ |
{ |
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); |
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); |
|
|
Line 1435 ip6_get_prevhdr(struct mbuf *m, int off) |
|
Line 1454 ip6_get_prevhdr(struct mbuf *m, int off) |
|
* get next header offset. m will be retained. |
* get next header offset. m will be retained. |
*/ |
*/ |
int |
int |
ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp) |
ip6_nexthdr(m, off, proto, nxtp) |
|
struct mbuf *m; |
|
int off; |
|
int proto; |
|
int *nxtp; |
{ |
{ |
struct ip6_hdr ip6; |
struct ip6_hdr ip6; |
struct ip6_ext ip6e; |
struct ip6_ext ip6e; |
Line 1514 ip6_nexthdr(struct mbuf *m, int off, int |
|
Line 1537 ip6_nexthdr(struct mbuf *m, int off, int |
|
* get offset for the last header in the chain. m will be kept untainted. |
* get offset for the last header in the chain. m will be kept untainted. |
*/ |
*/ |
int |
int |
ip6_lasthdr(struct mbuf *m, int off, int proto, int *nxtp) |
ip6_lasthdr(m, off, proto, nxtp) |
|
struct mbuf *m; |
|
int off; |
|
int proto; |
|
int *nxtp; |
{ |
{ |
int newoff; |
int newoff; |
int nxt; |
int nxt; |
Line 1538 ip6_lasthdr(struct mbuf *m, int off, int |
|
Line 1565 ip6_lasthdr(struct mbuf *m, int off, int |
|
} |
} |
|
|
struct m_tag * |
struct m_tag * |
ip6_addaux(struct mbuf *m) |
ip6_addaux(m) |
|
struct mbuf *m; |
{ |
{ |
struct m_tag *mtag; |
struct m_tag *mtag; |
|
|
Line 1555 ip6_addaux(struct mbuf *m) |
|
Line 1583 ip6_addaux(struct mbuf *m) |
|
} |
} |
|
|
struct m_tag * |
struct m_tag * |
ip6_findaux(struct mbuf *m) |
ip6_findaux(m) |
|
struct mbuf *m; |
{ |
{ |
struct m_tag *mtag; |
struct m_tag *mtag; |
|
|
Line 1564 ip6_findaux(struct mbuf *m) |
|
Line 1593 ip6_findaux(struct mbuf *m) |
|
} |
} |
|
|
void |
void |
ip6_delaux(struct mbuf *m) |
ip6_delaux(m) |
|
struct mbuf *m; |
{ |
{ |
struct m_tag *mtag; |
struct m_tag *mtag; |
|
|
Line 1624 sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A |
|
Line 1654 sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A |
|
} |
} |
#endif /* GATEWAY */ |
#endif /* GATEWAY */ |
|
|
|
static int |
|
sysctl_net_inet6_ip6_rht0(SYSCTLFN_ARGS) |
|
{ |
|
int error, tmp; |
|
struct sysctlnode node; |
|
|
|
node = *rnode; |
|
tmp = ip6_rht0; |
|
node.sysctl_data = &tmp; |
|
error = sysctl_lookup(SYSCTLFN_CALL(&node)); |
|
if (error || newp == NULL) |
|
return error; |
|
|
|
switch (tmp) { |
|
case -1: /* disable processing */ |
|
case 0: /* disable for host, enable for router */ |
|
case 1: /* enable for all */ |
|
break; |
|
default: |
|
return EINVAL; |
|
} |
|
ip6_rht0 = tmp; |
|
return 0; |
|
} |
|
|
/* |
/* |
* System control for IP6 |
* System control for IP6 |
*/ |
*/ |
Line 1923 SYSCTL_SETUP(sysctl_net_inet6_ip6_setup, |
|
Line 1978 SYSCTL_SETUP(sysctl_net_inet6_ip6_setup, |
|
CTL_NET, PF_INET6, IPPROTO_IPV6, |
CTL_NET, PF_INET6, IPPROTO_IPV6, |
CTL_CREATE, CTL_EOL); |
CTL_CREATE, CTL_EOL); |
#endif |
#endif |
|
sysctl_createv(clog, 0, NULL, NULL, |
|
CTLFLAG_PERMANENT|CTLFLAG_READWRITE, |
|
CTLTYPE_INT, "rht0", |
|
SYSCTL_DESCR("Processing of routing header type 0 (IPv6)"), |
|
sysctl_net_inet6_ip6_rht0, 0, &ip6_rht0, 0, |
|
CTL_NET, PF_INET6, IPPROTO_IPV6, |
|
CTL_CREATE, CTL_EOL); |
} |
} |