History

net: ipmr: add getlink support

Currently there's no way to dump the VIF table for an ipmr table other than the default (via proc). This is a major issue when debugging ipmr issues and in general it is good to know which interfaces are configured. This patch adds support for RTM_GETLINK for the ipmr family so we can dump the VIF table and the ipmr table's current config for each table. We're protected by rtnl so no need to acquire RCU or mrt_lock.

Nikolay Aleksandrov committed 9 years ago

Commit 772c3441 parent cb7f8fc2 files · +168 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/mroute.h+42−0
@@ -110,6 +110,48 @@ struct igmpmsg { · 109 unmodified lines
110 struct in_addr im_src,im_dst;110 struct in_addr im_src,im_dst;
111};111};
112 112
113/* ipmr netlink table attributes */
114enum {
115 IPMRA_TABLE_UNSPEC,
116 IPMRA_TABLE_ID,
117 IPMRA_TABLE_CACHE_RES_QUEUE_LEN,
118 IPMRA_TABLE_MROUTE_REG_VIF_NUM,
119 IPMRA_TABLE_MROUTE_DO_ASSERT,
120 IPMRA_TABLE_MROUTE_DO_PIM,
121 IPMRA_TABLE_VIFS,
122 __IPMRA_TABLE_MAX
123};
124#define IPMRA_TABLE_MAX (__IPMRA_TABLE_MAX - 1)
125
126/* ipmr netlink vif attribute format
127 * [ IPMRA_TABLE_VIFS ] - nested attribute
128 * [ IPMRA_VIF ] - nested attribute
129 * [ IPMRA_VIFA_xxx ]
130 */
131enum {
132 IPMRA_VIF_UNSPEC,
133 IPMRA_VIF,
134 __IPMRA_VIF_MAX
135};
136#define IPMRA_VIF_MAX (__IPMRA_VIF_MAX - 1)
137
138/* vif-specific attributes */
139enum {
140 IPMRA_VIFA_UNSPEC,
141 IPMRA_VIFA_IFINDEX,
142 IPMRA_VIFA_VIF_ID,
143 IPMRA_VIFA_FLAGS,
144 IPMRA_VIFA_BYTES_IN,
145 IPMRA_VIFA_BYTES_OUT,
146 IPMRA_VIFA_PACKETS_IN,
147 IPMRA_VIFA_PACKETS_OUT,
148 IPMRA_VIFA_LOCAL_ADDR,
149 IPMRA_VIFA_REMOTE_ADDR,
150 IPMRA_VIFA_PAD,
151 __IPMRA_VIFA_MAX
152};
153#define IPMRA_VIFA_MAX (__IPMRA_VIFA_MAX - 1)
154
113/* That's all usermode folks */155/* That's all usermode folks */
114 156
115#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */157#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */