Path: blob/master/net/netlabel/netlabel_cipso_v4.h
15109 views
/*1* NetLabel CIPSO/IPv4 Support2*3* This file defines the CIPSO/IPv4 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_CIPSO_V431#define _NETLABEL_CIPSO_V43233#include <net/netlabel.h>3435/*36* The following NetLabel payloads are supported by the CIPSO subsystem.37*38* o ADD:39* Sent by an application to add a new DOI mapping table.40*41* Required attributes:42*43* NLBL_CIPSOV4_A_DOI44* NLBL_CIPSOV4_A_MTYPE45* NLBL_CIPSOV4_A_TAGLST46*47* If using CIPSO_V4_MAP_TRANS the following attributes are required:48*49* NLBL_CIPSOV4_A_MLSLVLLST50* NLBL_CIPSOV4_A_MLSCATLST51*52* If using CIPSO_V4_MAP_PASS or CIPSO_V4_MAP_LOCAL no additional attributes53* are required.54*55* o REMOVE:56* Sent by an application to remove a specific DOI mapping table from the57* CIPSO V4 system.58*59* Required attributes:60*61* NLBL_CIPSOV4_A_DOI62*63* o LIST:64* Sent by an application to list the details of a DOI definition. On65* success the kernel should send a response using the following format.66*67* Required attributes:68*69* NLBL_CIPSOV4_A_DOI70*71* The valid response message format depends on the type of the DOI mapping,72* the defined formats are shown below.73*74* Required attributes:75*76* NLBL_CIPSOV4_A_MTYPE77* NLBL_CIPSOV4_A_TAGLST78*79* If using CIPSO_V4_MAP_TRANS the following attributes are required:80*81* NLBL_CIPSOV4_A_MLSLVLLST82* NLBL_CIPSOV4_A_MLSCATLST83*84* If using CIPSO_V4_MAP_PASS or CIPSO_V4_MAP_LOCAL no additional attributes85* are required.86*87* o LISTALL:88* This message is sent by an application to list the valid DOIs on the89* system. When sent by an application there is no payload and the90* NLM_F_DUMP flag should be set. The kernel should respond with a series of91* the following messages.92*93* Required attributes:94*95* NLBL_CIPSOV4_A_DOI96* NLBL_CIPSOV4_A_MTYPE97*98*/99100/* NetLabel CIPSOv4 commands */101enum {102NLBL_CIPSOV4_C_UNSPEC,103NLBL_CIPSOV4_C_ADD,104NLBL_CIPSOV4_C_REMOVE,105NLBL_CIPSOV4_C_LIST,106NLBL_CIPSOV4_C_LISTALL,107__NLBL_CIPSOV4_C_MAX,108};109110/* NetLabel CIPSOv4 attributes */111enum {112NLBL_CIPSOV4_A_UNSPEC,113NLBL_CIPSOV4_A_DOI,114/* (NLA_U32)115* the DOI value */116NLBL_CIPSOV4_A_MTYPE,117/* (NLA_U32)118* the mapping table type (defined in the cipso_ipv4.h header as119* CIPSO_V4_MAP_*) */120NLBL_CIPSOV4_A_TAG,121/* (NLA_U8)122* a CIPSO tag type, meant to be used within a NLBL_CIPSOV4_A_TAGLST123* attribute */124NLBL_CIPSOV4_A_TAGLST,125/* (NLA_NESTED)126* the CIPSO tag list for the DOI, there must be at least one127* NLBL_CIPSOV4_A_TAG attribute, tags listed first are given higher128* priorirty when sending packets */129NLBL_CIPSOV4_A_MLSLVLLOC,130/* (NLA_U32)131* the local MLS sensitivity level */132NLBL_CIPSOV4_A_MLSLVLREM,133/* (NLA_U32)134* the remote MLS sensitivity level */135NLBL_CIPSOV4_A_MLSLVL,136/* (NLA_NESTED)137* a MLS sensitivity level mapping, must contain only one attribute of138* each of the following types: NLBL_CIPSOV4_A_MLSLVLLOC and139* NLBL_CIPSOV4_A_MLSLVLREM */140NLBL_CIPSOV4_A_MLSLVLLST,141/* (NLA_NESTED)142* the CIPSO level mappings, there must be at least one143* NLBL_CIPSOV4_A_MLSLVL attribute */144NLBL_CIPSOV4_A_MLSCATLOC,145/* (NLA_U32)146* the local MLS category */147NLBL_CIPSOV4_A_MLSCATREM,148/* (NLA_U32)149* the remote MLS category */150NLBL_CIPSOV4_A_MLSCAT,151/* (NLA_NESTED)152* a MLS category mapping, must contain only one attribute of each of153* the following types: NLBL_CIPSOV4_A_MLSCATLOC and154* NLBL_CIPSOV4_A_MLSCATREM */155NLBL_CIPSOV4_A_MLSCATLST,156/* (NLA_NESTED)157* the CIPSO category mappings, there must be at least one158* NLBL_CIPSOV4_A_MLSCAT attribute */159__NLBL_CIPSOV4_A_MAX,160};161#define NLBL_CIPSOV4_A_MAX (__NLBL_CIPSOV4_A_MAX - 1)162163/* NetLabel protocol functions */164int netlbl_cipsov4_genl_init(void);165166/* Free the memory associated with a CIPSOv4 DOI definition */167void netlbl_cipsov4_doi_free(struct rcu_head *entry);168169#endif170171172