33 #include <linux/types.h>
34 #include <linux/slab.h>
35 #include <linux/net.h>
38 #include <linux/in6.h>
82 #define NETLBL_PROTO_VERSION 3
85 #define NETLBL_NLTYPE_NONE 0
86 #define NETLBL_NLTYPE_MGMT 1
87 #define NETLBL_NLTYPE_MGMT_NAME "NLBL_MGMT"
88 #define NETLBL_NLTYPE_RIPSO 2
89 #define NETLBL_NLTYPE_RIPSO_NAME "NLBL_RIPSO"
90 #define NETLBL_NLTYPE_CIPSOV4 3
91 #define NETLBL_NLTYPE_CIPSOV4_NAME "NLBL_CIPSOv4"
92 #define NETLBL_NLTYPE_CIPSOV6 4
93 #define NETLBL_NLTYPE_CIPSOV6_NAME "NLBL_CIPSOv6"
94 #define NETLBL_NLTYPE_UNLABELED 5
95 #define NETLBL_NLTYPE_UNLABELED_NAME "NLBL_UNLBL"
96 #define NETLBL_NLTYPE_ADDRSELECT 6
97 #define NETLBL_NLTYPE_ADDRSELECT_NAME "NLBL_ADRSEL"
160 #define NETLBL_CATMAP_MAPTYPE u64
161 #define NETLBL_CATMAP_MAPCNT 4
162 #define NETLBL_CATMAP_MAPSIZE (sizeof(NETLBL_CATMAP_MAPTYPE) * 8)
163 #define NETLBL_CATMAP_SIZE (NETLBL_CATMAP_MAPSIZE * \
164 NETLBL_CATMAP_MAPCNT)
165 #define NETLBL_CATMAP_BIT (NETLBL_CATMAP_MAPTYPE)0x01
195 #define NETLBL_SECATTR_NONE 0x00000000
196 #define NETLBL_SECATTR_DOMAIN 0x00000001
197 #define NETLBL_SECATTR_DOMAIN_CPY (NETLBL_SECATTR_DOMAIN | \
198 NETLBL_SECATTR_FREE_DOMAIN)
199 #define NETLBL_SECATTR_CACHE 0x00000002
200 #define NETLBL_SECATTR_MLS_LVL 0x00000004
201 #define NETLBL_SECATTR_MLS_CAT 0x00000008
202 #define NETLBL_SECATTR_SECID 0x00000010
204 #define NETLBL_SECATTR_FREE_DOMAIN 0x01000000
205 #define NETLBL_SECATTR_CACHEABLE (NETLBL_SECATTR_MLS_LVL | \
206 NETLBL_SECATTR_MLS_CAT | \
207 NETLBL_SECATTR_SECID)
237 cache = kzalloc(
sizeof(*cache), flags);
284 static inline void netlbl_secattr_catmap_free(
291 catmap = catmap->
next;
306 memset(secattr, 0,
sizeof(*secattr));
323 netlbl_secattr_cache_free(secattr->
cache);
325 netlbl_secattr_catmap_free(secattr->
attr.mls.cat);
352 netlbl_secattr_destroy(secattr);
356 #ifdef CONFIG_NETLABEL
371 const char *dev_name,
378 const char *dev_name,
460 const char *dev_name,
470 const char *dev_name,