aboutsummaryrefslogtreecommitdiff
path: root/lib/netlink-protocol.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-01-09 16:57:45 -0800
committerBen Pfaff <blp@nicira.com>2011-01-27 09:26:05 -0800
commitcceb11f5b12d09cc8afc87ca4fd03e941234d439 (patch)
tree9dcdb79b49856023c9f63f4595d82c4a18b37ecf /lib/netlink-protocol.h
parent18c58479a14f760fb03c2062f9a35961fc74ebb5 (diff)
netlink-socket: Add functions for joining and leaving multicast groups.
When this library was originally implemented, support for Linux 2.4 was important. The Netlink implementation in Linux only added support for joining and leaving multicast groups after a socket is bound as of Linux 2.6.14, so the library did not support it either. But the current version of Open vSwitch targets Linux 2.6.18 and over, so it's fine to add this support now, and this commit does so. This will be used more extensively in upcoming commits. Reviewed by Justin Pettit.
Diffstat (limited to 'lib/netlink-protocol.h')
-rw-r--r--lib/netlink-protocol.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/netlink-protocol.h b/lib/netlink-protocol.h
index 6281fb2c..1b5fa715 100644
--- a/lib/netlink-protocol.h
+++ b/lib/netlink-protocol.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2010, 2011 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -86,10 +86,6 @@ struct nlmsgerr
};
BUILD_ASSERT_DECL(sizeof(struct nlmsgerr) == 20);
-#define NETLINK_ADD_MEMBERSHIP 1
-#define NETLINK_DROP_MEMBERSHIP 2
-#define NETLINK_PKTINFO 3
-
struct genlmsghdr {
uint8_t cmd;
uint8_t version;
@@ -157,4 +153,11 @@ enum {
#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
#endif
+/* These were introduced all together in 2.6.14. (We want our programs to
+ * support the newer kernel features even if compiled with older headers.) */
+#ifndef NETLINK_ADD_MEMBERSHIP
+#define NETLINK_ADD_MEMBERSHIP 1
+#define NETLINK_DROP_MEMBERSHIP 2
+#endif
+
#endif /* netlink-protocol.h */