X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=lib%2Fnetlink-protocol.h;h=893805576d63e404eb8e7f8487f701abb055562c;hb=e6d9ab56ee1f417e8823a6405d5a085c70fe8982;hp=64f773e5a171d893fb73132714e9e1bcf55e5a5c;hpb=b0025c8389f6b8d0087df3468c14072a9935eb61;p=cascardo%2Fovs.git diff --git a/lib/netlink-protocol.h b/lib/netlink-protocol.h index 64f773e5a..893805576 100644 --- a/lib/netlink-protocol.h +++ b/lib/netlink-protocol.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, 2011 Nicira Networks. + * Copyright (c) 2008, 2010, 2011, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,35 +37,9 @@ #include #include -/* Some Xenddks have an outdated genetlink header file which doesn't have some - * symbols it should. */ -#ifndef CTRL_ATTR_MCAST_GRP_MAX - -#undef CTRL_ATTR_MAX -#define CTRL_ATTR_MAX 7 -#define CTRL_ATTR_MCAST_GROUPS 7 - -enum { - CTRL_ATTR_MCAST_GRP_UNSPEC, - CTRL_ATTR_MCAST_GRP_NAME, - CTRL_ATTR_MCAST_GRP_ID, - __CTRL_ATTR_MCAST_GRP_MAX, -}; - -#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1) -#endif /* CTRL_ATTR_MCAST_GRP_MAX */ - #else #define NETLINK_GENERIC 16 -struct sockaddr_nl { - sa_family_t nl_family; - unsigned short int nl_pad; - uint32_t nl_pid; - uint32_t nl_groups; -}; -BUILD_ASSERT_DECL(sizeof(struct sockaddr_nl) == 12); - /* nlmsg_flags bits. */ #define NLM_F_REQUEST 0x001 #define NLM_F_MULTI 0x002 @@ -74,7 +48,9 @@ BUILD_ASSERT_DECL(sizeof(struct sockaddr_nl) == 12); #define NLM_F_ROOT 0x100 #define NLM_F_MATCH 0x200 +#define NLM_F_EXCL 0x200 #define NLM_F_ATOMIC 0x400 +#define NLM_F_CREATE 0x400 #define NLM_F_DUMP (NLM_F_ROOT | NLM_F_MATCH) /* nlmsg_type values. */ @@ -85,6 +61,8 @@ BUILD_ASSERT_DECL(sizeof(struct sockaddr_nl) == 12); #define NLMSG_MIN_TYPE 0x10 +#define MAX_LINKS 32 + struct nlmsghdr { uint32_t nlmsg_len; uint16_t nlmsg_type; @@ -167,9 +145,9 @@ enum { /* These were introduced all together in 2.6.24. */ #ifndef NLA_TYPE_MASK -#define NLA_F_NESTED (1 << 15) -#define NLA_F_NET_BYTEORDER (1 << 14) -#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER) +#define NLA_F_NESTED (1 << 15) +#define NLA_F_NET_BYTEORDER (1 << 14) +#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 @@ -179,4 +157,22 @@ enum { #define NETLINK_DROP_MEMBERSHIP 2 #endif +/* These were introduced all together in 2.6.23. (We want our programs to + * support the newer kernel features even if compiled with older headers.) */ +#ifndef CTRL_ATTR_MCAST_GRP_MAX + +#undef CTRL_ATTR_MAX +#define CTRL_ATTR_MAX 7 +#define CTRL_ATTR_MCAST_GROUPS 7 + +enum { + CTRL_ATTR_MCAST_GRP_UNSPEC, + CTRL_ATTR_MCAST_GRP_NAME, + CTRL_ATTR_MCAST_GRP_ID, + __CTRL_ATTR_MCAST_GRP_MAX, +}; + +#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1) +#endif /* CTRL_ATTR_MCAST_GRP_MAX */ + #endif /* netlink-protocol.h */