[IPV6] NDISC: Add proxy_ndp sysctl.
[hh.org.git] / net / netlabel / netlabel_mgmt.h
blobfd6c6acbfa08d58b89dd34b2ec6acc8fa6524ca1
1 /*
2 * NetLabel Management Support
4 * This file defines the management functions for the NetLabel system. The
5 * NetLabel system manages static and dynamic label mappings for network
6 * protocols such as CIPSO and RIPSO.
8 * Author: Paul Moore <paul.moore@hp.com>
13 * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
23 * the GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #ifndef _NETLABEL_MGMT_H
32 #define _NETLABEL_MGMT_H
34 #include <net/netlabel.h>
37 * The following NetLabel payloads are supported by the management interface,
38 * all of which are preceeded by the nlmsghdr struct.
40 * o ACK:
41 * Sent by the kernel in response to an applications message, applications
42 * should never send this message.
44 * +----------------------+-----------------------+
45 * | seq number (32 bits) | return code (32 bits) |
46 * +----------------------+-----------------------+
48 * seq number: the sequence number of the original message, taken from the
49 * nlmsghdr structure
50 * return code: return value, based on errno values
52 * o ADD:
53 * Sent by an application to add a domain mapping to the NetLabel system.
54 * The kernel should respond with an ACK.
56 * +-------------------+
57 * | domains (32 bits) | ...
58 * +-------------------+
60 * domains: the number of domains in the message
62 * +--------------------------+-------------------------+
63 * | domain string (variable) | protocol type (32 bits) | ...
64 * +--------------------------+-------------------------+
66 * +-------------- ---- --- -- -
67 * | mapping data ... repeated
68 * +-------------- ---- --- -- -
70 * domain string: the domain string, NULL terminated
71 * protocol type: the protocol type (defined by NETLBL_NLTYPE_*)
72 * mapping data: specific to the map type (see below)
74 * NETLBL_NLTYPE_UNLABELED
76 * No mapping data for this protocol type.
78 * NETLBL_NLTYPE_CIPSOV4
80 * +---------------+
81 * | doi (32 bits) |
82 * +---------------+
84 * doi: the CIPSO DOI value
86 * o REMOVE:
87 * Sent by an application to remove a domain mapping from the NetLabel
88 * system. The kernel should ACK this message.
90 * +-------------------+
91 * | domains (32 bits) | ...
92 * +-------------------+
94 * domains: the number of domains in the message
96 * +--------------------------+
97 * | domain string (variable) | ...
98 * +--------------------------+
100 * domain string: the domain string, NULL terminated
102 * o LIST:
103 * This message can be sent either from an application or by the kernel in
104 * response to an application generated LIST message. When sent by an
105 * application there is no payload. The kernel should respond to a LIST
106 * message either with a LIST message on success or an ACK message on
107 * failure.
109 * +-------------------+
110 * | domains (32 bits) | ...
111 * +-------------------+
113 * domains: the number of domains in the message
115 * +--------------------------+
116 * | domain string (variable) | ...
117 * +--------------------------+
119 * +-------------------------+-------------- ---- --- -- -
120 * | protocol type (32 bits) | mapping data ... repeated
121 * +-------------------------+-------------- ---- --- -- -
123 * domain string: the domain string, NULL terminated
124 * protocol type: the protocol type (defined by NETLBL_NLTYPE_*)
125 * mapping data: specific to the map type (see below)
127 * NETLBL_NLTYPE_UNLABELED
129 * No mapping data for this protocol type.
131 * NETLBL_NLTYPE_CIPSOV4
133 * +----------------+---------------+
134 * | type (32 bits) | doi (32 bits) |
135 * +----------------+---------------+
137 * type: the CIPSO mapping table type (defined in the cipso_ipv4.h header
138 * as CIPSO_V4_MAP_*)
139 * doi: the CIPSO DOI value
141 * o ADDDEF:
142 * Sent by an application to set the default domain mapping for the NetLabel
143 * system. The kernel should respond with an ACK.
145 * +-------------------------+-------------- ---- --- -- -
146 * | protocol type (32 bits) | mapping data ... repeated
147 * +-------------------------+-------------- ---- --- -- -
149 * protocol type: the protocol type (defined by NETLBL_NLTYPE_*)
150 * mapping data: specific to the map type (see below)
152 * NETLBL_NLTYPE_UNLABELED
154 * No mapping data for this protocol type.
156 * NETLBL_NLTYPE_CIPSOV4
158 * +---------------+
159 * | doi (32 bits) |
160 * +---------------+
162 * doi: the CIPSO DOI value
164 * o REMOVEDEF:
165 * Sent by an application to remove the default domain mapping from the
166 * NetLabel system, there is no payload. The kernel should ACK this message.
168 * o LISTDEF:
169 * This message can be sent either from an application or by the kernel in
170 * response to an application generated LISTDEF message. When sent by an
171 * application there is no payload. The kernel should respond to a
172 * LISTDEF message either with a LISTDEF message on success or an ACK message
173 * on failure.
175 * +-------------------------+-------------- ---- --- -- -
176 * | protocol type (32 bits) | mapping data ... repeated
177 * +-------------------------+-------------- ---- --- -- -
179 * protocol type: the protocol type (defined by NETLBL_NLTYPE_*)
180 * mapping data: specific to the map type (see below)
182 * NETLBL_NLTYPE_UNLABELED
184 * No mapping data for this protocol type.
186 * NETLBL_NLTYPE_CIPSOV4
188 * +----------------+---------------+
189 * | type (32 bits) | doi (32 bits) |
190 * +----------------+---------------+
192 * type: the CIPSO mapping table type (defined in the cipso_ipv4.h header
193 * as CIPSO_V4_MAP_*)
194 * doi: the CIPSO DOI value
196 * o MODULES:
197 * Sent by an application to request a list of configured NetLabel modules
198 * in the kernel. When sent by an application there is no payload.
200 * +-------------------+
201 * | modules (32 bits) | ...
202 * +-------------------+
204 * modules: the number of modules in the message, if this is an application
205 * generated message and the value is zero then return a list of
206 * the configured modules
208 * +------------------+
209 * | module (32 bits) | ... repeated
210 * +------------------+
212 * module: the module number as defined by NETLBL_NLTYPE_*
214 * o VERSION:
215 * Sent by an application to request the NetLabel version string. When sent
216 * by an application there is no payload. This message type is also used by
217 * the kernel to respond to an VERSION request.
219 * +-------------------+
220 * | version (32 bits) |
221 * +-------------------+
223 * version: the protocol version number
227 /* NetLabel Management commands */
228 enum {
229 NLBL_MGMT_C_UNSPEC,
230 NLBL_MGMT_C_ACK,
231 NLBL_MGMT_C_ADD,
232 NLBL_MGMT_C_REMOVE,
233 NLBL_MGMT_C_LIST,
234 NLBL_MGMT_C_ADDDEF,
235 NLBL_MGMT_C_REMOVEDEF,
236 NLBL_MGMT_C_LISTDEF,
237 NLBL_MGMT_C_MODULES,
238 NLBL_MGMT_C_VERSION,
239 __NLBL_MGMT_C_MAX,
241 #define NLBL_MGMT_C_MAX (__NLBL_MGMT_C_MAX - 1)
243 /* NetLabel protocol functions */
244 int netlbl_mgmt_genl_init(void);
246 #endif