summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2008-09-20 09:09:25 +0000
committerzec <zec@FreeBSD.org>2008-09-20 09:09:25 +0000
commit12843f93b9d7372b583e0d4102c840304cc73fca (patch)
tree8e6ea8689f5645994de474f808ee978f9bc749f7
parentdf6baa426c8022150f3bcf31f5207c7bcb2c2461 (diff)
downloadFreeBSD-src-12843f93b9d7372b583e0d4102c840304cc73fca.zip
FreeBSD-src-12843f93b9d7372b583e0d4102c840304cc73fca.tar.gz
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
-rw-r--r--sys/net/route.c20
-rw-r--r--sys/net/route.h21
2 files changed, 21 insertions, 20 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 456caab..105c932 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -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, "");
/*
diff --git a/sys/net/route.h b/sys/net/route.h
index 249a41e..9a01aa6 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -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 */
OpenPOWER on IntegriCloud