Lines Matching refs:sock
21 #include <net/sock.h> /* for sock_no_* */
29 static int svc_create(struct net *net, struct socket *sock, int protocol,
39 static int svc_shutdown(struct socket *sock, int how)
48 struct sock *sk = sk_atm(vcc);
73 static int svc_release(struct socket *sock)
75 struct sock *sk = sock->sk;
79 vcc = ATM_SD(sock);
88 vcc_release(sock);
93 static int svc_bind(struct socket *sock, struct sockaddr *sockaddr,
97 struct sock *sk = sock->sk;
105 if (sock->state == SS_CONNECTED) {
109 if (sock->state != SS_UNCONNECTED) {
113 vcc = ATM_SD(sock);
148 static int svc_connect(struct socket *sock, struct sockaddr *sockaddr,
152 struct sock *sk = sock->sk;
154 struct atm_vcc *vcc = ATM_SD(sock);
164 switch (sock->state) {
176 sock->state = SS_UNCONNECTED;
208 sock->state = SS_CONNECTING;
276 error = vcc_connect(sock, vcc->itf, vcc->vpi, vcc->vci);
278 sock->state = SS_CONNECTED;
286 static int svc_listen(struct socket *sock, int backlog)
289 struct sock *sk = sock->sk;
290 struct atm_vcc *vcc = ATM_SD(sock);
325 static int svc_accept(struct socket *sock, struct socket *newsock, int flags)
327 struct sock *sk = sock->sk;
330 struct atm_vcc *old_vcc = ATM_SD(sock);
423 static int svc_getname(struct socket *sock, struct sockaddr *sockaddr,
430 memcpy(addr, peer ? &ATM_SD(sock)->remote : &ATM_SD(sock)->local,
437 struct sock *sk = sk_atm(vcc);
454 static int svc_setsockopt(struct socket *sock, int level, int optname,
457 struct sock *sk = sock->sk;
458 struct atm_vcc *vcc = ATM_SD(sock);
491 error = vcc_setsockopt(sock, level, optname, optval, optlen);
499 static int svc_getsockopt(struct socket *sock, int level, int optname,
502 struct sock *sk = sock->sk;
507 error = vcc_getsockopt(sock, level, optname, optval, optlen);
518 if (copy_to_user(optval, &ATM_SD(sock)->sap, sizeof(struct atm_sap))) {
527 static int svc_addparty(struct socket *sock, struct sockaddr *sockaddr,
531 struct sock *sk = sock->sk;
532 struct atm_vcc *vcc = ATM_SD(sock);
557 static int svc_dropparty(struct socket *sock, int ep_ref)
560 struct sock *sk = sock->sk;
561 struct atm_vcc *vcc = ATM_SD(sock);
583 static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
587 struct atm_vcc *vcc = ATM_SD(sock);
595 error = svc_addparty(sock, (struct sockaddr *)&sa, sizeof(sa),
603 error = svc_dropparty(sock, ep_ref);
606 error = vcc_ioctl(sock, cmd, arg);
613 static int svc_compat_ioctl(struct socket *sock, unsigned int cmd,
623 return svc_ioctl(sock, cmd, arg);
625 return vcc_compat_ioctl(sock, cmd, arg);
655 static int svc_create(struct net *net, struct socket *sock, int protocol,
663 sock->ops = &svc_proto_ops;
664 error = vcc_create(net, sock, protocol, AF_ATMSVC);
667 ATM_SD(sock)->local.sas_family = AF_ATMSVC;
668 ATM_SD(sock)->remote.sas_family = AF_ATMSVC;