GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / net / netlabel / netlabel_domainhash.h
blob37426d4479f659afa1dfe5247af93f16a3326bb4
1 /*
2 * NetLabel Domain Hash Table
4 * This file manages the domain hash table that NetLabel uses to determine
5 * which network labeling protocol to use for a given domain. The NetLabel
6 * system manages static and dynamic label mappings for network protocols such
7 * as CIPSO and RIPSO.
9 * Author: Paul Moore <paul.moore@hp.com>
14 * (c) Copyright Hewlett-Packard Development Company, L.P., 2006, 2008
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
24 * the GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #ifndef _NETLABEL_DOMAINHASH_H
33 #define _NETLABEL_DOMAINHASH_H
35 #include <linux/types.h>
36 #include <linux/rcupdate.h>
37 #include <linux/list.h>
39 #include "netlabel_addrlist.h"
41 /* Domain hash table size */
42 #define NETLBL_DOMHSH_BITSIZE 7
44 /* Domain mapping definition structures */
45 #define netlbl_domhsh_addr4_entry(iter) \
46 container_of(iter, struct netlbl_domaddr4_map, list)
47 struct netlbl_domaddr4_map {
48 u32 type;
49 union {
50 struct cipso_v4_doi *cipsov4;
51 } type_def;
53 struct netlbl_af4list list;
55 #define netlbl_domhsh_addr6_entry(iter) \
56 container_of(iter, struct netlbl_domaddr6_map, list)
57 struct netlbl_domaddr6_map {
58 u32 type;
60 /* NOTE: no 'type_def' union needed at present since we don't currently
61 * support any IPv6 labeling protocols */
63 struct netlbl_af6list list;
65 struct netlbl_domaddr_map {
66 struct list_head list4;
67 struct list_head list6;
69 struct netlbl_dom_map {
70 char *domain;
71 u32 type;
72 union {
73 struct cipso_v4_doi *cipsov4;
74 struct netlbl_domaddr_map *addrsel;
75 } type_def;
77 u32 valid;
78 struct list_head list;
79 struct rcu_head rcu;
82 /* init function */
83 int netlbl_domhsh_init(u32 size);
85 /* Manipulate the domain hash table */
86 int netlbl_domhsh_add(struct netlbl_dom_map *entry,
87 struct netlbl_audit *audit_info);
88 int netlbl_domhsh_add_default(struct netlbl_dom_map *entry,
89 struct netlbl_audit *audit_info);
90 int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry,
91 struct netlbl_audit *audit_info);
92 int netlbl_domhsh_remove_af4(const char *domain,
93 const struct in_addr *addr,
94 const struct in_addr *mask,
95 struct netlbl_audit *audit_info);
96 int netlbl_domhsh_remove(const char *domain, struct netlbl_audit *audit_info);
97 int netlbl_domhsh_remove_default(struct netlbl_audit *audit_info);
98 struct netlbl_dom_map *netlbl_domhsh_getentry(const char *domain);
99 struct netlbl_domaddr4_map *netlbl_domhsh_getentry_af4(const char *domain,
100 __be32 addr);
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);
106 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
107 struct netlbl_domaddr6_map *netlbl_domhsh_getentry_af6(const char *domain,
108 const struct in6_addr *addr);
109 #endif /* IPv6 */
111 #endif