Initial import
[sliver-openvswitch.git] / include / openflow-netlink.h
1 /* Copyright (C) 2007 Board of Trustees, Leland Stanford Jr. University.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to
5  * deal in the Software without restriction, including without limitation the
6  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7  * sell copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19  * IN THE SOFTWARE.
20  */
21
22 #ifndef OPENFLOW_NETLINK_H
23 #define OPENFLOW_NETLINK_H 1
24
25 #include <linux/netlink.h>
26
27 #define DP_GENL_FAMILY_NAME "OpenFlow"
28
29 /* Attributes that can be attached to the datapath's netlink messages. */
30 enum {
31         DP_GENL_A_UNSPEC,
32     DP_GENL_A_OFPHEADER, /* OFP header information */
33         DP_GENL_A_DP_IDX,        /* Datapath Ethernet device name. */
34         DP_GENL_A_PORTNAME,      /* Device name for datapath port. */
35         DP_GENL_A_MC_GROUP,      /* Generic netlink multicast group. */
36         DP_GENL_A_OPENFLOW,  /* OpenFlow packet. */
37
38     DP_GENL_A_DP_INFO,   /* OpenFlow datapath information */
39
40     DP_GENL_A_FLOW,      /* OpenFlow flow entry */
41     DP_GENL_A_NUMFLOWS,  /* Number of flows  */
42     DP_GENL_A_TABLEIDX,  /* Flow table index */
43
44     DP_GENL_A_TABLE,     /* OpenFlow table entry */
45     DP_GENL_A_NUMTABLES, /* Number of tables in a table query */
46
47     DP_GENL_A_NPACKETS,  /* Number of packets to send up netlink */
48     DP_GENL_A_PSIZE,     /* Size of packets to send up netlink */
49
50         __DP_GENL_A_MAX,
51         DP_GENL_A_MAX = __DP_GENL_A_MAX - 1
52 };
53
54 /* Commands that can be executed on the datapath's netlink interface. */
55 enum dp_genl_command {
56         DP_GENL_C_UNSPEC,
57         DP_GENL_C_ADD_DP,        /* Create datapath. */
58         DP_GENL_C_DEL_DP,        /* Destroy datapath. */
59         DP_GENL_C_QUERY_DP,      /* Get multicast group for datapath. */
60         DP_GENL_C_SHOW_DP,       /* Show information about datapath. */
61         DP_GENL_C_ADD_PORT,      /* Add port to datapath. */
62         DP_GENL_C_DEL_PORT,      /* Remove port from datapath. */
63         DP_GENL_C_OPENFLOW,  /* Encapsulated OpenFlow protocol. */
64
65     DP_GENL_C_QUERY_FLOW,  /* Request flow entries. */
66     DP_GENL_C_QUERY_TABLE, /* Request table entries. */
67
68     DP_GENL_C_BENCHMARK_NL, /* Benchmark netlink connection */
69
70         __DP_GENL_C_MAX,
71         DP_GENL_C_MAX = __DP_GENL_C_MAX - 1
72 };
73
74 /* Table */
75 enum {
76     TBL_MACONLY,
77     TBL_HASH,
78     TBL_LINEAR,
79      __TBL_MAX,
80      TBL_MAX = __TBL_MAX - 1
81 };
82
83 #endif /* openflow_netlink_h */