Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/route.h
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | struct rt_msghdr { | ||||
u_long rtm_inits; /* which metrics we are initializing */ | u_long rtm_inits; /* which metrics we are initializing */ | ||||
struct rt_metrics rtm_rmx; /* metrics themselves */ | struct rt_metrics rtm_rmx; /* metrics themselves */ | ||||
}; | }; | ||||
#define RTM_VERSION 5 /* Up the ante and ignore older versions */ | #define RTM_VERSION 5 /* Up the ante and ignore older versions */ | ||||
/* | /* | ||||
* Message types. | * Message types. | ||||
* | |||||
* The format for each message is annotated below using the following | |||||
* identifiers: | |||||
* | |||||
* (1) struct rt_msghdr | |||||
* (2) struct ifa_msghdr | |||||
* (3) struct if_msghdr | |||||
* (4) struct ifma_msghdr | |||||
* (5) struct if_announcemsghdr | |||||
* | |||||
*/ | */ | ||||
#define RTM_ADD 0x1 /* Add Route */ | #define RTM_ADD 0x1 /* (1) Add Route */ | ||||
#define RTM_DELETE 0x2 /* Delete Route */ | #define RTM_DELETE 0x2 /* (1) Delete Route */ | ||||
#define RTM_CHANGE 0x3 /* Change Metrics or flags */ | #define RTM_CHANGE 0x3 /* (1) Change Metrics or flags */ | ||||
#define RTM_GET 0x4 /* Report Metrics */ | #define RTM_GET 0x4 /* (1) Report Metrics */ | ||||
#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */ | #define RTM_LOSING 0x5 /* (1) Kernel Suspects Partitioning */ | ||||
#define RTM_REDIRECT 0x6 /* Told to use different route */ | #define RTM_REDIRECT 0x6 /* (1) Told to use different route */ | ||||
#define RTM_MISS 0x7 /* Lookup failed on this address */ | #define RTM_MISS 0x7 /* (1) Lookup failed on this address */ | ||||
#define RTM_LOCK 0x8 /* fix specified metrics */ | #define RTM_LOCK 0x8 /* (1) fix specified metrics */ | ||||
/* 0x9 */ | /* 0x9 */ | ||||
/* 0xa */ | /* 0xa */ | ||||
#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ | #define RTM_RESOLVE 0xb /* (1) req to resolve dst to LL addr */ | ||||
#define RTM_NEWADDR 0xc /* address being added to iface */ | #define RTM_NEWADDR 0xc /* (2) address being added to iface */ | ||||
#define RTM_DELADDR 0xd /* address being removed from iface */ | #define RTM_DELADDR 0xd /* (2) address being removed from iface */ | ||||
#define RTM_IFINFO 0xe /* iface going up/down etc. */ | #define RTM_IFINFO 0xe /* (3) iface going up/down etc. */ | ||||
#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */ | #define RTM_NEWMADDR 0xf /* (4) mcast group membership being added to if */ | ||||
#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ | #define RTM_DELMADDR 0x10 /* (4) mcast group membership being deleted */ | ||||
#define RTM_IFANNOUNCE 0x11 /* iface arrival/departure */ | #define RTM_IFANNOUNCE 0x11 /* (5) iface arrival/departure */ | ||||
#define RTM_IEEE80211 0x12 /* IEEE80211 wireless event */ | #define RTM_IEEE80211 0x12 /* (5) IEEE80211 wireless event */ | ||||
/* | /* | ||||
* Bitmask values for rtm_inits and rmx_locks. | * Bitmask values for rtm_inits and rmx_locks. | ||||
*/ | */ | ||||
#define RTV_MTU 0x1 /* init or lock _mtu */ | #define RTV_MTU 0x1 /* init or lock _mtu */ | ||||
#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ | #define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ | ||||
#define RTV_EXPIRE 0x4 /* init or lock _expire */ | #define RTV_EXPIRE 0x4 /* init or lock _expire */ | ||||
#define RTV_RPIPE 0x8 /* init or lock _recvpipe */ | #define RTV_RPIPE 0x8 /* init or lock _recvpipe */ | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | struct rt_addrinfo { | ||||
u_long rti_spare; /* Will be used for fib */ | u_long rti_spare; /* Will be used for fib */ | ||||
struct rt_metrics *rti_rmx; /* Pointer to route metrics */ | struct rt_metrics *rti_rmx; /* Pointer to route metrics */ | ||||
}; | }; | ||||
/* | /* | ||||
* This macro returns the size of a struct sockaddr when passed | * This macro returns the size of a struct sockaddr when passed | ||||
* through a routing socket. Basically we round up sa_len to | * through a routing socket. Basically we round up sa_len to | ||||
* a multiple of sizeof(long), with a minimum of sizeof(long). | * a multiple of sizeof(long), with a minimum of sizeof(long). | ||||
* The check for a NULL pointer is just a convenience, probably never used. | |||||
* The case sa_len == 0 should only apply to empty structures. | * The case sa_len == 0 should only apply to empty structures. | ||||
*/ | */ | ||||
#define SA_SIZE(sa) \ | #define SA_SIZE(sa) \ | ||||
( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \ | ( (((struct sockaddr *)(sa))->sa_len == 0) ? \ | ||||
sizeof(long) : \ | sizeof(long) : \ | ||||
1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) | 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) | ||||
#define sa_equal(a, b) ( \ | #define sa_equal(a, b) ( \ | ||||
(((const struct sockaddr *)(a))->sa_len == ((const struct sockaddr *)(b))->sa_len) && \ | (((const struct sockaddr *)(a))->sa_len == ((const struct sockaddr *)(b))->sa_len) && \ | ||||
(bcmp((a), (b), ((const struct sockaddr *)(b))->sa_len) == 0)) | (bcmp((a), (b), ((const struct sockaddr *)(b))->sa_len) == 0)) | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |