Skip to content

Commit

Permalink
[XFRM]: Add module alias for transformation type.
Browse files Browse the repository at this point in the history
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>
Acked-by: Ingo Oeser <netdev@axxeo.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Masahide NAKAMURA authored and David S. Miller committed Jul 11, 2007
1 parent 59fbb3a commit d3d6dd3
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 1 deletion.
10 changes: 10 additions & 0 deletions include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions net/ipv4/ah4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions net/ipv4/esp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions net/ipv4/ipcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions net/ipv4/xfrm4_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions net/ipv6/ah6.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,3 +554,4 @@ module_init(ah6_init);
module_exit(ah6_fini);

MODULE_LICENSE("GPL");
MODULE_ALIAS_XFRM_TYPE(AF_INET6, XFRM_PROTO_AH);
1 change: 1 addition & 0 deletions net/ipv6/esp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,4 @@ module_init(esp6_init);
module_exit(esp6_fini);

MODULE_LICENSE("GPL");
MODULE_ALIAS_XFRM_TYPE(AF_INET6, XFRM_PROTO_ESP);
2 changes: 1 addition & 1 deletion net/ipv6/ipcomp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 2 additions & 0 deletions net/ipv6/mip6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions net/ipv6/xfrm6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit d3d6dd3

Please sign in to comment.