aboutsummaryrefslogtreecommitdiff
path: root/sys/net/route.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h45
1 files changed, 27 insertions, 18 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index 93193b5fbc7f..d4bc4056b99b 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -265,25 +265,35 @@ struct rt_msghdr {
/*
* 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_DELETE 0x2 /* Delete Route */
-#define RTM_CHANGE 0x3 /* Change Metrics or flags */
-#define RTM_GET 0x4 /* Report Metrics */
-#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */
-#define RTM_REDIRECT 0x6 /* Told to use different route */
-#define RTM_MISS 0x7 /* Lookup failed on this address */
-#define RTM_LOCK 0x8 /* fix specified metrics */
+#define RTM_ADD 0x1 /* (1) Add Route */
+#define RTM_DELETE 0x2 /* (1) Delete Route */
+#define RTM_CHANGE 0x3 /* (1) Change Metrics or flags */
+#define RTM_GET 0x4 /* (1) Report Metrics */
+#define RTM_LOSING 0x5 /* (1) Kernel Suspects Partitioning */
+#define RTM_REDIRECT 0x6 /* (1) Told to use different route */
+#define RTM_MISS 0x7 /* (1) Lookup failed on this address */
+#define RTM_LOCK 0x8 /* (1) fix specified metrics */
/* 0x9 */
/* 0xa */
-#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */
-#define RTM_NEWADDR 0xc /* address being added to iface */
-#define RTM_DELADDR 0xd /* address being removed from iface */
-#define RTM_IFINFO 0xe /* iface going up/down etc. */
-#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */
-#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */
-#define RTM_IFANNOUNCE 0x11 /* iface arrival/departure */
-#define RTM_IEEE80211 0x12 /* IEEE80211 wireless event */
+#define RTM_RESOLVE 0xb /* (1) req to resolve dst to LL addr */
+#define RTM_NEWADDR 0xc /* (2) address being added to iface */
+#define RTM_DELADDR 0xd /* (2) address being removed from iface */
+#define RTM_IFINFO 0xe /* (3) iface going up/down etc. */
+#define RTM_NEWMADDR 0xf /* (4) mcast group membership being added to if */
+#define RTM_DELMADDR 0x10 /* (4) mcast group membership being deleted */
+#define RTM_IFANNOUNCE 0x11 /* (5) iface arrival/departure */
+#define RTM_IEEE80211 0x12 /* (5) IEEE80211 wireless event */
/*
* Bitmask values for rtm_inits and rmx_locks.
@@ -342,11 +352,10 @@ struct rt_addrinfo {
* This macro returns the size of a struct sockaddr when passed
* through a routing socket. Basically we round up sa_len to
* 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.
*/
#define SA_SIZE(sa) \
- ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \
+ ( (((struct sockaddr *)(sa))->sa_len == 0) ? \
sizeof(long) : \
1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) )