/*1* NetLabel Management Support2*3* This file defines the management functions for the NetLabel system. The4* NetLabel system manages static and dynamic label mappings for network5* protocols such as CIPSO and RIPSO.6*7* Author: Paul Moore <[email protected]>8*9*/1011/*12* (c) Copyright Hewlett-Packard Development Company, L.P., 200613*14* This program is free software; you can redistribute it and/or modify15* it under the terms of the GNU General Public License as published by16* the Free Software Foundation; either version 2 of the License, or17* (at your option) any later version.18*19* This program is distributed in the hope that it will be useful,20* but WITHOUT ANY WARRANTY; without even the implied warranty of21* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See22* the GNU General Public License for more details.23*24* You should have received a copy of the GNU General Public License25* along with this program; if not, write to the Free Software26* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA27*28*/2930#ifndef _NETLABEL_MGMT_H31#define _NETLABEL_MGMT_H3233#include <net/netlabel.h>34#include <asm/atomic.h>3536/*37* The following NetLabel payloads are supported by the management interface.38*39* o ADD:40* Sent by an application to add a domain mapping to the NetLabel system.41*42* Required attributes:43*44* NLBL_MGMT_A_DOMAIN45* NLBL_MGMT_A_PROTOCOL46*47* If IPv4 is specified the following attributes are required:48*49* NLBL_MGMT_A_IPV4ADDR50* NLBL_MGMT_A_IPV4MASK51*52* If IPv6 is specified the following attributes are required:53*54* NLBL_MGMT_A_IPV6ADDR55* NLBL_MGMT_A_IPV6MASK56*57* If using NETLBL_NLTYPE_CIPSOV4 the following attributes are required:58*59* NLBL_MGMT_A_CV4DOI60*61* If using NETLBL_NLTYPE_UNLABELED no other attributes are required.62*63* o REMOVE:64* Sent by an application to remove a domain mapping from the NetLabel65* system.66*67* Required attributes:68*69* NLBL_MGMT_A_DOMAIN70*71* o LISTALL:72* This message can be sent either from an application or by the kernel in73* response to an application generated LISTALL message. When sent by an74* application there is no payload and the NLM_F_DUMP flag should be set.75* The kernel should respond with a series of the following messages.76*77* Required attributes:78*79* NLBL_MGMT_A_DOMAIN80*81* If the IP address selectors are not used the following attribute is82* required:83*84* NLBL_MGMT_A_PROTOCOL85*86* If the IP address selectors are used then the following attritbute is87* required:88*89* NLBL_MGMT_A_SELECTORLIST90*91* If the mapping is using the NETLBL_NLTYPE_CIPSOV4 type then the following92* attributes are required:93*94* NLBL_MGMT_A_CV4DOI95*96* If the mapping is using the NETLBL_NLTYPE_UNLABELED type no other97* attributes are required.98*99* o ADDDEF:100* Sent by an application to set the default domain mapping for the NetLabel101* system.102*103* Required attributes:104*105* NLBL_MGMT_A_PROTOCOL106*107* If using NETLBL_NLTYPE_CIPSOV4 the following attributes are required:108*109* NLBL_MGMT_A_CV4DOI110*111* If using NETLBL_NLTYPE_UNLABELED no other attributes are required.112*113* o REMOVEDEF:114* Sent by an application to remove the default domain mapping from the115* NetLabel system, there is no payload.116*117* o LISTDEF:118* This message can be sent either from an application or by the kernel in119* response to an application generated LISTDEF message. When sent by an120* application there is no payload. On success the kernel should send a121* response using the following format.122*123* If the IP address selectors are not used the following attribute is124* required:125*126* NLBL_MGMT_A_PROTOCOL127*128* If the IP address selectors are used then the following attritbute is129* required:130*131* NLBL_MGMT_A_SELECTORLIST132*133* If the mapping is using the NETLBL_NLTYPE_CIPSOV4 type then the following134* attributes are required:135*136* NLBL_MGMT_A_CV4DOI137*138* If the mapping is using the NETLBL_NLTYPE_UNLABELED type no other139* attributes are required.140*141* o PROTOCOLS:142* Sent by an application to request a list of configured NetLabel protocols143* in the kernel. When sent by an application there is no payload and the144* NLM_F_DUMP flag should be set. The kernel should respond with a series of145* the following messages.146*147* Required attributes:148*149* NLBL_MGMT_A_PROTOCOL150*151* o VERSION:152* Sent by an application to request the NetLabel version. When sent by an153* application there is no payload. This message type is also used by the154* kernel to respond to an VERSION request.155*156* Required attributes:157*158* NLBL_MGMT_A_VERSION159*160*/161162/* NetLabel Management commands */163enum {164NLBL_MGMT_C_UNSPEC,165NLBL_MGMT_C_ADD,166NLBL_MGMT_C_REMOVE,167NLBL_MGMT_C_LISTALL,168NLBL_MGMT_C_ADDDEF,169NLBL_MGMT_C_REMOVEDEF,170NLBL_MGMT_C_LISTDEF,171NLBL_MGMT_C_PROTOCOLS,172NLBL_MGMT_C_VERSION,173__NLBL_MGMT_C_MAX,174};175176/* NetLabel Management attributes */177enum {178NLBL_MGMT_A_UNSPEC,179NLBL_MGMT_A_DOMAIN,180/* (NLA_NUL_STRING)181* the NULL terminated LSM domain string */182NLBL_MGMT_A_PROTOCOL,183/* (NLA_U32)184* the NetLabel protocol type (defined by NETLBL_NLTYPE_*) */185NLBL_MGMT_A_VERSION,186/* (NLA_U32)187* the NetLabel protocol version number (defined by188* NETLBL_PROTO_VERSION) */189NLBL_MGMT_A_CV4DOI,190/* (NLA_U32)191* the CIPSOv4 DOI value */192NLBL_MGMT_A_IPV6ADDR,193/* (NLA_BINARY, struct in6_addr)194* an IPv6 address */195NLBL_MGMT_A_IPV6MASK,196/* (NLA_BINARY, struct in6_addr)197* an IPv6 address mask */198NLBL_MGMT_A_IPV4ADDR,199/* (NLA_BINARY, struct in_addr)200* an IPv4 address */201NLBL_MGMT_A_IPV4MASK,202/* (NLA_BINARY, struct in_addr)203* and IPv4 address mask */204NLBL_MGMT_A_ADDRSELECTOR,205/* (NLA_NESTED)206* an IP address selector, must contain an address, mask, and protocol207* attribute plus any protocol specific attributes */208NLBL_MGMT_A_SELECTORLIST,209/* (NLA_NESTED)210* the selector list, there must be at least one211* NLBL_MGMT_A_ADDRSELECTOR attribute */212__NLBL_MGMT_A_MAX,213};214#define NLBL_MGMT_A_MAX (__NLBL_MGMT_A_MAX - 1)215216/* NetLabel protocol functions */217int netlbl_mgmt_genl_init(void);218219/* NetLabel configured protocol reference counter */220extern atomic_t netlabel_mgmt_protocount;221222#endif223224225