aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJamal Hadi Salim <hadi@cyberus.ca>2007-04-29 00:20:32 -0400
committerDavid S. Miller <davem@davemloft.net>2007-04-29 00:20:32 -0400
commitecfd6b183780c6d9e85873693b3ce6c5f4d08b58 (patch)
tree8ee1330176e3011d3fdf86e70b5933b50302b7e7 /include
parent5632c5152aa621885d87ea0b8fdd5a6bb9f69c6f (diff)
[XFRM]: Export SPD info
With this patch you can use iproute2 in user space to efficiently see how many policies exist in different directions. Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/xfrm.h35
-rw-r--r--include/net/xfrm.h13
2 files changed, 48 insertions, 0 deletions
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 9c656a5cf842..a5d53e0fe152 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -185,6 +185,11 @@ enum {
185#define XFRM_MSG_NEWSADINFO XFRM_MSG_NEWSADINFO 185#define XFRM_MSG_NEWSADINFO XFRM_MSG_NEWSADINFO
186 XFRM_MSG_GETSADINFO, 186 XFRM_MSG_GETSADINFO,
187#define XFRM_MSG_GETSADINFO XFRM_MSG_GETSADINFO 187#define XFRM_MSG_GETSADINFO XFRM_MSG_GETSADINFO
188
189 XFRM_MSG_NEWSPDINFO,
190#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO
191 XFRM_MSG_GETSPDINFO,
192#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
188 __XFRM_MSG_MAX 193 __XFRM_MSG_MAX
189}; 194};
190#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) 195#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -290,6 +295,36 @@ enum xfrm_sadattr_type_t {
290#define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1) 295#define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1)
291}; 296};
292 297
298/* SPD Table filter flags */
299enum xfrm_spd_ftype_t {
300 XFRM_SPD_UNSPEC,
301 XFRM_SPD_HMASK=1,
302 XFRM_SPD_HMAX=2,
303 XFRM_SPD_ICNT=4,
304 XFRM_SPD_OCNT=8,
305 XFRM_SPD_FCNT=16,
306 XFRM_SPD_ISCNT=32,
307 XFRM_SPD_OSCNT=64,
308 XFRM_SPD_FSCNT=128,
309 __XFRM_SPD_MAX
310
311#define XFRM_SPD_MAX (__XFRM_SPD_MAX - 1)
312};
313enum xfrm_spdattr_type_t {
314 XFRMA_SPD_UNSPEC,
315 XFRMA_SPDHMASK,
316 XFRMA_SPDHMAX,
317 XFRMA_SPDICNT,
318 XFRMA_SPDOCNT,
319 XFRMA_SPDFCNT,
320 XFRMA_SPDISCNT,
321 XFRMA_SPDOSCNT,
322 XFRMA_SPDFSCNT,
323 __XFRMA_SPD_MAX
324
325#define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1)
326};
327
293struct xfrm_usersa_info { 328struct xfrm_usersa_info {
294 struct xfrm_selector sel; 329 struct xfrm_selector sel;
295 struct xfrm_id id; 330 struct xfrm_id id;
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 8287081d77f2..9561bf817b02 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -423,6 +423,18 @@ struct xfrm_sadinfo
423 u32 sadhmcnt; /* max allowed hash bkts */ 423 u32 sadhmcnt; /* max allowed hash bkts */
424 u32 sadcnt; /* current running count */ 424 u32 sadcnt; /* current running count */
425}; 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};
426#ifdef CONFIG_AUDITSYSCALL 438#ifdef CONFIG_AUDITSYSCALL
427extern 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,
428 struct xfrm_policy *xp, struct xfrm_state *x); 440 struct xfrm_policy *xp, struct xfrm_state *x);
@@ -946,6 +958,7 @@ extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq);
946extern int xfrm_state_delete(struct xfrm_state *x); 958extern int xfrm_state_delete(struct xfrm_state *x);
947extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); 959extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info);
948extern void xfrm_sad_getinfo(struct xfrm_sadinfo *si); 960extern void xfrm_sad_getinfo(struct xfrm_sadinfo *si);
961extern void xfrm_spd_getinfo(struct xfrm_spdinfo *si);
949extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); 962extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq);
950extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); 963extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq);
951extern void xfrm_replay_notify(struct xfrm_state *x, int event); 964extern void xfrm_replay_notify(struct xfrm_state *x, int event);