aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h38
1 files changed, 35 insertions, 3 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 92a1fc46ea59..66c2d3eec03c 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -279,7 +279,7 @@ struct xfrm_type
279 xfrm_address_t *(*local_addr)(struct xfrm_state *, xfrm_address_t *); 279 xfrm_address_t *(*local_addr)(struct xfrm_state *, xfrm_address_t *);
280 xfrm_address_t *(*remote_addr)(struct xfrm_state *, xfrm_address_t *); 280 xfrm_address_t *(*remote_addr)(struct xfrm_state *, xfrm_address_t *);
281 /* Estimate maximal size of result of transformation of a dgram */ 281 /* Estimate maximal size of result of transformation of a dgram */
282 u32 (*get_max_size)(struct xfrm_state *, int size); 282 u32 (*get_mtu)(struct xfrm_state *, int size);
283}; 283};
284 284
285extern int xfrm_register_type(struct xfrm_type *type, unsigned short family); 285extern int xfrm_register_type(struct xfrm_type *type, unsigned short family);
@@ -416,6 +416,25 @@ struct xfrm_audit
416 u32 secid; 416 u32 secid;
417}; 417};
418 418
419/* SAD metadata, add more later */
420struct xfrm_sadinfo
421{
422 u32 sadhcnt; /* current hash bkts */
423 u32 sadhmcnt; /* max allowed hash bkts */
424 u32 sadcnt; /* current running count */
425};
426
427struct xfrm_spdinfo
428{
429 u32 incnt;
430 u32 outcnt;
431 u32 fwdcnt;
432 u32 inscnt;
433 u32 outscnt;
434 u32 fwdscnt;
435 u32 spdhcnt;
436 u32 spdhmcnt;
437};
419#ifdef CONFIG_AUDITSYSCALL 438#ifdef CONFIG_AUDITSYSCALL
420extern void xfrm_audit_log(uid_t auid, u32 secid, int type, int result, 439extern void xfrm_audit_log(uid_t auid, u32 secid, int type, int result,
421 struct xfrm_policy *xp, struct xfrm_state *x); 440 struct xfrm_policy *xp, struct xfrm_state *x);
@@ -584,6 +603,10 @@ struct xfrm_dst
584 struct rt6_info rt6; 603 struct rt6_info rt6;
585 } u; 604 } u;
586 struct dst_entry *route; 605 struct dst_entry *route;
606#ifdef CONFIG_XFRM_SUB_POLICY
607 struct flowi *origin;
608 struct xfrm_selector *partner;
609#endif
587 u32 genid; 610 u32 genid;
588 u32 route_mtu_cached; 611 u32 route_mtu_cached;
589 u32 child_mtu_cached; 612 u32 child_mtu_cached;
@@ -596,6 +619,12 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
596 dst_release(xdst->route); 619 dst_release(xdst->route);
597 if (likely(xdst->u.dst.xfrm)) 620 if (likely(xdst->u.dst.xfrm))
598 xfrm_state_put(xdst->u.dst.xfrm); 621 xfrm_state_put(xdst->u.dst.xfrm);
622#ifdef CONFIG_XFRM_SUB_POLICY
623 kfree(xdst->origin);
624 xdst->origin = NULL;
625 kfree(xdst->partner);
626 xdst->partner = NULL;
627#endif
599} 628}
600 629
601extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); 630extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
@@ -938,6 +967,8 @@ static inline int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **s
938extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); 967extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq);
939extern int xfrm_state_delete(struct xfrm_state *x); 968extern int xfrm_state_delete(struct xfrm_state *x);
940extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); 969extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info);
970extern void xfrm_sad_getinfo(struct xfrm_sadinfo *si);
971extern void xfrm_spd_getinfo(struct xfrm_spdinfo *si);
941extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); 972extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq);
942extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); 973extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq);
943extern void xfrm_replay_notify(struct xfrm_state *x, int event); 974extern void xfrm_replay_notify(struct xfrm_state *x, int event);
@@ -988,8 +1019,9 @@ extern int xfrm_policy_walk(u8 type, int (*func)(struct xfrm_policy *, int, int,
988int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1019int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
989struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, 1020struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
990 struct xfrm_selector *sel, 1021 struct xfrm_selector *sel,
991 struct xfrm_sec_ctx *ctx, int delete); 1022 struct xfrm_sec_ctx *ctx, int delete,
992struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete); 1023 int *err);
1024struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err);
993void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); 1025void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info);
994u32 xfrm_get_acqseq(void); 1026u32 xfrm_get_acqseq(void);
995void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); 1027void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi);