Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route.h
| Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
| * by a protocol slowtimo counter. | * by a protocol slowtimo counter. | ||||
| */ | */ | ||||
| #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ | #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ | ||||
| #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) | #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) | ||||
| /* lle state is exported in rmx_state rt_metrics field */ | /* lle state is exported in rmx_state rt_metrics field */ | ||||
| #define rmx_state rmx_weight | #define rmx_state rmx_weight | ||||
| /* default route weight */ | |||||
| #define RT_DEFAULT_WEIGHT 1 | |||||
| #define RT_MAX_WEIGHT 16777215 /* 3 bytes */ | |||||
| /* | /* | ||||
| * Keep a generation count of routing table, incremented on route addition, | * Keep a generation count of routing table, incremented on route addition, | ||||
| * so we can invalidate caches. This is accessed without a lock, as precision | * so we can invalidate caches. This is accessed without a lock, as precision | ||||
| * is not required. | * is not required. | ||||
| */ | */ | ||||
| typedef volatile u_int rt_gen_t; /* tree generation (for adds) */ | typedef volatile u_int rt_gen_t; /* tree generation (for adds) */ | ||||
| #define RT_GEN(fibnum, af) rt_tables_get_gen(fibnum, af) | #define RT_GEN(fibnum, af) rt_tables_get_gen(fibnum, af) | ||||
| #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ | #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ | ||||
| #define RT_ALL_FIBS -1 /* Announce event for every fib */ | #define RT_ALL_FIBS -1 /* Announce event for every fib */ | ||||
| #ifdef _KERNEL | #ifdef _KERNEL | ||||
| VNET_DECLARE(uint32_t, _rt_numfibs); /* number of existing route tables */ | VNET_DECLARE(uint32_t, _rt_numfibs); /* number of existing route tables */ | ||||
| #define V_rt_numfibs VNET(_rt_numfibs) | #define V_rt_numfibs VNET(_rt_numfibs) | ||||
| /* temporary compat arg */ | /* temporary compat arg */ | ||||
| #define rt_numfibs V_rt_numfibs | #define rt_numfibs V_rt_numfibs | ||||
| VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */ | VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */ | ||||
| #define V_rt_add_addr_allfibs VNET(rt_add_addr_allfibs) | #define V_rt_add_addr_allfibs VNET(rt_add_addr_allfibs) | ||||
| /* Calculate flowid for locally-originated packets */ | |||||
| #define V_fib_hash_outbound VNET(fib_hash_outbound) | |||||
| VNET_DECLARE(u_int, fib_hash_outbound); | |||||
| #endif | #endif | ||||
| /* | /* | ||||
| * We distinguish between routes to hosts and routes to networks, | * We distinguish between routes to hosts and routes to networks, | ||||
| * preferring the former if available. For each route we infer | * preferring the former if available. For each route we infer | ||||
| * the interface to use from the gateway address supplied when | * the interface to use from the gateway address supplied when | ||||
| * the route was entered. Routes that forward packets through | * the route was entered. Routes that forward packets through | ||||
| * gateways are marked so that the output routines know to address the | * gateways are marked so that the output routines know to address the | ||||
| Show All 37 Lines | #define RTF_FMASK \ | ||||
| (RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \ | (RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \ | ||||
| RTF_REJECT | RTF_STATIC | RTF_STICKY) | RTF_REJECT | RTF_STATIC | RTF_STICKY) | ||||
| /* | /* | ||||
| * fib_ nexthop API flags. | * fib_ nexthop API flags. | ||||
| */ | */ | ||||
| /* Consumer-visible nexthop info flags */ | /* Consumer-visible nexthop info flags */ | ||||
| #define NHF_MULTIPATH 0x0008 /* Nexhop is a nexthop group */ | |||||
| #define NHF_REJECT 0x0010 /* RTF_REJECT */ | #define NHF_REJECT 0x0010 /* RTF_REJECT */ | ||||
| #define NHF_BLACKHOLE 0x0020 /* RTF_BLACKHOLE */ | #define NHF_BLACKHOLE 0x0020 /* RTF_BLACKHOLE */ | ||||
| #define NHF_REDIRECT 0x0040 /* RTF_DYNAMIC|RTF_MODIFIED */ | #define NHF_REDIRECT 0x0040 /* RTF_DYNAMIC|RTF_MODIFIED */ | ||||
| #define NHF_DEFAULT 0x0080 /* Default route */ | #define NHF_DEFAULT 0x0080 /* Default route */ | ||||
| #define NHF_BROADCAST 0x0100 /* RTF_BROADCAST */ | #define NHF_BROADCAST 0x0100 /* RTF_BROADCAST */ | ||||
| #define NHF_GATEWAY 0x0200 /* RTF_GATEWAY */ | #define NHF_GATEWAY 0x0200 /* RTF_GATEWAY */ | ||||
| #define NHF_HOST 0x0400 /* RTF_HOST */ | #define NHF_HOST 0x0400 /* RTF_HOST */ | ||||
| Show All 14 Lines | |||||
| struct rtstat { | struct rtstat { | ||||
| uint64_t rts_badredirect; /* bogus redirect calls */ | uint64_t rts_badredirect; /* bogus redirect calls */ | ||||
| uint64_t rts_dynamic; /* routes created by redirects */ | uint64_t rts_dynamic; /* routes created by redirects */ | ||||
| uint64_t rts_newgateway; /* routes modified by redirects */ | uint64_t rts_newgateway; /* routes modified by redirects */ | ||||
| uint64_t rts_unreach; /* lookups which failed */ | uint64_t rts_unreach; /* lookups which failed */ | ||||
| uint64_t rts_wildcard; /* lookups satisfied by a wildcard */ | uint64_t rts_wildcard; /* lookups satisfied by a wildcard */ | ||||
| uint64_t rts_nh_idx_alloc_failure; /* nexthop index alloc failure*/ | uint64_t rts_nh_idx_alloc_failure; /* nexthop index alloc failure*/ | ||||
| uint64_t rts_nh_alloc_failure; /* nexthop allocation failure*/ | uint64_t rts_nh_alloc_failure; /* nexthop allocation failure*/ | ||||
| uint64_t rts_add_failure; /* route addition failure */ | |||||
| uint64_t rts_add_retry; /* route addition failure */ | |||||
glebius: Looks like three descriptions in comments need to be fixed. | |||||
| uint64_t rts_del_failure; /* route addition failure */ | |||||
| uint64_t rts_del_retry; /* route addition failure */ | |||||
| }; | }; | ||||
| /* | /* | ||||
| * Structures for routing messages. | * Structures for routing messages. | ||||
| */ | */ | ||||
| struct rt_msghdr { | struct rt_msghdr { | ||||
| u_short rtm_msglen; /* to skip over non-understood messages */ | u_short rtm_msglen; /* to skip over non-understood messages */ | ||||
| u_char rtm_version; /* future binary compatibility */ | u_char rtm_version; /* future binary compatibility */ | ||||
| ▲ Show 20 Lines • Show All 203 Lines • Show Last 20 Lines | |||||
Looks like three descriptions in comments need to be fixed.