mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
[NET] rules: Unified rules dumping
Implements a unified, protocol independant rules dumping function which is capable of both, dumping a specific protocol family or all of them. This speeds up dumping as less lookups are required. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
687ad8cc64
commit
c454673da7
6 changed files with 45 additions and 34 deletions
|
@ -15,4 +15,12 @@ extern int rtnl_unregister(int protocol, int msgtype);
|
|||
extern void rtnl_unregister_all(int protocol);
|
||||
extern int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb);
|
||||
|
||||
static inline int rtnl_msg_family(struct nlmsghdr *nlh)
|
||||
{
|
||||
if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg))
|
||||
return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family;
|
||||
else
|
||||
return AF_UNSPEC;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue