diff options
author | Paul Moore <paul.moore@hp.com> | 2008-10-10 10:16:34 -0400 |
---|---|---|
committer | Paul Moore <paul.moore@hp.com> | 2008-10-10 10:16:34 -0400 |
commit | 15c45f7b2e81655f6eb500ec949c8bd70a04325a (patch) | |
tree | 46037ccd3f3c83cb140abdf5d10af73888bdd362 /include/net/cipso_ipv4.h | |
parent | 8d75899d033617316e06296b7c0729612f56aba0 (diff) |
cipso: Add support for native local labeling and fixup mapping names
This patch accomplishes three minor tasks: add a new tag type for local
labeling, rename the CIPSO_V4_MAP_STD define to CIPSO_V4_MAP_TRANS and
replace some of the CIPSO "magic numbers" with constants from the header
file. The first change allows CIPSO to support full LSM labels/contexts,
not just MLS attributes. The second change brings the mapping names inline
with what userspace is using, compatibility is preserved since we don't
actually change the value. The last change is to aid readability and help
prevent mistakes.
Signed-off-by: Paul Moore <paul.moore@hp.com>
Diffstat (limited to 'include/net/cipso_ipv4.h')
-rw-r--r-- | include/net/cipso_ipv4.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index 811febf97caf..9909774eb998 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h | |||
@@ -45,7 +45,7 @@ | |||
45 | /* known doi values */ | 45 | /* known doi values */ |
46 | #define CIPSO_V4_DOI_UNKNOWN 0x00000000 | 46 | #define CIPSO_V4_DOI_UNKNOWN 0x00000000 |
47 | 47 | ||
48 | /* tag types */ | 48 | /* standard tag types */ |
49 | #define CIPSO_V4_TAG_INVALID 0 | 49 | #define CIPSO_V4_TAG_INVALID 0 |
50 | #define CIPSO_V4_TAG_RBITMAP 1 | 50 | #define CIPSO_V4_TAG_RBITMAP 1 |
51 | #define CIPSO_V4_TAG_ENUM 2 | 51 | #define CIPSO_V4_TAG_ENUM 2 |
@@ -53,10 +53,14 @@ | |||
53 | #define CIPSO_V4_TAG_PBITMAP 6 | 53 | #define CIPSO_V4_TAG_PBITMAP 6 |
54 | #define CIPSO_V4_TAG_FREEFORM 7 | 54 | #define CIPSO_V4_TAG_FREEFORM 7 |
55 | 55 | ||
56 | /* non-standard tag types (tags > 127) */ | ||
57 | #define CIPSO_V4_TAG_LOCAL 128 | ||
58 | |||
56 | /* doi mapping types */ | 59 | /* doi mapping types */ |
57 | #define CIPSO_V4_MAP_UNKNOWN 0 | 60 | #define CIPSO_V4_MAP_UNKNOWN 0 |
58 | #define CIPSO_V4_MAP_STD 1 | 61 | #define CIPSO_V4_MAP_TRANS 1 |
59 | #define CIPSO_V4_MAP_PASS 2 | 62 | #define CIPSO_V4_MAP_PASS 2 |
63 | #define CIPSO_V4_MAP_LOCAL 3 | ||
60 | 64 | ||
61 | /* limits */ | 65 | /* limits */ |
62 | #define CIPSO_V4_MAX_REM_LVLS 255 | 66 | #define CIPSO_V4_MAX_REM_LVLS 255 |
@@ -215,7 +219,7 @@ int cipso_v4_skbuff_setattr(struct sk_buff *skb, | |||
215 | int cipso_v4_skbuff_delattr(struct sk_buff *skb); | 219 | int cipso_v4_skbuff_delattr(struct sk_buff *skb); |
216 | int cipso_v4_skbuff_getattr(const struct sk_buff *skb, | 220 | int cipso_v4_skbuff_getattr(const struct sk_buff *skb, |
217 | struct netlbl_lsm_secattr *secattr); | 221 | struct netlbl_lsm_secattr *secattr); |
218 | int cipso_v4_validate(unsigned char **option); | 222 | int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option); |
219 | #else | 223 | #else |
220 | static inline void cipso_v4_error(struct sk_buff *skb, | 224 | static inline void cipso_v4_error(struct sk_buff *skb, |
221 | int error, | 225 | int error, |
@@ -259,7 +263,8 @@ static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb, | |||
259 | return -ENOSYS; | 263 | return -ENOSYS; |
260 | } | 264 | } |
261 | 265 | ||
262 | static inline int cipso_v4_validate(unsigned char **option) | 266 | static inline int cipso_v4_validate(const struct sk_buff *skb, |
267 | unsigned char **option) | ||
263 | { | 268 | { |
264 | return -ENOSYS; | 269 | return -ENOSYS; |
265 | } | 270 | } |