tag | line | file | source code |
sk | 206 | drivers/net/d_link.c | static unsigned long d_link_rspace(struct sock *sk); |
sk | 714 | drivers/net/d_link.c | d_link_rspace(struct sock *sk) |
sk | 718 | drivers/net/d_link.c | if (sk != NULL) { |
sk | 723 | drivers/net/d_link.c | sk->max_unacked = D_LINK_MAX_WINDOW - D_LINK_TCP_WINDOW_DIFF; |
sk | 725 | drivers/net/d_link.c | if (sk->rmem_alloc >= SK_RMEM_MAX-2*D_LINK_MIN_WINDOW) return(0); |
sk | 726 | drivers/net/d_link.c | amt = min((SK_RMEM_MAX-sk->rmem_alloc)/2-D_LINK_MIN_WINDOW, D_LINK_MAX_WINDOW); |
sk | 45 | include/linux/skbuff.h | struct sock *sk; |
sk | 131 | include/linux/skbuff.h | extern struct sk_buff * skb_recv_datagram(struct sock *sk,unsigned flags,int noblock, int *err); |
sk | 132 | include/linux/skbuff.h | extern int datagram_select(struct sock *sk, int sel_type, select_table *wait); |
sk | 411 | net/inet/arp.c | if(skb->sk==NULL) |
sk | 414 | net/inet/arp.c | dev_queue_xmit(skb,skb->dev,skb->sk->priority); |
sk | 53 | net/inet/datagram.c | struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, int *err) |
sk | 59 | net/inet/datagram.c | sk->inuse = 1; |
sk | 60 | net/inet/datagram.c | while(skb_peek(&sk->receive_queue) == NULL) /* No data */ |
sk | 63 | net/inet/datagram.c | if (sk->shutdown & RCV_SHUTDOWN) |
sk | 65 | net/inet/datagram.c | release_sock(sk); |
sk | 70 | net/inet/datagram.c | if(sk->err) |
sk | 72 | net/inet/datagram.c | release_sock(sk); |
sk | 73 | net/inet/datagram.c | *err=-sk->err; |
sk | 74 | net/inet/datagram.c | sk->err=0; |
sk | 79 | net/inet/datagram.c | if(sk->type==SOCK_SEQPACKET && sk->state!=TCP_ESTABLISHED) |
sk | 81 | net/inet/datagram.c | release_sock(sk); |
sk | 89 | net/inet/datagram.c | release_sock(sk); |
sk | 93 | net/inet/datagram.c | release_sock(sk); |
sk | 98 | net/inet/datagram.c | if (skb_peek(&sk->receive_queue) == NULL) |
sk | 100 | net/inet/datagram.c | interruptible_sleep_on(sk->sleep); |
sk | 108 | net/inet/datagram.c | if(sk->err != 0) /* Error while waiting for packet |
sk | 112 | net/inet/datagram.c | *err = -sk->err; |
sk | 114 | net/inet/datagram.c | sk->err=0; |
sk | 118 | net/inet/datagram.c | sk->inuse = 1; |
sk | 125 | net/inet/datagram.c | skb=skb_dequeue(&sk->receive_queue); |
sk | 134 | net/inet/datagram.c | skb=skb_peek(&sk->receive_queue); |
sk | 174 | net/inet/datagram.c | int datagram_select(struct sock *sk, int sel_type, select_table *wait) |
sk | 176 | net/inet/datagram.c | select_wait(sk->sleep, wait); |
sk | 180 | net/inet/datagram.c | if (sk->type==SOCK_SEQPACKET && sk->state==TCP_CLOSE) |
sk | 185 | net/inet/datagram.c | if (skb_peek(&sk->receive_queue) != NULL || sk->err != 0) |
sk | 193 | net/inet/datagram.c | if (sk->prot && sk->prot->wspace(sk) >= MIN_WRITE_SPACE) |
sk | 197 | net/inet/datagram.c | if (sk->prot==NULL && sk->sndbuf-sk->wmem_alloc >= MIN_WRITE_SPACE) |
sk | 204 | net/inet/datagram.c | if (sk->err) |
sk | 417 | net/inet/dev.c | skb->sk = NULL; |
sk | 200 | net/inet/icmp.c | skb->sk = NULL; |
sk | 462 | net/inet/icmp.c | skb->sk = NULL; |
sk | 597 | net/inet/icmp.c | skb->sk = NULL; |
sk | 693 | net/inet/icmp.c | skb1->sk = NULL; |
sk | 727 | net/inet/icmp.c | int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
sk | 35 | net/inet/icmp.h | extern int icmp_ioctl(struct sock *sk, int cmd, |
sk | 90 | net/inet/ip.c | extern void sort_send(struct sock *sk); |
sk | 167 | net/inet/ip.c | int ip_ioctl(struct sock *sk, int cmd, unsigned long arg) |
sk | 348 | net/inet/ip.c | if (skb->sk) |
sk | 349 | net/inet/ip.c | skb->sk->saddr = saddr; |
sk | 1015 | net/inet/ip.c | skb->sk = NULL; |
sk | 1120 | net/inet/ip.c | skb->sk = NULL; |
sk | 1163 | net/inet/ip.c | void ip_fragment(struct sock *sk, struct sk_buff *skb, struct device *dev, int is_frag) |
sk | 1286 | net/inet/ip.c | if (sk) |
sk | 1287 | net/inet/ip.c | sk->wmem_alloc += skb2->mem_len; |
sk | 1323 | net/inet/ip.c | ip_queue_xmit(sk, dev, skb2, 1); |
sk | 1762 | net/inet/ip.c | void ip_queue_xmit(struct sock *sk, struct device *dev, |
sk | 1769 | net/inet/ip.c | if (sk == NULL) |
sk | 1813 | net/inet/ip.c | ip_fragment(sk,skb,dev,0); |
sk | 1852 | net/inet/ip.c | sk->packets_out++; |
sk | 1863 | net/inet/ip.c | if (sk->send_head == NULL) |
sk | 1865 | net/inet/ip.c | sk->send_tail = skb; |
sk | 1866 | net/inet/ip.c | sk->send_head = skb; |
sk | 1870 | net/inet/ip.c | sk->send_tail->link3 = skb; |
sk | 1871 | net/inet/ip.c | sk->send_tail = skb; |
sk | 1879 | net/inet/ip.c | reset_timer(sk, TIME_WRITE, sk->rto); |
sk | 1883 | net/inet/ip.c | skb->sk = sk; |
sk | 1897 | net/inet/ip.c | if (sk != NULL) |
sk | 1899 | net/inet/ip.c | dev_queue_xmit(skb, dev, sk->priority); |
sk | 1920 | net/inet/ip.c | void ip_do_retransmit(struct sock *sk, int all) |
sk | 1927 | net/inet/ip.c | prot = sk->prot; |
sk | 1928 | net/inet/ip.c | skb = sk->send_head; |
sk | 1929 | net/inet/ip.c | retransmits = sk->retransmits; |
sk | 1971 | net/inet/ip.c | if (sk && !skb_device_locked(skb)) |
sk | 1977 | net/inet/ip.c | dev_queue_xmit(skb, dev, sk->priority); |
sk | 1985 | net/inet/ip.c | sk->prot->retransmits ++; |
sk | 1996 | net/inet/ip.c | if (sk->retransmits > sk->cong_window) |
sk | 2009 | net/inet/ip.c | void ip_retransmit(struct sock *sk, int all) |
sk | 2011 | net/inet/ip.c | ip_do_retransmit(sk, all); |
sk | 2026 | net/inet/ip.c | sk->retransmits++; |
sk | 2027 | net/inet/ip.c | sk->backoff++; |
sk | 2028 | net/inet/ip.c | sk->rto = min(sk->rto << 1, 120*HZ); |
sk | 2029 | net/inet/ip.c | reset_timer(sk, TIME_WRITE, sk->rto); |
sk | 2041 | net/inet/ip.c | int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen) |
sk | 2062 | net/inet/ip.c | sk->ip_tos=val; |
sk | 2067 | net/inet/ip.c | sk->ip_ttl=val; |
sk | 2080 | net/inet/ip.c | int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen) |
sk | 2090 | net/inet/ip.c | val=sk->ip_tos; |
sk | 2093 | net/inet/ip.c | val=sk->ip_ttl; |
sk | 69 | net/inet/ip.h | extern int ip_ioctl(struct sock *sk, int cmd, |
sk | 81 | net/inet/ip.h | extern void ip_queue_xmit(struct sock *sk, |
sk | 84 | net/inet/ip.h | extern void ip_retransmit(struct sock *sk, int all); |
sk | 85 | net/inet/ip.h | extern void ip_do_retransmit(struct sock *sk, int all); |
sk | 86 | net/inet/ip.h | extern int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen); |
sk | 87 | net/inet/ip.h | extern int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen); |
sk | 65 | net/inet/ipx.c | static void ipx_remove_socket(ipx_socket *sk) |
sk | 71 | net/inet/ipx.c | if(s==sk) |
sk | 79 | net/inet/ipx.c | if(s->next==sk) |
sk | 81 | net/inet/ipx.c | s->next=sk->next; |
sk | 90 | net/inet/ipx.c | static void ipx_insert_socket(ipx_socket *sk) |
sk | 93 | net/inet/ipx.c | sk->next=ipx_socket_list; |
sk | 94 | net/inet/ipx.c | ipx_socket_list=sk; |
sk | 120 | net/inet/ipx.c | static void ipx_destroy_socket(ipx_socket *sk) |
sk | 123 | net/inet/ipx.c | ipx_remove_socket(sk); |
sk | 125 | net/inet/ipx.c | while((skb=skb_dequeue(&sk->receive_queue))!=NULL) |
sk | 130 | net/inet/ipx.c | kfree_s(sk,sizeof(*sk)); |
sk | 347 | net/inet/ipx.c | ipx_socket *sk; |
sk | 349 | net/inet/ipx.c | sk=(ipx_socket *)sock->data; |
sk | 351 | net/inet/ipx.c | if(sk==NULL) |
sk | 367 | net/inet/ipx.c | ipx_socket *sk; |
sk | 370 | net/inet/ipx.c | sk=(ipx_socket *)sock->data; |
sk | 372 | net/inet/ipx.c | if(sk==NULL) |
sk | 393 | net/inet/ipx.c | sk->ipx_type=opt; |
sk | 401 | net/inet/ipx.c | return sock_setsockopt(sk,level,optname,optval,optlen); |
sk | 411 | net/inet/ipx.c | ipx_socket *sk; |
sk | 415 | net/inet/ipx.c | sk=(ipx_socket *)sock->data; |
sk | 416 | net/inet/ipx.c | if(sk==NULL) |
sk | 429 | net/inet/ipx.c | val=sk->ipx_type; |
sk | 437 | net/inet/ipx.c | return sock_getsockopt(sk,level,optname,optval,optlen); |
sk | 456 | net/inet/ipx.c | static void def_callback1(struct sock *sk) |
sk | 458 | net/inet/ipx.c | if(!sk->dead) |
sk | 459 | net/inet/ipx.c | wake_up_interruptible(sk->sleep); |
sk | 462 | net/inet/ipx.c | static void def_callback2(struct sock *sk, int len) |
sk | 464 | net/inet/ipx.c | if(!sk->dead) |
sk | 465 | net/inet/ipx.c | wake_up_interruptible(sk->sleep); |
sk | 470 | net/inet/ipx.c | ipx_socket *sk; |
sk | 471 | net/inet/ipx.c | sk=(ipx_socket *)kmalloc(sizeof(*sk),GFP_KERNEL); |
sk | 472 | net/inet/ipx.c | if(sk==NULL) |
sk | 479 | net/inet/ipx.c | kfree_s((void *)sk,sizeof(*sk)); |
sk | 482 | net/inet/ipx.c | sk->stamp.tv_sec=0; |
sk | 483 | net/inet/ipx.c | sk->rmem_alloc=0; |
sk | 484 | net/inet/ipx.c | sk->dead=0; |
sk | 485 | net/inet/ipx.c | sk->next=NULL; |
sk | 486 | net/inet/ipx.c | sk->broadcast=0; |
sk | 487 | net/inet/ipx.c | sk->rcvbuf=SK_RMEM_MAX; |
sk | 488 | net/inet/ipx.c | sk->sndbuf=SK_WMEM_MAX; |
sk | 489 | net/inet/ipx.c | sk->wmem_alloc=0; |
sk | 490 | net/inet/ipx.c | sk->rmem_alloc=0; |
sk | 491 | net/inet/ipx.c | sk->inuse=0; |
sk | 492 | net/inet/ipx.c | sk->dead=0; |
sk | 493 | net/inet/ipx.c | sk->prot=NULL; /* So we use default free mechanisms */ |
sk | 494 | net/inet/ipx.c | sk->broadcast=0; |
sk | 495 | net/inet/ipx.c | sk->err=0; |
sk | 496 | net/inet/ipx.c | skb_queue_head_init(&sk->receive_queue); |
sk | 497 | net/inet/ipx.c | skb_queue_head_init(&sk->write_queue); |
sk | 498 | net/inet/ipx.c | sk->send_head=NULL; |
sk | 499 | net/inet/ipx.c | skb_queue_head_init(&sk->back_log); |
sk | 500 | net/inet/ipx.c | sk->mtu=512; |
sk | 501 | net/inet/ipx.c | sk->state=TCP_CLOSE; |
sk | 502 | net/inet/ipx.c | sk->socket=sock; |
sk | 503 | net/inet/ipx.c | sk->type=sock->type; |
sk | 504 | net/inet/ipx.c | sk->ipx_type=0; /* General user level IPX */ |
sk | 505 | net/inet/ipx.c | sk->debug=0; |
sk | 506 | net/inet/ipx.c | sk->localroute=0; |
sk | 508 | net/inet/ipx.c | memset(&sk->ipx_dest_addr,'\0',sizeof(sk->ipx_dest_addr)); |
sk | 509 | net/inet/ipx.c | memset(&sk->ipx_source_addr,'\0',sizeof(sk->ipx_source_addr)); |
sk | 510 | net/inet/ipx.c | sk->mtu=IPX_MTU; |
sk | 514 | net/inet/ipx.c | sock->data=(void *)sk; |
sk | 515 | net/inet/ipx.c | sk->sleep=sock->wait; |
sk | 518 | net/inet/ipx.c | sk->state_change=def_callback1; |
sk | 519 | net/inet/ipx.c | sk->data_ready=def_callback2; |
sk | 520 | net/inet/ipx.c | sk->write_space=def_callback1; |
sk | 521 | net/inet/ipx.c | sk->error_report=def_callback1; |
sk | 523 | net/inet/ipx.c | sk->zapped=1; |
sk | 534 | net/inet/ipx.c | ipx_socket *sk=(ipx_socket *)sock->data; |
sk | 535 | net/inet/ipx.c | if(sk==NULL) |
sk | 537 | net/inet/ipx.c | if(!sk->dead) |
sk | 538 | net/inet/ipx.c | sk->state_change(sk); |
sk | 539 | net/inet/ipx.c | sk->dead=1; |
sk | 541 | net/inet/ipx.c | ipx_destroy_socket(sk); |
sk | 547 | net/inet/ipx.c | ipx_socket *sk; |
sk | 552 | net/inet/ipx.c | sk=(ipx_socket *)sock->data; |
sk | 553 | net/inet/ipx.c | if(sk==NULL) |
sk | 559 | net/inet/ipx.c | if(sk->zapped==0) |
sk | 577 | net/inet/ipx.c | if(sk->debug) |
sk | 582 | net/inet/ipx.c | sk->ipx_source_addr.sock=addr.sipx_port; |
sk | 583 | net/inet/ipx.c | memcpy(sk->ipx_source_addr.node,addr.sipx_node,sizeof(sk->ipx_source_addr.node)); |
sk | 584 | net/inet/ipx.c | sk->ipx_source_addr.net=addr.sipx_network; |
sk | 585 | net/inet/ipx.c | if((rt=ipxrtr_get_dev(sk->ipx_source_addr.net))==NULL) |
sk | 587 | net/inet/ipx.c | if(sk->debug) |
sk | 589 | net/inet/ipx.c | sk->ipx_source_addr.net); |
sk | 592 | net/inet/ipx.c | memset(sk->ipx_source_addr.node,'\0',6); |
sk | 593 | net/inet/ipx.c | memcpy(sk->ipx_source_addr.node,rt->dev->dev_addr,rt->dev->addr_len); |
sk | 594 | net/inet/ipx.c | ipx_insert_socket(sk); |
sk | 595 | net/inet/ipx.c | sk->zapped=0; |
sk | 596 | net/inet/ipx.c | if(sk->debug) |
sk | 604 | net/inet/ipx.c | ipx_socket *sk=(ipx_socket *)sock->data; |
sk | 608 | net/inet/ipx.c | if(sk==NULL) |
sk | 614 | net/inet/ipx.c | sk->state = TCP_CLOSE; |
sk | 626 | net/inet/ipx.c | if(sk->ipx_source_addr.net==0) /* Must bind first - no autobinding in this */ |
sk | 630 | net/inet/ipx.c | sk->ipx_dest_addr.net=addr.sipx_network; |
sk | 631 | net/inet/ipx.c | sk->ipx_dest_addr.sock=addr.sipx_port; |
sk | 632 | net/inet/ipx.c | memcpy(sk->ipx_dest_addr.node,addr.sipx_node,sizeof(sk->ipx_source_addr.node)); |
sk | 633 | net/inet/ipx.c | if(ipxrtr_get_dev(sk->ipx_dest_addr.net)==NULL) |
sk | 636 | net/inet/ipx.c | sk->state=TCP_ESTABLISHED; |
sk | 657 | net/inet/ipx.c | ipx_socket *sk; |
sk | 661 | net/inet/ipx.c | sk=(ipx_socket *)sock->data; |
sk | 678 | net/inet/ipx.c | if(sk->state!=TCP_ESTABLISHED) |
sk | 680 | net/inet/ipx.c | addr=&sk->ipx_dest_addr; |
sk | 683 | net/inet/ipx.c | addr=&sk->ipx_source_addr; |
sk | 830 | net/inet/ipx.c | ipx_socket *sk=(ipx_socket *)sock->data; |
sk | 862 | net/inet/ipx.c | if(sk->state!=TCP_ESTABLISHED) |
sk | 865 | net/inet/ipx.c | sipx.sipx_port=sk->ipx_dest_addr.sock; |
sk | 866 | net/inet/ipx.c | sipx.sipx_network=sk->ipx_dest_addr.net; |
sk | 867 | net/inet/ipx.c | memcpy(sipx.sipx_node,sk->ipx_dest_addr.node,sizeof(sipx.sipx_node)); |
sk | 870 | net/inet/ipx.c | if(sk->debug) |
sk | 872 | net/inet/ipx.c | if(!sk->broadcast && memcmp(&sipx.sipx_node,&ipx_broadcast_node,6)==0) |
sk | 876 | net/inet/ipx.c | if(sk->debug) |
sk | 887 | net/inet/ipx.c | if(rt==NULL || ((flags&IPX_RT_ROUTED)&& ((flags&MSG_DONTROUTE)||sk->localroute))) |
sk | 896 | net/inet/ipx.c | if(sk->debug) |
sk | 899 | net/inet/ipx.c | if(size+sk->wmem_alloc>sk->sndbuf) |
sk | 905 | net/inet/ipx.c | if(skb->mem_len+sk->wmem_alloc>sk->sndbuf) |
sk | 911 | net/inet/ipx.c | sk->wmem_alloc+=skb->mem_len; |
sk | 912 | net/inet/ipx.c | skb->sk=sk; |
sk | 917 | net/inet/ipx.c | if(sk->debug) |
sk | 929 | net/inet/ipx.c | if(sk->debug) |
sk | 935 | net/inet/ipx.c | ipx->ipx_type=sk->ipx_type; |
sk | 936 | net/inet/ipx.c | memcpy(&ipx->ipx_source,&sk->ipx_source_addr,sizeof(ipx->ipx_source)); |
sk | 940 | net/inet/ipx.c | if(sk->debug) |
sk | 944 | net/inet/ipx.c | if(sk->debug) |
sk | 967 | net/inet/ipx.c | ipx_socket *sk=(ipx_socket *)sock->data; |
sk | 974 | net/inet/ipx.c | if(sk->err) |
sk | 976 | net/inet/ipx.c | er= -sk->err; |
sk | 977 | net/inet/ipx.c | sk->err=0; |
sk | 1001 | net/inet/ipx.c | skb=skb_recv_datagram(sk,flags,noblock,&er); |
sk | 1006 | net/inet/ipx.c | sk->stamp=skb->stamp; |
sk | 1025 | net/inet/ipx.c | ipx_socket *sk=(ipx_socket *)sock->data; |
sk | 1026 | net/inet/ipx.c | if(sk->zapped) |
sk | 1037 | net/inet/ipx.c | static int ipx_shutdown(struct socket *sk,int how) |
sk | 1044 | net/inet/ipx.c | ipx_socket *sk=(ipx_socket *)sock->data; |
sk | 1046 | net/inet/ipx.c | return datagram_select(sk,sel_type,wait); |
sk | 67 | net/inet/packet.c | struct sock *sk; |
sk | 74 | net/inet/packet.c | sk = (struct sock *) pt->data; |
sk | 85 | net/inet/packet.c | skb->sk = sk; |
sk | 92 | net/inet/packet.c | if (sk->rmem_alloc + skb->mem_len >= sk->rcvbuf) |
sk | 94 | net/inet/packet.c | skb->sk = NULL; |
sk | 98 | net/inet/packet.c | sk->rmem_alloc += skb->mem_len; |
sk | 104 | net/inet/packet.c | skb_queue_tail(&sk->receive_queue,skb); |
sk | 105 | net/inet/packet.c | wake_up_interruptible(sk->sleep); |
sk | 111 | net/inet/packet.c | release_sock(sk); /* This is now effectively surplus in this layer */ |
sk | 121 | net/inet/packet.c | static int packet_sendto(struct sock *sk, unsigned char *from, int len, |
sk | 187 | net/inet/packet.c | skb = sk->prot->wmalloc(sk, len, 0, GFP_KERNEL); |
sk | 204 | net/inet/packet.c | skb->sk = sk; |
sk | 215 | net/inet/packet.c | dev_queue_xmit(skb, dev, sk->priority); |
sk | 226 | net/inet/packet.c | static int packet_write(struct sock *sk, unsigned char *buff, |
sk | 229 | net/inet/packet.c | return(packet_sendto(sk, buff, len, noblock, flags, NULL, 0)); |
sk | 239 | net/inet/packet.c | static void packet_close(struct sock *sk, int timeout) |
sk | 241 | net/inet/packet.c | sk->inuse = 1; |
sk | 242 | net/inet/packet.c | sk->state = TCP_CLOSE; |
sk | 243 | net/inet/packet.c | dev_remove_pack((struct packet_type *)sk->pair); |
sk | 244 | net/inet/packet.c | kfree_s((void *)sk->pair, sizeof(struct packet_type)); |
sk | 245 | net/inet/packet.c | sk->pair = NULL; |
sk | 246 | net/inet/packet.c | release_sock(sk); |
sk | 257 | net/inet/packet.c | static int packet_init(struct sock *sk) |
sk | 266 | net/inet/packet.c | p->type = sk->num; |
sk | 267 | net/inet/packet.c | p->data = (void *)sk; |
sk | 274 | net/inet/packet.c | sk->pair = (struct sock *)p; |
sk | 285 | net/inet/packet.c | int packet_recvfrom(struct sock *sk, unsigned char *to, int len, |
sk | 300 | net/inet/packet.c | if (sk->shutdown & RCV_SHUTDOWN) |
sk | 337 | net/inet/packet.c | skb=skb_recv_datagram(sk,flags,noblock,&err); |
sk | 381 | net/inet/packet.c | release_sock(sk); |
sk | 391 | net/inet/packet.c | int packet_read(struct sock *sk, unsigned char *buff, |
sk | 394 | net/inet/packet.c | return(packet_recvfrom(sk, buff, len, noblock, flags, NULL, NULL)); |
sk | 69 | net/inet/raw.c | struct sock *sk; |
sk | 75 | net/inet/raw.c | sk = (struct sock *) protocol->data; |
sk | 76 | net/inet/raw.c | if (sk == NULL) return; |
sk | 80 | net/inet/raw.c | if (sk->cong_window > 1) sk->cong_window = sk->cong_window/2; |
sk | 84 | net/inet/raw.c | sk->err = icmp_err_convert[err & 0xff].errno; |
sk | 85 | net/inet/raw.c | sk->error_report(sk); |
sk | 100 | net/inet/raw.c | struct sock *sk; |
sk | 115 | net/inet/raw.c | sk = (struct sock *) protocol->data; |
sk | 116 | net/inet/raw.c | if (sk == NULL) |
sk | 123 | net/inet/raw.c | skb->sk = sk; |
sk | 131 | net/inet/raw.c | if (sk->rmem_alloc + skb->mem_len >= sk->rcvbuf) { |
sk | 133 | net/inet/raw.c | skb->sk=NULL; |
sk | 137 | net/inet/raw.c | sk->rmem_alloc += skb->mem_len; |
sk | 139 | net/inet/raw.c | skb_queue_tail(&sk->receive_queue,skb); |
sk | 140 | net/inet/raw.c | sk->data_ready(sk,skb->len); |
sk | 141 | net/inet/raw.c | release_sock(sk); |
sk | 149 | net/inet/raw.c | static int raw_sendto(struct sock *sk, unsigned char *from, |
sk | 159 | net/inet/raw.c | " usin=%X, addr_len = %d)\n", sk, from, len, noblock, |
sk | 191 | net/inet/raw.c | if (sk->state != TCP_ESTABLISHED) |
sk | 194 | net/inet/raw.c | sin.sin_port = sk->protocol; |
sk | 195 | net/inet/raw.c | sin.sin_addr.s_addr = sk->daddr; |
sk | 198 | net/inet/raw.c | sin.sin_port = sk->protocol; |
sk | 203 | net/inet/raw.c | if (sk->broadcast == 0 && ip_chk_addr(sin.sin_addr.s_addr)==IS_BROADCAST) |
sk | 206 | net/inet/raw.c | sk->inuse = 1; |
sk | 210 | net/inet/raw.c | if(sk->err!=0) |
sk | 212 | net/inet/raw.c | err= -sk->err; |
sk | 213 | net/inet/raw.c | sk->err=0; |
sk | 214 | net/inet/raw.c | release_sock(sk); |
sk | 218 | net/inet/raw.c | skb = sk->prot->wmalloc(sk, |
sk | 219 | net/inet/raw.c | len + sk->prot->max_header, |
sk | 228 | net/inet/raw.c | tmp = sk->wmem_alloc; |
sk | 229 | net/inet/raw.c | release_sock(sk); |
sk | 231 | net/inet/raw.c | if (tmp <= sk->wmem_alloc) { |
sk | 232 | net/inet/raw.c | interruptible_sleep_on(sk->sleep); |
sk | 238 | net/inet/raw.c | sk->inuse = 1; |
sk | 242 | net/inet/raw.c | skb->sk = sk; |
sk | 244 | net/inet/raw.c | skb->localroute = sk->localroute | (flags&MSG_DONTROUTE); |
sk | 246 | net/inet/raw.c | tmp = sk->prot->build_header(skb, sk->saddr, |
sk | 248 | net/inet/raw.c | sk->protocol, sk->opt, skb->mem_len, sk->ip_tos,sk->ip_ttl); |
sk | 253 | net/inet/raw.c | release_sock(sk); |
sk | 264 | net/inet/raw.c | if(sk->protocol==IPPROTO_RAW) |
sk | 273 | net/inet/raw.c | iph->saddr = sk->saddr; |
sk | 278 | net/inet/raw.c | sk->prot->queue_xmit(sk, dev, skb, 1); |
sk | 279 | net/inet/raw.c | release_sock(sk); |
sk | 284 | net/inet/raw.c | static int raw_write(struct sock *sk, unsigned char *buff, int len, int noblock, |
sk | 287 | net/inet/raw.c | return(raw_sendto(sk, buff, len, noblock, flags, NULL, 0)); |
sk | 291 | net/inet/raw.c | static void raw_close(struct sock *sk, int timeout) |
sk | 293 | net/inet/raw.c | sk->inuse = 1; |
sk | 294 | net/inet/raw.c | sk->state = TCP_CLOSE; |
sk | 297 | net/inet/raw.c | ((struct inet_protocol *)sk->pair)->protocol)); |
sk | 299 | net/inet/raw.c | if (inet_del_protocol((struct inet_protocol *)sk->pair) < 0) |
sk | 301 | net/inet/raw.c | kfree_s((void *)sk->pair, sizeof (struct inet_protocol)); |
sk | 302 | net/inet/raw.c | sk->pair = NULL; |
sk | 303 | net/inet/raw.c | release_sock(sk); |
sk | 308 | net/inet/raw.c | raw_init(struct sock *sk) |
sk | 316 | net/inet/raw.c | p->protocol = sk->protocol; |
sk | 317 | net/inet/raw.c | p->data = (void *)sk; |
sk | 324 | net/inet/raw.c | sk->pair = (struct sock *)p; |
sk | 326 | net/inet/raw.c | DPRINTF((DBG_RAW, "raw init added protocol %d\n", sk->protocol)); |
sk | 337 | net/inet/raw.c | raw_recvfrom(struct sock *sk, unsigned char *to, int len, |
sk | 347 | net/inet/raw.c | sk, to, len, noblock, flags, sin, addr_len)); |
sk | 352 | net/inet/raw.c | if (sk->shutdown & RCV_SHUTDOWN) return(0); |
sk | 370 | net/inet/raw.c | skb=skb_recv_datagram(sk,flags,noblock,&err); |
sk | 377 | net/inet/raw.c | sk->stamp=skb->stamp; |
sk | 389 | net/inet/raw.c | release_sock(sk); |
sk | 395 | net/inet/raw.c | raw_read (struct sock *sk, unsigned char *buff, int len, int noblock, |
sk | 398 | net/inet/raw.c | return(raw_recvfrom(sk, buff, len, noblock, flags, NULL, NULL)); |
sk | 30 | net/inet/raw.h | extern int raw_recvfrom(struct sock *sk, unsigned char *to, |
sk | 33 | net/inet/raw.h | extern int raw_read(struct sock *sk, unsigned char *buff, |
sk | 356 | net/inet/skbuff.c | newsk->sk = NULL; |
sk | 372 | net/inet/skbuff.c | newsk->sk = NULL; |
sk | 403 | net/inet/skbuff.c | if (skb->sk) |
sk | 405 | net/inet/skbuff.c | if(skb->sk->prot!=NULL) |
sk | 408 | net/inet/skbuff.c | skb->sk->prot->rfree(skb->sk, skb->mem_addr, skb->mem_len); |
sk | 410 | net/inet/skbuff.c | skb->sk->prot->wfree(skb->sk, skb->mem_addr, skb->mem_len); |
sk | 417 | net/inet/skbuff.c | skb->sk->rmem_alloc-=skb->mem_len; |
sk | 419 | net/inet/skbuff.c | skb->sk->wmem_alloc-=skb->mem_len; |
sk | 420 | net/inet/skbuff.c | if(!skb->sk->dead) |
sk | 421 | net/inet/skbuff.c | wake_up_interruptible(skb->sk->sleep); |
sk | 460 | net/inet/skbuff.c | skb->sk = NULL; |
sk | 513 | net/inet/skbuff.c | n->sk=NULL; |
sk | 107 | net/inet/sock.c | print_sk(struct sock *sk) |
sk | 109 | net/inet/sock.c | if (!sk) { |
sk | 113 | net/inet/sock.c | printk(" wmem_alloc = %lu\n", sk->wmem_alloc); |
sk | 114 | net/inet/sock.c | printk(" rmem_alloc = %lu\n", sk->rmem_alloc); |
sk | 115 | net/inet/sock.c | printk(" state = %d\n",sk->state); |
sk | 116 | net/inet/sock.c | printk(" daddr = %lX, saddr = %lX\n", sk->daddr,sk->saddr); |
sk | 117 | net/inet/sock.c | printk(" num = %d", sk->num); |
sk | 118 | net/inet/sock.c | printk(" next = %p\n", sk->next); |
sk | 120 | net/inet/sock.c | sk->write_seq, sk->acked_seq, sk->copied_seq); |
sk | 122 | net/inet/sock.c | sk->rcv_ack_seq, sk->window_seq, sk->fin_seq); |
sk | 123 | net/inet/sock.c | printk(" prot = %p\n", sk->prot); |
sk | 124 | net/inet/sock.c | printk(" pair = %p\n", sk->pair); |
sk | 125 | net/inet/sock.c | printk(" inuse = %d , blog = %d\n", sk->inuse, sk->blog); |
sk | 126 | net/inet/sock.c | printk(" dead = %d delay_acks=%d\n", sk->dead, sk->delay_acks); |
sk | 127 | net/inet/sock.c | printk(" retransmits = %ld, timeout = %d\n", sk->retransmits, sk->timeout); |
sk | 128 | net/inet/sock.c | printk(" cong_window = %d, packets_out = %d\n", sk->cong_window, |
sk | 129 | net/inet/sock.c | sk->packets_out); |
sk | 130 | net/inet/sock.c | printk(" shutdown=%d\n", sk->shutdown); |
sk | 143 | net/inet/sock.c | printk(" sk = %p link3 = %p\n", skb->sk, skb->link3); |
sk | 154 | net/inet/sock.c | struct sock *sk; |
sk | 156 | net/inet/sock.c | for(sk = prot->sock_array[num & (SOCK_ARRAY_SIZE -1 )]; |
sk | 157 | net/inet/sock.c | sk != NULL; |
sk | 158 | net/inet/sock.c | sk=sk->next) { |
sk | 159 | net/inet/sock.c | if (sk->num == num) return(1); |
sk | 177 | net/inet/sock.c | struct sock *sk; |
sk | 187 | net/inet/sock.c | sk = prot->sock_array[(i+base+1) &(SOCK_ARRAY_SIZE -1)]; |
sk | 188 | net/inet/sock.c | while(sk != NULL) { |
sk | 189 | net/inet/sock.c | sk = sk->next; |
sk | 215 | net/inet/sock.c | put_sock(unsigned short num, struct sock *sk) |
sk | 221 | net/inet/sock.c | DPRINTF((DBG_INET, "put_sock(num = %d, sk = %X\n", num, sk)); |
sk | 222 | net/inet/sock.c | sk->num = num; |
sk | 223 | net/inet/sock.c | sk->next = NULL; |
sk | 228 | net/inet/sock.c | if (sk->prot->sock_array[num] == NULL) { |
sk | 229 | net/inet/sock.c | sk->prot->sock_array[num] = sk; |
sk | 235 | net/inet/sock.c | if ((mask & sk->saddr) && |
sk | 236 | net/inet/sock.c | (mask & sk->saddr) != (mask & 0xffffffff)) { |
sk | 244 | net/inet/sock.c | sk1 = sk->prot->sock_array[num]; |
sk | 248 | net/inet/sock.c | sk->next = sk->prot->sock_array[num]; |
sk | 249 | net/inet/sock.c | sk->prot->sock_array[num] = sk; |
sk | 253 | net/inet/sock.c | sk->next = sk2; |
sk | 254 | net/inet/sock.c | sk1->next= sk; |
sk | 262 | net/inet/sock.c | sk->next = NULL; |
sk | 263 | net/inet/sock.c | sk1->next = sk; |
sk | 305 | net/inet/sock.c | destroy_sock(struct sock *sk) |
sk | 309 | net/inet/sock.c | DPRINTF((DBG_INET, "destroying socket %X\n", sk)); |
sk | 310 | net/inet/sock.c | sk->inuse = 1; /* just to be safe. */ |
sk | 313 | net/inet/sock.c | if (!sk->dead) |
sk | 314 | net/inet/sock.c | sk->write_space(sk); |
sk | 316 | net/inet/sock.c | remove_sock(sk); |
sk | 319 | net/inet/sock.c | delete_timer(sk); |
sk | 321 | net/inet/sock.c | while ((skb = tcp_dequeue_partial(sk)) != NULL) { |
sk | 327 | net/inet/sock.c | while((skb = skb_dequeue(&sk->write_queue)) != NULL) { |
sk | 332 | net/inet/sock.c | while((skb=skb_dequeue(&sk->receive_queue))!=NULL) { |
sk | 337 | net/inet/sock.c | if (skb->sk != NULL && skb->sk != sk) |
sk | 340 | net/inet/sock.c | skb->sk->dead = 1; |
sk | 341 | net/inet/sock.c | skb->sk->prot->close(skb->sk, 0); |
sk | 349 | net/inet/sock.c | for(skb = sk->send_head; skb != NULL; ) |
sk | 367 | net/inet/sock.c | sk->send_head = NULL; |
sk | 371 | net/inet/sock.c | while((skb=skb_dequeue(&sk->back_log))!=NULL) { |
sk | 378 | net/inet/sock.c | if (sk->pair) |
sk | 380 | net/inet/sock.c | sk->pair->dead = 1; |
sk | 381 | net/inet/sock.c | sk->pair->prot->close(sk->pair, 0); |
sk | 382 | net/inet/sock.c | sk->pair = NULL; |
sk | 390 | net/inet/sock.c | if (sk->dead && sk->rmem_alloc == 0 && sk->wmem_alloc == 0) |
sk | 392 | net/inet/sock.c | kfree_s((void *)sk,sizeof(*sk)); |
sk | 398 | net/inet/sock.c | DPRINTF((DBG_INET, "possible memory leak in socket = %X\n", sk)); |
sk | 399 | net/inet/sock.c | sk->destroy = 1; |
sk | 400 | net/inet/sock.c | sk->ack_backlog = 0; |
sk | 401 | net/inet/sock.c | sk->inuse = 0; |
sk | 402 | net/inet/sock.c | reset_timer(sk, TIME_DESTROY, SOCK_DESTROY_TIME); |
sk | 411 | net/inet/sock.c | struct sock *sk; |
sk | 413 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 424 | net/inet/sock.c | sk->proc = arg; |
sk | 427 | net/inet/sock.c | return(sk->proc); |
sk | 440 | net/inet/sock.c | struct sock *sk = (struct sock *) sock->data; |
sk | 442 | net/inet/sock.c | return sock_setsockopt(sk,level,optname,optval,optlen); |
sk | 443 | net/inet/sock.c | if (sk->prot->setsockopt==NULL) |
sk | 446 | net/inet/sock.c | return sk->prot->setsockopt(sk,level,optname,optval,optlen); |
sk | 455 | net/inet/sock.c | struct sock *sk = (struct sock *) sock->data; |
sk | 457 | net/inet/sock.c | return sock_getsockopt(sk,level,optname,optval,optlen); |
sk | 458 | net/inet/sock.c | if(sk->prot->getsockopt==NULL) |
sk | 461 | net/inet/sock.c | return sk->prot->getsockopt(sk,level,optname,optval,optlen); |
sk | 469 | net/inet/sock.c | int sock_setsockopt(struct sock *sk, int level, int optname, |
sk | 491 | net/inet/sock.c | sk->debug=val?1:0; |
sk | 493 | net/inet/sock.c | sk->localroute=val?1:0; |
sk | 496 | net/inet/sock.c | sk->broadcast=val?1:0; |
sk | 503 | net/inet/sock.c | sk->sndbuf=val; |
sk | 511 | net/inet/sock.c | sk->linger=0; |
sk | 514 | net/inet/sock.c | sk->lingertime=ling.l_linger; |
sk | 515 | net/inet/sock.c | sk->linger=1; |
sk | 523 | net/inet/sock.c | sk->rcvbuf=val; |
sk | 528 | net/inet/sock.c | sk->reuse = 1; |
sk | 530 | net/inet/sock.c | sk->reuse = 0; |
sk | 535 | net/inet/sock.c | sk->keepopen = 1; |
sk | 537 | net/inet/sock.c | sk->keepopen = 0; |
sk | 542 | net/inet/sock.c | sk->urginline = 1; |
sk | 544 | net/inet/sock.c | sk->urginline = 0; |
sk | 549 | net/inet/sock.c | sk->no_check = 1; |
sk | 551 | net/inet/sock.c | sk->no_check = 0; |
sk | 557 | net/inet/sock.c | sk->priority = val; |
sk | 571 | net/inet/sock.c | int sock_getsockopt(struct sock *sk, int level, int optname, |
sk | 581 | net/inet/sock.c | val = sk->debug; |
sk | 585 | net/inet/sock.c | val = sk->localroute; |
sk | 589 | net/inet/sock.c | val= sk->broadcast; |
sk | 600 | net/inet/sock.c | ling.l_onoff=sk->linger; |
sk | 601 | net/inet/sock.c | ling.l_linger=sk->lingertime; |
sk | 606 | net/inet/sock.c | val=sk->sndbuf; |
sk | 610 | net/inet/sock.c | val =sk->rcvbuf; |
sk | 614 | net/inet/sock.c | val = sk->reuse; |
sk | 618 | net/inet/sock.c | val = sk->keepopen; |
sk | 622 | net/inet/sock.c | if (sk->prot == &tcp_prot) |
sk | 629 | net/inet/sock.c | val = sk->err; |
sk | 630 | net/inet/sock.c | sk->err = 0; |
sk | 634 | net/inet/sock.c | val = sk->urginline; |
sk | 638 | net/inet/sock.c | val = sk->no_check; |
sk | 642 | net/inet/sock.c | val = sk->priority; |
sk | 667 | net/inet/sock.c | struct sock *sk; |
sk | 669 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 670 | net/inet/sock.c | if (sk == NULL) { |
sk | 676 | net/inet/sock.c | if (sk->num == 0) { |
sk | 677 | net/inet/sock.c | sk->num = get_new_socknum(sk->prot, 0); |
sk | 678 | net/inet/sock.c | if (sk->num == 0) return(-EAGAIN); |
sk | 679 | net/inet/sock.c | put_sock(sk->num, sk); |
sk | 680 | net/inet/sock.c | sk->dummy_th.source = ntohs(sk->num); |
sk | 684 | net/inet/sock.c | sk->max_ack_backlog = backlog; |
sk | 685 | net/inet/sock.c | if (sk->state != TCP_LISTEN) { |
sk | 686 | net/inet/sock.c | sk->ack_backlog = 0; |
sk | 687 | net/inet/sock.c | sk->state = TCP_LISTEN; |
sk | 697 | net/inet/sock.c | static void def_callback1(struct sock *sk) |
sk | 699 | net/inet/sock.c | if(!sk->dead) |
sk | 700 | net/inet/sock.c | wake_up_interruptible(sk->sleep); |
sk | 703 | net/inet/sock.c | static void def_callback2(struct sock *sk,int len) |
sk | 705 | net/inet/sock.c | if(!sk->dead) |
sk | 706 | net/inet/sock.c | wake_up_interruptible(sk->sleep); |
sk | 713 | net/inet/sock.c | struct sock *sk; |
sk | 717 | net/inet/sock.c | sk = (struct sock *) kmalloc(sizeof(*sk), GFP_KERNEL); |
sk | 718 | net/inet/sock.c | if (sk == NULL) |
sk | 720 | net/inet/sock.c | sk->num = 0; |
sk | 721 | net/inet/sock.c | sk->reuse = 0; |
sk | 726 | net/inet/sock.c | kfree_s((void *)sk, sizeof(*sk)); |
sk | 730 | net/inet/sock.c | sk->no_check = TCP_NO_CHECK; |
sk | 736 | net/inet/sock.c | kfree_s((void *)sk, sizeof(*sk)); |
sk | 740 | net/inet/sock.c | sk->no_check = UDP_NO_CHECK; |
sk | 746 | net/inet/sock.c | kfree_s((void *)sk, sizeof(*sk)); |
sk | 750 | net/inet/sock.c | kfree_s((void *)sk, sizeof(*sk)); |
sk | 754 | net/inet/sock.c | sk->reuse = 1; |
sk | 755 | net/inet/sock.c | sk->no_check = 0; /* |
sk | 759 | net/inet/sock.c | sk->num = protocol; |
sk | 764 | net/inet/sock.c | kfree_s((void *)sk, sizeof(*sk)); |
sk | 768 | net/inet/sock.c | kfree_s((void *)sk, sizeof(*sk)); |
sk | 772 | net/inet/sock.c | sk->reuse = 1; |
sk | 773 | net/inet/sock.c | sk->no_check = 0; /* Doesn't matter no checksum is |
sk | 776 | net/inet/sock.c | sk->num = protocol; |
sk | 780 | net/inet/sock.c | kfree_s((void *)sk, sizeof(*sk)); |
sk | 783 | net/inet/sock.c | sk->socket = sock; |
sk | 785 | net/inet/sock.c | sk->nonagle = 1; |
sk | 787 | net/inet/sock.c | sk->nonagle = 0; |
sk | 789 | net/inet/sock.c | sk->type = sock->type; |
sk | 790 | net/inet/sock.c | sk->stamp.tv_sec=0; |
sk | 791 | net/inet/sock.c | sk->protocol = protocol; |
sk | 792 | net/inet/sock.c | sk->wmem_alloc = 0; |
sk | 793 | net/inet/sock.c | sk->rmem_alloc = 0; |
sk | 794 | net/inet/sock.c | sk->sndbuf = SK_WMEM_MAX; |
sk | 795 | net/inet/sock.c | sk->rcvbuf = SK_RMEM_MAX; |
sk | 796 | net/inet/sock.c | sk->pair = NULL; |
sk | 797 | net/inet/sock.c | sk->opt = NULL; |
sk | 798 | net/inet/sock.c | sk->write_seq = 0; |
sk | 799 | net/inet/sock.c | sk->acked_seq = 0; |
sk | 800 | net/inet/sock.c | sk->copied_seq = 0; |
sk | 801 | net/inet/sock.c | sk->fin_seq = 0; |
sk | 802 | net/inet/sock.c | sk->urg_seq = 0; |
sk | 803 | net/inet/sock.c | sk->urg_data = 0; |
sk | 804 | net/inet/sock.c | sk->proc = 0; |
sk | 805 | net/inet/sock.c | sk->rtt = TCP_WRITE_TIME << 3; |
sk | 806 | net/inet/sock.c | sk->rto = TCP_WRITE_TIME; |
sk | 807 | net/inet/sock.c | sk->mdev = 0; |
sk | 808 | net/inet/sock.c | sk->backoff = 0; |
sk | 809 | net/inet/sock.c | sk->packets_out = 0; |
sk | 810 | net/inet/sock.c | sk->cong_window = 1; /* start with only sending one packet at a time. */ |
sk | 811 | net/inet/sock.c | sk->cong_count = 0; |
sk | 812 | net/inet/sock.c | sk->ssthresh = 0; |
sk | 813 | net/inet/sock.c | sk->max_window = 0; |
sk | 814 | net/inet/sock.c | sk->urginline = 0; |
sk | 815 | net/inet/sock.c | sk->intr = 0; |
sk | 816 | net/inet/sock.c | sk->linger = 0; |
sk | 817 | net/inet/sock.c | sk->destroy = 0; |
sk | 819 | net/inet/sock.c | sk->priority = 1; |
sk | 820 | net/inet/sock.c | sk->shutdown = 0; |
sk | 821 | net/inet/sock.c | sk->keepopen = 0; |
sk | 822 | net/inet/sock.c | sk->zapped = 0; |
sk | 823 | net/inet/sock.c | sk->done = 0; |
sk | 824 | net/inet/sock.c | sk->ack_backlog = 0; |
sk | 825 | net/inet/sock.c | sk->window = 0; |
sk | 826 | net/inet/sock.c | sk->bytes_rcv = 0; |
sk | 827 | net/inet/sock.c | sk->state = TCP_CLOSE; |
sk | 828 | net/inet/sock.c | sk->dead = 0; |
sk | 829 | net/inet/sock.c | sk->ack_timed = 0; |
sk | 830 | net/inet/sock.c | sk->partial = NULL; |
sk | 831 | net/inet/sock.c | sk->user_mss = 0; |
sk | 832 | net/inet/sock.c | sk->debug = 0; |
sk | 835 | net/inet/sock.c | sk->max_unacked = 2048; /* needs to be at most 2 full packets. */ |
sk | 839 | net/inet/sock.c | sk->max_ack_backlog = 0; |
sk | 840 | net/inet/sock.c | sk->inuse = 0; |
sk | 841 | net/inet/sock.c | sk->delay_acks = 0; |
sk | 842 | net/inet/sock.c | skb_queue_head_init(&sk->write_queue); |
sk | 843 | net/inet/sock.c | skb_queue_head_init(&sk->receive_queue); |
sk | 844 | net/inet/sock.c | sk->mtu = 576; |
sk | 845 | net/inet/sock.c | sk->prot = prot; |
sk | 846 | net/inet/sock.c | sk->sleep = sock->wait; |
sk | 847 | net/inet/sock.c | sk->daddr = 0; |
sk | 848 | net/inet/sock.c | sk->saddr = ip_my_addr(); |
sk | 849 | net/inet/sock.c | sk->err = 0; |
sk | 850 | net/inet/sock.c | sk->next = NULL; |
sk | 851 | net/inet/sock.c | sk->pair = NULL; |
sk | 852 | net/inet/sock.c | sk->send_tail = NULL; |
sk | 853 | net/inet/sock.c | sk->send_head = NULL; |
sk | 854 | net/inet/sock.c | sk->timeout = 0; |
sk | 855 | net/inet/sock.c | sk->broadcast = 0; |
sk | 856 | net/inet/sock.c | sk->localroute = 0; |
sk | 857 | net/inet/sock.c | sk->timer.data = (unsigned long)sk; |
sk | 858 | net/inet/sock.c | sk->timer.function = &net_timer; |
sk | 859 | net/inet/sock.c | skb_queue_head_init(&sk->back_log); |
sk | 860 | net/inet/sock.c | sk->blog = 0; |
sk | 861 | net/inet/sock.c | sock->data =(void *) sk; |
sk | 862 | net/inet/sock.c | sk->dummy_th.doff = sizeof(sk->dummy_th)/4; |
sk | 863 | net/inet/sock.c | sk->dummy_th.res1=0; |
sk | 864 | net/inet/sock.c | sk->dummy_th.res2=0; |
sk | 865 | net/inet/sock.c | sk->dummy_th.urg_ptr = 0; |
sk | 866 | net/inet/sock.c | sk->dummy_th.fin = 0; |
sk | 867 | net/inet/sock.c | sk->dummy_th.syn = 0; |
sk | 868 | net/inet/sock.c | sk->dummy_th.rst = 0; |
sk | 869 | net/inet/sock.c | sk->dummy_th.psh = 0; |
sk | 870 | net/inet/sock.c | sk->dummy_th.ack = 0; |
sk | 871 | net/inet/sock.c | sk->dummy_th.urg = 0; |
sk | 872 | net/inet/sock.c | sk->dummy_th.dest = 0; |
sk | 874 | net/inet/sock.c | sk->ip_tos=0; |
sk | 875 | net/inet/sock.c | sk->ip_ttl=64; |
sk | 877 | net/inet/sock.c | sk->state_change = def_callback1; |
sk | 878 | net/inet/sock.c | sk->data_ready = def_callback2; |
sk | 879 | net/inet/sock.c | sk->write_space = def_callback1; |
sk | 880 | net/inet/sock.c | sk->error_report = def_callback1; |
sk | 882 | net/inet/sock.c | if (sk->num) { |
sk | 889 | net/inet/sock.c | put_sock(sk->num, sk); |
sk | 890 | net/inet/sock.c | sk->dummy_th.source = ntohs(sk->num); |
sk | 893 | net/inet/sock.c | if (sk->prot->init) { |
sk | 894 | net/inet/sock.c | err = sk->prot->init(sk); |
sk | 896 | net/inet/sock.c | destroy_sock(sk); |
sk | 916 | net/inet/sock.c | struct sock *sk; |
sk | 918 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 919 | net/inet/sock.c | if (sk == NULL) return(0); |
sk | 922 | net/inet/sock.c | sk->state_change(sk); |
sk | 930 | net/inet/sock.c | if (sk->linger == 0) { |
sk | 931 | net/inet/sock.c | sk->prot->close(sk,0); |
sk | 932 | net/inet/sock.c | sk->dead = 1; |
sk | 935 | net/inet/sock.c | sk->prot->close(sk, 0); |
sk | 937 | net/inet/sock.c | if (sk->lingertime) |
sk | 938 | net/inet/sock.c | current->timeout = jiffies + HZ*sk->lingertime; |
sk | 939 | net/inet/sock.c | while(sk->state != TCP_CLOSE && current->timeout>0) { |
sk | 940 | net/inet/sock.c | interruptible_sleep_on(sk->sleep); |
sk | 953 | net/inet/sock.c | sk->dead = 1; |
sk | 955 | net/inet/sock.c | sk->inuse = 1; |
sk | 958 | net/inet/sock.c | release_sock(sk); |
sk | 974 | net/inet/sock.c | struct sock *sk, *sk2; |
sk | 979 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 981 | net/inet/sock.c | if (sk->state != TCP_CLOSE) return(-EIO); |
sk | 982 | net/inet/sock.c | if (sk->num != 0) return(-EINVAL); |
sk | 990 | net/inet/sock.c | DPRINTF((DBG_INET, "bind sk =%X to port = %d\n", sk, snum)); |
sk | 991 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 999 | net/inet/sock.c | snum = get_new_socknum(sk->prot, 0); |
sk | 1008 | net/inet/sock.c | sk->saddr = addr.sin_addr.s_addr; |
sk | 1011 | net/inet/sock.c | sk->prot->sock_array[snum &(SOCK_ARRAY_SIZE -1)])); |
sk | 1016 | net/inet/sock.c | for(sk2 = sk->prot->sock_array[snum & (SOCK_ARRAY_SIZE -1)]; |
sk | 1026 | net/inet/sock.c | if (!sk->reuse) { |
sk | 1031 | net/inet/sock.c | if (sk2->saddr != sk->saddr) continue; /* socket per slot ! -FB */ |
sk | 1039 | net/inet/sock.c | remove_sock(sk); |
sk | 1040 | net/inet/sock.c | put_sock(snum, sk); |
sk | 1041 | net/inet/sock.c | sk->dummy_th.source = ntohs(sk->num); |
sk | 1042 | net/inet/sock.c | sk->daddr = 0; |
sk | 1043 | net/inet/sock.c | sk->dummy_th.dest = 0; |
sk | 1052 | net/inet/sock.c | struct sock *sk; |
sk | 1056 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1058 | net/inet/sock.c | if (sock->state == SS_CONNECTING && sk->state == TCP_ESTABLISHED) |
sk | 1065 | net/inet/sock.c | if (sock->state == SS_CONNECTING && sk->protocol == IPPROTO_TCP && |
sk | 1071 | net/inet/sock.c | if (sk->num == 0) { |
sk | 1072 | net/inet/sock.c | sk->num = get_new_socknum(sk->prot, 0); |
sk | 1073 | net/inet/sock.c | if (sk->num == 0) |
sk | 1075 | net/inet/sock.c | put_sock(sk->num, sk); |
sk | 1076 | net/inet/sock.c | sk->dummy_th.source = htons(sk->num); |
sk | 1079 | net/inet/sock.c | if (sk->prot->connect == NULL) |
sk | 1082 | net/inet/sock.c | err = sk->prot->connect(sk, (struct sockaddr_in *)uaddr, addr_len); |
sk | 1088 | net/inet/sock.c | if (sk->state != TCP_ESTABLISHED &&(flags & O_NONBLOCK)) |
sk | 1092 | net/inet/sock.c | while(sk->state == TCP_SYN_SENT || sk->state == TCP_SYN_RECV) |
sk | 1094 | net/inet/sock.c | interruptible_sleep_on(sk->sleep); |
sk | 1101 | net/inet/sock.c | if(sk->err && sk->protocol == IPPROTO_TCP) |
sk | 1105 | net/inet/sock.c | err = -sk->err; |
sk | 1106 | net/inet/sock.c | sk->err=0; |
sk | 1113 | net/inet/sock.c | if (sk->state != TCP_ESTABLISHED && sk->err) { |
sk | 1115 | net/inet/sock.c | err=sk->err; |
sk | 1116 | net/inet/sock.c | sk->err=0; |
sk | 1145 | net/inet/sock.c | struct sock *sk=(struct sock *)newsock->data; |
sk | 1147 | net/inet/sock.c | sk->dead = 1; |
sk | 1148 | net/inet/sock.c | destroy_sock(sk); |
sk | 1203 | net/inet/sock.c | struct sock *sk; |
sk | 1222 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1223 | net/inet/sock.c | if (sk == NULL) { |
sk | 1228 | net/inet/sock.c | if (!tcp_connected(sk->state)) return(-ENOTCONN); |
sk | 1229 | net/inet/sock.c | sin.sin_port = sk->dummy_th.dest; |
sk | 1230 | net/inet/sock.c | sin.sin_addr.s_addr = sk->daddr; |
sk | 1232 | net/inet/sock.c | sin.sin_port = sk->dummy_th.source; |
sk | 1233 | net/inet/sock.c | if (sk->saddr == 0) sin.sin_addr.s_addr = ip_my_addr(); |
sk | 1234 | net/inet/sock.c | else sin.sin_addr.s_addr = sk->saddr; |
sk | 1248 | net/inet/sock.c | struct sock *sk; |
sk | 1250 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1253 | net/inet/sock.c | if (sk->num == 0) { |
sk | 1254 | net/inet/sock.c | sk->num = get_new_socknum(sk->prot, 0); |
sk | 1255 | net/inet/sock.c | if (sk->num == 0) return(-EAGAIN); |
sk | 1256 | net/inet/sock.c | put_sock(sk->num, sk); |
sk | 1257 | net/inet/sock.c | sk->dummy_th.source = ntohs(sk->num); |
sk | 1259 | net/inet/sock.c | return(sk->prot->read(sk, (unsigned char *) ubuf, size, noblock,0)); |
sk | 1267 | net/inet/sock.c | struct sock *sk; |
sk | 1269 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1272 | net/inet/sock.c | if (sk->num == 0) { |
sk | 1273 | net/inet/sock.c | sk->num = get_new_socknum(sk->prot, 0); |
sk | 1274 | net/inet/sock.c | if (sk->num == 0) return(-EAGAIN); |
sk | 1275 | net/inet/sock.c | put_sock(sk->num, sk); |
sk | 1276 | net/inet/sock.c | sk->dummy_th.source = ntohs(sk->num); |
sk | 1278 | net/inet/sock.c | return(sk->prot->read(sk, (unsigned char *) ubuf, size, noblock, flags)); |
sk | 1285 | net/inet/sock.c | struct sock *sk; |
sk | 1287 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1288 | net/inet/sock.c | if (sk->shutdown & SEND_SHUTDOWN) { |
sk | 1294 | net/inet/sock.c | if (sk->num == 0) { |
sk | 1295 | net/inet/sock.c | sk->num = get_new_socknum(sk->prot, 0); |
sk | 1296 | net/inet/sock.c | if (sk->num == 0) return(-EAGAIN); |
sk | 1297 | net/inet/sock.c | put_sock(sk->num, sk); |
sk | 1298 | net/inet/sock.c | sk->dummy_th.source = ntohs(sk->num); |
sk | 1301 | net/inet/sock.c | return(sk->prot->write(sk, (unsigned char *) ubuf, size, noblock, 0)); |
sk | 1309 | net/inet/sock.c | struct sock *sk; |
sk | 1311 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1312 | net/inet/sock.c | if (sk->shutdown & SEND_SHUTDOWN) { |
sk | 1318 | net/inet/sock.c | if (sk->num == 0) { |
sk | 1319 | net/inet/sock.c | sk->num = get_new_socknum(sk->prot, 0); |
sk | 1320 | net/inet/sock.c | if (sk->num == 0) return(-EAGAIN); |
sk | 1321 | net/inet/sock.c | put_sock(sk->num, sk); |
sk | 1322 | net/inet/sock.c | sk->dummy_th.source = ntohs(sk->num); |
sk | 1325 | net/inet/sock.c | return(sk->prot->write(sk, (unsigned char *) ubuf, size, noblock, flags)); |
sk | 1333 | net/inet/sock.c | struct sock *sk; |
sk | 1335 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1336 | net/inet/sock.c | if (sk->shutdown & SEND_SHUTDOWN) { |
sk | 1341 | net/inet/sock.c | if (sk->prot->sendto == NULL) return(-EOPNOTSUPP); |
sk | 1344 | net/inet/sock.c | if (sk->num == 0) { |
sk | 1345 | net/inet/sock.c | sk->num = get_new_socknum(sk->prot, 0); |
sk | 1346 | net/inet/sock.c | if (sk->num == 0) return(-EAGAIN); |
sk | 1347 | net/inet/sock.c | put_sock(sk->num, sk); |
sk | 1348 | net/inet/sock.c | sk->dummy_th.source = ntohs(sk->num); |
sk | 1351 | net/inet/sock.c | return(sk->prot->sendto(sk, (unsigned char *) ubuf, size, noblock, flags, |
sk | 1360 | net/inet/sock.c | struct sock *sk; |
sk | 1362 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1364 | net/inet/sock.c | if (sk->prot->recvfrom == NULL) return(-EOPNOTSUPP); |
sk | 1367 | net/inet/sock.c | if (sk->num == 0) { |
sk | 1368 | net/inet/sock.c | sk->num = get_new_socknum(sk->prot, 0); |
sk | 1369 | net/inet/sock.c | if (sk->num == 0) return(-EAGAIN); |
sk | 1370 | net/inet/sock.c | put_sock(sk->num, sk); |
sk | 1371 | net/inet/sock.c | sk->dummy_th.source = ntohs(sk->num); |
sk | 1374 | net/inet/sock.c | return(sk->prot->recvfrom(sk, (unsigned char *) ubuf, size, noblock, flags, |
sk | 1382 | net/inet/sock.c | struct sock *sk; |
sk | 1392 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1393 | net/inet/sock.c | if (sk == NULL) { |
sk | 1397 | net/inet/sock.c | if (sock->state == SS_CONNECTING && sk->state == TCP_ESTABLISHED) |
sk | 1400 | net/inet/sock.c | if (!tcp_connected(sk->state)) return(-ENOTCONN); |
sk | 1401 | net/inet/sock.c | sk->shutdown |= how; |
sk | 1402 | net/inet/sock.c | if (sk->prot->shutdown) sk->prot->shutdown(sk, how); |
sk | 1410 | net/inet/sock.c | struct sock *sk; |
sk | 1412 | net/inet/sock.c | sk = (struct sock *) sock->data; |
sk | 1414 | net/inet/sock.c | if (sk->prot->select == NULL) { |
sk | 1418 | net/inet/sock.c | return(sk->prot->select(sk, sel_type, wait)); |
sk | 1425 | net/inet/sock.c | struct sock *sk; |
sk | 1429 | net/inet/sock.c | sk = NULL; |
sk | 1430 | net/inet/sock.c | if (sock && (sk = (struct sock *) sock->data) == NULL) { |
sk | 1441 | net/inet/sock.c | if (sk) |
sk | 1442 | net/inet/sock.c | sk->proc = get_fs_long((int *) arg); |
sk | 1446 | net/inet/sock.c | if (sk) { |
sk | 1450 | net/inet/sock.c | put_fs_long(sk->proc,(int *)arg); |
sk | 1455 | net/inet/sock.c | if (sk) |
sk | 1457 | net/inet/sock.c | if(sk->stamp.tv_sec==0) |
sk | 1462 | net/inet/sock.c | memcpy_tofs((void *)arg,&sk->stamp,sizeof(struct timeval)); |
sk | 1509 | net/inet/sock.c | if (!sk || !sk->prot->ioctl) return(-EINVAL); |
sk | 1510 | net/inet/sock.c | return(sk->prot->ioctl(sk, cmd, arg)); |
sk | 1518 | net/inet/sock.c | sock_wmalloc(struct sock *sk, unsigned long size, int force, |
sk | 1521 | net/inet/sock.c | if (sk) { |
sk | 1522 | net/inet/sock.c | if (sk->wmem_alloc + size < sk->sndbuf || force) { |
sk | 1526 | net/inet/sock.c | sk->wmem_alloc+= c->mem_len; |
sk | 1532 | net/inet/sock.c | sk, size, force, priority)); |
sk | 1540 | net/inet/sock.c | sock_rmalloc(struct sock *sk, unsigned long size, int force, int priority) |
sk | 1542 | net/inet/sock.c | if (sk) { |
sk | 1543 | net/inet/sock.c | if (sk->rmem_alloc + size < sk->rcvbuf || force) { |
sk | 1547 | net/inet/sock.c | sk->rmem_alloc += c->mem_len; |
sk | 1553 | net/inet/sock.c | sk,size,force, priority)); |
sk | 1561 | net/inet/sock.c | sock_rspace(struct sock *sk) |
sk | 1565 | net/inet/sock.c | if (sk != NULL) { |
sk | 1566 | net/inet/sock.c | if (sk->rmem_alloc >= sk->rcvbuf-2*MIN_WINDOW) return(0); |
sk | 1567 | net/inet/sock.c | amt = min((sk->rcvbuf-sk->rmem_alloc)/2-MIN_WINDOW, MAX_WINDOW); |
sk | 1576 | net/inet/sock.c | sock_wspace(struct sock *sk) |
sk | 1578 | net/inet/sock.c | if (sk != NULL) { |
sk | 1579 | net/inet/sock.c | if (sk->shutdown & SEND_SHUTDOWN) return(0); |
sk | 1580 | net/inet/sock.c | if (sk->wmem_alloc >= sk->sndbuf) return(0); |
sk | 1581 | net/inet/sock.c | return(sk->sndbuf-sk->wmem_alloc ); |
sk | 1588 | net/inet/sock.c | sock_wfree(struct sock *sk, void *mem, unsigned long size) |
sk | 1590 | net/inet/sock.c | DPRINTF((DBG_INET, "sock_wfree(sk=%X, mem=%X, size=%d)\n", sk, mem, size)); |
sk | 1594 | net/inet/sock.c | if (sk) { |
sk | 1595 | net/inet/sock.c | sk->wmem_alloc -= size; |
sk | 1598 | net/inet/sock.c | if (!sk->dead) sk->write_space(sk); |
sk | 1599 | net/inet/sock.c | if (sk->destroy && sk->wmem_alloc == 0 && sk->rmem_alloc == 0) { |
sk | 1601 | net/inet/sock.c | "recovered lost memory, sock = %X\n", sk)); |
sk | 1609 | net/inet/sock.c | sock_rfree(struct sock *sk, void *mem, unsigned long size) |
sk | 1611 | net/inet/sock.c | DPRINTF((DBG_INET, "sock_rfree(sk=%X, mem=%X, size=%d)\n", sk, mem, size)); |
sk | 1614 | net/inet/sock.c | if (sk) { |
sk | 1615 | net/inet/sock.c | sk->rmem_alloc -= size; |
sk | 1616 | net/inet/sock.c | if (sk->destroy && sk->wmem_alloc == 0 && sk->rmem_alloc == 0) { |
sk | 1618 | net/inet/sock.c | "recovered lot memory, sock = %X\n", sk)); |
sk | 1668 | net/inet/sock.c | void release_sock(struct sock *sk) |
sk | 1672 | net/inet/sock.c | if (!sk->prot) |
sk | 1675 | net/inet/sock.c | if (sk->blog) return; |
sk | 1678 | net/inet/sock.c | sk->inuse = 1; |
sk | 1679 | net/inet/sock.c | while((skb = skb_dequeue(&sk->back_log)) != NULL) { |
sk | 1680 | net/inet/sock.c | sk->blog = 1; |
sk | 1682 | net/inet/sock.c | if (sk->prot->rcv) sk->prot->rcv(skb, skb->dev, sk->opt, |
sk | 1685 | net/inet/sock.c | (struct inet_protocol *)sk->pair); |
sk | 1687 | net/inet/sock.c | sk->blog = 0; |
sk | 1688 | net/inet/sock.c | sk->inuse = 0; |
sk | 1689 | net/inet/sock.c | if (sk->dead && sk->state == TCP_CLOSE) { |
sk | 1691 | net/inet/sock.c | reset_timer(sk, TIME_DONE, min(sk->rtt * 2, TCP_DONE_TIME)); |
sk | 167 | net/inet/sock.h | void (*state_change)(struct sock *sk); |
sk | 168 | net/inet/sock.h | void (*data_ready)(struct sock *sk,int bytes); |
sk | 169 | net/inet/sock.h | void (*write_space)(struct sock *sk); |
sk | 170 | net/inet/sock.h | void (*error_report)(struct sock *sk); |
sk | 175 | net/inet/sock.h | struct sk_buff * (*wmalloc)(struct sock *sk, |
sk | 178 | net/inet/sock.h | struct sk_buff * (*rmalloc)(struct sock *sk, |
sk | 181 | net/inet/sock.h | void (*wfree)(struct sock *sk, void *mem, |
sk | 183 | net/inet/sock.h | void (*rfree)(struct sock *sk, void *mem, |
sk | 185 | net/inet/sock.h | unsigned long (*rspace)(struct sock *sk); |
sk | 186 | net/inet/sock.h | unsigned long (*wspace)(struct sock *sk); |
sk | 187 | net/inet/sock.h | void (*close)(struct sock *sk, int timeout); |
sk | 188 | net/inet/sock.h | int (*read)(struct sock *sk, unsigned char *to, |
sk | 190 | net/inet/sock.h | int (*write)(struct sock *sk, unsigned char *to, |
sk | 192 | net/inet/sock.h | int (*sendto)(struct sock *sk, |
sk | 196 | net/inet/sock.h | int (*recvfrom)(struct sock *sk, |
sk | 205 | net/inet/sock.h | int (*connect)(struct sock *sk, |
sk | 207 | net/inet/sock.h | struct sock * (*accept) (struct sock *sk, int flags); |
sk | 208 | net/inet/sock.h | void (*queue_xmit)(struct sock *sk, |
sk | 211 | net/inet/sock.h | void (*retransmit)(struct sock *sk, int all); |
sk | 212 | net/inet/sock.h | void (*write_wakeup)(struct sock *sk); |
sk | 213 | net/inet/sock.h | void (*read_wakeup)(struct sock *sk); |
sk | 218 | net/inet/sock.h | int (*select)(struct sock *sk, int which, |
sk | 220 | net/inet/sock.h | int (*ioctl)(struct sock *sk, int cmd, |
sk | 222 | net/inet/sock.h | int (*init)(struct sock *sk); |
sk | 223 | net/inet/sock.h | void (*shutdown)(struct sock *sk, int how); |
sk | 224 | net/inet/sock.h | int (*setsockopt)(struct sock *sk, int level, int optname, |
sk | 226 | net/inet/sock.h | int (*getsockopt)(struct sock *sk, int level, int optname, |
sk | 249 | net/inet/sock.h | extern void destroy_sock(struct sock *sk); |
sk | 252 | net/inet/sock.h | extern void release_sock(struct sock *sk); |
sk | 257 | net/inet/sock.h | extern struct sk_buff *sock_wmalloc(struct sock *sk, |
sk | 260 | net/inet/sock.h | extern struct sk_buff *sock_rmalloc(struct sock *sk, |
sk | 263 | net/inet/sock.h | extern void sock_wfree(struct sock *sk, void *mem, |
sk | 265 | net/inet/sock.h | extern void sock_rfree(struct sock *sk, void *mem, |
sk | 267 | net/inet/sock.h | extern unsigned long sock_rspace(struct sock *sk); |
sk | 268 | net/inet/sock.h | extern unsigned long sock_wspace(struct sock *sk); |
sk | 270 | net/inet/sock.h | extern int sock_setsockopt(struct sock *sk,int level,int op,char *optval,int optlen); |
sk | 271 | net/inet/sock.h | extern int sock_getsockopt(struct sock *sk,int level,int op,char *optval,int *optlen); |
sk | 162 | net/inet/tcp.c | static int tcp_select_window(struct sock *sk) |
sk | 164 | net/inet/tcp.c | int new_window = sk->prot->rspace(sk); |
sk | 175 | net/inet/tcp.c | if (new_window < min(sk->mss, MAX_WINDOW/2) || |
sk | 176 | net/inet/tcp.c | new_window < sk->window) |
sk | 177 | net/inet/tcp.c | return(sk->window); |
sk | 183 | net/inet/tcp.c | static void tcp_time_wait(struct sock *sk) |
sk | 185 | net/inet/tcp.c | sk->state = TCP_TIME_WAIT; |
sk | 186 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 187 | net/inet/tcp.c | if (!sk->dead) |
sk | 188 | net/inet/tcp.c | sk->state_change(sk); |
sk | 189 | net/inet/tcp.c | reset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN); |
sk | 200 | net/inet/tcp.c | tcp_retransmit(struct sock *sk, int all) |
sk | 203 | net/inet/tcp.c | ip_retransmit(sk, all); |
sk | 207 | net/inet/tcp.c | sk->ssthresh = sk->cong_window >> 1; /* remember window where we lost */ |
sk | 209 | net/inet/tcp.c | sk->cong_count = 0; |
sk | 211 | net/inet/tcp.c | sk->cong_window = 1; |
sk | 214 | net/inet/tcp.c | ip_retransmit(sk, all); |
sk | 231 | net/inet/tcp.c | struct sock *sk; |
sk | 240 | net/inet/tcp.c | sk = get_sock(&tcp_prot, th->source/*dest*/, daddr, th->dest/*source*/, saddr); |
sk | 243 | net/inet/tcp.c | if (sk == NULL) return; |
sk | 247 | net/inet/tcp.c | sk->err = -err; |
sk | 248 | net/inet/tcp.c | sk->error_report(sk); |
sk | 258 | net/inet/tcp.c | if (sk->cong_window > 4) sk->cong_window--; |
sk | 263 | net/inet/tcp.c | sk->err = icmp_err_convert[err & 0xff].errno; |
sk | 270 | net/inet/tcp.c | if (sk->state == TCP_SYN_SENT) { |
sk | 272 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 273 | net/inet/tcp.c | sk->error_report(sk); /* Wake people up to see the error (see connect in sock.c) */ |
sk | 286 | net/inet/tcp.c | tcp_readable(struct sock *sk) |
sk | 294 | net/inet/tcp.c | DPRINTF((DBG_TCP, "tcp_readable(sk=%X)\n", sk)); |
sk | 295 | net/inet/tcp.c | if(sk && sk->debug) |
sk | 296 | net/inet/tcp.c | printk("tcp_readable: %p - ",sk); |
sk | 300 | net/inet/tcp.c | if (sk == NULL || (skb = skb_peek(&sk->receive_queue)) == NULL) |
sk | 303 | net/inet/tcp.c | if(sk && sk->debug) |
sk | 308 | net/inet/tcp.c | counted = sk->copied_seq+1; /* Where we are at the moment */ |
sk | 325 | net/inet/tcp.c | } while(skb != (struct sk_buff *)&sk->receive_queue); |
sk | 326 | net/inet/tcp.c | if (amount && !sk->urginline && sk->urg_data && |
sk | 327 | net/inet/tcp.c | (sk->urg_seq - sk->copied_seq) <= (counted - sk->copied_seq)) |
sk | 331 | net/inet/tcp.c | if(sk->debug) |
sk | 343 | net/inet/tcp.c | tcp_select(struct sock *sk, int sel_type, select_table *wait) |
sk | 346 | net/inet/tcp.c | sk, sel_type, wait)); |
sk | 348 | net/inet/tcp.c | sk->inuse = 1; |
sk | 351 | net/inet/tcp.c | if(sk->debug) |
sk | 353 | net/inet/tcp.c | select_wait(sk->sleep, wait); |
sk | 354 | net/inet/tcp.c | if(sk->debug) |
sk | 356 | net/inet/tcp.c | if (skb_peek(&sk->receive_queue) != NULL) { |
sk | 357 | net/inet/tcp.c | if (sk->state == TCP_LISTEN || tcp_readable(sk)) { |
sk | 358 | net/inet/tcp.c | release_sock(sk); |
sk | 359 | net/inet/tcp.c | if(sk->debug) |
sk | 364 | net/inet/tcp.c | if (sk->err != 0) /* Receiver error */ |
sk | 366 | net/inet/tcp.c | release_sock(sk); |
sk | 367 | net/inet/tcp.c | if(sk->debug) |
sk | 371 | net/inet/tcp.c | if (sk->shutdown & RCV_SHUTDOWN) { |
sk | 372 | net/inet/tcp.c | release_sock(sk); |
sk | 373 | net/inet/tcp.c | if(sk->debug) |
sk | 377 | net/inet/tcp.c | release_sock(sk); |
sk | 378 | net/inet/tcp.c | if(sk->debug) |
sk | 383 | net/inet/tcp.c | select_wait(sk->sleep, wait); |
sk | 384 | net/inet/tcp.c | if (sk->shutdown & SEND_SHUTDOWN) { |
sk | 389 | net/inet/tcp.c | release_sock(sk); |
sk | 398 | net/inet/tcp.c | if (sk->prot->wspace(sk) >= sk->mss) { |
sk | 399 | net/inet/tcp.c | release_sock(sk); |
sk | 401 | net/inet/tcp.c | if (sk->state == TCP_SYN_RECV || |
sk | 402 | net/inet/tcp.c | sk->state == TCP_SYN_SENT) return(0); |
sk | 409 | net/inet/tcp.c | sk->wmem_alloc, sk->packets_out, |
sk | 410 | net/inet/tcp.c | sk->write_seq, sk->window_seq)); |
sk | 412 | net/inet/tcp.c | release_sock(sk); |
sk | 415 | net/inet/tcp.c | select_wait(sk->sleep,wait); |
sk | 416 | net/inet/tcp.c | if (sk->err || sk->urg_data) { |
sk | 417 | net/inet/tcp.c | release_sock(sk); |
sk | 420 | net/inet/tcp.c | release_sock(sk); |
sk | 424 | net/inet/tcp.c | release_sock(sk); |
sk | 430 | net/inet/tcp.c | tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
sk | 433 | net/inet/tcp.c | DPRINTF((DBG_TCP, "tcp_ioctl(sk=%X, cmd = %d, arg=%X)\n", sk, cmd, arg)); |
sk | 445 | net/inet/tcp.c | if (sk->state == TCP_LISTEN) return(-EINVAL); |
sk | 447 | net/inet/tcp.c | sk->inuse = 1; |
sk | 448 | net/inet/tcp.c | amount = tcp_readable(sk); |
sk | 449 | net/inet/tcp.c | release_sock(sk); |
sk | 460 | net/inet/tcp.c | int answ = sk->urg_data && sk->urg_seq == sk->copied_seq+1; |
sk | 473 | net/inet/tcp.c | if (sk->state == TCP_LISTEN) return(-EINVAL); |
sk | 474 | net/inet/tcp.c | amount = sk->prot->wspace(sk); |
sk | 552 | net/inet/tcp.c | unsigned long daddr, int len, struct sock *sk) |
sk | 559 | net/inet/tcp.c | static void tcp_send_skb(struct sock *sk, struct sk_buff *skb) |
sk | 587 | net/inet/tcp.c | tcp_send_check(th, sk->saddr, sk->daddr, size, sk); |
sk | 590 | net/inet/tcp.c | if (after(skb->h.seq, sk->window_seq) || |
sk | 591 | net/inet/tcp.c | (sk->retransmits && sk->timeout == TIME_WRITE) || |
sk | 592 | net/inet/tcp.c | sk->packets_out >= sk->cong_window) { |
sk | 594 | net/inet/tcp.c | sk->cong_window, sk->packets_out)); |
sk | 596 | net/inet/tcp.c | sk->write_seq, sk->window_seq)); |
sk | 601 | net/inet/tcp.c | skb_queue_tail(&sk->write_queue, skb); |
sk | 602 | net/inet/tcp.c | if (before(sk->window_seq, sk->write_queue.next->h.seq) && |
sk | 603 | net/inet/tcp.c | sk->send_head == NULL && |
sk | 604 | net/inet/tcp.c | sk->ack_backlog == 0) |
sk | 605 | net/inet/tcp.c | reset_timer(sk, TIME_PROBE0, sk->rto); |
sk | 607 | net/inet/tcp.c | sk->sent_seq = sk->write_seq; |
sk | 608 | net/inet/tcp.c | sk->prot->queue_xmit(sk, skb->dev, skb, 0); |
sk | 612 | net/inet/tcp.c | struct sk_buff * tcp_dequeue_partial(struct sock * sk) |
sk | 619 | net/inet/tcp.c | skb = sk->partial; |
sk | 621 | net/inet/tcp.c | sk->partial = NULL; |
sk | 622 | net/inet/tcp.c | del_timer(&sk->partial_timer); |
sk | 628 | net/inet/tcp.c | static void tcp_send_partial(struct sock *sk) |
sk | 632 | net/inet/tcp.c | if (sk == NULL) |
sk | 634 | net/inet/tcp.c | while ((skb = tcp_dequeue_partial(sk)) != NULL) |
sk | 635 | net/inet/tcp.c | tcp_send_skb(sk, skb); |
sk | 638 | net/inet/tcp.c | void tcp_enqueue_partial(struct sk_buff * skb, struct sock * sk) |
sk | 645 | net/inet/tcp.c | tmp = sk->partial; |
sk | 647 | net/inet/tcp.c | del_timer(&sk->partial_timer); |
sk | 648 | net/inet/tcp.c | sk->partial = skb; |
sk | 649 | net/inet/tcp.c | sk->partial_timer.expires = HZ; |
sk | 650 | net/inet/tcp.c | sk->partial_timer.function = (void (*)(unsigned long)) tcp_send_partial; |
sk | 651 | net/inet/tcp.c | sk->partial_timer.data = (unsigned long) sk; |
sk | 652 | net/inet/tcp.c | add_timer(&sk->partial_timer); |
sk | 655 | net/inet/tcp.c | tcp_send_skb(sk, tmp); |
sk | 662 | net/inet/tcp.c | struct sock *sk, |
sk | 670 | net/inet/tcp.c | if(sk->zapped) |
sk | 677 | net/inet/tcp.c | buff = sk->prot->wmalloc(sk, MAX_ACK_SIZE, 1, GFP_ATOMIC); |
sk | 681 | net/inet/tcp.c | sk->ack_backlog++; |
sk | 682 | net/inet/tcp.c | if (sk->timeout != TIME_WRITE && tcp_connected(sk->state)) |
sk | 684 | net/inet/tcp.c | reset_timer(sk, TIME_WRITE, 10); |
sk | 692 | net/inet/tcp.c | buff->sk = sk; |
sk | 693 | net/inet/tcp.c | buff->localroute = sk->localroute; |
sk | 697 | net/inet/tcp.c | tmp = sk->prot->build_header(buff, sk->saddr, daddr, &dev, |
sk | 698 | net/inet/tcp.c | IPPROTO_TCP, sk->opt, MAX_ACK_SIZE,sk->ip_tos,sk->ip_ttl); |
sk | 702 | net/inet/tcp.c | sk->prot->wfree(sk, buff->mem_addr, buff->mem_len); |
sk | 720 | net/inet/tcp.c | sk->window = tcp_select_window(sk); |
sk | 721 | net/inet/tcp.c | t1->window = ntohs(sk->window); |
sk | 729 | net/inet/tcp.c | if (ack == sk->acked_seq) |
sk | 731 | net/inet/tcp.c | sk->ack_backlog = 0; |
sk | 732 | net/inet/tcp.c | sk->bytes_rcv = 0; |
sk | 733 | net/inet/tcp.c | sk->ack_timed = 0; |
sk | 734 | net/inet/tcp.c | if (sk->send_head == NULL && skb_peek(&sk->write_queue) == NULL |
sk | 735 | net/inet/tcp.c | && sk->timeout == TIME_WRITE) |
sk | 737 | net/inet/tcp.c | if(sk->keepopen) |
sk | 738 | net/inet/tcp.c | reset_timer(sk,TIME_KEEPOPEN,TCP_TIMEOUT_LEN); |
sk | 740 | net/inet/tcp.c | delete_timer(sk); |
sk | 745 | net/inet/tcp.c | tcp_send_check(t1, sk->saddr, daddr, sizeof(*t1), sk); |
sk | 746 | net/inet/tcp.c | if (sk->debug) |
sk | 749 | net/inet/tcp.c | sk->prot->queue_xmit(sk, dev, buff, 1); |
sk | 755 | net/inet/tcp.c | tcp_build_header(struct tcphdr *th, struct sock *sk, int push) |
sk | 759 | net/inet/tcp.c | memcpy(th,(void *) &(sk->dummy_th), sizeof(*th)); |
sk | 760 | net/inet/tcp.c | th->seq = htonl(sk->write_seq); |
sk | 765 | net/inet/tcp.c | sk->ack_backlog = 0; |
sk | 766 | net/inet/tcp.c | sk->bytes_rcv = 0; |
sk | 767 | net/inet/tcp.c | sk->ack_timed = 0; |
sk | 768 | net/inet/tcp.c | th->ack_seq = htonl(sk->acked_seq); |
sk | 769 | net/inet/tcp.c | sk->window = tcp_select_window(sk)/*sk->prot->rspace(sk)*/; |
sk | 770 | net/inet/tcp.c | th->window = htons(sk->window); |
sk | 779 | net/inet/tcp.c | static int tcp_write(struct sock *sk, unsigned char *from, |
sk | 792 | net/inet/tcp.c | sk, from, len, nonblock, flags)); |
sk | 794 | net/inet/tcp.c | sk->inuse=1; |
sk | 795 | net/inet/tcp.c | prot = sk->prot; |
sk | 798 | net/inet/tcp.c | if (sk->err) |
sk | 800 | net/inet/tcp.c | release_sock(sk); |
sk | 803 | net/inet/tcp.c | tmp = -sk->err; |
sk | 804 | net/inet/tcp.c | sk->err = 0; |
sk | 812 | net/inet/tcp.c | if (sk->shutdown & SEND_SHUTDOWN) |
sk | 814 | net/inet/tcp.c | release_sock(sk); |
sk | 815 | net/inet/tcp.c | sk->err = EPIPE; |
sk | 818 | net/inet/tcp.c | sk->err = 0; |
sk | 827 | net/inet/tcp.c | while(sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT) |
sk | 829 | net/inet/tcp.c | if (sk->err) |
sk | 831 | net/inet/tcp.c | release_sock(sk); |
sk | 834 | net/inet/tcp.c | tmp = -sk->err; |
sk | 835 | net/inet/tcp.c | sk->err = 0; |
sk | 839 | net/inet/tcp.c | if (sk->state != TCP_SYN_SENT && sk->state != TCP_SYN_RECV) |
sk | 841 | net/inet/tcp.c | release_sock(sk); |
sk | 846 | net/inet/tcp.c | if (sk->err) |
sk | 848 | net/inet/tcp.c | tmp = -sk->err; |
sk | 849 | net/inet/tcp.c | sk->err = 0; |
sk | 853 | net/inet/tcp.c | if (sk->keepopen) |
sk | 862 | net/inet/tcp.c | release_sock(sk); |
sk | 869 | net/inet/tcp.c | release_sock(sk); |
sk | 872 | net/inet/tcp.c | if (sk->state != TCP_ESTABLISHED && |
sk | 873 | net/inet/tcp.c | sk->state != TCP_CLOSE_WAIT && sk->err == 0) |
sk | 875 | net/inet/tcp.c | interruptible_sleep_on(sk->sleep); |
sk | 885 | net/inet/tcp.c | sk->inuse = 1; |
sk | 905 | net/inet/tcp.c | if ((skb = tcp_dequeue_partial(sk)) != NULL) |
sk | 916 | net/inet/tcp.c | copy = min(sk->mss - (skb->len - hdrlen), len); |
sk | 929 | net/inet/tcp.c | sk->write_seq += copy; |
sk | 931 | net/inet/tcp.c | if ((skb->len - hdrlen) >= sk->mss || |
sk | 932 | net/inet/tcp.c | (flags & MSG_OOB) || !sk->packets_out) |
sk | 933 | net/inet/tcp.c | tcp_send_skb(sk, skb); |
sk | 935 | net/inet/tcp.c | tcp_enqueue_partial(skb, sk); |
sk | 951 | net/inet/tcp.c | copy = sk->window_seq - sk->write_seq; |
sk | 952 | net/inet/tcp.c | if (copy <= 0 || copy < (sk->max_window >> 1) || copy > sk->mss) |
sk | 953 | net/inet/tcp.c | copy = sk->mss; |
sk | 962 | net/inet/tcp.c | if (copy < sk->mss && !(flags & MSG_OOB)) |
sk | 967 | net/inet/tcp.c | release_sock(sk); |
sk | 972 | net/inet/tcp.c | skb = prot->wmalloc(sk, sk->mtu + 128 + prot->max_header, 0, GFP_KERNEL); |
sk | 973 | net/inet/tcp.c | sk->inuse = 1; |
sk | 981 | net/inet/tcp.c | release_sock(sk); |
sk | 982 | net/inet/tcp.c | skb = prot->wmalloc(sk, copy + prot->max_header , 0, GFP_KERNEL); |
sk | 983 | net/inet/tcp.c | sk->inuse = 1; |
sk | 994 | net/inet/tcp.c | release_sock(sk); |
sk | 1005 | net/inet/tcp.c | tmp = sk->wmem_alloc; |
sk | 1006 | net/inet/tcp.c | release_sock(sk); |
sk | 1011 | net/inet/tcp.c | if (tmp <= sk->wmem_alloc && |
sk | 1012 | net/inet/tcp.c | (sk->state == TCP_ESTABLISHED||sk->state == TCP_CLOSE_WAIT) |
sk | 1013 | net/inet/tcp.c | && sk->err == 0) |
sk | 1015 | net/inet/tcp.c | interruptible_sleep_on(sk->sleep); |
sk | 1025 | net/inet/tcp.c | sk->inuse = 1; |
sk | 1031 | net/inet/tcp.c | skb->sk = sk; |
sk | 1033 | net/inet/tcp.c | skb->localroute = sk->localroute|(flags&MSG_DONTROUTE); |
sk | 1042 | net/inet/tcp.c | tmp = prot->build_header(skb, sk->saddr, sk->daddr, &dev, |
sk | 1043 | net/inet/tcp.c | IPPROTO_TCP, sk->opt, skb->mem_len,sk->ip_tos,sk->ip_ttl); |
sk | 1046 | net/inet/tcp.c | prot->wfree(sk, skb->mem_addr, skb->mem_len); |
sk | 1047 | net/inet/tcp.c | release_sock(sk); |
sk | 1057 | net/inet/tcp.c | tmp = tcp_build_header((struct tcphdr *)buff, sk, len-copy); |
sk | 1060 | net/inet/tcp.c | prot->wfree(sk, skb->mem_addr, skb->mem_len); |
sk | 1061 | net/inet/tcp.c | release_sock(sk); |
sk | 1081 | net/inet/tcp.c | sk->write_seq += copy; |
sk | 1083 | net/inet/tcp.c | if (send_tmp != NULL && sk->packets_out) |
sk | 1085 | net/inet/tcp.c | tcp_enqueue_partial(send_tmp, sk); |
sk | 1088 | net/inet/tcp.c | tcp_send_skb(sk, skb); |
sk | 1090 | net/inet/tcp.c | sk->err = 0; |
sk | 1103 | net/inet/tcp.c | if(sk->partial && ((!sk->packets_out) |
sk | 1105 | net/inet/tcp.c | || (sk->nonagle && before(sk->write_seq , sk->window_seq)) |
sk | 1107 | net/inet/tcp.c | tcp_send_partial(sk); |
sk | 1109 | net/inet/tcp.c | release_sock(sk); |
sk | 1115 | net/inet/tcp.c | static int tcp_sendto(struct sock *sk, unsigned char *from, |
sk | 1128 | net/inet/tcp.c | if (sin.sin_port != sk->dummy_th.dest) |
sk | 1130 | net/inet/tcp.c | if (sin.sin_addr.s_addr != sk->daddr) |
sk | 1132 | net/inet/tcp.c | return(tcp_write(sk, from, len, nonblock, flags)); |
sk | 1137 | net/inet/tcp.c | tcp_read_wakeup(struct sock *sk) |
sk | 1145 | net/inet/tcp.c | if (!sk->ack_backlog) |
sk | 1159 | net/inet/tcp.c | buff = sk->prot->wmalloc(sk,MAX_ACK_SIZE,1, GFP_ATOMIC); |
sk | 1163 | net/inet/tcp.c | reset_timer(sk, TIME_WRITE, 10); |
sk | 1168 | net/inet/tcp.c | buff->sk = sk; |
sk | 1169 | net/inet/tcp.c | buff->localroute = sk->localroute; |
sk | 1175 | net/inet/tcp.c | tmp = sk->prot->build_header(buff, sk->saddr, sk->daddr, &dev, |
sk | 1176 | net/inet/tcp.c | IPPROTO_TCP, sk->opt, MAX_ACK_SIZE,sk->ip_tos,sk->ip_ttl); |
sk | 1180 | net/inet/tcp.c | sk->prot->wfree(sk, buff->mem_addr, buff->mem_len); |
sk | 1187 | net/inet/tcp.c | memcpy(t1,(void *) &sk->dummy_th, sizeof(*t1)); |
sk | 1188 | net/inet/tcp.c | t1->seq = htonl(sk->sent_seq); |
sk | 1196 | net/inet/tcp.c | sk->ack_backlog = 0; |
sk | 1197 | net/inet/tcp.c | sk->bytes_rcv = 0; |
sk | 1198 | net/inet/tcp.c | sk->window = tcp_select_window(sk);/*sk->prot->rspace(sk);*/ |
sk | 1199 | net/inet/tcp.c | t1->window = ntohs(sk->window); |
sk | 1200 | net/inet/tcp.c | t1->ack_seq = ntohl(sk->acked_seq); |
sk | 1202 | net/inet/tcp.c | tcp_send_check(t1, sk->saddr, sk->daddr, sizeof(*t1), sk); |
sk | 1203 | net/inet/tcp.c | sk->prot->queue_xmit(sk, dev, buff, 1); |
sk | 1215 | net/inet/tcp.c | static void cleanup_rbuf(struct sock *sk) |
sk | 1221 | net/inet/tcp.c | if(sk->debug) |
sk | 1222 | net/inet/tcp.c | printk("cleaning rbuf for sk=%p\n", sk); |
sk | 1227 | net/inet/tcp.c | left = sk->prot->rspace(sk); |
sk | 1234 | net/inet/tcp.c | while((skb=skb_peek(&sk->receive_queue)) != NULL) |
sk | 1239 | net/inet/tcp.c | skb->sk = sk; |
sk | 1253 | net/inet/tcp.c | sk->window - sk->bytes_rcv, sk->prot->rspace(sk))); |
sk | 1255 | net/inet/tcp.c | if(sk->debug) |
sk | 1256 | net/inet/tcp.c | printk("sk->rspace = %lu, was %d\n", sk->prot->rspace(sk), |
sk | 1258 | net/inet/tcp.c | if (sk->prot->rspace(sk) != left) |
sk | 1270 | net/inet/tcp.c | sk->ack_backlog++; |
sk | 1280 | net/inet/tcp.c | if ((sk->prot->rspace(sk) > (sk->window - sk->bytes_rcv + sk->mtu))) |
sk | 1283 | net/inet/tcp.c | tcp_read_wakeup(sk); |
sk | 1288 | net/inet/tcp.c | int was_active = del_timer(&sk->timer); |
sk | 1289 | net/inet/tcp.c | if (!was_active || TCP_ACK_TIME < sk->timer.expires) |
sk | 1291 | net/inet/tcp.c | reset_timer(sk, TIME_WRITE, TCP_ACK_TIME); |
sk | 1294 | net/inet/tcp.c | add_timer(&sk->timer); |
sk | 1302 | net/inet/tcp.c | tcp_read_urg(struct sock * sk, int nonblock, |
sk | 1308 | net/inet/tcp.c | if (sk->urginline || !sk->urg_data || sk->urg_data == URG_READ) |
sk | 1310 | net/inet/tcp.c | if (sk->urg_data & URG_VALID) { |
sk | 1311 | net/inet/tcp.c | char c = sk->urg_data; |
sk | 1313 | net/inet/tcp.c | sk->urg_data = URG_READ; |
sk | 1318 | net/inet/tcp.c | if (sk->err) { |
sk | 1319 | net/inet/tcp.c | int tmp = -sk->err; |
sk | 1320 | net/inet/tcp.c | sk->err = 0; |
sk | 1324 | net/inet/tcp.c | if (sk->state == TCP_CLOSE || sk->done) { |
sk | 1325 | net/inet/tcp.c | if (!sk->done) { |
sk | 1326 | net/inet/tcp.c | sk->done = 1; |
sk | 1332 | net/inet/tcp.c | if (sk->shutdown & RCV_SHUTDOWN) { |
sk | 1333 | net/inet/tcp.c | sk->done = 1; |
sk | 1344 | net/inet/tcp.c | add_wait_queue(sk->sleep, &wait); |
sk | 1345 | net/inet/tcp.c | if ((sk->urg_data & URG_NOTYET) && sk->err == 0 && |
sk | 1346 | net/inet/tcp.c | !(sk->shutdown & RCV_SHUTDOWN)) |
sk | 1348 | net/inet/tcp.c | remove_wait_queue(sk->sleep, &wait); |
sk | 1356 | net/inet/tcp.c | static int tcp_read(struct sock *sk, unsigned char *to, |
sk | 1377 | net/inet/tcp.c | if (sk->state == TCP_LISTEN) |
sk | 1382 | net/inet/tcp.c | return tcp_read_urg(sk, nonblock, to, len, flags); |
sk | 1384 | net/inet/tcp.c | peek_seq = sk->copied_seq; |
sk | 1385 | net/inet/tcp.c | seq = &sk->copied_seq; |
sk | 1389 | net/inet/tcp.c | add_wait_queue(sk->sleep, &wait); |
sk | 1390 | net/inet/tcp.c | sk->inuse = 1; |
sk | 1398 | net/inet/tcp.c | if (copied && sk->urg_data && sk->urg_seq == 1+*seq) |
sk | 1403 | net/inet/tcp.c | skb = skb_peek(&sk->receive_queue); |
sk | 1417 | net/inet/tcp.c | } while (skb != (struct sk_buff *)&sk->receive_queue); |
sk | 1422 | net/inet/tcp.c | if (sk->err) { |
sk | 1423 | net/inet/tcp.c | copied = -sk->err; |
sk | 1424 | net/inet/tcp.c | sk->err = 0; |
sk | 1428 | net/inet/tcp.c | if (sk->state == TCP_CLOSE) { |
sk | 1429 | net/inet/tcp.c | if (!sk->done) { |
sk | 1430 | net/inet/tcp.c | sk->done = 1; |
sk | 1437 | net/inet/tcp.c | if (sk->shutdown & RCV_SHUTDOWN) { |
sk | 1438 | net/inet/tcp.c | sk->done = 1; |
sk | 1447 | net/inet/tcp.c | cleanup_rbuf(sk); |
sk | 1448 | net/inet/tcp.c | release_sock(sk); |
sk | 1450 | net/inet/tcp.c | sk->inuse = 1; |
sk | 1464 | net/inet/tcp.c | if (sk->urg_data) { |
sk | 1465 | net/inet/tcp.c | unsigned long urg_offset = sk->urg_seq - (1 + *seq); |
sk | 1468 | net/inet/tcp.c | if (!sk->urginline) { |
sk | 1484 | net/inet/tcp.c | if (after(sk->copied_seq+1,sk->urg_seq)) |
sk | 1485 | net/inet/tcp.c | sk->urg_data = 0; |
sk | 1489 | net/inet/tcp.c | remove_wait_queue(sk->sleep, &wait); |
sk | 1493 | net/inet/tcp.c | cleanup_rbuf(sk); |
sk | 1494 | net/inet/tcp.c | release_sock(sk); |
sk | 1505 | net/inet/tcp.c | void tcp_shutdown(struct sock *sk, int how) |
sk | 1525 | net/inet/tcp.c | if (sk->state == TCP_FIN_WAIT1 || sk->state == TCP_FIN_WAIT2) |
sk | 1529 | net/inet/tcp.c | sk->inuse = 1; |
sk | 1535 | net/inet/tcp.c | if (sk->partial) |
sk | 1536 | net/inet/tcp.c | tcp_send_partial(sk); |
sk | 1538 | net/inet/tcp.c | prot =(struct proto *)sk->prot; |
sk | 1539 | net/inet/tcp.c | th =(struct tcphdr *)&sk->dummy_th; |
sk | 1540 | net/inet/tcp.c | release_sock(sk); /* incase the malloc sleeps. */ |
sk | 1541 | net/inet/tcp.c | buff = prot->wmalloc(sk, MAX_RESET_SIZE,1 , GFP_KERNEL); |
sk | 1544 | net/inet/tcp.c | sk->inuse = 1; |
sk | 1547 | net/inet/tcp.c | buff->sk = sk; |
sk | 1549 | net/inet/tcp.c | buff->localroute = sk->localroute; |
sk | 1556 | net/inet/tcp.c | tmp = prot->build_header(buff,sk->saddr, sk->daddr, &dev, |
sk | 1557 | net/inet/tcp.c | IPPROTO_TCP, sk->opt, |
sk | 1558 | net/inet/tcp.c | sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl); |
sk | 1565 | net/inet/tcp.c | prot->wfree(sk,buff->mem_addr, buff->mem_len); |
sk | 1566 | net/inet/tcp.c | if(sk->state==TCP_ESTABLISHED) |
sk | 1567 | net/inet/tcp.c | sk->state=TCP_FIN_WAIT1; |
sk | 1569 | net/inet/tcp.c | sk->state=TCP_FIN_WAIT2; |
sk | 1570 | net/inet/tcp.c | release_sock(sk); |
sk | 1579 | net/inet/tcp.c | t1->seq = ntohl(sk->write_seq); |
sk | 1580 | net/inet/tcp.c | sk->write_seq++; |
sk | 1581 | net/inet/tcp.c | buff->h.seq = sk->write_seq; |
sk | 1583 | net/inet/tcp.c | t1->ack_seq = ntohl(sk->acked_seq); |
sk | 1584 | net/inet/tcp.c | t1->window = ntohs(sk->window=tcp_select_window(sk)/*sk->prot->rspace(sk)*/); |
sk | 1588 | net/inet/tcp.c | tcp_send_check(t1, sk->saddr, sk->daddr, sizeof(*t1), sk); |
sk | 1595 | net/inet/tcp.c | if (skb_peek(&sk->write_queue) != NULL) |
sk | 1603 | net/inet/tcp.c | skb_queue_tail(&sk->write_queue, buff); |
sk | 1607 | net/inet/tcp.c | sk->sent_seq = sk->write_seq; |
sk | 1608 | net/inet/tcp.c | sk->prot->queue_xmit(sk, dev, buff, 0); |
sk | 1611 | net/inet/tcp.c | if (sk->state == TCP_ESTABLISHED) |
sk | 1612 | net/inet/tcp.c | sk->state = TCP_FIN_WAIT1; |
sk | 1614 | net/inet/tcp.c | sk->state = TCP_FIN_WAIT2; |
sk | 1616 | net/inet/tcp.c | release_sock(sk); |
sk | 1621 | net/inet/tcp.c | tcp_recvfrom(struct sock *sk, unsigned char *to, |
sk | 1643 | net/inet/tcp.c | result=tcp_read(sk, to, to_len, nonblock, flags); |
sk | 1648 | net/inet/tcp.c | sin.sin_port = sk->dummy_th.dest; |
sk | 1649 | net/inet/tcp.c | sin.sin_addr.s_addr = sk->daddr; |
sk | 1680 | net/inet/tcp.c | buff->sk = NULL; |
sk | 1748 | net/inet/tcp.c | tcp_options(struct sock *sk, struct tcphdr *th) |
sk | 1776 | net/inet/tcp.c | sk->mtu=min(sk->mtu,ntohs(*(unsigned short *)ptr)); |
sk | 1788 | net/inet/tcp.c | sk->mtu=min(sk->mtu, 536); /* default MSS if none sent */ |
sk | 1790 | net/inet/tcp.c | sk->mss = min(sk->max_window, sk->mtu); |
sk | 1811 | net/inet/tcp.c | tcp_conn_request(struct sock *sk, struct sk_buff *skb, |
sk | 1825 | net/inet/tcp.c | sk, skb, daddr, saddr, opt, dev)); |
sk | 1830 | net/inet/tcp.c | if (!sk->dead) { |
sk | 1831 | net/inet/tcp.c | sk->data_ready(sk,0); |
sk | 1834 | net/inet/tcp.c | tcp_reset(daddr, saddr, th, sk->prot, opt, dev, sk->ip_tos,sk->ip_ttl); |
sk | 1844 | net/inet/tcp.c | if (sk->ack_backlog >= sk->max_ack_backlog) { |
sk | 1866 | net/inet/tcp.c | memcpy(newsk, sk, sizeof(*newsk)); |
sk | 1888 | net/inet/tcp.c | newsk->localroute = sk->localroute; |
sk | 1929 | net/inet/tcp.c | newsk->ip_ttl=sk->ip_ttl; |
sk | 1934 | net/inet/tcp.c | if (sk->user_mss) |
sk | 1935 | net/inet/tcp.c | newsk->mtu = sk->user_mss; |
sk | 1954 | net/inet/tcp.c | sk->err = -ENOMEM; |
sk | 1963 | net/inet/tcp.c | buff->sk = newsk; |
sk | 1969 | net/inet/tcp.c | tmp = sk->prot->build_header(buff, newsk->saddr, newsk->daddr, &ndev, |
sk | 1970 | net/inet/tcp.c | IPPROTO_TCP, NULL, MAX_SYN_SIZE,sk->ip_tos,sk->ip_ttl); |
sk | 1974 | net/inet/tcp.c | sk->err = tmp; |
sk | 1979 | net/inet/tcp.c | skb->sk = sk; |
sk | 2018 | net/inet/tcp.c | skb->sk = newsk; |
sk | 2021 | net/inet/tcp.c | sk->rmem_alloc -= skb->mem_len; |
sk | 2024 | net/inet/tcp.c | skb_queue_tail(&sk->receive_queue,skb); |
sk | 2025 | net/inet/tcp.c | sk->ack_backlog++; |
sk | 2031 | net/inet/tcp.c | static void tcp_close(struct sock *sk, int timeout) |
sk | 2044 | net/inet/tcp.c | DPRINTF((DBG_TCP, "tcp_close((struct sock *)%X, %d)\n",sk, timeout)); |
sk | 2045 | net/inet/tcp.c | sk->inuse = 1; |
sk | 2046 | net/inet/tcp.c | sk->keepopen = 1; |
sk | 2047 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 2049 | net/inet/tcp.c | if (!sk->dead) |
sk | 2050 | net/inet/tcp.c | sk->state_change(sk); |
sk | 2056 | net/inet/tcp.c | if (skb_peek(&sk->receive_queue) != NULL) |
sk | 2059 | net/inet/tcp.c | if(sk->debug) |
sk | 2061 | net/inet/tcp.c | while((skb=skb_dequeue(&sk->receive_queue))!=NULL) |
sk | 2063 | net/inet/tcp.c | if(skb->len > 0 && after(skb->h.th->seq + skb->len + 1 , sk->copied_seq)) |
sk | 2067 | net/inet/tcp.c | if(sk->debug) |
sk | 2075 | net/inet/tcp.c | if (sk->partial) |
sk | 2077 | net/inet/tcp.c | tcp_send_partial(sk); |
sk | 2080 | net/inet/tcp.c | switch(sk->state) |
sk | 2091 | net/inet/tcp.c | reset_timer(sk, TIME_CLOSE, 4 * sk->rto); |
sk | 2093 | net/inet/tcp.c | tcp_time_wait(sk); |
sk | 2094 | net/inet/tcp.c | release_sock(sk); |
sk | 2099 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 2101 | net/inet/tcp.c | release_sock(sk); |
sk | 2104 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 2105 | net/inet/tcp.c | release_sock(sk); |
sk | 2108 | net/inet/tcp.c | release_sock(sk); |
sk | 2114 | net/inet/tcp.c | prot =(struct proto *)sk->prot; |
sk | 2115 | net/inet/tcp.c | th =(struct tcphdr *)&sk->dummy_th; |
sk | 2116 | net/inet/tcp.c | buff = prot->wmalloc(sk, MAX_FIN_SIZE, 1, GFP_ATOMIC); |
sk | 2122 | net/inet/tcp.c | release_sock(sk); |
sk | 2123 | net/inet/tcp.c | if (sk->state != TCP_CLOSE_WAIT) |
sk | 2124 | net/inet/tcp.c | sk->state = TCP_ESTABLISHED; |
sk | 2125 | net/inet/tcp.c | reset_timer(sk, TIME_CLOSE, 100); |
sk | 2128 | net/inet/tcp.c | buff->sk = sk; |
sk | 2131 | net/inet/tcp.c | buff->localroute = sk->localroute; |
sk | 2137 | net/inet/tcp.c | tmp = prot->build_header(buff,sk->saddr, sk->daddr, &dev, |
sk | 2138 | net/inet/tcp.c | IPPROTO_TCP, sk->opt, |
sk | 2139 | net/inet/tcp.c | sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl); |
sk | 2143 | net/inet/tcp.c | if(sk->state==TCP_ESTABLISHED) |
sk | 2144 | net/inet/tcp.c | sk->state=TCP_FIN_WAIT1; |
sk | 2146 | net/inet/tcp.c | sk->state=TCP_FIN_WAIT2; |
sk | 2147 | net/inet/tcp.c | reset_timer(sk, TIME_CLOSE,4*sk->rto); |
sk | 2149 | net/inet/tcp.c | tcp_time_wait(sk); |
sk | 2152 | net/inet/tcp.c | release_sock(sk); |
sk | 2160 | net/inet/tcp.c | t1->seq = ntohl(sk->write_seq); |
sk | 2161 | net/inet/tcp.c | sk->write_seq++; |
sk | 2162 | net/inet/tcp.c | buff->h.seq = sk->write_seq; |
sk | 2169 | net/inet/tcp.c | sk->delay_acks = 0; |
sk | 2170 | net/inet/tcp.c | t1->ack_seq = ntohl(sk->acked_seq); |
sk | 2171 | net/inet/tcp.c | t1->window = ntohs(sk->window=tcp_select_window(sk)/*sk->prot->rspace(sk)*/); |
sk | 2175 | net/inet/tcp.c | tcp_send_check(t1, sk->saddr, sk->daddr, sizeof(*t1), sk); |
sk | 2179 | net/inet/tcp.c | if (skb_peek(&sk->write_queue) == NULL) |
sk | 2181 | net/inet/tcp.c | sk->sent_seq = sk->write_seq; |
sk | 2182 | net/inet/tcp.c | prot->queue_xmit(sk, dev, buff, 0); |
sk | 2186 | net/inet/tcp.c | reset_timer(sk, TIME_WRITE, sk->rto); |
sk | 2192 | net/inet/tcp.c | skb_queue_tail(&sk->write_queue, buff); |
sk | 2195 | net/inet/tcp.c | if (sk->state == TCP_CLOSE_WAIT) |
sk | 2197 | net/inet/tcp.c | sk->state = TCP_FIN_WAIT2; |
sk | 2201 | net/inet/tcp.c | sk->state = TCP_FIN_WAIT1; |
sk | 2204 | net/inet/tcp.c | release_sock(sk); |
sk | 2213 | net/inet/tcp.c | tcp_write_xmit(struct sock *sk) |
sk | 2217 | net/inet/tcp.c | DPRINTF((DBG_TCP, "tcp_write_xmit(sk=%X)\n", sk)); |
sk | 2221 | net/inet/tcp.c | if(sk->zapped) |
sk | 2224 | net/inet/tcp.c | while((skb = skb_peek(&sk->write_queue)) != NULL && |
sk | 2225 | net/inet/tcp.c | before(skb->h.seq, sk->window_seq + 1) && |
sk | 2226 | net/inet/tcp.c | (sk->retransmits == 0 || |
sk | 2227 | net/inet/tcp.c | sk->timeout != TIME_WRITE || |
sk | 2228 | net/inet/tcp.c | before(skb->h.seq, sk->rcv_ack_seq + 1)) |
sk | 2229 | net/inet/tcp.c | && sk->packets_out < sk->cong_window) { |
sk | 2235 | net/inet/tcp.c | if (before(skb->h.seq, sk->rcv_ack_seq +1)) { |
sk | 2236 | net/inet/tcp.c | sk->retransmits = 0; |
sk | 2238 | net/inet/tcp.c | if (!sk->dead) sk->write_space(sk); |
sk | 2240 | net/inet/tcp.c | sk->sent_seq = skb->h.seq; |
sk | 2241 | net/inet/tcp.c | sk->prot->queue_xmit(sk, skb->dev, skb, skb->free); |
sk | 2252 | net/inet/tcp.c | sort_send(struct sock *sk) |
sk | 2257 | net/inet/tcp.c | for (skb = sk->send_head; skb != NULL; skb = skb2) { |
sk | 2261 | net/inet/tcp.c | sk->send_tail = skb; |
sk | 2269 | net/inet/tcp.c | if (skb->link3 == NULL) sk->send_tail = skb; |
sk | 2275 | net/inet/tcp.c | sk->send_head = list; |
sk | 2281 | net/inet/tcp.c | tcp_ack(struct sock *sk, struct tcphdr *th, unsigned long saddr, int len) |
sk | 2292 | net/inet/tcp.c | if(sk->zapped) |
sk | 2298 | net/inet/tcp.c | ack, ntohs(th->window), sk->rcv_ack_seq, sk->window_seq)); |
sk | 2300 | net/inet/tcp.c | if (ntohs(th->window) > sk->max_window) { |
sk | 2301 | net/inet/tcp.c | sk->max_window = ntohs(th->window); |
sk | 2302 | net/inet/tcp.c | sk->mss = min(sk->max_window, sk->mtu); |
sk | 2305 | net/inet/tcp.c | if (sk->retransmits && sk->timeout == TIME_KEEPOPEN) |
sk | 2306 | net/inet/tcp.c | sk->retransmits = 0; |
sk | 2309 | net/inet/tcp.c | if (after(ack, sk->sent_seq+1) || before(ack, sk->rcv_ack_seq-1)) { |
sk | 2310 | net/inet/tcp.c | if (after(ack, sk->sent_seq) || |
sk | 2311 | net/inet/tcp.c | (sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT)) { |
sk | 2314 | net/inet/tcp.c | if (sk->keepopen) { |
sk | 2315 | net/inet/tcp.c | reset_timer(sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN); |
sk | 2323 | net/inet/tcp.c | if (after(sk->window_seq, ack+ntohs(th->window))) { |
sk | 2335 | net/inet/tcp.c | skb2 = sk->send_head; |
sk | 2336 | net/inet/tcp.c | sk->send_head = NULL; |
sk | 2337 | net/inet/tcp.c | sk->send_tail = NULL; |
sk | 2341 | net/inet/tcp.c | sk->window_seq = ack + ntohs(th->window); |
sk | 2347 | net/inet/tcp.c | if (after(skb->h.seq, sk->window_seq)) { |
sk | 2348 | net/inet/tcp.c | if (sk->packets_out > 0) sk->packets_out--; |
sk | 2355 | net/inet/tcp.c | skb_queue_head(&sk->write_queue,skb); |
sk | 2360 | net/inet/tcp.c | if (sk->send_head == NULL) { |
sk | 2361 | net/inet/tcp.c | sk->send_head = skb; |
sk | 2362 | net/inet/tcp.c | sk->send_tail = skb; |
sk | 2364 | net/inet/tcp.c | sk->send_tail->link3 = skb; |
sk | 2365 | net/inet/tcp.c | sk->send_tail = skb; |
sk | 2373 | net/inet/tcp.c | if (sk->send_tail == NULL || sk->send_head == NULL) { |
sk | 2374 | net/inet/tcp.c | sk->send_head = NULL; |
sk | 2375 | net/inet/tcp.c | sk->send_tail = NULL; |
sk | 2376 | net/inet/tcp.c | sk->packets_out= 0; |
sk | 2379 | net/inet/tcp.c | sk->window_seq = ack + ntohs(th->window); |
sk | 2382 | net/inet/tcp.c | if (sk->timeout == TIME_WRITE && |
sk | 2383 | net/inet/tcp.c | sk->cong_window < 2048 && after(ack, sk->rcv_ack_seq)) { |
sk | 2393 | net/inet/tcp.c | if (sk->cong_window < sk->ssthresh) |
sk | 2395 | net/inet/tcp.c | sk->cong_window++; |
sk | 2400 | net/inet/tcp.c | if (sk->cong_count >= sk->cong_window) { |
sk | 2401 | net/inet/tcp.c | sk->cong_window++; |
sk | 2402 | net/inet/tcp.c | sk->cong_count = 0; |
sk | 2404 | net/inet/tcp.c | sk->cong_count++; |
sk | 2409 | net/inet/tcp.c | sk->rcv_ack_seq = ack; |
sk | 2416 | net/inet/tcp.c | if (sk->timeout == TIME_PROBE0) { |
sk | 2417 | net/inet/tcp.c | if (skb_peek(&sk->write_queue) != NULL && /* should always be non-null */ |
sk | 2418 | net/inet/tcp.c | ! before (sk->window_seq, sk->write_queue.next->h.seq)) { |
sk | 2419 | net/inet/tcp.c | sk->retransmits = 0; |
sk | 2420 | net/inet/tcp.c | sk->backoff = 0; |
sk | 2422 | net/inet/tcp.c | sk->rto = ((sk->rtt >> 2) + sk->mdev) >> 1; |
sk | 2423 | net/inet/tcp.c | if (sk->rto > 120*HZ) |
sk | 2424 | net/inet/tcp.c | sk->rto = 120*HZ; |
sk | 2425 | net/inet/tcp.c | if (sk->rto < 1*HZ) |
sk | 2426 | net/inet/tcp.c | sk->rto = 1*HZ; |
sk | 2431 | net/inet/tcp.c | while(sk->send_head != NULL) { |
sk | 2433 | net/inet/tcp.c | if (sk->send_head->link3 && |
sk | 2434 | net/inet/tcp.c | after(sk->send_head->h.seq, sk->send_head->link3->h.seq)) { |
sk | 2436 | net/inet/tcp.c | sort_send(sk); |
sk | 2439 | net/inet/tcp.c | if (before(sk->send_head->h.seq, ack+1)) { |
sk | 2442 | net/inet/tcp.c | if (sk->retransmits) { |
sk | 2455 | net/inet/tcp.c | if (sk->send_head->link3) |
sk | 2456 | net/inet/tcp.c | sk->retransmits = 1; |
sk | 2458 | net/inet/tcp.c | sk->retransmits = 0; |
sk | 2475 | net/inet/tcp.c | if (sk->packets_out > 0) sk->packets_out --; |
sk | 2477 | net/inet/tcp.c | sk->send_head, sk->send_head->h.seq, ack)); |
sk | 2480 | net/inet/tcp.c | if (!sk->dead) sk->write_space(sk); |
sk | 2482 | net/inet/tcp.c | oskb = sk->send_head; |
sk | 2495 | net/inet/tcp.c | m -= (sk->rtt >> 3); /* m is now error in rtt est */ |
sk | 2496 | net/inet/tcp.c | sk->rtt += m; /* rtt = 7/8 rtt + 1/8 new */ |
sk | 2499 | net/inet/tcp.c | m -= (sk->mdev >> 2); /* similar update on mdev */ |
sk | 2500 | net/inet/tcp.c | sk->mdev += m; /* mdev = 3/4 mdev + 1/4 new */ |
sk | 2503 | net/inet/tcp.c | sk->rto = ((sk->rtt >> 2) + sk->mdev) >> 1; |
sk | 2504 | net/inet/tcp.c | if (sk->rto > 120*HZ) |
sk | 2505 | net/inet/tcp.c | sk->rto = 120*HZ; |
sk | 2506 | net/inet/tcp.c | if (sk->rto < 1*HZ) |
sk | 2507 | net/inet/tcp.c | sk->rto = 1*HZ; |
sk | 2508 | net/inet/tcp.c | sk->backoff = 0; |
sk | 2515 | net/inet/tcp.c | oskb = sk->send_head; |
sk | 2517 | net/inet/tcp.c | sk->send_head = oskb->link3; |
sk | 2518 | net/inet/tcp.c | if (sk->send_head == NULL) { |
sk | 2519 | net/inet/tcp.c | sk->send_tail = NULL; |
sk | 2527 | net/inet/tcp.c | if (!sk->dead) sk->write_space(sk); |
sk | 2537 | net/inet/tcp.c | if (skb_peek(&sk->write_queue) != NULL) { |
sk | 2538 | net/inet/tcp.c | if (after (sk->window_seq+1, sk->write_queue.next->h.seq) && |
sk | 2539 | net/inet/tcp.c | (sk->retransmits == 0 || |
sk | 2540 | net/inet/tcp.c | sk->timeout != TIME_WRITE || |
sk | 2541 | net/inet/tcp.c | before(sk->write_queue.next->h.seq, sk->rcv_ack_seq + 1)) |
sk | 2542 | net/inet/tcp.c | && sk->packets_out < sk->cong_window) { |
sk | 2544 | net/inet/tcp.c | tcp_write_xmit(sk); |
sk | 2545 | net/inet/tcp.c | } else if (before(sk->window_seq, sk->write_queue.next->h.seq) && |
sk | 2546 | net/inet/tcp.c | sk->send_head == NULL && |
sk | 2547 | net/inet/tcp.c | sk->ack_backlog == 0 && |
sk | 2548 | net/inet/tcp.c | sk->state != TCP_TIME_WAIT) { |
sk | 2549 | net/inet/tcp.c | reset_timer(sk, TIME_PROBE0, sk->rto); |
sk | 2552 | net/inet/tcp.c | if (sk->send_head == NULL && sk->ack_backlog == 0 && |
sk | 2553 | net/inet/tcp.c | sk->state != TCP_TIME_WAIT && !sk->keepopen) { |
sk | 2555 | net/inet/tcp.c | if (!sk->dead) sk->write_space(sk); |
sk | 2557 | net/inet/tcp.c | if (sk->keepopen) |
sk | 2558 | net/inet/tcp.c | reset_timer(sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN); |
sk | 2560 | net/inet/tcp.c | delete_timer(sk); |
sk | 2562 | net/inet/tcp.c | if (sk->state != (unsigned char) sk->keepopen) { |
sk | 2563 | net/inet/tcp.c | reset_timer(sk, TIME_WRITE, sk->rto); |
sk | 2565 | net/inet/tcp.c | if (sk->state == TCP_TIME_WAIT) { |
sk | 2566 | net/inet/tcp.c | reset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN); |
sk | 2571 | net/inet/tcp.c | if (sk->packets_out == 0 && sk->partial != NULL && |
sk | 2572 | net/inet/tcp.c | skb_peek(&sk->write_queue) == NULL && sk->send_head == NULL) { |
sk | 2574 | net/inet/tcp.c | tcp_send_partial(sk); |
sk | 2578 | net/inet/tcp.c | if (sk->state == TCP_TIME_WAIT) { |
sk | 2579 | net/inet/tcp.c | if (!sk->dead) |
sk | 2580 | net/inet/tcp.c | sk->state_change(sk); |
sk | 2581 | net/inet/tcp.c | if (sk->rcv_ack_seq == sk->write_seq && sk->acked_seq == sk->fin_seq) { |
sk | 2583 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 2584 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 2588 | net/inet/tcp.c | if (sk->state == TCP_LAST_ACK || sk->state == TCP_FIN_WAIT2) { |
sk | 2589 | net/inet/tcp.c | if (!sk->dead) sk->state_change(sk); |
sk | 2590 | net/inet/tcp.c | if (sk->rcv_ack_seq == sk->write_seq) { |
sk | 2592 | net/inet/tcp.c | if (sk->acked_seq != sk->fin_seq) { |
sk | 2593 | net/inet/tcp.c | tcp_time_wait(sk); |
sk | 2595 | net/inet/tcp.c | DPRINTF((DBG_TCP, "tcp_ack closing socket - %X\n", sk)); |
sk | 2596 | net/inet/tcp.c | tcp_send_ack(sk->sent_seq, sk->acked_seq, sk, |
sk | 2597 | net/inet/tcp.c | th, sk->daddr); |
sk | 2598 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 2599 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 2633 | net/inet/tcp.c | if (((!flag) || (flag&4)) && sk->send_head != NULL && |
sk | 2634 | net/inet/tcp.c | (((flag&2) && sk->retransmits) || |
sk | 2635 | net/inet/tcp.c | (sk->send_head->when + sk->rto < jiffies))) { |
sk | 2636 | net/inet/tcp.c | ip_do_retransmit(sk, 1); |
sk | 2637 | net/inet/tcp.c | reset_timer(sk, TIME_WRITE, sk->rto); |
sk | 2651 | net/inet/tcp.c | tcp_data(struct sk_buff *skb, struct sock *sk, |
sk | 2662 | net/inet/tcp.c | DPRINTF((DBG_TCP, "tcp_data len = %d sk = %X:\n", skb->len, sk)); |
sk | 2664 | net/inet/tcp.c | sk->bytes_rcv += skb->len; |
sk | 2667 | net/inet/tcp.c | if (!th->ack) tcp_send_ack(sk->sent_seq, sk->acked_seq,sk, th, saddr); |
sk | 2672 | net/inet/tcp.c | if (sk->shutdown & RCV_SHUTDOWN) { |
sk | 2673 | net/inet/tcp.c | sk->acked_seq = th->seq + skb->len + th->syn + th->fin; |
sk | 2674 | net/inet/tcp.c | tcp_reset(sk->saddr, sk->daddr, skb->h.th, |
sk | 2675 | net/inet/tcp.c | sk->prot, NULL, skb->dev, sk->ip_tos, sk->ip_ttl); |
sk | 2677 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 2678 | net/inet/tcp.c | sk->err = EPIPE; |
sk | 2679 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 2680 | net/inet/tcp.c | DPRINTF((DBG_TCP, "tcp_data: closing socket - %X\n", sk)); |
sk | 2682 | net/inet/tcp.c | if (!sk->dead) sk->state_change(sk); |
sk | 2695 | net/inet/tcp.c | if (skb_peek(&sk->receive_queue) == NULL) { |
sk | 2697 | net/inet/tcp.c | skb_queue_head(&sk->receive_queue,skb); |
sk | 2700 | net/inet/tcp.c | DPRINTF((DBG_TCP, "tcp_data adding to chain sk = %X:\n", sk)); |
sk | 2701 | net/inet/tcp.c | for(skb1=sk->receive_queue.prev; ; skb1 = skb1->prev) { |
sk | 2702 | net/inet/tcp.c | if(sk->debug) |
sk | 2707 | net/inet/tcp.c | printk("copied_seq = %ld acked_seq = %ld\n", sk->copied_seq, |
sk | 2708 | net/inet/tcp.c | sk->acked_seq); |
sk | 2724 | net/inet/tcp.c | if (skb1 == skb_peek(&sk->receive_queue)) |
sk | 2726 | net/inet/tcp.c | skb_queue_head(&sk->receive_queue, skb); |
sk | 2737 | net/inet/tcp.c | if (before(sk->acked_seq, sk->copied_seq)) { |
sk | 2739 | net/inet/tcp.c | sk->acked_seq = sk->copied_seq; |
sk | 2743 | net/inet/tcp.c | if ((!dup_dumped && (skb1 == NULL || skb1->acked)) || before(th->seq, sk->acked_seq+1)) { |
sk | 2744 | net/inet/tcp.c | if (before(th->seq, sk->acked_seq+1)) { |
sk | 2747 | net/inet/tcp.c | if (after(th->ack_seq, sk->acked_seq)) { |
sk | 2748 | net/inet/tcp.c | newwindow = sk->window - |
sk | 2749 | net/inet/tcp.c | (th->ack_seq - sk->acked_seq); |
sk | 2752 | net/inet/tcp.c | sk->window = newwindow; |
sk | 2753 | net/inet/tcp.c | sk->acked_seq = th->ack_seq; |
sk | 2759 | net/inet/tcp.c | if (!sk->dead) sk->state_change(sk); |
sk | 2760 | net/inet/tcp.c | sk->shutdown |= RCV_SHUTDOWN; |
sk | 2764 | net/inet/tcp.c | skb2 != (struct sk_buff *)&sk->receive_queue; |
sk | 2766 | net/inet/tcp.c | if (before(skb2->h.th->seq, sk->acked_seq+1)) { |
sk | 2767 | net/inet/tcp.c | if (after(skb2->h.th->ack_seq, sk->acked_seq)) |
sk | 2769 | net/inet/tcp.c | newwindow = sk->window - |
sk | 2770 | net/inet/tcp.c | (skb2->h.th->ack_seq - sk->acked_seq); |
sk | 2773 | net/inet/tcp.c | sk->window = newwindow; |
sk | 2774 | net/inet/tcp.c | sk->acked_seq = skb2->h.th->ack_seq; |
sk | 2783 | net/inet/tcp.c | sk->shutdown |= RCV_SHUTDOWN; |
sk | 2784 | net/inet/tcp.c | if (!sk->dead) sk->state_change(sk); |
sk | 2788 | net/inet/tcp.c | sk->ack_backlog = sk->max_ack_backlog; |
sk | 2798 | net/inet/tcp.c | if (!sk->delay_acks || |
sk | 2799 | net/inet/tcp.c | sk->ack_backlog >= sk->max_ack_backlog || |
sk | 2800 | net/inet/tcp.c | sk->bytes_rcv > sk->max_unacked || th->fin) { |
sk | 2803 | net/inet/tcp.c | sk->ack_backlog++; |
sk | 2804 | net/inet/tcp.c | if(sk->debug) |
sk | 2806 | net/inet/tcp.c | reset_timer(sk, TIME_WRITE, TCP_ACK_TIME); |
sk | 2822 | net/inet/tcp.c | while (sk->prot->rspace(sk) < sk->mtu) { |
sk | 2823 | net/inet/tcp.c | skb1 = skb_peek(&sk->receive_queue); |
sk | 2837 | net/inet/tcp.c | tcp_send_ack(sk->sent_seq, sk->acked_seq, sk, th, saddr); |
sk | 2838 | net/inet/tcp.c | sk->ack_backlog++; |
sk | 2839 | net/inet/tcp.c | reset_timer(sk, TIME_WRITE, TCP_ACK_TIME); |
sk | 2842 | net/inet/tcp.c | tcp_send_ack(sk->sent_seq, sk->acked_seq, sk, th, saddr); |
sk | 2846 | net/inet/tcp.c | if (!sk->dead) { |
sk | 2847 | net/inet/tcp.c | if(sk->debug) |
sk | 2849 | net/inet/tcp.c | sk->data_ready(sk,0); |
sk | 2854 | net/inet/tcp.c | if (sk->state == TCP_FIN_WAIT2 && |
sk | 2855 | net/inet/tcp.c | sk->acked_seq == sk->fin_seq && sk->rcv_ack_seq == sk->write_seq) { |
sk | 2856 | net/inet/tcp.c | DPRINTF((DBG_TCP, "tcp_data: entering last_ack state sk = %X\n", sk)); |
sk | 2859 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 2860 | net/inet/tcp.c | sk->state = TCP_LAST_ACK; |
sk | 2861 | net/inet/tcp.c | if (!sk->dead) sk->state_change(sk); |
sk | 2868 | net/inet/tcp.c | static void tcp_check_urg(struct sock * sk, struct tcphdr * th) |
sk | 2877 | net/inet/tcp.c | if (after(sk->copied_seq+1, ptr)) |
sk | 2881 | net/inet/tcp.c | if (sk->urg_data && !after(ptr, sk->urg_seq)) |
sk | 2885 | net/inet/tcp.c | if (sk->proc != 0) { |
sk | 2886 | net/inet/tcp.c | if (sk->proc > 0) { |
sk | 2887 | net/inet/tcp.c | kill_proc(sk->proc, SIGURG, 1); |
sk | 2889 | net/inet/tcp.c | kill_pg(-sk->proc, SIGURG, 1); |
sk | 2892 | net/inet/tcp.c | sk->urg_data = URG_NOTYET; |
sk | 2893 | net/inet/tcp.c | sk->urg_seq = ptr; |
sk | 2896 | net/inet/tcp.c | static inline int tcp_urg(struct sock *sk, struct tcphdr *th, |
sk | 2903 | net/inet/tcp.c | tcp_check_urg(sk,th); |
sk | 2906 | net/inet/tcp.c | if (sk->urg_data != URG_NOTYET) |
sk | 2910 | net/inet/tcp.c | ptr = sk->urg_seq - th->seq + th->doff*4; |
sk | 2915 | net/inet/tcp.c | sk->urg_data = URG_VALID | *(ptr + (unsigned char *) th); |
sk | 2916 | net/inet/tcp.c | if (!sk->dead) |
sk | 2917 | net/inet/tcp.c | sk->data_ready(sk,0); |
sk | 2926 | net/inet/tcp.c | static int tcp_fin(struct sock *sk, struct tcphdr *th, |
sk | 2930 | net/inet/tcp.c | sk, th, saddr, dev)); |
sk | 2932 | net/inet/tcp.c | if (!sk->dead) |
sk | 2934 | net/inet/tcp.c | sk->state_change(sk); |
sk | 2937 | net/inet/tcp.c | switch(sk->state) |
sk | 2943 | net/inet/tcp.c | reset_timer(sk, TIME_CLOSE, TCP_TIMEOUT_LEN); |
sk | 2944 | net/inet/tcp.c | sk->fin_seq = th->seq+1; |
sk | 2946 | net/inet/tcp.c | sk->state = TCP_CLOSE_WAIT; |
sk | 2948 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 2957 | net/inet/tcp.c | sk->fin_seq = th->seq+1; |
sk | 2958 | net/inet/tcp.c | sk->state = TCP_FIN_WAIT2; |
sk | 2963 | net/inet/tcp.c | sk->state = TCP_LAST_ACK; |
sk | 2966 | net/inet/tcp.c | reset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN); |
sk | 2969 | net/inet/tcp.c | sk->ack_backlog++; |
sk | 2977 | net/inet/tcp.c | tcp_accept(struct sock *sk, int flags) |
sk | 2983 | net/inet/tcp.c | sk, flags, in_ntoa(sk->saddr))); |
sk | 2989 | net/inet/tcp.c | if (sk->state != TCP_LISTEN) { |
sk | 2990 | net/inet/tcp.c | sk->err = EINVAL; |
sk | 2996 | net/inet/tcp.c | sk->inuse = 1; |
sk | 2997 | net/inet/tcp.c | while((skb = skb_dequeue(&sk->receive_queue)) == NULL) { |
sk | 3000 | net/inet/tcp.c | release_sock(sk); |
sk | 3001 | net/inet/tcp.c | sk->err = EAGAIN; |
sk | 3005 | net/inet/tcp.c | release_sock(sk); |
sk | 3006 | net/inet/tcp.c | interruptible_sleep_on(sk->sleep); |
sk | 3009 | net/inet/tcp.c | sk->err = ERESTARTSYS; |
sk | 3012 | net/inet/tcp.c | sk->inuse = 1; |
sk | 3017 | net/inet/tcp.c | newsk = skb->sk; |
sk | 3020 | net/inet/tcp.c | sk->ack_backlog--; |
sk | 3021 | net/inet/tcp.c | release_sock(sk); |
sk | 3030 | net/inet/tcp.c | static int tcp_connect(struct sock *sk, struct sockaddr_in *usin, int addr_len) |
sk | 3040 | net/inet/tcp.c | if (sk->state != TCP_CLOSE) |
sk | 3077 | net/inet/tcp.c | if(sk->saddr == sin.sin_addr.s_addr && sk->num==ntohs(sin.sin_port)) |
sk | 3080 | net/inet/tcp.c | sk->inuse = 1; |
sk | 3081 | net/inet/tcp.c | sk->daddr = sin.sin_addr.s_addr; |
sk | 3082 | net/inet/tcp.c | sk->write_seq = jiffies * SEQ_TICK - seq_offset; |
sk | 3083 | net/inet/tcp.c | sk->window_seq = sk->write_seq; |
sk | 3084 | net/inet/tcp.c | sk->rcv_ack_seq = sk->write_seq -1; |
sk | 3085 | net/inet/tcp.c | sk->err = 0; |
sk | 3086 | net/inet/tcp.c | sk->dummy_th.dest = sin.sin_port; |
sk | 3087 | net/inet/tcp.c | release_sock(sk); |
sk | 3089 | net/inet/tcp.c | buff = sk->prot->wmalloc(sk,MAX_SYN_SIZE,0, GFP_KERNEL); |
sk | 3094 | net/inet/tcp.c | sk->inuse = 1; |
sk | 3096 | net/inet/tcp.c | buff->sk = sk; |
sk | 3098 | net/inet/tcp.c | buff->localroute = sk->localroute; |
sk | 3110 | net/inet/tcp.c | tmp = sk->prot->build_header(buff, sk->saddr, sk->daddr, &dev, |
sk | 3111 | net/inet/tcp.c | IPPROTO_TCP, NULL, MAX_SYN_SIZE,sk->ip_tos,sk->ip_ttl); |
sk | 3114 | net/inet/tcp.c | sk->prot->wfree(sk, buff->mem_addr, buff->mem_len); |
sk | 3115 | net/inet/tcp.c | release_sock(sk); |
sk | 3122 | net/inet/tcp.c | memcpy(t1,(void *)&(sk->dummy_th), sizeof(*t1)); |
sk | 3123 | net/inet/tcp.c | t1->seq = ntohl(sk->write_seq++); |
sk | 3124 | net/inet/tcp.c | sk->sent_seq = sk->write_seq; |
sk | 3125 | net/inet/tcp.c | buff->h.seq = sk->write_seq; |
sk | 3138 | net/inet/tcp.c | if (sk->user_mss) |
sk | 3139 | net/inet/tcp.c | sk->mtu = sk->user_mss; |
sk | 3143 | net/inet/tcp.c | if ((sk->saddr ^ sk->daddr) & default_mask(sk->saddr)) |
sk | 3145 | net/inet/tcp.c | if ((sk->saddr ^ sk->daddr) & dev->pa_mask) |
sk | 3147 | net/inet/tcp.c | sk->mtu = 576 - HEADER_SIZE; |
sk | 3149 | net/inet/tcp.c | sk->mtu = MAX_WINDOW; |
sk | 3155 | net/inet/tcp.c | sk->mtu = min(sk->mtu, dev->mtu - HEADER_SIZE); |
sk | 3164 | net/inet/tcp.c | ptr[2] = (sk->mtu) >> 8; |
sk | 3165 | net/inet/tcp.c | ptr[3] = (sk->mtu) & 0xff; |
sk | 3166 | net/inet/tcp.c | tcp_send_check(t1, sk->saddr, sk->daddr, |
sk | 3167 | net/inet/tcp.c | sizeof(struct tcphdr) + 4, sk); |
sk | 3173 | net/inet/tcp.c | sk->state = TCP_SYN_SENT; |
sk | 3174 | net/inet/tcp.c | sk->rtt = TCP_CONNECT_TIME; |
sk | 3175 | net/inet/tcp.c | reset_timer(sk, TIME_WRITE, TCP_CONNECT_TIME); /* Timer for repeating the SYN until an answer */ |
sk | 3176 | net/inet/tcp.c | sk->retransmits = TCP_RETR2 - TCP_SYN_RETRIES; |
sk | 3178 | net/inet/tcp.c | sk->prot->queue_xmit(sk, dev, buff, 0); |
sk | 3182 | net/inet/tcp.c | release_sock(sk); |
sk | 3189 | net/inet/tcp.c | tcp_sequence(struct sock *sk, struct tcphdr *th, short len, |
sk | 3198 | net/inet/tcp.c | if (next_seq && !sk->window) |
sk | 3210 | net/inet/tcp.c | if (!after(next_seq+1, sk->acked_seq)) |
sk | 3213 | net/inet/tcp.c | if (!before(th->seq, sk->acked_seq + sk->window + 1)) |
sk | 3232 | net/inet/tcp.c | if (sk->state==TCP_SYN_SENT || sk->state==TCP_SYN_RECV) { |
sk | 3233 | net/inet/tcp.c | tcp_reset(sk->saddr,sk->daddr,th,sk->prot,NULL,dev, sk->ip_tos,sk->ip_ttl); |
sk | 3238 | net/inet/tcp.c | tcp_send_ack(sk->sent_seq, sk->acked_seq, sk, th, saddr); |
sk | 3249 | net/inet/tcp.c | struct sock *sk; |
sk | 3267 | net/inet/tcp.c | sk = get_sock(&tcp_prot, th->dest, saddr, th->source, daddr); |
sk | 3273 | net/inet/tcp.c | if (sk!=NULL && sk->zapped) |
sk | 3274 | net/inet/tcp.c | sk=NULL; |
sk | 3276 | net/inet/tcp.c | if (sk) { |
sk | 3277 | net/inet/tcp.c | DPRINTF((DBG_TCP, "sk = %X:\n", sk)); |
sk | 3282 | net/inet/tcp.c | skb->sk = NULL; |
sk | 3296 | net/inet/tcp.c | if (sk == NULL) { |
sk | 3299 | net/inet/tcp.c | skb->sk = NULL; |
sk | 3305 | net/inet/tcp.c | skb->sk = sk; |
sk | 3314 | net/inet/tcp.c | if (sk->inuse) { |
sk | 3315 | net/inet/tcp.c | skb_queue_head(&sk->back_log, skb); |
sk | 3319 | net/inet/tcp.c | sk->inuse = 1; |
sk | 3322 | net/inet/tcp.c | if (!sk) { |
sk | 3328 | net/inet/tcp.c | if (!sk->prot) { |
sk | 3334 | net/inet/tcp.c | if (sk->rmem_alloc + skb->mem_len >= sk->rcvbuf) { |
sk | 3335 | net/inet/tcp.c | skb->sk = NULL; |
sk | 3338 | net/inet/tcp.c | release_sock(sk); |
sk | 3341 | net/inet/tcp.c | sk->rmem_alloc += skb->mem_len; |
sk | 3346 | net/inet/tcp.c | switch(sk->state) { |
sk | 3353 | net/inet/tcp.c | sk->zapped=1; |
sk | 3354 | net/inet/tcp.c | sk->err = ECONNRESET; |
sk | 3355 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 3356 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 3357 | net/inet/tcp.c | if (!sk->dead) { |
sk | 3358 | net/inet/tcp.c | sk->state_change(sk); |
sk | 3361 | net/inet/tcp.c | release_sock(sk); |
sk | 3370 | net/inet/tcp.c | if (!tcp_sequence(sk, th, len, opt, saddr,dev)) { |
sk | 3374 | net/inet/tcp.c | release_sock(sk); |
sk | 3382 | net/inet/tcp.c | sk->zapped=1; |
sk | 3384 | net/inet/tcp.c | sk->err = ECONNRESET; |
sk | 3386 | net/inet/tcp.c | if (sk->state == TCP_CLOSE_WAIT) |
sk | 3388 | net/inet/tcp.c | sk->err = EPIPE; |
sk | 3395 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 3396 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 3397 | net/inet/tcp.c | if (!sk->dead) |
sk | 3399 | net/inet/tcp.c | sk->state_change(sk); |
sk | 3402 | net/inet/tcp.c | release_sock(sk); |
sk | 3409 | net/inet/tcp.c | sk->err = ECONNRESET; |
sk | 3410 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 3411 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 3412 | net/inet/tcp.c | tcp_reset(daddr, saddr, th, sk->prot, opt,dev, sk->ip_tos,sk->ip_ttl); |
sk | 3413 | net/inet/tcp.c | if (!sk->dead) { |
sk | 3414 | net/inet/tcp.c | sk->state_change(sk); |
sk | 3417 | net/inet/tcp.c | release_sock(sk); |
sk | 3421 | net/inet/tcp.c | if (th->ack && !tcp_ack(sk, th, saddr, len)) { |
sk | 3423 | net/inet/tcp.c | release_sock(sk); |
sk | 3427 | net/inet/tcp.c | if (tcp_urg(sk, th, saddr, len)) { |
sk | 3429 | net/inet/tcp.c | release_sock(sk); |
sk | 3433 | net/inet/tcp.c | if (tcp_data(skb, sk, saddr, len)) { |
sk | 3435 | net/inet/tcp.c | release_sock(sk); |
sk | 3440 | net/inet/tcp.c | if (th->fin && tcp_fin(sk, th, saddr, dev)) { |
sk | 3442 | net/inet/tcp.c | release_sock(sk); |
sk | 3446 | net/inet/tcp.c | release_sock(sk); |
sk | 3450 | net/inet/tcp.c | if (sk->dead || sk->daddr) { |
sk | 3453 | net/inet/tcp.c | release_sock(sk); |
sk | 3460 | net/inet/tcp.c | tcp_reset(daddr, saddr, th, sk->prot, opt,dev,sk->ip_tos,sk->ip_ttl); |
sk | 3463 | net/inet/tcp.c | release_sock(sk); |
sk | 3469 | net/inet/tcp.c | release_sock(sk); |
sk | 3473 | net/inet/tcp.c | tcp_reset(daddr, saddr, th, sk->prot, opt,dev,sk->ip_tos,sk->ip_ttl); |
sk | 3475 | net/inet/tcp.c | release_sock(sk); |
sk | 3487 | net/inet/tcp.c | tcp_conn_request(sk, skb, daddr, saddr, opt, dev); |
sk | 3488 | net/inet/tcp.c | release_sock(sk); |
sk | 3493 | net/inet/tcp.c | release_sock(sk); |
sk | 3500 | net/inet/tcp.c | release_sock(sk); |
sk | 3506 | net/inet/tcp.c | if (!tcp_sequence(sk, th, len, opt, saddr,dev)) |
sk | 3509 | net/inet/tcp.c | release_sock(sk); |
sk | 3517 | net/inet/tcp.c | sk->err = ECONNREFUSED; |
sk | 3518 | net/inet/tcp.c | sk->state = TCP_CLOSE; |
sk | 3519 | net/inet/tcp.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 3520 | net/inet/tcp.c | sk->zapped = 1; |
sk | 3521 | net/inet/tcp.c | if (!sk->dead) |
sk | 3523 | net/inet/tcp.c | sk->state_change(sk); |
sk | 3526 | net/inet/tcp.c | release_sock(sk); |
sk | 3533 | net/inet/tcp.c | sk->state = TCP_SYN_RECV; |
sk | 3537 | net/inet/tcp.c | release_sock(sk); |
sk | 3541 | net/inet/tcp.c | switch(sk->state) |
sk | 3544 | net/inet/tcp.c | if (!tcp_ack(sk, th, saddr, len)) |
sk | 3548 | net/inet/tcp.c | sk->prot, opt,dev,sk->ip_tos,sk->ip_ttl); |
sk | 3550 | net/inet/tcp.c | release_sock(sk); |
sk | 3561 | net/inet/tcp.c | release_sock(sk); |
sk | 3566 | net/inet/tcp.c | sk->acked_seq = th->seq+1; |
sk | 3567 | net/inet/tcp.c | sk->fin_seq = th->seq; |
sk | 3568 | net/inet/tcp.c | tcp_send_ack(sk->sent_seq, th->seq+1, |
sk | 3569 | net/inet/tcp.c | sk, th, sk->daddr); |
sk | 3572 | net/inet/tcp.c | if (!tcp_ack(sk, th, saddr, len)) |
sk | 3576 | net/inet/tcp.c | sk->prot, opt, dev,sk->ip_tos,sk->ip_ttl); |
sk | 3578 | net/inet/tcp.c | release_sock(sk); |
sk | 3583 | net/inet/tcp.c | sk->state = TCP_ESTABLISHED; |
sk | 3590 | net/inet/tcp.c | tcp_options(sk, th); |
sk | 3591 | net/inet/tcp.c | sk->dummy_th.dest = th->source; |
sk | 3592 | net/inet/tcp.c | sk->copied_seq = sk->acked_seq-1; |
sk | 3593 | net/inet/tcp.c | if (!sk->dead) { |
sk | 3594 | net/inet/tcp.c | sk->state_change(sk); |
sk | 3606 | net/inet/tcp.c | if (sk->max_window == 0) { |
sk | 3607 | net/inet/tcp.c | sk->max_window = 32; |
sk | 3608 | net/inet/tcp.c | sk->mss = min(sk->max_window, sk->mtu); |
sk | 3616 | net/inet/tcp.c | if (tcp_urg(sk, th, saddr, len)) { |
sk | 3618 | net/inet/tcp.c | release_sock(sk); |
sk | 3622 | net/inet/tcp.c | if (tcp_data(skb, sk, saddr, len)) |
sk | 3625 | net/inet/tcp.c | if (th->fin) tcp_fin(sk, th, saddr, dev); |
sk | 3626 | net/inet/tcp.c | release_sock(sk); |
sk | 3631 | net/inet/tcp.c | if (tcp_urg(sk, th, saddr, len)) { |
sk | 3633 | net/inet/tcp.c | release_sock(sk); |
sk | 3638 | net/inet/tcp.c | if (tcp_data(skb, sk, saddr, len)) { |
sk | 3640 | net/inet/tcp.c | release_sock(sk); |
sk | 3645 | net/inet/tcp.c | release_sock(sk); |
sk | 3648 | net/inet/tcp.c | tcp_fin(sk, th, saddr, dev); |
sk | 3649 | net/inet/tcp.c | release_sock(sk); |
sk | 3660 | net/inet/tcp.c | static void tcp_write_wakeup(struct sock *sk) |
sk | 3667 | net/inet/tcp.c | if (sk->zapped) |
sk | 3670 | net/inet/tcp.c | if (sk -> state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT && |
sk | 3671 | net/inet/tcp.c | sk -> state != TCP_FIN_WAIT1 && sk->state != TCP_FIN_WAIT2) |
sk | 3674 | net/inet/tcp.c | buff = sk->prot->wmalloc(sk,MAX_ACK_SIZE,1, GFP_ATOMIC); |
sk | 3680 | net/inet/tcp.c | buff->sk = sk; |
sk | 3681 | net/inet/tcp.c | buff->localroute = sk->localroute; |
sk | 3687 | net/inet/tcp.c | tmp = sk->prot->build_header(buff, sk->saddr, sk->daddr, &dev, |
sk | 3688 | net/inet/tcp.c | IPPROTO_TCP, sk->opt, MAX_ACK_SIZE,sk->ip_tos,sk->ip_ttl); |
sk | 3691 | net/inet/tcp.c | sk->prot->wfree(sk, buff->mem_addr, buff->mem_len); |
sk | 3698 | net/inet/tcp.c | memcpy(t1,(void *) &sk->dummy_th, sizeof(*t1)); |
sk | 3704 | net/inet/tcp.c | t1->seq = htonl(sk->sent_seq-1); |
sk | 3713 | net/inet/tcp.c | t1->ack_seq = ntohl(sk->acked_seq); |
sk | 3714 | net/inet/tcp.c | t1->window = ntohs(tcp_select_window(sk)/*sk->prot->rspace(sk)*/); |
sk | 3716 | net/inet/tcp.c | tcp_send_check(t1, sk->saddr, sk->daddr, sizeof(*t1), sk); |
sk | 3721 | net/inet/tcp.c | sk->prot->queue_xmit(sk, dev, buff, 1); |
sk | 3726 | net/inet/tcp.c | tcp_send_probe0(struct sock *sk) |
sk | 3728 | net/inet/tcp.c | if (sk->zapped) |
sk | 3731 | net/inet/tcp.c | tcp_write_wakeup(sk); |
sk | 3733 | net/inet/tcp.c | sk->backoff++; |
sk | 3734 | net/inet/tcp.c | sk->rto = min(sk->rto << 1, 120*HZ); |
sk | 3735 | net/inet/tcp.c | reset_timer (sk, TIME_PROBE0, sk->rto); |
sk | 3736 | net/inet/tcp.c | sk->retransmits++; |
sk | 3737 | net/inet/tcp.c | sk->prot->retransmits ++; |
sk | 3744 | net/inet/tcp.c | int tcp_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen) |
sk | 3749 | net/inet/tcp.c | return ip_setsockopt(sk,level,optname,optval,optlen); |
sk | 3771 | net/inet/tcp.c | sk->user_mss=val; |
sk | 3774 | net/inet/tcp.c | sk->nonagle=(val==0)?0:1; |
sk | 3781 | net/inet/tcp.c | int tcp_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen) |
sk | 3786 | net/inet/tcp.c | return ip_getsockopt(sk,level,optname,optval,optlen); |
sk | 3791 | net/inet/tcp.c | val=sk->user_mss; |
sk | 3794 | net/inet/tcp.c | val=sk->nonagle; /* Until Johannes stuff is in */ |
sk | 118 | net/inet/tcp.h | extern void tcp_shutdown (struct sock *sk, int how); |
sk | 124 | net/inet/tcp.h | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
sk | 126 | net/inet/tcp.h | extern void tcp_send_probe0(struct sock *sk); |
sk | 91 | net/inet/timer.c | struct sock *sk = (struct sock*)data; |
sk | 92 | net/inet/timer.c | int why = sk->timeout; |
sk | 96 | net/inet/timer.c | if (sk->inuse || in_bh) { |
sk | 97 | net/inet/timer.c | sk->timer.expires = 10; |
sk | 98 | net/inet/timer.c | add_timer(&sk->timer); |
sk | 102 | net/inet/timer.c | sk->inuse = 1; |
sk | 105 | net/inet/timer.c | DPRINTF ((DBG_TMR, "net_timer: found sk=%X why = %d\n", sk, why)); |
sk | 106 | net/inet/timer.c | if (skb_peek(&sk->write_queue) && |
sk | 107 | net/inet/timer.c | before(sk->window_seq, sk->write_queue.next->h.seq) && |
sk | 108 | net/inet/timer.c | sk->send_head == NULL && |
sk | 109 | net/inet/timer.c | sk->ack_backlog == 0 && |
sk | 110 | net/inet/timer.c | sk->state != TCP_TIME_WAIT) |
sk | 111 | net/inet/timer.c | reset_timer(sk, TIME_PROBE0, sk->rto); |
sk | 112 | net/inet/timer.c | else if (sk->keepopen) |
sk | 113 | net/inet/timer.c | reset_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN); |
sk | 116 | net/inet/timer.c | if (sk->ack_backlog) { |
sk | 117 | net/inet/timer.c | sk->prot->read_wakeup (sk); |
sk | 118 | net/inet/timer.c | if (! sk->dead) |
sk | 119 | net/inet/timer.c | sk->data_ready(sk,0); |
sk | 125 | net/inet/timer.c | if (! sk->dead || sk->state != TCP_CLOSE) { |
sk | 127 | net/inet/timer.c | release_sock (sk); |
sk | 130 | net/inet/timer.c | destroy_sock (sk); |
sk | 136 | net/inet/timer.c | if(sk->wmem_alloc!=0 || sk->rmem_alloc!=0) |
sk | 138 | net/inet/timer.c | DPRINTF ((DBG_TMR, "possible memory leak. sk = %X\n", sk)); |
sk | 139 | net/inet/timer.c | sk->wmem_alloc++; /* So it DOESNT go away */ |
sk | 140 | net/inet/timer.c | destroy_sock (sk); |
sk | 141 | net/inet/timer.c | sk->wmem_alloc--; /* Might now have hit 0 - fall through and do it again if so */ |
sk | 142 | net/inet/timer.c | sk->inuse = 0; /* This will be ok, the destroy won't totally work */ |
sk | 144 | net/inet/timer.c | if(sk->wmem_alloc==0 && sk->rmem_alloc==0) |
sk | 145 | net/inet/timer.c | destroy_sock(sk); /* Socket gone, DONT update sk->inuse! */ |
sk | 149 | net/inet/timer.c | sk->state = TCP_CLOSE; |
sk | 150 | net/inet/timer.c | delete_timer (sk); |
sk | 152 | net/inet/timer.c | arp_destroy (sk->daddr, 0); |
sk | 153 | net/inet/timer.c | if (!sk->dead) |
sk | 154 | net/inet/timer.c | sk->state_change(sk); |
sk | 155 | net/inet/timer.c | sk->shutdown = SHUTDOWN_MASK; |
sk | 156 | net/inet/timer.c | reset_timer (sk, TIME_DESTROY, TCP_DONE_TIME); |
sk | 157 | net/inet/timer.c | release_sock (sk); |
sk | 160 | net/inet/timer.c | tcp_send_probe0(sk); |
sk | 161 | net/inet/timer.c | release_sock (sk); |
sk | 173 | net/inet/timer.c | skb = sk->send_head; |
sk | 177 | net/inet/timer.c | if (jiffies < skb->when + sk->rto) { |
sk | 178 | net/inet/timer.c | reset_timer (sk, TIME_WRITE, skb->when + sk->rto - jiffies); |
sk | 180 | net/inet/timer.c | release_sock (sk); |
sk | 187 | net/inet/timer.c | sk->prot->retransmit (sk, 0); |
sk | 188 | net/inet/timer.c | if ((sk->state == TCP_ESTABLISHED && sk->retransmits && !(sk->retransmits & 7)) |
sk | 189 | net/inet/timer.c | || (sk->state != TCP_ESTABLISHED && sk->retransmits > TCP_RETR1)) { |
sk | 191 | net/inet/timer.c | arp_destroy (sk->daddr, 0); |
sk | 192 | net/inet/timer.c | ip_route_check (sk->daddr); |
sk | 194 | net/inet/timer.c | if (sk->state != TCP_ESTABLISHED && sk->retransmits > TCP_RETR2) { |
sk | 196 | net/inet/timer.c | sk->err = ETIMEDOUT; |
sk | 197 | net/inet/timer.c | if (sk->state == TCP_FIN_WAIT1 || sk->state == TCP_FIN_WAIT2 |
sk | 198 | net/inet/timer.c | || sk->state == TCP_LAST_ACK) { |
sk | 199 | net/inet/timer.c | sk->state = TCP_TIME_WAIT; |
sk | 200 | net/inet/timer.c | reset_timer (sk, TIME_CLOSE, TCP_TIMEWAIT_LEN); |
sk | 202 | net/inet/timer.c | sk->prot->close (sk, 1); |
sk | 207 | net/inet/timer.c | release_sock (sk); |
sk | 212 | net/inet/timer.c | if (sk->prot->write_wakeup) |
sk | 213 | net/inet/timer.c | sk->prot->write_wakeup (sk); |
sk | 214 | net/inet/timer.c | sk->retransmits++; |
sk | 215 | net/inet/timer.c | if (sk->shutdown == SHUTDOWN_MASK) { |
sk | 216 | net/inet/timer.c | sk->prot->close (sk, 1); |
sk | 217 | net/inet/timer.c | sk->state = TCP_CLOSE; |
sk | 220 | net/inet/timer.c | if ((sk->state == TCP_ESTABLISHED && sk->retransmits && !(sk->retransmits & 7)) |
sk | 221 | net/inet/timer.c | || (sk->state != TCP_ESTABLISHED && sk->retransmits > TCP_RETR1)) { |
sk | 223 | net/inet/timer.c | arp_destroy (sk->daddr, 0); |
sk | 224 | net/inet/timer.c | ip_route_check (sk->daddr); |
sk | 225 | net/inet/timer.c | release_sock (sk); |
sk | 228 | net/inet/timer.c | if (sk->state != TCP_ESTABLISHED && sk->retransmits > TCP_RETR2) { |
sk | 230 | net/inet/timer.c | arp_destroy (sk->daddr, 0); |
sk | 231 | net/inet/timer.c | sk->err = ETIMEDOUT; |
sk | 232 | net/inet/timer.c | if (sk->state == TCP_FIN_WAIT1 || sk->state == TCP_FIN_WAIT2) { |
sk | 233 | net/inet/timer.c | sk->state = TCP_TIME_WAIT; |
sk | 234 | net/inet/timer.c | if (!sk->dead) |
sk | 235 | net/inet/timer.c | sk->state_change(sk); |
sk | 236 | net/inet/timer.c | release_sock (sk); |
sk | 238 | net/inet/timer.c | sk->prot->close (sk, 1); |
sk | 242 | net/inet/timer.c | release_sock (sk); |
sk | 246 | net/inet/timer.c | release_sock (sk); |
sk | 111 | net/inet/udp.c | struct sock *sk; |
sk | 124 | net/inet/udp.c | sk = get_sock(&udp_prot, th->source, daddr, th->dest, saddr); |
sk | 126 | net/inet/udp.c | if (sk == NULL) |
sk | 131 | net/inet/udp.c | if (sk->cong_window > 1) |
sk | 132 | net/inet/udp.c | sk->cong_window = sk->cong_window/2; |
sk | 136 | net/inet/udp.c | sk->err = icmp_err_convert[err & 0xff].errno; |
sk | 143 | net/inet/udp.c | if (icmp_err_convert[err & 0xff].fatal && sk->state == TCP_ESTABLISHED) |
sk | 145 | net/inet/udp.c | sk->err=ECONNREFUSED; |
sk | 148 | net/inet/udp.c | sk->error_report(sk); |
sk | 236 | net/inet/udp.c | unsigned long daddr, int len, struct sock *sk) |
sk | 239 | net/inet/udp.c | if (sk && sk->no_check) |
sk | 253 | net/inet/udp.c | static int udp_send(struct sock *sk, struct sockaddr_in *sin, |
sk | 276 | net/inet/udp.c | size = sk->prot->max_header + len; |
sk | 277 | net/inet/udp.c | skb = sk->prot->wmalloc(sk, size, 0, GFP_KERNEL); |
sk | 283 | net/inet/udp.c | skb->sk = NULL; /* to avoid changing sk->saddr */ |
sk | 285 | net/inet/udp.c | skb->localroute = sk->localroute|(rt&MSG_DONTROUTE); |
sk | 296 | net/inet/udp.c | tmp = sk->prot->build_header(skb, saddr, sin->sin_addr.s_addr, |
sk | 297 | net/inet/udp.c | &dev, IPPROTO_UDP, sk->opt, skb->mem_len,sk->ip_tos,sk->ip_ttl); |
sk | 298 | net/inet/udp.c | skb->sk=sk; /* So memory is freed correctly */ |
sk | 306 | net/inet/udp.c | sk->prot->wfree(sk, skb->mem_addr, skb->mem_len); |
sk | 323 | net/inet/udp.c | uh->source = sk->dummy_th.source; |
sk | 337 | net/inet/udp.c | udp_send_check(uh, saddr, sin->sin_addr.s_addr, skb->len - tmp, sk); |
sk | 345 | net/inet/udp.c | sk->prot->queue_xmit(sk, dev, skb, 1); |
sk | 350 | net/inet/udp.c | static int udp_sendto(struct sock *sk, unsigned char *from, int len, int noblock, |
sk | 388 | net/inet/udp.c | if (sk->state != TCP_ESTABLISHED) |
sk | 391 | net/inet/udp.c | sin.sin_port = sk->dummy_th.dest; |
sk | 392 | net/inet/udp.c | sin.sin_addr.s_addr = sk->daddr; |
sk | 403 | net/inet/udp.c | if(!sk->broadcast && ip_chk_addr(sin.sin_addr.s_addr)==IS_BROADCAST) |
sk | 406 | net/inet/udp.c | sk->inuse = 1; |
sk | 409 | net/inet/udp.c | tmp = udp_send(sk, &sin, from, len, flags); |
sk | 412 | net/inet/udp.c | release_sock(sk); |
sk | 420 | net/inet/udp.c | static int udp_write(struct sock *sk, unsigned char *buff, int len, int noblock, |
sk | 423 | net/inet/udp.c | return(udp_sendto(sk, buff, len, noblock, flags, NULL, 0)); |
sk | 431 | net/inet/udp.c | int udp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
sk | 461 | net/inet/udp.c | if (sk->state == TCP_LISTEN) return(-EINVAL); |
sk | 462 | net/inet/udp.c | amount = sk->prot->wspace(sk)/*/2*/; |
sk | 476 | net/inet/udp.c | if (sk->state == TCP_LISTEN) return(-EINVAL); |
sk | 478 | net/inet/udp.c | skb = skb_peek(&sk->receive_queue); |
sk | 507 | net/inet/udp.c | int udp_recvfrom(struct sock *sk, unsigned char *to, int len, |
sk | 521 | net/inet/udp.c | if (sk->err) |
sk | 525 | net/inet/udp.c | err = -sk->err; |
sk | 526 | net/inet/udp.c | sk->err = 0; |
sk | 567 | net/inet/udp.c | skb=skb_recv_datagram(sk,flags,noblock,&er); |
sk | 578 | net/inet/udp.c | sk->stamp=skb->stamp; |
sk | 592 | net/inet/udp.c | release_sock(sk); |
sk | 600 | net/inet/udp.c | int udp_read(struct sock *sk, unsigned char *buff, int len, int noblock, |
sk | 603 | net/inet/udp.c | return(udp_recvfrom(sk, buff, len, noblock, flags, NULL, NULL)); |
sk | 608 | net/inet/udp.c | udp_connect(struct sock *sk, struct sockaddr_in *usin, int addr_len) |
sk | 626 | net/inet/udp.c | if(!sk->broadcast && ip_chk_addr(sin.sin_addr.s_addr)==IS_BROADCAST) |
sk | 629 | net/inet/udp.c | sk->daddr = sin.sin_addr.s_addr; |
sk | 630 | net/inet/udp.c | sk->dummy_th.dest = sin.sin_port; |
sk | 631 | net/inet/udp.c | sk->state = TCP_ESTABLISHED; |
sk | 637 | net/inet/udp.c | udp_close(struct sock *sk, int timeout) |
sk | 639 | net/inet/udp.c | sk->inuse = 1; |
sk | 640 | net/inet/udp.c | sk->state = TCP_CLOSE; |
sk | 641 | net/inet/udp.c | if (sk->dead) destroy_sock(sk); |
sk | 642 | net/inet/udp.c | else release_sock(sk); |
sk | 654 | net/inet/udp.c | struct sock *sk; |
sk | 665 | net/inet/udp.c | sk = get_sock(&udp_prot, uh->dest, saddr, uh->source, daddr); |
sk | 666 | net/inet/udp.c | if (sk == NULL) |
sk | 677 | net/inet/udp.c | skb->sk = NULL; |
sk | 691 | net/inet/udp.c | skb->sk = sk; |
sk | 707 | net/inet/udp.c | if (sk->rmem_alloc + skb->mem_len >= sk->rcvbuf) |
sk | 712 | net/inet/udp.c | skb->sk = NULL; |
sk | 714 | net/inet/udp.c | release_sock(sk); |
sk | 717 | net/inet/udp.c | sk->rmem_alloc += skb->mem_len; |
sk | 732 | net/inet/udp.c | skb_queue_tail(&sk->receive_queue,skb); |
sk | 735 | net/inet/udp.c | if (!sk->dead) |
sk | 736 | net/inet/udp.c | sk->data_ready(sk,skb->len); |
sk | 738 | net/inet/udp.c | release_sock(sk); |
sk | 36 | net/inet/udp.h | extern int udp_recvfrom(struct sock *sk, unsigned char *to, |
sk | 39 | net/inet/udp.h | extern int udp_read(struct sock *sk, unsigned char *buff, |
sk | 41 | net/inet/udp.h | extern int udp_connect(struct sock *sk, |
sk | 47 | net/inet/udp.h | extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); |