Release 4.11 net/atm/pvc.c
/* net/atm/pvc.c - ATM PVC sockets */
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
#include <linux/net.h> /* struct socket, struct proto_ops */
#include <linux/atm.h> /* ATM stuff */
#include <linux/atmdev.h> /* ATM devices */
#include <linux/errno.h> /* error codes */
#include <linux/kernel.h> /* printk */
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/bitops.h>
#include <linux/export.h>
#include <net/sock.h> /* for sock_no_* */
#include "resources.h" /* devs and vccs */
#include "common.h" /* common for PVCs and SVCs */
static int pvc_shutdown(struct socket *sock, int how)
{
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 17 | 100.00% | 1 | 100.00% |
Total | 17 | 100.00% | 1 | 100.00% |
static int pvc_bind(struct socket *sock, struct sockaddr *sockaddr,
int sockaddr_len)
{
struct sock *sk = sock->sk;
struct sockaddr_atmpvc *addr;
struct atm_vcc *vcc;
int error;
if (sockaddr_len != sizeof(struct sockaddr_atmpvc))
return -EINVAL;
addr = (struct sockaddr_atmpvc *)sockaddr;
if (addr->sap_family != AF_ATMPVC)
return -EAFNOSUPPORT;
lock_sock(sk);
vcc = ATM_SD(sock);
if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) {
error = -EBADFD;
goto out;
}
if (test_bit(ATM_VF_PARTIAL, &vcc->flags)) {
if (vcc->vpi != ATM_VPI_UNSPEC)
addr->sap_addr.vpi = vcc->vpi;
if (vcc->vci != ATM_VCI_UNSPEC)
addr->sap_addr.vci = vcc->vci;
}
error = vcc_connect(sock, addr->sap_addr.itf, addr->sap_addr.vpi,
addr->sap_addr.vci);
out:
release_sock(sk);
return error;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 158 | 80.61% | 2 | 66.67% |
Chas Williams | 38 | 19.39% | 1 | 33.33% |
Total | 196 | 100.00% | 3 | 100.00% |
static int pvc_connect(struct socket *sock, struct sockaddr *sockaddr,
int sockaddr_len, int flags)
{
return pvc_bind(sock, sockaddr, sockaddr_len);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 32 | 100.00% | 1 | 100.00% |
Total | 32 | 100.00% | 1 | 100.00% |
static int pvc_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, unsigned int optlen)
{
struct sock *sk = sock->sk;
int error;
lock_sock(sk);
error = vcc_setsockopt(sock, level, optname, optval, optlen);
release_sock(sk);
return error;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Chas Williams | 64 | 96.97% | 1 | 33.33% |
David S. Miller | 1 | 1.52% | 1 | 33.33% |
Al Viro | 1 | 1.52% | 1 | 33.33% |
Total | 66 | 100.00% | 3 | 100.00% |
static int pvc_getsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user *optlen)
{
struct sock *sk = sock->sk;
int error;
lock_sock(sk);
error = vcc_getsockopt(sock, level, optname, optval, optlen);
release_sock(sk);
return error;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Chas Williams | 65 | 97.01% | 1 | 50.00% |
Al Viro | 2 | 2.99% | 1 | 50.00% |
Total | 67 | 100.00% | 2 | 100.00% |
static int pvc_getname(struct socket *sock, struct sockaddr *sockaddr,
int *sockaddr_len, int peer)
{
struct sockaddr_atmpvc *addr;
struct atm_vcc *vcc = ATM_SD(sock);
if (!vcc->dev || !test_bit(ATM_VF_ADDR, &vcc->flags))
return -ENOTCONN;
*sockaddr_len = sizeof(struct sockaddr_atmpvc);
addr = (struct sockaddr_atmpvc *)sockaddr;
memset(addr, 0, sizeof(*addr));
addr->sap_family = AF_ATMPVC;
addr->sap_addr.itf = vcc->dev->number;
addr->sap_addr.vpi = vcc->vpi;
addr->sap_addr.vci = vcc->vci;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 119 | 90.15% | 3 | 75.00% |
Mathias Krause | 13 | 9.85% | 1 | 25.00% |
Total | 132 | 100.00% | 4 | 100.00% |
static const struct proto_ops pvc_proto_ops = {
.family = PF_ATMPVC,
.owner = THIS_MODULE,
.release = vcc_release,
.bind = pvc_bind,
.connect = pvc_connect,
.socketpair = sock_no_socketpair,
.accept = sock_no_accept,
.getname = pvc_getname,
.poll = vcc_poll,
.ioctl = vcc_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = vcc_compat_ioctl,
#endif
.listen = sock_no_listen,
.shutdown = pvc_shutdown,
.setsockopt = pvc_setsockopt,
.getsockopt = pvc_getsockopt,
.sendmsg = vcc_sendmsg,
.recvmsg = vcc_recvmsg,
.mmap = sock_no_mmap,
.sendpage = sock_no_sendpage,
};
static int pvc_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
if (net != &init_net)
return -EAFNOSUPPORT;
sock->ops = &pvc_proto_ops;
return vcc_create(net, sock, protocol, PF_ATMPVC, kern);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 30 | 55.56% | 1 | 20.00% |
Eric W. Biedermann | 20 | 37.04% | 2 | 40.00% |
Eric Paris | 3 | 5.56% | 1 | 20.00% |
Chas Williams | 1 | 1.85% | 1 | 20.00% |
Total | 54 | 100.00% | 5 | 100.00% |
static const struct net_proto_family pvc_family_ops = {
.family = PF_ATMPVC,
.create = pvc_create,
.owner = THIS_MODULE,
};
/*
* Initialize the ATM PVC protocol family
*/
int __init atmpvc_init(void)
{
return sock_register(&pvc_family_ops);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 14 | 93.33% | 4 | 80.00% |
Chas Williams | 1 | 6.67% | 1 | 20.00% |
Total | 15 | 100.00% | 5 | 100.00% |
void atmpvc_exit(void)
{
sock_unregister(PF_ATMPVC);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Chas Williams | 8 | 66.67% | 1 | 50.00% |
Linus Torvalds (pre-git) | 4 | 33.33% | 1 | 50.00% |
Total | 12 | 100.00% | 2 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 435 | 56.57% | 7 | 26.92% |
Chas Williams | 260 | 33.81% | 6 | 23.08% |
Eric W. Biedermann | 20 | 2.60% | 2 | 7.69% |
Rusty Russell | 15 | 1.95% | 1 | 3.85% |
Mathias Krause | 13 | 1.69% | 1 | 3.85% |
David Woodhouse | 10 | 1.30% | 1 | 3.85% |
David S. Miller | 4 | 0.52% | 2 | 7.69% |
Al Viro | 3 | 0.39% | 1 | 3.85% |
Eric Paris | 3 | 0.39% | 1 | 3.85% |
Paul Gortmaker | 3 | 0.39% | 1 | 3.85% |
Stephen Hemminger | 1 | 0.13% | 1 | 3.85% |
Eric Dumazet | 1 | 0.13% | 1 | 3.85% |
Arnaldo Carvalho de Melo | 1 | 0.13% | 1 | 3.85% |
Total | 769 | 100.00% | 26 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.