Release 4.11 drivers/net/ppp/pppox.c
/** -*- linux-c -*- ***********************************************************
* Linux PPP over X/Ethernet (PPPoX/PPPoE) Sockets
*
* PPPoX --- Generic PPP encapsulation socket family
* PPPoE --- PPP over Ethernet (RFC 2516)
*
*
* Version: 0.5.2
*
* Author: Michal Ostrowski <mostrows@speakeasy.net>
*
* 051000 : Initialization cleanup
*
* License:
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
*/
#include <linux/string.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/net.h>
#include <linux/init.h>
#include <linux/if_pppox.h>
#include <linux/ppp_defs.h>
#include <linux/ppp-ioctl.h>
#include <linux/ppp_channel.h>
#include <linux/kmod.h>
#include <net/sock.h>
#include <linux/uaccess.h>
static const struct pppox_proto *pppox_protos[PX_MAX_PROTO + 1];
int register_pppox_proto(int proto_num, const struct pppox_proto *pp)
{
if (proto_num < 0 || proto_num > PX_MAX_PROTO)
return -EINVAL;
if (pppox_protos[proto_num])
return -EALREADY;
pppox_protos[proto_num] = pp;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 46 | 93.88% | 1 | 33.33% |
Arnaldo Carvalho de Melo | 2 | 4.08% | 1 | 33.33% |
Eric Dumazet | 1 | 2.04% | 1 | 33.33% |
Total | 49 | 100.00% | 3 | 100.00% |
void unregister_pppox_proto(int proto_num)
{
if (proto_num >= 0 && proto_num <= PX_MAX_PROTO)
pppox_protos[proto_num] = NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 24 | 96.00% | 1 | 50.00% |
Arnaldo Carvalho de Melo | 1 | 4.00% | 1 | 50.00% |
Total | 25 | 100.00% | 2 | 100.00% |
void pppox_unbind_sock(struct sock *sk)
{
/* Clear connection to ppp device, if attached. */
if (sk->sk_state & (PPPOX_BOUND | PPPOX_CONNECTED)) {
ppp_unregister_channel(&pppox_sk(sk)->chan);
sk->sk_state = PPPOX_DEAD;
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 31 | 73.81% | 1 | 20.00% |
Michal Ostrowski | 5 | 11.90% | 1 | 20.00% |
David S. Miller | 3 | 7.14% | 1 | 20.00% |
Arnaldo Carvalho de Melo | 2 | 4.76% | 1 | 20.00% |
Florian Zumbiehl | 1 | 2.38% | 1 | 20.00% |
Total | 42 | 100.00% | 5 | 100.00% |
EXPORT_SYMBOL(register_pppox_proto);
EXPORT_SYMBOL(unregister_pppox_proto);
EXPORT_SYMBOL(pppox_unbind_sock);
int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
struct sock *sk = sock->sk;
struct pppox_sock *po = pppox_sk(sk);
int rc;
lock_sock(sk);
switch (cmd) {
case PPPIOCGCHAN: {
int index;
rc = -ENOTCONN;
if (!(sk->sk_state & PPPOX_CONNECTED))
break;
rc = -EINVAL;
index = ppp_channel_index(&po->chan);
if (put_user(index , (int __user *) arg))
break;
rc = 0;
sk->sk_state |= PPPOX_BOUND;
break;
}
default:
rc = pppox_protos[sk->sk_protocol]->ioctl ?
pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, arg) : -ENOTTY;
}
release_sock(sk);
return rc;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 128 | 82.05% | 1 | 14.29% |
Arnaldo Carvalho de Melo | 16 | 10.26% | 3 | 42.86% |
Florian Zumbiehl | 6 | 3.85% | 1 | 14.29% |
David S. Miller | 5 | 3.21% | 1 | 14.29% |
Al Viro | 1 | 0.64% | 1 | 14.29% |
Total | 156 | 100.00% | 7 | 100.00% |
EXPORT_SYMBOL(pppox_ioctl);
static int pppox_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
int rc = -EPROTOTYPE;
if (protocol < 0 || protocol > PX_MAX_PROTO)
goto out;
rc = -EPROTONOSUPPORT;
if (!pppox_protos[protocol])
request_module("net-pf-%d-proto-%d", PF_PPPOX, protocol);
if (!pppox_protos[protocol] ||
!try_module_get(pppox_protos[protocol]->owner))
goto out;
rc = pppox_protos[protocol]->create(net, sock, kern);
module_put(pppox_protos[protocol]->owner);
out:
return rc;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Arnaldo Carvalho de Melo | 45 | 38.79% | 3 | 27.27% |
Linus Torvalds (pre-git) | 41 | 35.34% | 1 | 9.09% |
James Chapman | 13 | 11.21% | 1 | 9.09% |
Eric W. Biedermann | 9 | 7.76% | 2 | 18.18% |
Guillaume Nault | 3 | 2.59% | 1 | 9.09% |
Eric Paris | 3 | 2.59% | 1 | 9.09% |
Linus Torvalds | 1 | 0.86% | 1 | 9.09% |
Johannes Berg | 1 | 0.86% | 1 | 9.09% |
Total | 116 | 100.00% | 11 | 100.00% |
static const struct net_proto_family pppox_proto_family = {
.family = PF_PPPOX,
.create = pppox_create,
.owner = THIS_MODULE,
};
static int __init pppox_init(void)
{
return sock_register(&pppox_proto_family);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 14 | 87.50% | 3 | 60.00% |
Arnaldo Carvalho de Melo | 1 | 6.25% | 1 | 20.00% |
Linus Torvalds | 1 | 6.25% | 1 | 20.00% |
Total | 16 | 100.00% | 5 | 100.00% |
static void __exit pppox_exit(void)
{
sock_unregister(PF_PPPOX);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 13 | 92.86% | 2 | 66.67% |
Linus Torvalds | 1 | 7.14% | 1 | 33.33% |
Total | 14 | 100.00% | 3 | 100.00% |
module_init(pppox_init);
module_exit(pppox_exit);
MODULE_AUTHOR("Michal Ostrowski <mostrows@speakeasy.net>");
MODULE_DESCRIPTION("PPP over Ethernet driver (generic socket layer)");
MODULE_LICENSE("GPL");
MODULE_ALIAS_NETPROTO(PF_PPPOX);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 373 | 68.32% | 3 | 10.71% |
Arnaldo Carvalho de Melo | 85 | 15.57% | 7 | 25.00% |
Linus Torvalds | 20 | 3.66% | 3 | 10.71% |
James Chapman | 16 | 2.93% | 1 | 3.57% |
David S. Miller | 13 | 2.38% | 2 | 7.14% |
Eric W. Biedermann | 9 | 1.65% | 2 | 7.14% |
Guillaume Nault | 8 | 1.47% | 1 | 3.57% |
Florian Zumbiehl | 7 | 1.28% | 2 | 7.14% |
Michal Ostrowski | 6 | 1.10% | 1 | 3.57% |
Eric Paris | 3 | 0.55% | 1 | 3.57% |
Eric Dumazet | 2 | 0.37% | 1 | 3.57% |
Stephen Hemminger | 1 | 0.18% | 1 | 3.57% |
Johannes Berg | 1 | 0.18% | 1 | 3.57% |
Paul Mackerras | 1 | 0.18% | 1 | 3.57% |
Al Viro | 1 | 0.18% | 1 | 3.57% |
Total | 546 | 100.00% | 28 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.