xfrm.h (61420e147a706ee7c7a902008045547fb2a2a330) | xfrm.h (df71837d5024e2524cd51c93621e558aa7dd9f3f) |
---|---|
1#ifndef _NET_XFRM_H 2#define _NET_XFRM_H 3 4#include <linux/compiler.h> 5#include <linux/xfrm.h> 6#include <linux/spinlock.h> 7#include <linux/list.h> 8#include <linux/skbuff.h> --- 130 unchanged lines hidden (view full) --- 139 140 struct xfrm_lifetime_cur curlft; 141 struct timer_list timer; 142 143 /* Reference to data common to all the instances of this 144 * transformer. */ 145 struct xfrm_type *type; 146 | 1#ifndef _NET_XFRM_H 2#define _NET_XFRM_H 3 4#include <linux/compiler.h> 5#include <linux/xfrm.h> 6#include <linux/spinlock.h> 7#include <linux/list.h> 8#include <linux/skbuff.h> --- 130 unchanged lines hidden (view full) --- 139 140 struct xfrm_lifetime_cur curlft; 141 struct timer_list timer; 142 143 /* Reference to data common to all the instances of this 144 * transformer. */ 145 struct xfrm_type *type; 146 |
147 /* Security context */ 148 struct xfrm_sec_ctx *security; 149 |
|
147 /* Private data of this transformer, format is opaque, 148 * interpreted by xfrm_type methods. */ 149 void *data; 150}; 151 152enum { 153 XFRM_STATE_VOID, 154 XFRM_STATE_ACQ, --- 138 unchanged lines hidden (view full) --- 293 struct xfrm_lifetime_cfg lft; 294 struct xfrm_lifetime_cur curlft; 295 struct dst_entry *bundles; 296 __u16 family; 297 __u8 action; 298 __u8 flags; 299 __u8 dead; 300 __u8 xfrm_nr; | 150 /* Private data of this transformer, format is opaque, 151 * interpreted by xfrm_type methods. */ 152 void *data; 153}; 154 155enum { 156 XFRM_STATE_VOID, 157 XFRM_STATE_ACQ, --- 138 unchanged lines hidden (view full) --- 296 struct xfrm_lifetime_cfg lft; 297 struct xfrm_lifetime_cur curlft; 298 struct dst_entry *bundles; 299 __u16 family; 300 __u8 action; 301 __u8 flags; 302 __u8 dead; 303 __u8 xfrm_nr; |
304 struct xfrm_sec_ctx *security; |
|
301 struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; 302}; 303 304#define XFRM_KM_TIMEOUT 30 305 306struct xfrm_mgr 307{ 308 struct list_head list; --- 196 unchanged lines hidden (view full) --- 505 case AF_INET: 506 return __xfrm4_selector_match(sel, fl); 507 case AF_INET6: 508 return __xfrm6_selector_match(sel, fl); 509 } 510 return 0; 511} 512 | 305 struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; 306}; 307 308#define XFRM_KM_TIMEOUT 30 309 310struct xfrm_mgr 311{ 312 struct list_head list; --- 196 unchanged lines hidden (view full) --- 509 case AF_INET: 510 return __xfrm4_selector_match(sel, fl); 511 case AF_INET6: 512 return __xfrm6_selector_match(sel, fl); 513 } 514 return 0; 515} 516 |
517#ifdef CONFIG_SECURITY_NETWORK_XFRM 518/* If neither has a context --> match 519 * Otherwise, both must have a context and the sids, doi, alg must match 520 */ 521static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ctx *s2) 522{ 523 return ((!s1 && !s2) || 524 (s1 && s2 && 525 (s1->ctx_sid == s2->ctx_sid) && 526 (s1->ctx_doi == s2->ctx_doi) && 527 (s1->ctx_alg == s2->ctx_alg))); 528} 529#else 530static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ctx *s2) 531{ 532 return 1; 533} 534#endif 535 |
|
513/* A struct encoding bundle of transformations to apply to some set of flow. 514 * 515 * dst->child points to the next element of bundle. 516 * dst->xfrm points to an instanse of transformer. 517 * 518 * Due to unfortunate limitations of current routing cache, which we 519 * have no time to fix, it mirrors struct rtable and bound to the same 520 * routing key, including saddr,daddr. However, we can have many of --- 352 unchanged lines hidden (view full) --- 873{ 874 return -EINVAL; 875} 876#endif 877 878struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); 879extern int xfrm_policy_walk(int (*func)(struct xfrm_policy *, int, int, void*), void *); 880int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); | 536/* A struct encoding bundle of transformations to apply to some set of flow. 537 * 538 * dst->child points to the next element of bundle. 539 * dst->xfrm points to an instanse of transformer. 540 * 541 * Due to unfortunate limitations of current routing cache, which we 542 * have no time to fix, it mirrors struct rtable and bound to the same 543 * routing key, including saddr,daddr. However, we can have many of --- 352 unchanged lines hidden (view full) --- 896{ 897 return -EINVAL; 898} 899#endif 900 901struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); 902extern int xfrm_policy_walk(int (*func)(struct xfrm_policy *, int, int, void*), void *); 903int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); |
881struct xfrm_policy *xfrm_policy_bysel(int dir, struct xfrm_selector *sel, 882 int delete); | 904struct xfrm_policy *xfrm_policy_bysel_ctx(int dir, struct xfrm_selector *sel, 905 struct xfrm_sec_ctx *ctx, int delete); |
883struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete); 884void xfrm_policy_flush(void); 885u32 xfrm_get_acqseq(void); 886void xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 887struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, 888 xfrm_address_t *daddr, xfrm_address_t *saddr, 889 int create, unsigned short family); 890extern void xfrm_policy_flush(void); --- 50 unchanged lines hidden --- | 906struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete); 907void xfrm_policy_flush(void); 908u32 xfrm_get_acqseq(void); 909void xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 910struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, 911 xfrm_address_t *daddr, xfrm_address_t *saddr, 912 int create, unsigned short family); 913extern void xfrm_policy_flush(void); --- 50 unchanged lines hidden --- |