* [PATCH iproute2] ip xfrm state: parse and print "icmp" and "af-unspec" flags
@ 2010-01-11 15:23 Alex Badea
2010-01-21 18:10 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Alex Badea @ 2010-01-11 15:23 UTC (permalink / raw)
To: shemminger; +Cc: netdev, Alex Badea
Convert to/from XFRM_STATE_ICMP and XFRM_STATE_AF_UNSPEC state flags.
Signed-off-by: Alex Badea <abadea@ixiacom.com>
---
ip/ipxfrm.c | 2 ++
ip/xfrm_state.c | 6 +++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 18250de..7dc36f3 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -780,6 +780,8 @@ void xfrm_state_info_print(struct xfrm_usersa_info *xsinfo,
XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_DECAP_DSCP, "decap-dscp");
XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_NOPMTUDISC, "nopmtudisc");
XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_WILDRECV, "wildrecv");
+ XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_ICMP, "icmp");
+ XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_AF_UNSPEC, "af-unspec");
if (flags)
fprintf(fp, "%x", flags);
}
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
index b1e3f22..32238ab 100644
--- a/ip/xfrm_state.c
+++ b/ip/xfrm_state.c
@@ -83,7 +83,7 @@ static void usage(void)
//fprintf(stderr, "REQID - number(default=0)\n");
fprintf(stderr, "FLAG-LIST := [ FLAG-LIST ] FLAG\n");
- fprintf(stderr, "FLAG := [ noecn | decap-dscp | nopmtudisc | wildrecv ]\n");
+ fprintf(stderr, "FLAG := [ noecn | decap-dscp | nopmtudisc | wildrecv | icmp | af-unspec ]\n");
fprintf(stderr, "ENCAP := ENCAP-TYPE SPORT DPORT OADDR\n");
fprintf(stderr, "ENCAP-TYPE := espinudp | espinudp-nonike\n");
@@ -210,6 +210,10 @@ static int xfrm_state_flag_parse(__u8 *flags, int *argcp, char ***argvp)
*flags |= XFRM_STATE_NOPMTUDISC;
else if (strcmp(*argv, "wildrecv") == 0)
*flags |= XFRM_STATE_WILDRECV;
+ else if (strcmp(*argv, "icmp") == 0)
+ *flags |= XFRM_STATE_ICMP;
+ else if (strcmp(*argv, "af-unspec") == 0)
+ *flags |= XFRM_STATE_AF_UNSPEC;
else {
PREV_ARG(); /* back track */
break;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH iproute2] ip xfrm state: parse and print "icmp" and "af-unspec" flags
2010-01-11 15:23 [PATCH iproute2] ip xfrm state: parse and print "icmp" and "af-unspec" flags Alex Badea
@ 2010-01-21 18:10 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2010-01-21 18:10 UTC (permalink / raw)
To: Alex Badea; +Cc: netdev, Alex Badea
On Mon, 11 Jan 2010 17:23:41 +0200
Alex Badea <abadea@ixiacom.com> wrote:
> Convert to/from XFRM_STATE_ICMP and XFRM_STATE_AF_UNSPEC state flags.
>
> Signed-off-by: Alex Badea <abadea@ixiacom.com>
> ---
> ip/ipxfrm.c | 2 ++
> ip/xfrm_state.c | 6 +++++-
> 2 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
> index 18250de..7dc36f3 100644
> --- a/ip/ipxfrm.c
> +++ b/ip/ipxfrm.c
> @@ -780,6 +780,8 @@ void xfrm_state_info_print(struct xfrm_usersa_info *xsinfo,
> XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_DECAP_DSCP, "decap-dscp");
> XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_NOPMTUDISC, "nopmtudisc");
> XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_WILDRECV, "wildrecv");
> + XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_ICMP, "icmp");
> + XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_AF_UNSPEC, "af-unspec");
> if (flags)
> fprintf(fp, "%x", flags);
> }
> diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
> index b1e3f22..32238ab 100644
> --- a/ip/xfrm_state.c
> +++ b/ip/xfrm_state.c
> @@ -83,7 +83,7 @@ static void usage(void)
> //fprintf(stderr, "REQID - number(default=0)\n");
>
> fprintf(stderr, "FLAG-LIST := [ FLAG-LIST ] FLAG\n");
> - fprintf(stderr, "FLAG := [ noecn | decap-dscp | nopmtudisc | wildrecv ]\n");
> + fprintf(stderr, "FLAG := [ noecn | decap-dscp | nopmtudisc | wildrecv | icmp | af-unspec ]\n");
>
> fprintf(stderr, "ENCAP := ENCAP-TYPE SPORT DPORT OADDR\n");
> fprintf(stderr, "ENCAP-TYPE := espinudp | espinudp-nonike\n");
> @@ -210,6 +210,10 @@ static int xfrm_state_flag_parse(__u8 *flags, int *argcp, char ***argvp)
> *flags |= XFRM_STATE_NOPMTUDISC;
> else if (strcmp(*argv, "wildrecv") == 0)
> *flags |= XFRM_STATE_WILDRECV;
> + else if (strcmp(*argv, "icmp") == 0)
> + *flags |= XFRM_STATE_ICMP;
> + else if (strcmp(*argv, "af-unspec") == 0)
> + *flags |= XFRM_STATE_AF_UNSPEC;
> else {
> PREV_ARG(); /* back track */
> break;
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-21 18:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11 15:23 [PATCH iproute2] ip xfrm state: parse and print "icmp" and "af-unspec" flags Alex Badea
2010-01-21 18:10 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).