* [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.)
@ 2007-05-25 4:23 nakam
2007-05-25 5:32 ` Herbert Xu
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: nakam @ 2007-05-25 4:23 UTC (permalink / raw)
To: netdev, davem; +Cc: netdev, herbert, jmorris, kazunori, mk, Masahide NAKAMURA
Hi Ingo and all,
This is the third one of MIPv6 module patch. It can be applied
after two patches which are already sent to the list.
Could you review it?
It is clean-up for XFRM type modules and adds aliases with its
protocol:
ESP, AH, IPCOMP, IPIP and IPv6 for IPsec
ROUTING and DSTOPTS for MIPv6
It is almost the same thing as XFRM mode alias, but it is added
new defines XFRM_PROTO_XXX for preprocessing since some protocols
are defined as enum.
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6•org>
---
include/net/xfrm.h | 10 ++++++++++
net/ipv4/ah4.c | 1 +
net/ipv4/esp4.c | 1 +
net/ipv4/ipcomp.c | 1 +
net/ipv4/xfrm4_tunnel.c | 1 +
net/ipv6/ah6.c | 1 +
net/ipv6/esp6.c | 1 +
net/ipv6/ipcomp6.c | 2 +-
net/ipv6/mip6.c | 2 ++
net/ipv6/xfrm6_tunnel.c | 1 +
10 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 1e53520..c9f895f 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -19,9 +19,19 @@
#include <net/ipv6.h>
#include <net/ip6_fib.h>
+#define XFRM_PROTO_ESP 50
+#define XFRM_PROTO_AH 51
+#define XFRM_PROTO_COMP 108
+#define XFRM_PROTO_IPIP 4
+#define XFRM_PROTO_IPV6 41
+#define XFRM_PROTO_ROUTING IPPROTO_ROUTING
+#define XFRM_PROTO_DSTOPTS IPPROTO_DSTOPTS
+
#define XFRM_ALIGN8(len) (((len) + 7) & ~7)
#define MODULE_ALIAS_XFRM_MODE(family, encap) \
MODULE_ALIAS("xfrm-mode-" __stringify(family) "-" __stringify(encap))
+#define MODULE_ALIAS_XFRM_TYPE(family, proto) \
+ MODULE_ALIAS("xfrm-type-" __stringify(family) "-" __stringify(proto))
extern struct sock *xfrm_nl;
extern u32 sysctl_xfrm_aevent_etime;
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index 6da8ff5..7a23e59 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -339,3 +339,4 @@ static void __exit ah4_fini(void)
module_init(ah4_init);
module_exit(ah4_fini);
MODULE_LICENSE("GPL");
+MODULE_ALIAS_XFRM_TYPE(AF_INET, XFRM_PROTO_AH);
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 47c95e8..98767a4 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -481,3 +481,4 @@ static void __exit esp4_fini(void)
module_init(esp4_init);
module_exit(esp4_fini);
MODULE_LICENSE("GPL");
+MODULE_ALIAS_XFRM_TYPE(AF_INET, XFRM_PROTO_ESP);
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index ab86137..e787044 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -485,3 +485,4 @@ MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("IP Payload Compression Protocol (IPComp) - RFC3173");
MODULE_AUTHOR("James Morris <jmorris@intercode•com.au>");
+MODULE_ALIAS_XFRM_TYPE(AF_INET, XFRM_PROTO_COMP);
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c
index 5685103..9275c79 100644
--- a/net/ipv4/xfrm4_tunnel.c
+++ b/net/ipv4/xfrm4_tunnel.c
@@ -109,3 +109,4 @@ static void __exit ipip_fini(void)
module_init(ipip_init);
module_exit(ipip_fini);
MODULE_LICENSE("GPL");
+MODULE_ALIAS_XFRM_TYPE(AF_INET, XFRM_PROTO_IPIP);
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 7f764f9..5669430 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -554,3 +554,4 @@ module_init(ah6_init);
module_exit(ah6_fini);
MODULE_LICENSE("GPL");
+MODULE_ALIAS_XFRM_TYPE(AF_INET6, XFRM_PROTO_AH);
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 7107bb7..2db31ce 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -421,3 +421,4 @@ module_init(esp6_init);
module_exit(esp6_fini);
MODULE_LICENSE("GPL");
+MODULE_ALIAS_XFRM_TYPE(AF_INET6, XFRM_PROTO_ESP);
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 1ee50b5..473f165 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -500,4 +500,4 @@ MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("IP Payload Compression Protocol (IPComp) for IPv6 - RFC3173");
MODULE_AUTHOR("Mitsuru KANDA <mk@linux-ipv6•org>");
-
+MODULE_ALIAS_XFRM_TYPE(AF_INET6, XFRM_PROTO_COMP);
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index 20c78ec..8a1399c 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -514,3 +514,5 @@ module_init(mip6_init);
module_exit(mip6_fini);
MODULE_LICENSE("GPL");
+MODULE_ALIAS_XFRM_TYPE(AF_INET6, XFRM_PROTO_DSTOPTS);
+MODULE_ALIAS_XFRM_TYPE(AF_INET6, XFRM_PROTO_ROUTING);
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index 5502cc9..6f87dd5 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -379,3 +379,4 @@ static void __exit xfrm6_tunnel_fini(void)
module_init(xfrm6_tunnel_init);
module_exit(xfrm6_tunnel_fini);
MODULE_LICENSE("GPL");
+MODULE_ALIAS_XFRM_TYPE(AF_INET6, XFRM_PROTO_IPV6);
--
1.4.4.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.)
2007-05-25 4:23 [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.) nakam
@ 2007-05-25 5:32 ` Herbert Xu
2007-05-25 5:34 ` [PATCH] [XFRM]: Add module alias for transformation type YOSHIFUJI Hideaki / 吉藤英明
2007-05-31 15:10 ` [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.) Ingo Oeser
2007-06-27 6:58 ` [PATCH] [XFRM]: Add module alias for transformation type David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2007-05-25 5:32 UTC (permalink / raw)
To: nakam; +Cc: netdev, davem, netdev, jmorris, kazunori, mk
On Fri, May 25, 2007 at 01:23:23PM +0900, nakam@linux-ipv6•org wrote:
>
> diff --git a/include/net/xfrm.h b/include/net/xfrm.h
> index 1e53520..c9f895f 100644
> --- a/include/net/xfrm.h
> +++ b/include/net/xfrm.h
> @@ -19,9 +19,19 @@
> #include <net/ipv6.h>
> #include <net/ip6_fib.h>
>
> +#define XFRM_PROTO_ESP 50
> +#define XFRM_PROTO_AH 51
> +#define XFRM_PROTO_COMP 108
> +#define XFRM_PROTO_IPIP 4
> +#define XFRM_PROTO_IPV6 41
> +#define XFRM_PROTO_ROUTING IPPROTO_ROUTING
> +#define XFRM_PROTO_DSTOPTS IPPROTO_DSTOPTS
Could we use the existing IPPROTO_* values for all of these?
Otherwise this looks pretty good.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor•apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] [XFRM]: Add module alias for transformation type.
2007-05-25 5:32 ` Herbert Xu
@ 2007-05-25 5:34 ` YOSHIFUJI Hideaki / 吉藤英明
2007-05-25 5:37 ` Herbert Xu
0 siblings, 1 reply; 6+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-05-25 5:34 UTC (permalink / raw)
To: herbert; +Cc: nakam, netdev, davem, netdev, jmorris, kazunori, mk, yoshfuji
In article <20070525053220.GA24362@gondor•apana.org.au> (at Fri, 25 May 2007 15:32:20 +1000), Herbert Xu <herbert@gondor•apana.org.au> says:
> On Fri, May 25, 2007 at 01:23:23PM +0900, nakam@linux-ipv6•org wrote:
> >
> > diff --git a/include/net/xfrm.h b/include/net/xfrm.h
> > index 1e53520..c9f895f 100644
> > --- a/include/net/xfrm.h
> > +++ b/include/net/xfrm.h
> > @@ -19,9 +19,19 @@
> > #include <net/ipv6.h>
> > #include <net/ip6_fib.h>
> >
> > +#define XFRM_PROTO_ESP 50
> > +#define XFRM_PROTO_AH 51
> > +#define XFRM_PROTO_COMP 108
> > +#define XFRM_PROTO_IPIP 4
> > +#define XFRM_PROTO_IPV6 41
> > +#define XFRM_PROTO_ROUTING IPPROTO_ROUTING
> > +#define XFRM_PROTO_DSTOPTS IPPROTO_DSTOPTS
>
> Could we use the existing IPPROTO_* values for all of these?
No, because they are of enums.
--yoshfuji
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [XFRM]: Add module alias for transformation type.
2007-05-25 5:34 ` [PATCH] [XFRM]: Add module alias for transformation type YOSHIFUJI Hideaki / 吉藤英明
@ 2007-05-25 5:37 ` Herbert Xu
0 siblings, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2007-05-25 5:37 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明
Cc: nakam, netdev, davem, netdev, jmorris, kazunori, mk
On Fri, May 25, 2007 at 02:34:34PM +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote:
> > Could we use the existing IPPROTO_* values for all of these?
>
> No, because they are of enums.
Good point. I've forgotten about these module alias hacks :)
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor•apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.)
2007-05-25 4:23 [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.) nakam
2007-05-25 5:32 ` Herbert Xu
@ 2007-05-31 15:10 ` Ingo Oeser
2007-06-27 6:58 ` [PATCH] [XFRM]: Add module alias for transformation type David Miller
2 siblings, 0 replies; 6+ messages in thread
From: Ingo Oeser @ 2007-05-31 15:10 UTC (permalink / raw)
To: nakam; +Cc: davem, netdev, herbert, jmorris, kazunori, mk
Dear Nakamura-san,
nakam@linux-ipv6•org schrieb:
> This is the third one of MIPv6 module patch. It can be applied
> after two patches which are already sent to the list.
> Could you review it?
They look good. Thanks for taking the time to clean this up!
Acked-by: Ingo Oeser <netdev@axxeo•de>
Best Regards
Ingo Oeser
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [XFRM]: Add module alias for transformation type.
2007-05-25 4:23 [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.) nakam
2007-05-25 5:32 ` Herbert Xu
2007-05-31 15:10 ` [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.) Ingo Oeser
@ 2007-06-27 6:58 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2007-06-27 6:58 UTC (permalink / raw)
To: nakam; +Cc: netdev, netdev, herbert, jmorris, kazunori, mk
From: nakam@linux-ipv6•org
Date: Fri, 25 May 2007 13:23:23 +0900
> Hi Ingo and all,
>
> This is the third one of MIPv6 module patch. It can be applied
> after two patches which are already sent to the list.
> Could you review it?
>
>
> It is clean-up for XFRM type modules and adds aliases with its
> protocol:
> ESP, AH, IPCOMP, IPIP and IPv6 for IPsec
> ROUTING and DSTOPTS for MIPv6
>
> It is almost the same thing as XFRM mode alias, but it is added
> new defines XFRM_PROTO_XXX for preprocessing since some protocols
> are defined as enum.
>
> Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6•org>
I have also applied this patch, thank you!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-06-27 6:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-25 4:23 [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.) nakam
2007-05-25 5:32 ` Herbert Xu
2007-05-25 5:34 ` [PATCH] [XFRM]: Add module alias for transformation type YOSHIFUJI Hideaki / 吉藤英明
2007-05-25 5:37 ` Herbert Xu
2007-05-31 15:10 ` [PATCH] [XFRM]: Add module alias for transformation type. (Re: [PATCH 2/2] [IPV6] MIP6: Loadable module support for MIPv6.) Ingo Oeser
2007-06-27 6:58 ` [PATCH] [XFRM]: Add module alias for transformation type David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox