Move #defines for MRT-related constants from net/route.c to
net/route.h, because the vnet code will need those constants as well. Reviewed by: bz Approved by: julian (mentor) MFC after: never
This commit is contained in:
parent
023d231918
commit
4e7840e25e
@ -63,26 +63,6 @@
|
||||
|
||||
#include <vm/uma.h>
|
||||
|
||||
#ifndef ROUTETABLES
|
||||
#define RT_NUMFIBS 1
|
||||
#define RT_MAXFIBS 1
|
||||
#else
|
||||
/* while we use 4 bits in the mbuf flags,
|
||||
* we are limited to 16
|
||||
*/
|
||||
#define RT_MAXFIBS 16
|
||||
#if ROUTETABLES > RT_MAXFIBS
|
||||
#define RT_NUMFIBS RT_MAXFIBS
|
||||
#error "ROUTETABLES defined too big"
|
||||
#else
|
||||
#if ROUTETABLES == 0
|
||||
#define RT_NUMFIBS 1
|
||||
#else
|
||||
#define RT_NUMFIBS ROUTETABLES
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
u_int rt_numfibs = RT_NUMFIBS;
|
||||
SYSCTL_INT(_net, OID_AUTO, fibs, CTLFLAG_RD, &rt_numfibs, 0, "");
|
||||
/*
|
||||
|
@ -82,6 +82,27 @@ struct rt_metrics {
|
||||
#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
|
||||
#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
|
||||
|
||||
/* MRT compile-time constants */
|
||||
#ifdef _KERNEL
|
||||
#ifndef ROUTETABLES
|
||||
#define RT_NUMFIBS 1
|
||||
#define RT_MAXFIBS 1
|
||||
#else
|
||||
/* while we use 4 bits in the mbuf flags, we are limited to 16 */
|
||||
#define RT_MAXFIBS 16
|
||||
#if ROUTETABLES > RT_MAXFIBS
|
||||
#define RT_NUMFIBS RT_MAXFIBS
|
||||
#error "ROUTETABLES defined too big"
|
||||
#else
|
||||
#if ROUTETABLES == 0
|
||||
#define RT_NUMFIBS 1
|
||||
#else
|
||||
#define RT_NUMFIBS ROUTETABLES
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern u_int rt_numfibs; /* number fo usable routing tables */
|
||||
extern u_int tunnel_fib; /* tunnels use these */
|
||||
extern u_int fwd_fib; /* packets being forwarded use these routes */
|
||||
|
Loading…
x
Reference in New Issue
Block a user