~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/netlabel/netlabel_domainhash.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * NetLabel Domain Hash Table
  4  *
  5  * This file manages the domain hash table that NetLabel uses to determine
  6  * which network labeling protocol to use for a given domain.  The NetLabel
  7  * system manages static and dynamic label mappings for network protocols such
  8  * as CIPSO and RIPSO.
  9  *
 10  * Author: Paul Moore <paul@paul-moore.com>
 11  */
 12 
 13 /*
 14  * (c) Copyright Hewlett-Packard Development Company, L.P., 2006, 2008
 15  */
 16 
 17 #ifndef _NETLABEL_DOMAINHASH_H
 18 #define _NETLABEL_DOMAINHASH_H
 19 
 20 #include <linux/types.h>
 21 #include <linux/rcupdate.h>
 22 #include <linux/list.h>
 23 
 24 #include "netlabel_addrlist.h"
 25 
 26 /* Domain hash table size */
 27 /* XXX - currently this number is an uneducated guess */
 28 #define NETLBL_DOMHSH_BITSIZE       7
 29 
 30 /* Domain mapping definition structures */
 31 struct netlbl_domaddr_map {
 32         struct list_head list4;
 33         struct list_head list6;
 34 };
 35 struct netlbl_dommap_def {
 36         u32 type;
 37         union {
 38                 struct netlbl_domaddr_map *addrsel;
 39                 struct cipso_v4_doi *cipso;
 40                 struct calipso_doi *calipso;
 41         };
 42 };
 43 #define netlbl_domhsh_addr4_entry(iter) \
 44         container_of(iter, struct netlbl_domaddr4_map, list)
 45 struct netlbl_domaddr4_map {
 46         struct netlbl_dommap_def def;
 47 
 48         struct netlbl_af4list list;
 49 };
 50 #define netlbl_domhsh_addr6_entry(iter) \
 51         container_of(iter, struct netlbl_domaddr6_map, list)
 52 struct netlbl_domaddr6_map {
 53         struct netlbl_dommap_def def;
 54 
 55         struct netlbl_af6list list;
 56 };
 57 
 58 struct netlbl_dom_map {
 59         char *domain;
 60         struct netlbl_dommap_def def;
 61         u16 family;
 62 
 63         u32 valid;
 64         struct list_head list;
 65         struct rcu_head rcu;
 66 };
 67 
 68 /* init function */
 69 int netlbl_domhsh_init(u32 size);
 70 
 71 /* Manipulate the domain hash table */
 72 int netlbl_domhsh_add(struct netlbl_dom_map *entry,
 73                       struct netlbl_audit *audit_info);
 74 int netlbl_domhsh_add_default(struct netlbl_dom_map *entry,
 75                               struct netlbl_audit *audit_info);
 76 int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry,
 77                                struct netlbl_audit *audit_info);
 78 int netlbl_domhsh_remove_af4(const char *domain,
 79                              const struct in_addr *addr,
 80                              const struct in_addr *mask,
 81                              struct netlbl_audit *audit_info);
 82 int netlbl_domhsh_remove_af6(const char *domain,
 83                              const struct in6_addr *addr,
 84                              const struct in6_addr *mask,
 85                              struct netlbl_audit *audit_info);
 86 int netlbl_domhsh_remove(const char *domain, u16 family,
 87                          struct netlbl_audit *audit_info);
 88 int netlbl_domhsh_remove_default(u16 family, struct netlbl_audit *audit_info);
 89 struct netlbl_dom_map *netlbl_domhsh_getentry(const char *domain, u16 family);
 90 struct netlbl_dommap_def *netlbl_domhsh_getentry_af4(const char *domain,
 91                                                      __be32 addr);
 92 #if IS_ENABLED(CONFIG_IPV6)
 93 struct netlbl_dommap_def *netlbl_domhsh_getentry_af6(const char *domain,
 94                                                    const struct in6_addr *addr);
 95 int netlbl_domhsh_remove_af6(const char *domain,
 96                              const struct in6_addr *addr,
 97                              const struct in6_addr *mask,
 98                              struct netlbl_audit *audit_info);
 99 #endif /* IPv6 */
100 
101 int netlbl_domhsh_walk(u32 *skip_bkt,
102                      u32 *skip_chain,
103                      int (*callback) (struct netlbl_dom_map *entry, void *arg),
104                      void *cb_arg);
105 
106 #endif
107 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php