On Fri, Jul 11, 2014 at 12:59:55AM +0000, Alin Serdean wrote:
> 
> Add NETLINK defines for MSVC compiling
> 
> Signed-off-by: Alin Gabriel Serdean <aserd...@cloudbasesolutions.com>
> ---
>  lib/netlink.h | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/lib/netlink.h b/lib/netlink.h
> index f9234da..c46a5d0 100644
> --- a/lib/netlink.h
> +++ b/lib/netlink.h
> @@ -214,4 +214,36 @@ const struct nlattr *nl_attr_find_nested(const struct 
> nlattr *, uint16_t type);
>  const struct nlattr *nl_attr_find__(const struct nlattr *attrs, size_t size,
>                                      uint16_t type);
>  
> +#ifdef _WIN32
> +#define NLM_F_CREATE    0x400   /* Create, if it does not exist */
> +#define NLM_F_EXCL      0x200    /* Do not touch, if it exists    */
>
> +#define NETLINK_ROUTE           0       /* Routing/device hook          */
> +#define NETLINK_UNUSED          1       /* Unused number                */
> +#define NETLINK_USERSOCK        2       /* Reserved for user            */
> +                                        /* mode socket protocols        */
> +#define NETLINK_FIREWALL        3       /* Firewalling hook             */
> +#define NETLINK_INET_DIAG       4       /* INET socket monitoring       */
> +#define NETLINK_NFLOG           5       /* netfilter/iptables ULOG      */
> +#define NETLINK_XFRM            6       /* ipsec                        */
> +#define NETLINK_SELINUX         7       /* SELinux event notifications  */
> +#define NETLINK_ISCSI           8       /* Open-iSCSI                   */
> +#define NETLINK_AUDIT           9       /* auditing                     */
> +#define NETLINK_FIB_LOOKUP      10
> +#define NETLINK_CONNECTOR       11
> +#define NETLINK_NETFILTER       12      /* netfilter subsystem          */
> +#define NETLINK_IP6_FW          13
> +#define NETLINK_DNRTMSG         14      /* DECnet routing messages      */
> +#define NETLINK_KOBJECT_UEVENT  15      /* Kernel messages to userspace */
> +#define NETLINK_GENERIC         16
> +
> +/* leave room for NETLINK_DM (DM Events) */
> +#define NETLINK_SCSITRANSPORT   18      /* SCSI Transports              */
> +#define NETLINK_ECRYPTFS        19
> +#define NETLINK_RDMA            20
> +
> +#define MAX_LINKS 32

These definitions should go in netlink-protocol.h with the existing
similar definitions.  The NLM_F_ constants make perfect sense there.
I am not sure about the NETLINK_ constants though; are you actually
using any of them other than NETLINK_GENERIC (which is already defined
there)?

I would remove MAX_LINKS.  It is not good for anything as far as I
know.

I would remove the comments.  The names and values of the constants
are facts and therefore not copyrightable (as far as I know), but the
comments have creative elements that make me think twice about copying
without adding a GPL notice to netlink-protocol.h.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to