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, 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 58 Lines • ▼ Show 20 Lines | |||||
* inet versions of rt functions. These have fib extensions and | * inet versions of rt functions. These have fib extensions and | ||||
* for now will just reference the _fib variants. | * for now will just reference the _fib variants. | ||||
* eventually this order will be reversed, | * eventually this order will be reversed, | ||||
*/ | */ | ||||
void | void | ||||
in_rtalloc_ign(struct route *ro, u_long ignflags, u_int fibnum) | in_rtalloc_ign(struct route *ro, u_long ignflags, u_int fibnum) | ||||
{ | { | ||||
rtalloc_ign_fib(ro, ignflags, fibnum); | rtalloc_ign_fib(ro, ignflags, fibnum); | ||||
} | |||||
void | |||||
in_rtredirect(struct sockaddr *dst, | |||||
struct sockaddr *gateway, | |||||
struct sockaddr *netmask, | |||||
int flags, | |||||
struct sockaddr *src, | |||||
u_int fibnum) | |||||
{ | |||||
rtredirect_fib(dst, gateway, netmask, flags, src, fibnum); | |||||
} | } | ||||