1 /* Copyright (C) 2007 Board of Trustees, Leland Stanford Jr. University.
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:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
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
22 #ifndef OPENFLOW_NETLINK_H
23 #define OPENFLOW_NETLINK_H 1
25 #include <linux/netlink.h>
27 #define DP_GENL_FAMILY_NAME "OpenFlow"
29 /* Attributes that can be attached to the datapath's netlink messages. */
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. */
38 DP_GENL_A_DP_INFO, /* OpenFlow datapath information */
40 DP_GENL_A_FLOW, /* OpenFlow flow entry */
41 DP_GENL_A_NUMFLOWS, /* Number of flows */
42 DP_GENL_A_TABLEIDX, /* Flow table index */
44 DP_GENL_A_TABLE, /* OpenFlow table entry */
45 DP_GENL_A_NUMTABLES, /* Number of tables in a table query */
47 DP_GENL_A_NPACKETS, /* Number of packets to send up netlink */
48 DP_GENL_A_PSIZE, /* Size of packets to send up netlink */
51 DP_GENL_A_MAX = __DP_GENL_A_MAX - 1
54 /* Commands that can be executed on the datapath's netlink interface. */
55 enum dp_genl_command {
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. */
65 DP_GENL_C_QUERY_FLOW, /* Request flow entries. */
66 DP_GENL_C_QUERY_TABLE, /* Request table entries. */
68 DP_GENL_C_BENCHMARK_NL, /* Benchmark netlink connection */
71 DP_GENL_C_MAX = __DP_GENL_C_MAX - 1
80 TBL_MAX = __TBL_MAX - 1
83 #endif /* openflow_netlink_h */