37 #include <linux/types.h>
39 #include <linux/list.h>
40 #include <linux/net.h>
45 #include <asm/unaligned.h>
48 #define CIPSO_V4_DOI_UNKNOWN 0x00000000
51 #define CIPSO_V4_TAG_INVALID 0
52 #define CIPSO_V4_TAG_RBITMAP 1
53 #define CIPSO_V4_TAG_ENUM 2
54 #define CIPSO_V4_TAG_RANGE 5
55 #define CIPSO_V4_TAG_PBITMAP 6
56 #define CIPSO_V4_TAG_FREEFORM 7
59 #define CIPSO_V4_TAG_LOCAL 128
62 #define CIPSO_V4_MAP_UNKNOWN 0
63 #define CIPSO_V4_MAP_TRANS 1
64 #define CIPSO_V4_MAP_PASS 2
65 #define CIPSO_V4_MAP_LOCAL 3
68 #define CIPSO_V4_MAX_REM_LVLS 255
69 #define CIPSO_V4_INV_LVL 0x80000000
70 #define CIPSO_V4_MAX_LOC_LVLS (CIPSO_V4_INV_LVL - 1)
71 #define CIPSO_V4_MAX_REM_CATS 65534
72 #define CIPSO_V4_INV_CAT 0x80000000
73 #define CIPSO_V4_MAX_LOC_CATS (CIPSO_V4_INV_CAT - 1)
80 #define CIPSO_V4_TAG_MAXCNT 5
117 #ifdef CONFIG_NETLABEL
128 #define CIPSO_V4_OPTEXIST(x) (IPCB(x)->opt.cipso != 0)
129 #define CIPSO_V4_OPTPTR(x) (skb_network_header(x) + IPCB(x)->opt.cipso)
135 #ifdef CONFIG_NETLABEL
175 static inline int cipso_v4_doi_domhsh_add(
struct cipso_v4_doi *doi_def,
181 static inline int cipso_v4_doi_domhsh_remove(
struct cipso_v4_doi *doi_def,
192 #ifdef CONFIG_NETLABEL
213 #ifdef CONFIG_NETLABEL
290 unsigned char err_offset = 0;
304 for (opt_iter = 6; opt_iter < opt_len;) {
305 if (opt[opt_iter + 1] > (opt_len - opt_iter)) {
306 err_offset = opt_iter + 1;
309 opt_iter += opt[opt_iter + 1];
313 *option = opt + err_offset;