Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/in6_rmx.c
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
#include <netinet/icmp6.h> | #include <netinet/icmp6.h> | ||||
#include <netinet6/nd6.h> | #include <netinet6/nd6.h> | ||||
#include <netinet/tcp.h> | #include <netinet/tcp.h> | ||||
#include <netinet/tcp_seq.h> | #include <netinet/tcp_seq.h> | ||||
#include <netinet/tcp_timer.h> | #include <netinet/tcp_timer.h> | ||||
#include <netinet/tcp_var.h> | #include <netinet/tcp_var.h> | ||||
extern int in6_inithead(void **head, int off, u_int fibnum); | |||||
#ifdef VIMAGE | |||||
extern int in6_detachhead(void **head, int off); | |||||
#endif | |||||
static int | static int | ||||
rib6_preadd(u_int fibnum, const struct sockaddr *addr, const struct sockaddr *mask, | rib6_preadd(u_int fibnum, const struct sockaddr *addr, const struct sockaddr *mask, | ||||
struct nhop_object *nh) | struct nhop_object *nh) | ||||
{ | { | ||||
uint16_t nh_type; | uint16_t nh_type; | ||||
/* XXX: RTF_LOCAL */ | /* XXX: RTF_LOCAL */ | ||||
Show All 25 Lines | rib6_preadd(u_int fibnum, const struct sockaddr *addr, const struct sockaddr *mask, | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Initialize our routing tree. | * Initialize our routing tree. | ||||
*/ | */ | ||||
int | struct rib_head * | ||||
in6_inithead(void **head, int off, u_int fibnum) | in6_inithead(uint32_t fibnum) | ||||
{ | { | ||||
struct rib_head *rh; | struct rib_head *rh; | ||||
struct rib_subscription *rs; | struct rib_subscription *rs; | ||||
rh = rt_table_init(offsetof(struct sockaddr_in6, sin6_addr) << 3, | rh = rt_table_init(offsetof(struct sockaddr_in6, sin6_addr) << 3, | ||||
AF_INET6, fibnum); | AF_INET6, fibnum); | ||||
if (rh == NULL) | if (rh == NULL) | ||||
return (0); | return (NULL); | ||||
rh->rnh_preadd = rib6_preadd; | rh->rnh_preadd = rib6_preadd; | ||||
#ifdef RADIX_MPATH | #ifdef RADIX_MPATH | ||||
rt_mpath_init_rnh(rh); | rt_mpath_init_rnh(rh); | ||||
#endif | #endif | ||||
*head = (void *)rh; | |||||
rs = rib_subscribe(fibnum, AF_INET6, nd6_subscription_cb, NULL, | rs = rib_subscribe_internal(rh, nd6_subscription_cb, NULL, | ||||
RIB_NOTIFY_IMMEDIATE, true); | RIB_NOTIFY_IMMEDIATE, true); | ||||
KASSERT(rs != NULL, ("Unable to subscribe to fib %u\n", fibnum)); | KASSERT(rs != NULL, ("Unable to subscribe to fib %u\n", fibnum)); | ||||
return (1); | return (rh); | ||||
} | } | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
int | void | ||||
in6_detachhead(void **head, int off) | in6_detachhead(struct rib_head *rh) | ||||
{ | { | ||||
rt_table_destroy((struct rib_head *)(*head)); | rt_table_destroy(rh); | ||||
return (1); | |||||
} | } | ||||
#endif | #endif | ||||