tag | line | file | source code |
sock | 42 | net/kern_sock.h | int (*create)(struct socket *sock, int protocol); |
sock | 44 | net/kern_sock.h | int (*release)(struct socket *sock, struct socket *peer); |
sock | 45 | net/kern_sock.h | int (*bind)(struct socket *sock, struct sockaddr *umyaddr, |
sock | 47 | net/kern_sock.h | int (*connect)(struct socket *sock, struct sockaddr *uservaddr, |
sock | 50 | net/kern_sock.h | int (*accept)(struct socket *sock, struct socket *newsock); |
sock | 51 | net/kern_sock.h | int (*getname)(struct socket *sock, struct sockaddr *uaddr, |
sock | 53 | net/kern_sock.h | int (*read)(struct socket *sock, char *ubuf, int size, int nonblock); |
sock | 54 | net/kern_sock.h | int (*write)(struct socket *sock, char *ubuf, int size, int nonblock); |
sock | 55 | net/kern_sock.h | int (*select)(struct socket *sock, int sel_type, select_table * wait); |
sock | 56 | net/kern_sock.h | int (*ioctl)(struct socket *sock, unsigned int cmd, unsigned long arg); |
sock | 118 | net/socket.c | struct socket *sock; |
sock | 120 | net/socket.c | for (sock = sockets; sock <= last_socket; ++sock) |
sock | 121 | net/socket.c | if (sock->state != SS_FREE && SOCK_INODE(sock) == inode) |
sock | 122 | net/socket.c | return sock; |
sock | 141 | net/socket.c | struct socket *sock; |
sock | 145 | net/socket.c | for (sock = sockets; sock <= last_socket; ++sock) |
sock | 146 | net/socket.c | if (sock->state == SS_FREE) { |
sock | 147 | net/socket.c | sock->state = SS_UNCONNECTED; |
sock | 149 | net/socket.c | sock->flags = 0; |
sock | 150 | net/socket.c | sock->ops = NULL; |
sock | 151 | net/socket.c | sock->data = NULL; |
sock | 152 | net/socket.c | sock->conn = NULL; |
sock | 153 | net/socket.c | sock->iconn = NULL; |
sock | 163 | net/socket.c | if (!(SOCK_INODE(sock) = get_empty_inode())) { |
sock | 165 | net/socket.c | sock->state = SS_FREE; |
sock | 168 | net/socket.c | SOCK_INODE(sock)->i_mode = S_IFSOCK; |
sock | 169 | net/socket.c | sock->wait = &SOCK_INODE(sock)->i_wait; |
sock | 171 | net/socket.c | sock, SOCK_INODE(sock)); |
sock | 172 | net/socket.c | return sock; |
sock | 195 | net/socket.c | sock_release(struct socket *sock) |
sock | 200 | net/socket.c | PRINTK("sock_release: socket 0x%x, inode 0x%x\n", sock, |
sock | 201 | net/socket.c | SOCK_INODE(sock)); |
sock | 202 | net/socket.c | if ((oldstate = sock->state) != SS_UNCONNECTED) |
sock | 203 | net/socket.c | sock->state = SS_DISCONNECTING; |
sock | 207 | net/socket.c | for (peersock = sock->iconn; peersock; peersock = nextsock) { |
sock | 215 | net/socket.c | peersock = (oldstate == SS_CONNECTED) ? sock->conn : NULL; |
sock | 216 | net/socket.c | if (sock->ops) |
sock | 217 | net/socket.c | sock->ops->release(sock, peersock); |
sock | 220 | net/socket.c | sock->state = SS_FREE; /* this really releases us */ |
sock | 234 | net/socket.c | struct socket *sock; |
sock | 237 | net/socket.c | if (!(sock = socki_lookup(inode))) { |
sock | 241 | net/socket.c | if (sock->flags & SO_ACCEPTCON) |
sock | 243 | net/socket.c | return sock->ops->read(sock, ubuf, size, (file->f_flags & O_NONBLOCK)); |
sock | 249 | net/socket.c | struct socket *sock; |
sock | 252 | net/socket.c | if (!(sock = socki_lookup(inode))) { |
sock | 256 | net/socket.c | if (sock->flags & SO_ACCEPTCON) |
sock | 258 | net/socket.c | return sock->ops->write(sock, ubuf, size,(file->f_flags & O_NONBLOCK)); |
sock | 273 | net/socket.c | struct socket *sock; |
sock | 276 | net/socket.c | if (!(sock = socki_lookup(inode))) { |
sock | 283 | net/socket.c | if (sock->flags & SO_ACCEPTCON) |
sock | 290 | net/socket.c | return sock->ops->ioctl(sock, cmd, arg); |
sock | 296 | net/socket.c | struct socket *sock; |
sock | 301 | net/socket.c | if (!(sock = socki_lookup(inode))) { |
sock | 309 | net/socket.c | if (sock->flags & SO_ACCEPTCON) { |
sock | 312 | net/socket.c | sock->iconn ? "" : "no "); |
sock | 313 | net/socket.c | if (sock->iconn) |
sock | 316 | net/socket.c | return sock->iconn ? 1 : 0; |
sock | 325 | net/socket.c | if (sock->ops && sock->ops->select) |
sock | 326 | net/socket.c | return sock->ops->select(sock, sel_type, wait); |
sock | 333 | net/socket.c | struct socket *sock; |
sock | 342 | net/socket.c | if (!(sock = socki_lookup(inode))) { |
sock | 346 | net/socket.c | sock_release(sock); |
sock | 417 | net/socket.c | struct socket *sock; |
sock | 452 | net/socket.c | if (!(sock = sock_alloc(1))) { |
sock | 456 | net/socket.c | sock->type = type; |
sock | 457 | net/socket.c | sock->ops = ops; |
sock | 458 | net/socket.c | if ((i = sock->ops->create(sock, protocol)) < 0) { |
sock | 459 | net/socket.c | sock_release(sock); |
sock | 463 | net/socket.c | if ((fd = get_fd(SOCK_INODE(sock))) < 0) { |
sock | 464 | net/socket.c | sock_release(sock); |
sock | 524 | net/socket.c | struct socket *sock; |
sock | 528 | net/socket.c | if (!(sock = sockfd_lookup(fd, NULL))) |
sock | 530 | net/socket.c | if ((i = sock->ops->bind(sock, umyaddr, addrlen)) < 0) { |
sock | 545 | net/socket.c | struct socket *sock; |
sock | 548 | net/socket.c | if (!(sock = sockfd_lookup(fd, NULL))) |
sock | 550 | net/socket.c | if (sock->state != SS_UNCONNECTED) { |
sock | 554 | net/socket.c | if (sock->flags & SO_ACCEPTCON) { |
sock | 558 | net/socket.c | sock->flags |= SO_ACCEPTCON; |
sock | 570 | net/socket.c | struct socket *sock, *clientsock, *newsock; |
sock | 574 | net/socket.c | if (!(sock = sockfd_lookup(fd, &file))) |
sock | 576 | net/socket.c | if (sock->state != SS_UNCONNECTED) { |
sock | 580 | net/socket.c | if (!(sock->flags & SO_ACCEPTCON)) { |
sock | 589 | net/socket.c | while (!(clientsock = sock->iconn)) { |
sock | 592 | net/socket.c | interruptible_sleep_on(sock->wait); |
sock | 603 | net/socket.c | newsock->type = sock->type; |
sock | 604 | net/socket.c | newsock->ops = sock->ops; |
sock | 605 | net/socket.c | if ((i = sock->ops->dup(newsock, sock)) < 0) { |
sock | 619 | net/socket.c | sock->iconn = clientsock->next; |
sock | 625 | net/socket.c | newsock->ops->accept(sock, newsock); |
sock | 627 | net/socket.c | sock, newsock, clientsock); |
sock | 642 | net/socket.c | struct socket *sock; |
sock | 646 | net/socket.c | if (!(sock = sockfd_lookup(fd, NULL))) |
sock | 648 | net/socket.c | if (sock->state != SS_UNCONNECTED) { |
sock | 652 | net/socket.c | if ((i = sock->ops->connect(sock, uservaddr, addrlen)) < 0) { |
sock | 662 | net/socket.c | struct socket *sock; |
sock | 665 | net/socket.c | if (!(sock = sockfd_lookup(fd, NULL))) |
sock | 667 | net/socket.c | return sock->ops->getname(sock, usockaddr, usockaddr_len, 0); |
sock | 673 | net/socket.c | struct socket *sock; |
sock | 676 | net/socket.c | if (!(sock = sockfd_lookup(fd, NULL))) |
sock | 678 | net/socket.c | return sock->ops->getname(sock, usockaddr, usockaddr_len, 1); |
sock | 746 | net/socket.c | struct socket *sock; |
sock | 749 | net/socket.c | for (sock = sockets; sock <= last_socket; ++sock) |
sock | 750 | net/socket.c | sock->state = SS_FREE; |
sock | 43 | net/unix.c | static int unix_proto_create(struct socket *sock, int protocol); |
sock | 45 | net/unix.c | static int unix_proto_release(struct socket *sock, struct socket *peer); |
sock | 46 | net/unix.c | static int unix_proto_bind(struct socket *sock, struct sockaddr *umyaddr, |
sock | 48 | net/unix.c | static int unix_proto_connect(struct socket *sock, struct sockaddr *uservaddr, |
sock | 51 | net/unix.c | static int unix_proto_accept(struct socket *sock, struct socket *newsock); |
sock | 52 | net/unix.c | static int unix_proto_getname(struct socket *sock, struct sockaddr *usockaddr, |
sock | 54 | net/unix.c | static int unix_proto_read(struct socket *sock, char *ubuf, int size, |
sock | 56 | net/unix.c | static int unix_proto_write(struct socket *sock, char *ubuf, int size, |
sock | 58 | net/unix.c | static int unix_proto_select(struct socket *sock, int sel_type, select_table * wait); |
sock | 59 | net/unix.c | static int unix_proto_ioctl(struct socket *sock, unsigned int cmd, |
sock | 161 | net/unix.c | unix_proto_create(struct socket *sock, int protocol) |
sock | 165 | net/unix.c | PRINTK("unix_proto_create: socket 0x%x, proto %d\n", sock, protocol); |
sock | 180 | net/unix.c | upd->socket = sock; |
sock | 181 | net/unix.c | UN_DATA(sock) = upd; |
sock | 195 | net/unix.c | unix_proto_release(struct socket *sock, struct socket *peer) |
sock | 197 | net/unix.c | struct unix_proto_data *upd = UN_DATA(sock); |
sock | 200 | net/unix.c | sock, upd); |
sock | 203 | net/unix.c | if (upd->socket != sock) { |
sock | 213 | net/unix.c | UN_DATA(sock) = NULL; |
sock | 231 | net/unix.c | unix_proto_bind(struct socket *sock, struct sockaddr *umyaddr, |
sock | 234 | net/unix.c | struct unix_proto_data *upd = UN_DATA(sock); |
sock | 239 | net/unix.c | PRINTK("unix_proto_bind: socket 0x%x, len=%d\n", sock, |
sock | 284 | net/unix.c | unix_proto_connect(struct socket *sock, struct sockaddr *uservaddr, |
sock | 291 | net/unix.c | PRINTK("unix_proto_connect: socket 0x%x, servlen=%d\n", sock, |
sock | 309 | net/unix.c | if ((i = sock_awaitconn(sock, serv_upd->socket)) < 0) { |
sock | 313 | net/unix.c | unix_data_ref(UN_DATA(sock->conn)); |
sock | 314 | net/unix.c | UN_DATA(sock)->peerupd = UN_DATA(sock->conn); /* ref server */ |
sock | 340 | net/unix.c | unix_proto_accept(struct socket *sock, struct socket *newsock) |
sock | 343 | net/unix.c | sock, newsock); |
sock | 353 | net/unix.c | unix_proto_getname(struct socket *sock, struct sockaddr *usockaddr, |
sock | 359 | net/unix.c | PRINTK("unix_proto_getname: socket 0x%x for %s\n", sock, |
sock | 362 | net/unix.c | if (sock->state != SS_CONNECTED) { |
sock | 366 | net/unix.c | upd = UN_DATA(sock->conn); |
sock | 369 | net/unix.c | upd = UN_DATA(sock); |
sock | 387 | net/unix.c | unix_proto_read(struct socket *sock, char *ubuf, int size, int nonblock) |
sock | 394 | net/unix.c | upd = UN_DATA(sock); |
sock | 396 | net/unix.c | if (sock->state != SS_CONNECTED) { |
sock | 398 | net/unix.c | return (sock->state == SS_DISCONNECTING) ? 0 : -EINVAL; |
sock | 403 | net/unix.c | interruptible_sleep_on(sock->wait); |
sock | 408 | net/unix.c | if (sock->state == SS_DISCONNECTING) { |
sock | 438 | net/unix.c | if (sock->state == SS_CONNECTED) |
sock | 439 | net/unix.c | wake_up(sock->conn->wait); |
sock | 451 | net/unix.c | unix_proto_write(struct socket *sock, char *ubuf, int size, int nonblock) |
sock | 458 | net/unix.c | if (sock->state != SS_CONNECTED) { |
sock | 460 | net/unix.c | if (sock->state == SS_DISCONNECTING) { |
sock | 466 | net/unix.c | pupd = UN_DATA(sock)->peerupd; /* safer than sock->conn */ |
sock | 472 | net/unix.c | interruptible_sleep_on(sock->wait); |
sock | 477 | net/unix.c | if (sock->state == SS_DISCONNECTING) { |
sock | 501 | net/unix.c | if (sock->state == SS_DISCONNECTING) { |
sock | 516 | net/unix.c | if (sock->state == SS_CONNECTED) |
sock | 517 | net/unix.c | wake_up(sock->conn->wait); |
sock | 524 | net/unix.c | unix_proto_select(struct socket *sock, int sel_type, select_table * wait) |
sock | 529 | net/unix.c | upd = UN_DATA(sock); |
sock | 534 | net/unix.c | else if (sock->state != SS_CONNECTED) { |
sock | 538 | net/unix.c | select_wait(sock->wait,wait); |
sock | 542 | net/unix.c | if (sock->state != SS_CONNECTED) { |
sock | 546 | net/unix.c | peerupd = UN_DATA(sock->conn); |
sock | 551 | net/unix.c | select_wait(sock->wait,wait); |
sock | 560 | net/unix.c | unix_proto_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
sock | 564 | net/unix.c | upd = UN_DATA(sock); |
sock | 565 | net/unix.c | peerupd = (sock->state == SS_CONNECTED) ? UN_DATA(sock->conn) : NULL; |