1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * NetLabel CIPSO/IPv4 Support
5 * This file defines the CIPSO/IPv4 functions for the NetLabel system. The
6 * NetLabel system manages static and dynamic label mappings for network
7 * protocols such as CIPSO and RIPSO.
9 * Author: Paul Moore <paul@paul-moore.com>
13 * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
16 #ifndef _NETLABEL_CIPSO_V4
17 #define _NETLABEL_CIPSO_V4
19 #include <net/netlabel.h>
22 * The following NetLabel payloads are supported by the CIPSO subsystem.
25 * Sent by an application to add a new DOI mapping table.
27 * Required attributes:
30 * NLBL_CIPSOV4_A_MTYPE
31 * NLBL_CIPSOV4_A_TAGLST
33 * If using CIPSO_V4_MAP_TRANS the following attributes are required:
35 * NLBL_CIPSOV4_A_MLSLVLLST
36 * NLBL_CIPSOV4_A_MLSCATLST
38 * If using CIPSO_V4_MAP_PASS or CIPSO_V4_MAP_LOCAL no additional attributes
42 * Sent by an application to remove a specific DOI mapping table from the
45 * Required attributes:
50 * Sent by an application to list the details of a DOI definition. On
51 * success the kernel should send a response using the following format.
53 * Required attributes:
57 * The valid response message format depends on the type of the DOI mapping,
58 * the defined formats are shown below.
60 * Required attributes:
62 * NLBL_CIPSOV4_A_MTYPE
63 * NLBL_CIPSOV4_A_TAGLST
65 * If using CIPSO_V4_MAP_TRANS the following attributes are required:
67 * NLBL_CIPSOV4_A_MLSLVLLST
68 * NLBL_CIPSOV4_A_MLSCATLST
70 * If using CIPSO_V4_MAP_PASS or CIPSO_V4_MAP_LOCAL no additional attributes
74 * This message is sent by an application to list the valid DOIs on the
75 * system. When sent by an application there is no payload and the
76 * NLM_F_DUMP flag should be set. The kernel should respond with a series of
77 * the following messages.
79 * Required attributes:
82 * NLBL_CIPSOV4_A_MTYPE
86 /* NetLabel CIPSOv4 commands */
88 NLBL_CIPSOV4_C_UNSPEC,
90 NLBL_CIPSOV4_C_REMOVE,
92 NLBL_CIPSOV4_C_LISTALL,
96 /* NetLabel CIPSOv4 attributes */
98 NLBL_CIPSOV4_A_UNSPEC,
102 NLBL_CIPSOV4_A_MTYPE,
104 * the mapping table type (defined in the cipso_ipv4.h header as
108 * a CIPSO tag type, meant to be used within a NLBL_CIPSOV4_A_TAGLST
110 NLBL_CIPSOV4_A_TAGLST,
112 * the CIPSO tag list for the DOI, there must be at least one
113 * NLBL_CIPSOV4_A_TAG attribute, tags listed first are given higher
114 * priorirty when sending packets */
115 NLBL_CIPSOV4_A_MLSLVLLOC,
117 * the local MLS sensitivity level */
118 NLBL_CIPSOV4_A_MLSLVLREM,
120 * the remote MLS sensitivity level */
121 NLBL_CIPSOV4_A_MLSLVL,
123 * a MLS sensitivity level mapping, must contain only one attribute of
124 * each of the following types: NLBL_CIPSOV4_A_MLSLVLLOC and
125 * NLBL_CIPSOV4_A_MLSLVLREM */
126 NLBL_CIPSOV4_A_MLSLVLLST,
128 * the CIPSO level mappings, there must be at least one
129 * NLBL_CIPSOV4_A_MLSLVL attribute */
130 NLBL_CIPSOV4_A_MLSCATLOC,
132 * the local MLS category */
133 NLBL_CIPSOV4_A_MLSCATREM,
135 * the remote MLS category */
136 NLBL_CIPSOV4_A_MLSCAT,
138 * a MLS category mapping, must contain only one attribute of each of
139 * the following types: NLBL_CIPSOV4_A_MLSCATLOC and
140 * NLBL_CIPSOV4_A_MLSCATREM */
141 NLBL_CIPSOV4_A_MLSCATLST,
143 * the CIPSO category mappings, there must be at least one
144 * NLBL_CIPSOV4_A_MLSCAT attribute */
145 __NLBL_CIPSOV4_A_MAX,
147 #define NLBL_CIPSOV4_A_MAX (__NLBL_CIPSOV4_A_MAX - 1)
149 /* NetLabel protocol functions */
150 int netlbl_cipsov4_genl_init(void);