Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_rmx.c
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/in_var.h> | #include <netinet/in_var.h> | ||||
#include <netinet/ip.h> | #include <netinet/ip.h> | ||||
#include <netinet/ip_icmp.h> | #include <netinet/ip_icmp.h> | ||||
#include <netinet/ip_var.h> | #include <netinet/ip_var.h> | ||||
extern int in_inithead(void **head, int off); | extern int in_inithead(void **head, int off, u_int fibnum); | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
extern int in_detachhead(void **head, int off); | extern int in_detachhead(void **head, int off); | ||||
#endif | #endif | ||||
/* | /* | ||||
* Do what we need to do when inserting a route. | * Do what we need to do when inserting a route. | ||||
*/ | */ | ||||
static struct radix_node * | static struct radix_node * | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | in_addroute(void *v_arg, void *n_arg, struct radix_head *head, | ||||
return (rn_addroute(v_arg, n_arg, head, treenodes)); | return (rn_addroute(v_arg, n_arg, head, treenodes)); | ||||
} | } | ||||
static int _in_rt_was_here; | static int _in_rt_was_here; | ||||
/* | /* | ||||
* Initialize our routing tree. | * Initialize our routing tree. | ||||
*/ | */ | ||||
int | int | ||||
in_inithead(void **head, int off) | in_inithead(void **head, int off, u_int fibnum) | ||||
{ | { | ||||
struct rib_head *rh; | struct rib_head *rh; | ||||
rh = rt_table_init(32); | rh = rt_table_init(32, sizeof(struct sockaddr_in), AF_INET, fibnum); | ||||
if (rh == NULL) | if (rh == NULL) | ||||
return (0); | return (0); | ||||
rh->rnh_addaddr = in_addroute; | rh->rnh_addaddr = in_addroute; | ||||
*head = (void *)rh; | *head = (void *)rh; | ||||
if (_in_rt_was_here == 0 ) { | if (_in_rt_was_here == 0 ) { | ||||
_in_rt_was_here = 1; | _in_rt_was_here = 1; | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |