Global replace of Nicira Networks.
[sliver-openvswitch.git] / include / openvswitch / brcompat-netlink.h
1 /*
2  * Copyright (c) 2008, 2009, 2011 Nicira, Inc.
3  *
4  * This file is offered under your choice of two licenses: Apache 2.0 or GNU
5  * GPL 2.0 or later.  The permission statements for each of these licenses is
6  * given below.  You may license your modifications to this file under either
7  * of these licenses or both.  If you wish to license your modifications under
8  * only one of these licenses, delete the permission text for the other
9  * license.
10  *
11  * ----------------------------------------------------------------------
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at:
15  *
16  *     http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  * ----------------------------------------------------------------------
24  * This program is free software; you can redistribute it and/or modify
25  * it under the terms of the GNU General Public License as published by
26  * the Free Software Foundation; either version 2 of the License, or
27  * (at your option) any later version.
28  *
29  * This program is distributed in the hope that it will be useful,
30  * but WITHOUT ANY WARRANTY; without even the implied warranty of
31  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32  * GNU General Public License for more details.
33  *
34  * You should have received a copy of the GNU General Public License along
35  * with this program; if not, write to the Free Software Foundation, Inc.,
36  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
37  * ----------------------------------------------------------------------
38  */
39
40 #ifndef OPENVSWITCH_BRCOMPAT_NETLINK_H
41 #define OPENVSWITCH_BRCOMPAT_NETLINK_H 1
42
43 #define BRC_GENL_FAMILY_NAME "brcompat"
44
45 /* Attributes that can be attached to the datapath's netlink messages. */
46 enum {
47         BRC_GENL_A_UNSPEC,
48
49         /*
50          * "K:" attributes appear in messages from the kernel to userspace.
51          * "U:" attributes appear in messages from userspace to the kernel.
52          */
53
54         /* BRC_GENL_C_DP_ADD, BRC_GENL_C_DP_DEL. */
55         BRC_GENL_A_DP_NAME,             /* K: Datapath name. */
56
57         /* BRC_GENL_C_DP_ADD, BRC_GENL_C_DP_DEL,
58            BRC_GENL_C_PORT_ADD, BRC_GENL_C_PORT_DEL. */
59         BRC_GENL_A_PORT_NAME,   /* K: Interface name. */
60
61         /* BRC_GENL_C_DP_RESULT. */
62         BRC_GENL_A_ERR_CODE,    /* U: Positive error code. */
63
64         /* BRC_GENL_C_QUERY_MC. */
65         BRC_GENL_A_MC_GROUP,    /* K: Generic netlink multicast group. */
66
67         /* BRC_GENL_C_FDB_QUERY. */
68         BRC_GENL_A_FDB_COUNT,   /* K: Number of FDB entries to read. */
69         BRC_GENL_A_FDB_SKIP,    /* K: Record offset into FDB to start reading. */
70
71         /* BRC_GENL_C_DP_RESULT. */
72         BRC_GENL_A_FDB_DATA,    /* U: FDB records. */
73         BRC_GENL_A_IFINDEXES,   /* U: "int" ifindexes of bridges or ports. */
74
75         __BRC_GENL_A_MAX,
76         BRC_GENL_A_MAX = __BRC_GENL_A_MAX - 1
77 };
78
79 /* Commands that can be executed on the datapath's netlink interface. */
80 enum brc_genl_command {
81         BRC_GENL_C_UNSPEC,
82
83         /*
84          * "K:" messages are sent by the kernel to userspace.
85          * "U:" messages are sent by userspace to the kernel.
86          */
87         BRC_GENL_C_DP_ADD,              /* K: Datapath created. */
88         BRC_GENL_C_DP_DEL,              /* K: Datapath destroyed. */
89         BRC_GENL_C_DP_RESULT,   /* U: Return code from ovs-brcompatd. */
90         BRC_GENL_C_PORT_ADD,    /* K: Port added to datapath. */
91         BRC_GENL_C_PORT_DEL,    /* K: Port removed from datapath. */
92         BRC_GENL_C_QUERY_MC,    /* U: Get multicast group for brcompat. */
93         BRC_GENL_C_FDB_QUERY,   /* K: Read records from forwarding database. */
94         BRC_GENL_C_GET_BRIDGES, /* K: Get ifindexes of all bridges. */
95         BRC_GENL_C_GET_PORTS,   /* K: Get ifindexes of all ports on a bridge. */
96
97         __BRC_GENL_C_MAX,
98         BRC_GENL_C_MAX = __BRC_GENL_C_MAX - 1
99 };
100 #endif /* openvswitch/brcompat-netlink.h */