Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.
[cascardo/ovs.git] / include / openvswitch / brcompat-netlink.h
1 /*
2  * Copyright (c) 2008, 2009 Nicira Networks.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16
17 #ifndef OPENVSWITCH_BRCOMPAT_NETLINK_H
18 #define OPENVSWITCH_BRCOMPAT_NETLINK_H 1
19
20 #define BRC_GENL_FAMILY_NAME "brcompat"
21
22 /* Attributes that can be attached to the datapath's netlink messages. */
23 enum {
24         BRC_GENL_A_UNSPEC,
25         BRC_GENL_A_DP_NAME,         /* Datapath name. */
26         BRC_GENL_A_PORT_NAME,   /* Interface name. */
27         BRC_GENL_A_ERR_CODE,    /* Positive error code. */
28         BRC_GENL_A_MC_GROUP,    /* Generic netlink multicast group. */
29         BRC_GENL_A_PROC_DIR,    /* Name of subdirectory in /proc. */
30         BRC_GENL_A_PROC_NAME,   /* Name of file in /proc. */
31         BRC_GENL_A_PROC_DATA,   /* Contents of file in /proc. */
32
33         __BRC_GENL_A_MAX,
34         BRC_GENL_A_MAX = __BRC_GENL_A_MAX - 1
35 };
36
37 /* Commands that can be executed on the datapath's netlink interface. */
38 enum brc_genl_command {
39         BRC_GENL_C_UNSPEC,
40
41         /*
42          * "K:" messages are sent by the kernel to userspace.
43          * "U:" messages are sent by userspace to the kernel.
44          */
45         BRC_GENL_C_DP_ADD,      /* K: Datapath created. */
46         BRC_GENL_C_DP_DEL,      /* K: Datapath destroyed. */
47         BRC_GENL_C_DP_RESULT,   /* U: Return code from ovs-brcompatd. */
48         BRC_GENL_C_PORT_ADD,    /* K: Port added to datapath. */
49         BRC_GENL_C_PORT_DEL,    /* K: Port removed from datapath. */
50         BRC_GENL_C_QUERY_MC,    /* U: Get multicast group for brcompat. */
51         BRC_GENL_C_SET_PROC,    /* U: Set contents of file in /proc. */
52
53         __BRC_GENL_C_MAX,
54         BRC_GENL_C_MAX = __BRC_GENL_C_MAX - 1
55 };
56 #endif /* openvswitch/brcompat-netlink.h */