diff options
author | Cong Wang <amwang@redhat.com> | 2012-12-06 19:04:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-07 14:32:52 -0500 |
commit | ee07c6e7a6f8a25c18f0a6b18152fbd7499245f6 (patch) | |
tree | 055d61934deeedf93eefbde3106f6a751c35d932 /include | |
parent | 5d248c491b38d4f1b2a0bd7721241d68cd0b3067 (diff) |
bridge: export multicast database via netlink
V5: fix two bugs pointed out by Thomas
remove seq check for now, mark it as TODO
V4: remove some useless #include
some coding style fix
V3: drop debugging printk's
update selinux perm table as well
V2: drop patch 1/2, export ifindex directly
Redesign netlink attributes
Improve netlink seq check
Handle IPv6 addr as well
This patch exports bridge multicast database via netlink
message type RTM_GETMDB. Similar to fdb, but currently bridge-specific.
We may need to support modify multicast database too (RTM_{ADD,DEL}MDB).
(Thanks to Thomas for patient reviews)
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Graf <tgraf@suug.ch>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/if_bridge.h | 55 | ||||
-rw-r--r-- | include/uapi/linux/rtnetlink.h | 3 |
2 files changed, 58 insertions, 0 deletions
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h index b3885791e11e..9a0f6ff0d7e7 100644 --- a/include/uapi/linux/if_bridge.h +++ b/include/uapi/linux/if_bridge.h | |||
@@ -116,4 +116,59 @@ enum { | |||
116 | __IFLA_BRIDGE_MAX, | 116 | __IFLA_BRIDGE_MAX, |
117 | }; | 117 | }; |
118 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) | 118 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) |
119 | |||
120 | /* Bridge multicast database attributes | ||
121 | * [MDBA_MDB] = { | ||
122 | * [MDBA_MDB_ENTRY] = { | ||
123 | * [MDBA_MDB_ENTRY_INFO] | ||
124 | * } | ||
125 | * } | ||
126 | * [MDBA_ROUTER] = { | ||
127 | * [MDBA_ROUTER_PORT] | ||
128 | * } | ||
129 | */ | ||
130 | enum { | ||
131 | MDBA_UNSPEC, | ||
132 | MDBA_MDB, | ||
133 | MDBA_ROUTER, | ||
134 | __MDBA_MAX, | ||
135 | }; | ||
136 | #define MDBA_MAX (__MDBA_MAX - 1) | ||
137 | |||
138 | enum { | ||
139 | MDBA_MDB_UNSPEC, | ||
140 | MDBA_MDB_ENTRY, | ||
141 | __MDBA_MDB_MAX, | ||
142 | }; | ||
143 | #define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1) | ||
144 | |||
145 | enum { | ||
146 | MDBA_MDB_ENTRY_UNSPEC, | ||
147 | MDBA_MDB_ENTRY_INFO, | ||
148 | __MDBA_MDB_ENTRY_MAX, | ||
149 | }; | ||
150 | #define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1) | ||
151 | |||
152 | enum { | ||
153 | MDBA_ROUTER_UNSPEC, | ||
154 | MDBA_ROUTER_PORT, | ||
155 | __MDBA_ROUTER_MAX, | ||
156 | }; | ||
157 | #define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1) | ||
158 | |||
159 | struct br_port_msg { | ||
160 | __u32 ifindex; | ||
161 | }; | ||
162 | |||
163 | struct br_mdb_entry { | ||
164 | __u32 ifindex; | ||
165 | struct { | ||
166 | union { | ||
167 | __be32 ip4; | ||
168 | struct in6_addr ip6; | ||
169 | } u; | ||
170 | __be16 proto; | ||
171 | } addr; | ||
172 | }; | ||
173 | |||
119 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ | 174 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ |
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index 33d29cea37ea..354a1e7d32a3 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h | |||
@@ -125,6 +125,9 @@ enum { | |||
125 | RTM_GETNETCONF = 82, | 125 | RTM_GETNETCONF = 82, |
126 | #define RTM_GETNETCONF RTM_GETNETCONF | 126 | #define RTM_GETNETCONF RTM_GETNETCONF |
127 | 127 | ||
128 | RTM_GETMDB = 86, | ||
129 | #define RTM_GETMDB RTM_GETMDB | ||
130 | |||
128 | __RTM_MAX, | 131 | __RTM_MAX, |
129 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 132 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
130 | }; | 133 | }; |