Release 4.11 net/ipv4/xfrm4_tunnel.c
/* xfrm4_tunnel.c: Generic IP tunnel transformer.
*
* Copyright (C) 2003 David S. Miller (davem@redhat.com)
*/
#define pr_fmt(fmt) "IPsec: " fmt
#include <linux/skbuff.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <net/xfrm.h>
#include <net/ip.h>
#include <net/protocol.h>
static int ipip_output(struct xfrm_state *x, struct sk_buff *skb)
{
skb_push(skb, -skb_network_offset(skb));
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 18 | 60.00% | 4 | 66.67% |
David S. Miller | 10 | 33.33% | 1 | 16.67% |
James Morris | 2 | 6.67% | 1 | 16.67% |
Total | 30 | 100.00% | 6 | 100.00% |
static int ipip_xfrm_rcv(struct xfrm_state *x, struct sk_buff *skb)
{
return ip_hdr(skb)->protocol;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 18 | 75.00% | 1 | 50.00% |
Herbert Xu | 6 | 25.00% | 1 | 50.00% |
Total | 24 | 100.00% | 2 | 100.00% |
static int ipip_init_state(struct xfrm_state *x)
{
if (x->props.mode != XFRM_MODE_TUNNEL)
return -EINVAL;
if (x->encap)
return -EINVAL;
x->props.header_len = sizeof(struct iphdr);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 26 | 52.00% | 1 | 25.00% |
James Morris | 12 | 24.00% | 1 | 25.00% |
Herbert Xu | 10 | 20.00% | 1 | 25.00% |
Masahide Nakamura | 2 | 4.00% | 1 | 25.00% |
Total | 50 | 100.00% | 4 | 100.00% |
static void ipip_destroy(struct xfrm_state *x)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 10 | 100.00% | 1 | 100.00% |
Total | 10 | 100.00% | 1 | 100.00% |
static const struct xfrm_type ipip_type = {
.description = "IPIP",
.owner = THIS_MODULE,
.proto = IPPROTO_IPIP,
.init_state = ipip_init_state,
.destructor = ipip_destroy,
.input = ipip_xfrm_rcv,
.output = ipip_output
};
static int xfrm_tunnel_rcv(struct sk_buff *skb)
{
return xfrm4_rcv_spi(skb, IPPROTO_IPIP, ip_hdr(skb)->saddr);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 26 | 100.00% | 2 | 100.00% |
Total | 26 | 100.00% | 2 | 100.00% |
static int xfrm_tunnel_err(struct sk_buff *skb, u32 info)
{
return -ENOENT;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 18 | 100.00% | 1 | 100.00% |
Total | 18 | 100.00% | 1 | 100.00% |
static struct xfrm_tunnel xfrm_tunnel_handler __read_mostly = {
.handler = xfrm_tunnel_rcv,
.err_handler = xfrm_tunnel_err,
.priority = 3,
};
#if IS_ENABLED(CONFIG_IPV6)
static struct xfrm_tunnel xfrm64_tunnel_handler __read_mostly = {
.handler = xfrm_tunnel_rcv,
.err_handler = xfrm_tunnel_err,
.priority = 2,
};
#endif
static int __init ipip_init(void)
{
if (xfrm_register_type(&ipip_type, AF_INET) < 0) {
pr_info("%s: can't add xfrm type\n", __func__);
return -EAGAIN;
}
if (xfrm4_tunnel_register(&xfrm_tunnel_handler, AF_INET)) {
pr_info("%s: can't add xfrm handler for AF_INET\n", __func__);
xfrm_unregister_type(&ipip_type, AF_INET);
return -EAGAIN;
}
#if IS_ENABLED(CONFIG_IPV6)
if (xfrm4_tunnel_register(&xfrm64_tunnel_handler, AF_INET6)) {
pr_info("%s: can't add xfrm handler for AF_INET6\n", __func__);
xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET);
xfrm_unregister_type(&ipip_type, AF_INET);
return -EAGAIN;
}
#endif
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 56 | 48.70% | 1 | 20.00% |
Kazunori Miyazawa | 44 | 38.26% | 1 | 20.00% |
Joe Perches | 12 | 10.43% | 1 | 20.00% |
Herbert Xu | 2 | 1.74% | 1 | 20.00% |
Eric Dumazet | 1 | 0.87% | 1 | 20.00% |
Total | 115 | 100.00% | 5 | 100.00% |
static void __exit ipip_fini(void)
{
#if IS_ENABLED(CONFIG_IPV6)
if (xfrm4_tunnel_deregister(&xfrm64_tunnel_handler, AF_INET6))
pr_info("%s: can't remove xfrm handler for AF_INET6\n",
__func__);
#endif
if (xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET))
pr_info("%s: can't remove xfrm handler for AF_INET\n",
__func__);
if (xfrm_unregister_type(&ipip_type, AF_INET) < 0)
pr_info("%s: can't remove xfrm type\n", __func__);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 33 | 47.14% | 1 | 20.00% |
Kazunori Miyazawa | 22 | 31.43% | 1 | 20.00% |
Joe Perches | 12 | 17.14% | 1 | 20.00% |
Herbert Xu | 2 | 2.86% | 1 | 20.00% |
Eric Dumazet | 1 | 1.43% | 1 | 20.00% |
Total | 70 | 100.00% | 5 | 100.00% |
module_init(ipip_init);
module_exit(ipip_fini);
MODULE_LICENSE("GPL");
MODULE_ALIAS_XFRM_TYPE(AF_INET, XFRM_PROTO_IPIP);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 230 | 47.13% | 1 | 3.85% |
Herbert Xu | 95 | 19.47% | 12 | 46.15% |
Kazunori Miyazawa | 94 | 19.26% | 1 | 3.85% |
Joe Perches | 31 | 6.35% | 2 | 7.69% |
James Morris | 14 | 2.87% | 2 | 7.69% |
Masahide Nakamura | 9 | 1.84% | 2 | 7.69% |
Eric Dumazet | 6 | 1.23% | 3 | 11.54% |
Thomas Schlichter | 5 | 1.02% | 1 | 3.85% |
Arjan van de Ven | 3 | 0.61% | 1 | 3.85% |
Nicolas Dichtel | 1 | 0.20% | 1 | 3.85% |
Total | 488 | 100.00% | 26 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.