aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlabel/netlabel_domainhash.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlabel/netlabel_domainhash.h')
-rw-r--r--net/netlabel/netlabel_domainhash.h46
1 files changed, 22 insertions, 24 deletions
diff --git a/net/netlabel/netlabel_domainhash.h b/net/netlabel/netlabel_domainhash.h
index 90872c4ca30f..b9be0eed8980 100644
--- a/net/netlabel/netlabel_domainhash.h
+++ b/net/netlabel/netlabel_domainhash.h
@@ -43,37 +43,35 @@
43#define NETLBL_DOMHSH_BITSIZE 7 43#define NETLBL_DOMHSH_BITSIZE 7
44 44
45/* Domain mapping definition structures */ 45/* Domain mapping definition structures */
46struct netlbl_domaddr_map {
47 struct list_head list4;
48 struct list_head list6;
49};
50struct netlbl_dommap_def {
51 u32 type;
52 union {
53 struct netlbl_domaddr_map *addrsel;
54 struct cipso_v4_doi *cipso;
55 };
56};
46#define netlbl_domhsh_addr4_entry(iter) \ 57#define netlbl_domhsh_addr4_entry(iter) \
47 container_of(iter, struct netlbl_domaddr4_map, list) 58 container_of(iter, struct netlbl_domaddr4_map, list)
48struct netlbl_domaddr4_map { 59struct netlbl_domaddr4_map {
49 u32 type; 60 struct netlbl_dommap_def def;
50 union {
51 struct cipso_v4_doi *cipsov4;
52 } type_def;
53 61
54 struct netlbl_af4list list; 62 struct netlbl_af4list list;
55}; 63};
56#define netlbl_domhsh_addr6_entry(iter) \ 64#define netlbl_domhsh_addr6_entry(iter) \
57 container_of(iter, struct netlbl_domaddr6_map, list) 65 container_of(iter, struct netlbl_domaddr6_map, list)
58struct netlbl_domaddr6_map { 66struct netlbl_domaddr6_map {
59 u32 type; 67 struct netlbl_dommap_def def;
60
61 /* NOTE: no 'type_def' union needed at present since we don't currently
62 * support any IPv6 labeling protocols */
63 68
64 struct netlbl_af6list list; 69 struct netlbl_af6list list;
65}; 70};
66struct netlbl_domaddr_map { 71
67 struct list_head list4;
68 struct list_head list6;
69};
70struct netlbl_dom_map { 72struct netlbl_dom_map {
71 char *domain; 73 char *domain;
72 u32 type; 74 struct netlbl_dommap_def def;
73 union {
74 struct cipso_v4_doi *cipsov4;
75 struct netlbl_domaddr_map *addrsel;
76 } type_def;
77 75
78 u32 valid; 76 u32 valid;
79 struct list_head list; 77 struct list_head list;
@@ -97,16 +95,16 @@ int netlbl_domhsh_remove_af4(const char *domain,
97int netlbl_domhsh_remove(const char *domain, struct netlbl_audit *audit_info); 95int netlbl_domhsh_remove(const char *domain, struct netlbl_audit *audit_info);
98int netlbl_domhsh_remove_default(struct netlbl_audit *audit_info); 96int netlbl_domhsh_remove_default(struct netlbl_audit *audit_info);
99struct netlbl_dom_map *netlbl_domhsh_getentry(const char *domain); 97struct netlbl_dom_map *netlbl_domhsh_getentry(const char *domain);
100struct netlbl_domaddr4_map *netlbl_domhsh_getentry_af4(const char *domain, 98struct netlbl_dommap_def *netlbl_domhsh_getentry_af4(const char *domain,
101 __be32 addr); 99 __be32 addr);
100#if IS_ENABLED(CONFIG_IPV6)
101struct netlbl_dommap_def *netlbl_domhsh_getentry_af6(const char *domain,
102 const struct in6_addr *addr);
103#endif /* IPv6 */
104
102int netlbl_domhsh_walk(u32 *skip_bkt, 105int netlbl_domhsh_walk(u32 *skip_bkt,
103 u32 *skip_chain, 106 u32 *skip_chain,
104 int (*callback) (struct netlbl_dom_map *entry, void *arg), 107 int (*callback) (struct netlbl_dom_map *entry, void *arg),
105 void *cb_arg); 108 void *cb_arg);
106 109
107#if IS_ENABLED(CONFIG_IPV6)
108struct netlbl_domaddr6_map *netlbl_domhsh_getentry_af6(const char *domain,
109 const struct in6_addr *addr);
110#endif /* IPv6 */
111
112#endif 110#endif