diff options
Diffstat (limited to 'include/linux/rtnetlink.h')
-rw-r--r-- | include/linux/rtnetlink.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index d50482ba27fe..df0cdd41085c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -199,6 +199,7 @@ enum | |||
199 | #define RTPROT_BIRD 12 /* BIRD */ | 199 | #define RTPROT_BIRD 12 /* BIRD */ |
200 | #define RTPROT_DNROUTED 13 /* DECnet routing daemon */ | 200 | #define RTPROT_DNROUTED 13 /* DECnet routing daemon */ |
201 | #define RTPROT_XORP 14 /* XORP */ | 201 | #define RTPROT_XORP 14 /* XORP */ |
202 | #define RTPROT_NTK 15 /* Netsukuku */ | ||
202 | 203 | ||
203 | /* rtm_scope | 204 | /* rtm_scope |
204 | 205 | ||
@@ -733,6 +734,8 @@ enum | |||
733 | #define IFLA_MAP IFLA_MAP | 734 | #define IFLA_MAP IFLA_MAP |
734 | IFLA_WEIGHT, | 735 | IFLA_WEIGHT, |
735 | #define IFLA_WEIGHT IFLA_WEIGHT | 736 | #define IFLA_WEIGHT IFLA_WEIGHT |
737 | IFLA_OPERSTATE, | ||
738 | IFLA_LINKMODE, | ||
736 | __IFLA_MAX | 739 | __IFLA_MAX |
737 | }; | 740 | }; |
738 | 741 | ||
@@ -836,6 +839,7 @@ enum | |||
836 | #define RTMGRP_IPV4_IFADDR 0x10 | 839 | #define RTMGRP_IPV4_IFADDR 0x10 |
837 | #define RTMGRP_IPV4_MROUTE 0x20 | 840 | #define RTMGRP_IPV4_MROUTE 0x20 |
838 | #define RTMGRP_IPV4_ROUTE 0x40 | 841 | #define RTMGRP_IPV4_ROUTE 0x40 |
842 | #define RTMGRP_IPV4_RULE 0x80 | ||
839 | 843 | ||
840 | #define RTMGRP_IPV6_IFADDR 0x100 | 844 | #define RTMGRP_IPV6_IFADDR 0x100 |
841 | #define RTMGRP_IPV6_MROUTE 0x200 | 845 | #define RTMGRP_IPV6_MROUTE 0x200 |
@@ -866,7 +870,8 @@ enum rtnetlink_groups { | |||
866 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE | 870 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE |
867 | RTNLGRP_IPV4_ROUTE, | 871 | RTNLGRP_IPV4_ROUTE, |
868 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE | 872 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE |
869 | RTNLGRP_NOP1, | 873 | RTNLGRP_IPV4_RULE, |
874 | #define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE | ||
870 | RTNLGRP_IPV6_IFADDR, | 875 | RTNLGRP_IPV6_IFADDR, |
871 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR | 876 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR |
872 | RTNLGRP_IPV6_MROUTE, | 877 | RTNLGRP_IPV6_MROUTE, |
@@ -905,6 +910,7 @@ struct tcamsg | |||
905 | #ifdef __KERNEL__ | 910 | #ifdef __KERNEL__ |
906 | 911 | ||
907 | #include <linux/config.h> | 912 | #include <linux/config.h> |
913 | #include <linux/mutex.h> | ||
908 | 914 | ||
909 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); | 915 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); |
910 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) | 916 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) |
@@ -1036,24 +1042,17 @@ __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) | |||
1036 | 1042 | ||
1037 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); | 1043 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); |
1038 | 1044 | ||
1039 | extern struct semaphore rtnl_sem; | 1045 | /* RTNL is used as a global lock for all changes to network configuration */ |
1040 | |||
1041 | #define rtnl_shlock() down(&rtnl_sem) | ||
1042 | #define rtnl_shlock_nowait() down_trylock(&rtnl_sem) | ||
1043 | |||
1044 | #define rtnl_shunlock() do { up(&rtnl_sem); \ | ||
1045 | if (rtnl && rtnl->sk_receive_queue.qlen) \ | ||
1046 | rtnl->sk_data_ready(rtnl, 0); \ | ||
1047 | } while(0) | ||
1048 | |||
1049 | extern void rtnl_lock(void); | 1046 | extern void rtnl_lock(void); |
1050 | extern int rtnl_lock_interruptible(void); | ||
1051 | extern void rtnl_unlock(void); | 1047 | extern void rtnl_unlock(void); |
1048 | extern int rtnl_trylock(void); | ||
1049 | |||
1052 | extern void rtnetlink_init(void); | 1050 | extern void rtnetlink_init(void); |
1051 | extern void __rtnl_unlock(void); | ||
1053 | 1052 | ||
1054 | #define ASSERT_RTNL() do { \ | 1053 | #define ASSERT_RTNL() do { \ |
1055 | if (unlikely(down_trylock(&rtnl_sem) == 0)) { \ | 1054 | if (unlikely(rtnl_trylock())) { \ |
1056 | up(&rtnl_sem); \ | 1055 | rtnl_unlock(); \ |
1057 | printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ | 1056 | printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ |
1058 | __FILE__, __LINE__); \ | 1057 | __FILE__, __LINE__); \ |
1059 | dump_stack(); \ | 1058 | dump_stack(); \ |