taglinefilesource code
sk206drivers/net/d_link.cstatic unsigned long  d_link_rspace(struct sock *sk);
sk714drivers/net/d_link.cd_link_rspace(struct sock *sk)
sk718drivers/net/d_link.cif (sk != NULL) {
sk723drivers/net/d_link.csk->max_unacked = D_LINK_MAX_WINDOW - D_LINK_TCP_WINDOW_DIFF;
sk725drivers/net/d_link.cif (sk->rmem_alloc >= SK_RMEM_MAX-2*D_LINK_MIN_WINDOW) return(0);
sk726drivers/net/d_link.camt = min((SK_RMEM_MAX-sk->rmem_alloc)/2-D_LINK_MIN_WINDOW, D_LINK_MAX_WINDOW);
sk45include/linux/skbuff.hstruct sock      *sk;
sk131include/linux/skbuff.hextern struct sk_buff *    skb_recv_datagram(struct sock *sk,unsigned flags,int noblock, int *err);
sk132include/linux/skbuff.hextern int      datagram_select(struct sock *sk, int sel_type, select_table *wait);
sk411net/inet/arp.cif(skb->sk==NULL)
sk414net/inet/arp.cdev_queue_xmit(skb,skb->dev,skb->sk->priority);
sk53net/inet/datagram.cstruct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, int *err)
sk59net/inet/datagram.csk->inuse = 1;
sk60net/inet/datagram.cwhile(skb_peek(&sk->receive_queue) == NULL)  /* No data */
sk63net/inet/datagram.cif (sk->shutdown & RCV_SHUTDOWN)
sk65net/inet/datagram.crelease_sock(sk);
sk70net/inet/datagram.cif(sk->err)
sk72net/inet/datagram.crelease_sock(sk);
sk73net/inet/datagram.c*err=-sk->err;
sk74net/inet/datagram.csk->err=0;
sk79net/inet/datagram.cif(sk->type==SOCK_SEQPACKET && sk->state!=TCP_ESTABLISHED)
sk81net/inet/datagram.crelease_sock(sk);
sk89net/inet/datagram.crelease_sock(sk);
sk93net/inet/datagram.crelease_sock(sk);
sk98net/inet/datagram.cif (skb_peek(&sk->receive_queue) == NULL)
sk100net/inet/datagram.cinterruptible_sleep_on(sk->sleep);
sk108net/inet/datagram.cif(sk->err != 0)  /* Error while waiting for packet
sk112net/inet/datagram.c*err = -sk->err;
sk114net/inet/datagram.csk->err=0;
sk118net/inet/datagram.csk->inuse = 1;
sk125net/inet/datagram.cskb=skb_dequeue(&sk->receive_queue);
sk134net/inet/datagram.cskb=skb_peek(&sk->receive_queue);
sk174net/inet/datagram.cint datagram_select(struct sock *sk, int sel_type, select_table *wait)
sk176net/inet/datagram.cselect_wait(sk->sleep, wait);
sk180net/inet/datagram.cif (sk->type==SOCK_SEQPACKET && sk->state==TCP_CLOSE)
sk185net/inet/datagram.cif (skb_peek(&sk->receive_queue) != NULL || sk->err != 0)
sk193net/inet/datagram.cif (sk->prot && sk->prot->wspace(sk) >= MIN_WRITE_SPACE)
sk197net/inet/datagram.cif (sk->prot==NULL && sk->sndbuf-sk->wmem_alloc >= MIN_WRITE_SPACE)
sk204net/inet/datagram.cif (sk->err)
sk417net/inet/dev.cskb->sk = NULL;
sk200net/inet/icmp.cskb->sk = NULL;
sk462net/inet/icmp.cskb->sk = NULL;
sk597net/inet/icmp.cskb->sk = NULL;
sk693net/inet/icmp.cskb1->sk = NULL;
sk727net/inet/icmp.cint icmp_ioctl(struct sock *sk, int cmd, unsigned long arg)
sk35net/inet/icmp.hextern int  icmp_ioctl(struct sock *sk, int cmd,
sk90net/inet/ip.cextern void sort_send(struct sock *sk);
sk167net/inet/ip.cint ip_ioctl(struct sock *sk, int cmd, unsigned long arg)
sk348net/inet/ip.cif (skb->sk) 
sk349net/inet/ip.cskb->sk->saddr = saddr;
sk1015net/inet/ip.cskb->sk = NULL;
sk1120net/inet/ip.cskb->sk = NULL;
sk1163net/inet/ip.cvoid ip_fragment(struct sock *sk, struct sk_buff *skb, struct device *dev, int is_frag)
sk1286net/inet/ip.cif (sk) 
sk1287net/inet/ip.csk->wmem_alloc += skb2->mem_len;
sk1323net/inet/ip.cip_queue_xmit(sk, dev, skb2, 1);
sk1762net/inet/ip.cvoid ip_queue_xmit(struct sock *sk, struct device *dev, 
sk1769net/inet/ip.cif (sk == NULL) 
sk1813net/inet/ip.cip_fragment(sk,skb,dev,0);
sk1852net/inet/ip.csk->packets_out++;
sk1863net/inet/ip.cif (sk->send_head == NULL) 
sk1865net/inet/ip.csk->send_tail = skb;
sk1866net/inet/ip.csk->send_head = skb;
sk1870net/inet/ip.csk->send_tail->link3 = skb;
sk1871net/inet/ip.csk->send_tail = skb;
sk1879net/inet/ip.creset_timer(sk, TIME_WRITE, sk->rto);
sk1883net/inet/ip.cskb->sk = sk;
sk1897net/inet/ip.cif (sk != NULL) 
sk1899net/inet/ip.cdev_queue_xmit(skb, dev, sk->priority);
sk1920net/inet/ip.cvoid ip_do_retransmit(struct sock *sk, int all)
sk1927net/inet/ip.cprot = sk->prot;
sk1928net/inet/ip.cskb = sk->send_head;
sk1929net/inet/ip.cretransmits = sk->retransmits;
sk1971net/inet/ip.cif (sk && !skb_device_locked(skb))
sk1977net/inet/ip.cdev_queue_xmit(skb, dev, sk->priority);
sk1985net/inet/ip.csk->prot->retransmits ++;
sk1996net/inet/ip.cif (sk->retransmits > sk->cong_window) 
sk2009net/inet/ip.cvoid ip_retransmit(struct sock *sk, int all)
sk2011net/inet/ip.cip_do_retransmit(sk, all);
sk2026net/inet/ip.csk->retransmits++;
sk2027net/inet/ip.csk->backoff++;
sk2028net/inet/ip.csk->rto = min(sk->rto << 1, 120*HZ);
sk2029net/inet/ip.creset_timer(sk, TIME_WRITE, sk->rto);
sk2041net/inet/ip.cint ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen)
sk2062net/inet/ip.csk->ip_tos=val;
sk2067net/inet/ip.csk->ip_ttl=val;
sk2080net/inet/ip.cint ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen)
sk2090net/inet/ip.cval=sk->ip_tos;
sk2093net/inet/ip.cval=sk->ip_ttl;
sk69net/inet/ip.hextern int    ip_ioctl(struct sock *sk, int cmd,
sk81net/inet/ip.hextern void    ip_queue_xmit(struct sock *sk,
sk84net/inet/ip.hextern void    ip_retransmit(struct sock *sk, int all);
sk85net/inet/ip.hextern void    ip_do_retransmit(struct sock *sk, int all);
sk86net/inet/ip.hextern int     ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen);
sk87net/inet/ip.hextern int     ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen);
sk65net/inet/ipx.cstatic void ipx_remove_socket(ipx_socket *sk)
sk71net/inet/ipx.cif(s==sk)
sk79net/inet/ipx.cif(s->next==sk)
sk81net/inet/ipx.cs->next=sk->next;
sk90net/inet/ipx.cstatic void ipx_insert_socket(ipx_socket *sk)
sk93net/inet/ipx.csk->next=ipx_socket_list;
sk94net/inet/ipx.cipx_socket_list=sk;
sk120net/inet/ipx.cstatic void ipx_destroy_socket(ipx_socket *sk)
sk123net/inet/ipx.cipx_remove_socket(sk);
sk125net/inet/ipx.cwhile((skb=skb_dequeue(&sk->receive_queue))!=NULL)
sk130net/inet/ipx.ckfree_s(sk,sizeof(*sk));
sk347net/inet/ipx.cipx_socket *sk;
sk349net/inet/ipx.csk=(ipx_socket *)sock->data;
sk351net/inet/ipx.cif(sk==NULL)
sk367net/inet/ipx.cipx_socket *sk;
sk370net/inet/ipx.csk=(ipx_socket *)sock->data;
sk372net/inet/ipx.cif(sk==NULL)
sk393net/inet/ipx.csk->ipx_type=opt;
sk401net/inet/ipx.creturn sock_setsockopt(sk,level,optname,optval,optlen);
sk411net/inet/ipx.cipx_socket *sk;
sk415net/inet/ipx.csk=(ipx_socket *)sock->data;
sk416net/inet/ipx.cif(sk==NULL)
sk429net/inet/ipx.cval=sk->ipx_type;
sk437net/inet/ipx.creturn sock_getsockopt(sk,level,optname,optval,optlen);
sk456net/inet/ipx.cstatic void def_callback1(struct sock *sk)
sk458net/inet/ipx.cif(!sk->dead)
sk459net/inet/ipx.cwake_up_interruptible(sk->sleep);
sk462net/inet/ipx.cstatic void def_callback2(struct sock *sk, int len)
sk464net/inet/ipx.cif(!sk->dead)
sk465net/inet/ipx.cwake_up_interruptible(sk->sleep);
sk470net/inet/ipx.cipx_socket *sk;
sk471net/inet/ipx.csk=(ipx_socket *)kmalloc(sizeof(*sk),GFP_KERNEL);
sk472net/inet/ipx.cif(sk==NULL)
sk479net/inet/ipx.ckfree_s((void *)sk,sizeof(*sk));
sk482net/inet/ipx.csk->stamp.tv_sec=0;
sk483net/inet/ipx.csk->rmem_alloc=0;
sk484net/inet/ipx.csk->dead=0;
sk485net/inet/ipx.csk->next=NULL;
sk486net/inet/ipx.csk->broadcast=0;
sk487net/inet/ipx.csk->rcvbuf=SK_RMEM_MAX;
sk488net/inet/ipx.csk->sndbuf=SK_WMEM_MAX;
sk489net/inet/ipx.csk->wmem_alloc=0;
sk490net/inet/ipx.csk->rmem_alloc=0;
sk491net/inet/ipx.csk->inuse=0;
sk492net/inet/ipx.csk->dead=0;
sk493net/inet/ipx.csk->prot=NULL;  /* So we use default free mechanisms */
sk494net/inet/ipx.csk->broadcast=0;
sk495net/inet/ipx.csk->err=0;
sk496net/inet/ipx.cskb_queue_head_init(&sk->receive_queue);
sk497net/inet/ipx.cskb_queue_head_init(&sk->write_queue);
sk498net/inet/ipx.csk->send_head=NULL;
sk499net/inet/ipx.cskb_queue_head_init(&sk->back_log);
sk500net/inet/ipx.csk->mtu=512;
sk501net/inet/ipx.csk->state=TCP_CLOSE;
sk502net/inet/ipx.csk->socket=sock;
sk503net/inet/ipx.csk->type=sock->type;
sk504net/inet/ipx.csk->ipx_type=0;    /* General user level IPX */
sk505net/inet/ipx.csk->debug=0;
sk506net/inet/ipx.csk->localroute=0;
sk508net/inet/ipx.cmemset(&sk->ipx_dest_addr,'\0',sizeof(sk->ipx_dest_addr));
sk509net/inet/ipx.cmemset(&sk->ipx_source_addr,'\0',sizeof(sk->ipx_source_addr));
sk510net/inet/ipx.csk->mtu=IPX_MTU;
sk514net/inet/ipx.csock->data=(void *)sk;
sk515net/inet/ipx.csk->sleep=sock->wait;
sk518net/inet/ipx.csk->state_change=def_callback1;
sk519net/inet/ipx.csk->data_ready=def_callback2;
sk520net/inet/ipx.csk->write_space=def_callback1;
sk521net/inet/ipx.csk->error_report=def_callback1;
sk523net/inet/ipx.csk->zapped=1;
sk534net/inet/ipx.cipx_socket *sk=(ipx_socket *)sock->data;
sk535net/inet/ipx.cif(sk==NULL)
sk537net/inet/ipx.cif(!sk->dead)
sk538net/inet/ipx.csk->state_change(sk);
sk539net/inet/ipx.csk->dead=1;
sk541net/inet/ipx.cipx_destroy_socket(sk);
sk547net/inet/ipx.cipx_socket *sk;
sk552net/inet/ipx.csk=(ipx_socket *)sock->data;
sk553net/inet/ipx.cif(sk==NULL)
sk559net/inet/ipx.cif(sk->zapped==0)
sk577net/inet/ipx.cif(sk->debug)
sk582net/inet/ipx.csk->ipx_source_addr.sock=addr.sipx_port;
sk583net/inet/ipx.cmemcpy(sk->ipx_source_addr.node,addr.sipx_node,sizeof(sk->ipx_source_addr.node));
sk584net/inet/ipx.csk->ipx_source_addr.net=addr.sipx_network;
sk585net/inet/ipx.cif((rt=ipxrtr_get_dev(sk->ipx_source_addr.net))==NULL)
sk587net/inet/ipx.cif(sk->debug)
sk589net/inet/ipx.csk->ipx_source_addr.net);
sk592net/inet/ipx.cmemset(sk->ipx_source_addr.node,'\0',6);
sk593net/inet/ipx.cmemcpy(sk->ipx_source_addr.node,rt->dev->dev_addr,rt->dev->addr_len);
sk594net/inet/ipx.cipx_insert_socket(sk);
sk595net/inet/ipx.csk->zapped=0;
sk596net/inet/ipx.cif(sk->debug)
sk604net/inet/ipx.cipx_socket *sk=(ipx_socket *)sock->data;
sk608net/inet/ipx.cif(sk==NULL)
sk614net/inet/ipx.csk->state = TCP_CLOSE;  
sk626net/inet/ipx.cif(sk->ipx_source_addr.net==0)  /* Must bind first - no autobinding in this */
sk630net/inet/ipx.csk->ipx_dest_addr.net=addr.sipx_network;
sk631net/inet/ipx.csk->ipx_dest_addr.sock=addr.sipx_port;
sk632net/inet/ipx.cmemcpy(sk->ipx_dest_addr.node,addr.sipx_node,sizeof(sk->ipx_source_addr.node));
sk633net/inet/ipx.cif(ipxrtr_get_dev(sk->ipx_dest_addr.net)==NULL)
sk636net/inet/ipx.csk->state=TCP_ESTABLISHED;
sk657net/inet/ipx.cipx_socket *sk;
sk661net/inet/ipx.csk=(ipx_socket *)sock->data;
sk678net/inet/ipx.cif(sk->state!=TCP_ESTABLISHED)
sk680net/inet/ipx.caddr=&sk->ipx_dest_addr;
sk683net/inet/ipx.caddr=&sk->ipx_source_addr;
sk830net/inet/ipx.cipx_socket *sk=(ipx_socket *)sock->data;
sk862net/inet/ipx.cif(sk->state!=TCP_ESTABLISHED)
sk865net/inet/ipx.csipx.sipx_port=sk->ipx_dest_addr.sock;
sk866net/inet/ipx.csipx.sipx_network=sk->ipx_dest_addr.net;
sk867net/inet/ipx.cmemcpy(sipx.sipx_node,sk->ipx_dest_addr.node,sizeof(sipx.sipx_node));
sk870net/inet/ipx.cif(sk->debug)
sk872net/inet/ipx.cif(!sk->broadcast && memcmp(&sipx.sipx_node,&ipx_broadcast_node,6)==0)
sk876net/inet/ipx.cif(sk->debug)
sk887net/inet/ipx.cif(rt==NULL || ((flags&IPX_RT_ROUTED)&& ((flags&MSG_DONTROUTE)||sk->localroute)))
sk896net/inet/ipx.cif(sk->debug)
sk899net/inet/ipx.cif(size+sk->wmem_alloc>sk->sndbuf)
sk905net/inet/ipx.cif(skb->mem_len+sk->wmem_alloc>sk->sndbuf)
sk911net/inet/ipx.csk->wmem_alloc+=skb->mem_len;
sk912net/inet/ipx.cskb->sk=sk;
sk917net/inet/ipx.cif(sk->debug)
sk929net/inet/ipx.cif(sk->debug)
sk935net/inet/ipx.cipx->ipx_type=sk->ipx_type;
sk936net/inet/ipx.cmemcpy(&ipx->ipx_source,&sk->ipx_source_addr,sizeof(ipx->ipx_source));
sk940net/inet/ipx.cif(sk->debug)
sk944net/inet/ipx.cif(sk->debug)
sk967net/inet/ipx.cipx_socket *sk=(ipx_socket *)sock->data;
sk974net/inet/ipx.cif(sk->err)
sk976net/inet/ipx.cer= -sk->err;
sk977net/inet/ipx.csk->err=0;
sk1001net/inet/ipx.cskb=skb_recv_datagram(sk,flags,noblock,&er);
sk1006net/inet/ipx.csk->stamp=skb->stamp;
sk1025net/inet/ipx.cipx_socket *sk=(ipx_socket *)sock->data;
sk1026net/inet/ipx.cif(sk->zapped)
sk1037net/inet/ipx.cstatic int ipx_shutdown(struct socket *sk,int how)
sk1044net/inet/ipx.cipx_socket *sk=(ipx_socket *)sock->data;
sk1046net/inet/ipx.creturn datagram_select(sk,sel_type,wait);
sk67net/inet/packet.cstruct sock *sk;
sk74net/inet/packet.csk = (struct sock *) pt->data;  
sk85net/inet/packet.cskb->sk = sk;
sk92net/inet/packet.cif (sk->rmem_alloc + skb->mem_len >= sk->rcvbuf) 
sk94net/inet/packet.cskb->sk = NULL;
sk98net/inet/packet.csk->rmem_alloc += skb->mem_len;  
sk104net/inet/packet.cskb_queue_tail(&sk->receive_queue,skb);
sk105net/inet/packet.cwake_up_interruptible(sk->sleep);
sk111net/inet/packet.crelease_sock(sk);  /* This is now effectively surplus in this layer */
sk121net/inet/packet.cstatic int packet_sendto(struct sock *sk, unsigned char *from, int len,
sk187net/inet/packet.cskb = sk->prot->wmalloc(sk, len, 0, GFP_KERNEL);
sk204net/inet/packet.cskb->sk = sk;
sk215net/inet/packet.cdev_queue_xmit(skb, dev, sk->priority);
sk226net/inet/packet.cstatic int packet_write(struct sock *sk, unsigned char *buff, 
sk229net/inet/packet.creturn(packet_sendto(sk, buff, len, noblock, flags, NULL, 0));
sk239net/inet/packet.cstatic void packet_close(struct sock *sk, int timeout)
sk241net/inet/packet.csk->inuse = 1;
sk242net/inet/packet.csk->state = TCP_CLOSE;
sk243net/inet/packet.cdev_remove_pack((struct packet_type *)sk->pair);
sk244net/inet/packet.ckfree_s((void *)sk->pair, sizeof(struct packet_type));
sk245net/inet/packet.csk->pair = NULL;
sk246net/inet/packet.crelease_sock(sk);
sk257net/inet/packet.cstatic int packet_init(struct sock *sk)
sk266net/inet/packet.cp->type = sk->num;
sk267net/inet/packet.cp->data = (void *)sk;
sk274net/inet/packet.csk->pair = (struct sock *)p;
sk285net/inet/packet.cint packet_recvfrom(struct sock *sk, unsigned char *to, int len,
sk300net/inet/packet.cif (sk->shutdown & RCV_SHUTDOWN) 
sk337net/inet/packet.cskb=skb_recv_datagram(sk,flags,noblock,&err);
sk381net/inet/packet.crelease_sock(sk);
sk391net/inet/packet.cint packet_read(struct sock *sk, unsigned char *buff,
sk394net/inet/packet.creturn(packet_recvfrom(sk, buff, len, noblock, flags, NULL, NULL));
sk69net/inet/raw.cstruct sock *sk;
sk75net/inet/raw.csk = (struct sock *) protocol->data;
sk76net/inet/raw.cif (sk == NULL) return;
sk80net/inet/raw.cif (sk->cong_window > 1) sk->cong_window = sk->cong_window/2;
sk84net/inet/raw.csk->err = icmp_err_convert[err & 0xff].errno;
sk85net/inet/raw.csk->error_report(sk);
sk100net/inet/raw.cstruct sock *sk;
sk115net/inet/raw.csk = (struct sock *) protocol->data;
sk116net/inet/raw.cif (sk == NULL) 
sk123net/inet/raw.cskb->sk = sk;
sk131net/inet/raw.cif (sk->rmem_alloc + skb->mem_len >= sk->rcvbuf) {
sk133net/inet/raw.cskb->sk=NULL;
sk137net/inet/raw.csk->rmem_alloc += skb->mem_len;
sk139net/inet/raw.cskb_queue_tail(&sk->receive_queue,skb);
sk140net/inet/raw.csk->data_ready(sk,skb->len);
sk141net/inet/raw.crelease_sock(sk);
sk149net/inet/raw.cstatic int raw_sendto(struct sock *sk, unsigned char *from, 
sk159net/inet/raw.c"            usin=%X, addr_len = %d)\n", sk, from, len, noblock,
sk191net/inet/raw.cif (sk->state != TCP_ESTABLISHED) 
sk194net/inet/raw.csin.sin_port = sk->protocol;
sk195net/inet/raw.csin.sin_addr.s_addr = sk->daddr;
sk198net/inet/raw.csin.sin_port = sk->protocol;
sk203net/inet/raw.cif (sk->broadcast == 0 && ip_chk_addr(sin.sin_addr.s_addr)==IS_BROADCAST)
sk206net/inet/raw.csk->inuse = 1;
sk210net/inet/raw.cif(sk->err!=0)
sk212net/inet/raw.cerr= -sk->err;
sk213net/inet/raw.csk->err=0;
sk214net/inet/raw.crelease_sock(sk);
sk218net/inet/raw.cskb = sk->prot->wmalloc(sk,
sk219net/inet/raw.clen + sk->prot->max_header,
sk228net/inet/raw.ctmp = sk->wmem_alloc;
sk229net/inet/raw.crelease_sock(sk);
sk231net/inet/raw.cif (tmp <= sk->wmem_alloc) {
sk232net/inet/raw.cinterruptible_sleep_on(sk->sleep);
sk238net/inet/raw.csk->inuse = 1;
sk242net/inet/raw.cskb->sk = sk;
sk244net/inet/raw.cskb->localroute = sk->localroute | (flags&MSG_DONTROUTE);
sk246net/inet/raw.ctmp = sk->prot->build_header(skb, sk->saddr, 
sk248net/inet/raw.csk->protocol, sk->opt, skb->mem_len, sk->ip_tos,sk->ip_ttl);
sk253net/inet/raw.crelease_sock(sk);
sk264net/inet/raw.cif(sk->protocol==IPPROTO_RAW) 
sk273net/inet/raw.ciph->saddr = sk->saddr;
sk278net/inet/raw.csk->prot->queue_xmit(sk, dev, skb, 1);
sk279net/inet/raw.crelease_sock(sk);
sk284net/inet/raw.cstatic int raw_write(struct sock *sk, unsigned char *buff, int len, int noblock,
sk287net/inet/raw.creturn(raw_sendto(sk, buff, len, noblock, flags, NULL, 0));
sk291net/inet/raw.cstatic void raw_close(struct sock *sk, int timeout)
sk293net/inet/raw.csk->inuse = 1;
sk294net/inet/raw.csk->state = TCP_CLOSE;
sk297net/inet/raw.c((struct inet_protocol *)sk->pair)->protocol));
sk299net/inet/raw.cif (inet_del_protocol((struct inet_protocol *)sk->pair) < 0)
sk301net/inet/raw.ckfree_s((void *)sk->pair, sizeof (struct inet_protocol));
sk302net/inet/raw.csk->pair = NULL;
sk303net/inet/raw.crelease_sock(sk);
sk308net/inet/raw.craw_init(struct sock *sk)
sk316net/inet/raw.cp->protocol = sk->protocol;
sk317net/inet/raw.cp->data = (void *)sk;
sk324net/inet/raw.csk->pair = (struct sock *)p;
sk326net/inet/raw.cDPRINTF((DBG_RAW, "raw init added protocol %d\n", sk->protocol));
sk337net/inet/raw.craw_recvfrom(struct sock *sk, unsigned char *to, int len,
sk347net/inet/raw.csk, to, len, noblock, flags, sin, addr_len));
sk352net/inet/raw.cif (sk->shutdown & RCV_SHUTDOWN) return(0);
sk370net/inet/raw.cskb=skb_recv_datagram(sk,flags,noblock,&err);
sk377net/inet/raw.csk->stamp=skb->stamp;
sk389net/inet/raw.crelease_sock(sk);
sk395net/inet/raw.craw_read (struct sock *sk, unsigned char *buff, int len, int noblock,
sk398net/inet/raw.creturn(raw_recvfrom(sk, buff, len, noblock, flags, NULL, NULL));
sk30net/inet/raw.hextern int  raw_recvfrom(struct sock *sk, unsigned char *to,
sk33net/inet/raw.hextern int  raw_read(struct sock *sk, unsigned char *buff,
sk356net/inet/skbuff.cnewsk->sk = NULL;
sk372net/inet/skbuff.cnewsk->sk = NULL;
sk403net/inet/skbuff.cif (skb->sk) 
sk405net/inet/skbuff.cif(skb->sk->prot!=NULL)
sk408net/inet/skbuff.cskb->sk->prot->rfree(skb->sk, skb->mem_addr, skb->mem_len);
sk410net/inet/skbuff.cskb->sk->prot->wfree(skb->sk, skb->mem_addr, skb->mem_len);
sk417net/inet/skbuff.cskb->sk->rmem_alloc-=skb->mem_len;
sk419net/inet/skbuff.cskb->sk->wmem_alloc-=skb->mem_len;
sk420net/inet/skbuff.cif(!skb->sk->dead)
sk421net/inet/skbuff.cwake_up_interruptible(skb->sk->sleep);
sk460net/inet/skbuff.cskb->sk = NULL;
sk513net/inet/skbuff.cn->sk=NULL;
sk107net/inet/sock.cprint_sk(struct sock *sk)
sk109net/inet/sock.cif (!sk) {
sk113net/inet/sock.cprintk("  wmem_alloc = %lu\n", sk->wmem_alloc);
sk114net/inet/sock.cprintk("  rmem_alloc = %lu\n", sk->rmem_alloc);
sk115net/inet/sock.cprintk("  state = %d\n",sk->state);
sk116net/inet/sock.cprintk("  daddr = %lX, saddr = %lX\n", sk->daddr,sk->saddr);
sk117net/inet/sock.cprintk("  num = %d", sk->num);
sk118net/inet/sock.cprintk(" next = %p\n", sk->next);
sk120net/inet/sock.csk->write_seq, sk->acked_seq, sk->copied_seq);
sk122net/inet/sock.csk->rcv_ack_seq, sk->window_seq, sk->fin_seq);
sk123net/inet/sock.cprintk("  prot = %p\n", sk->prot);
sk124net/inet/sock.cprintk("  pair = %p\n", sk->pair);
sk125net/inet/sock.cprintk("  inuse = %d , blog = %d\n", sk->inuse, sk->blog);
sk126net/inet/sock.cprintk("  dead = %d delay_acks=%d\n", sk->dead, sk->delay_acks);
sk127net/inet/sock.cprintk("  retransmits = %ld, timeout = %d\n", sk->retransmits, sk->timeout);
sk128net/inet/sock.cprintk("  cong_window = %d, packets_out = %d\n", sk->cong_window,
sk129net/inet/sock.csk->packets_out);
sk130net/inet/sock.cprintk("  shutdown=%d\n", sk->shutdown);
sk143net/inet/sock.cprintk("  sk = %p link3 = %p\n", skb->sk, skb->link3);
sk154net/inet/sock.cstruct sock *sk;
sk156net/inet/sock.cfor(sk = prot->sock_array[num & (SOCK_ARRAY_SIZE -1 )];
sk157net/inet/sock.csk != NULL;
sk158net/inet/sock.csk=sk->next) {
sk159net/inet/sock.cif (sk->num == num) return(1);
sk177net/inet/sock.cstruct sock *sk;
sk187net/inet/sock.csk = prot->sock_array[(i+base+1) &(SOCK_ARRAY_SIZE -1)];
sk188net/inet/sock.cwhile(sk != NULL) {
sk189net/inet/sock.csk = sk->next;
sk215net/inet/sock.cput_sock(unsigned short num, struct sock *sk)
sk221net/inet/sock.cDPRINTF((DBG_INET, "put_sock(num = %d, sk = %X\n", num, sk));
sk222net/inet/sock.csk->num = num;
sk223net/inet/sock.csk->next = NULL;
sk228net/inet/sock.cif (sk->prot->sock_array[num] == NULL) {
sk229net/inet/sock.csk->prot->sock_array[num] = sk;
sk235net/inet/sock.cif ((mask & sk->saddr) &&
sk236net/inet/sock.c(mask & sk->saddr) != (mask & 0xffffffff)) {
sk244net/inet/sock.csk1 = sk->prot->sock_array[num];
sk248net/inet/sock.csk->next = sk->prot->sock_array[num];
sk249net/inet/sock.csk->prot->sock_array[num] = sk;
sk253net/inet/sock.csk->next = sk2;
sk254net/inet/sock.csk1->next= sk;
sk262net/inet/sock.csk->next = NULL;
sk263net/inet/sock.csk1->next = sk;
sk305net/inet/sock.cdestroy_sock(struct sock *sk)
sk309net/inet/sock.cDPRINTF((DBG_INET, "destroying socket %X\n", sk));
sk310net/inet/sock.csk->inuse = 1;      /* just to be safe. */
sk313net/inet/sock.cif (!sk->dead) 
sk314net/inet/sock.csk->write_space(sk);
sk316net/inet/sock.cremove_sock(sk);
sk319net/inet/sock.cdelete_timer(sk);
sk321net/inet/sock.cwhile ((skb = tcp_dequeue_partial(sk)) != NULL) {
sk327net/inet/sock.cwhile((skb = skb_dequeue(&sk->write_queue)) != NULL) {
sk332net/inet/sock.cwhile((skb=skb_dequeue(&sk->receive_queue))!=NULL) {
sk337net/inet/sock.cif (skb->sk != NULL && skb->sk != sk) 
sk340net/inet/sock.cskb->sk->dead = 1;
sk341net/inet/sock.cskb->sk->prot->close(skb->sk, 0);
sk349net/inet/sock.cfor(skb = sk->send_head; skb != NULL; )
sk367net/inet/sock.csk->send_head = NULL;
sk371net/inet/sock.cwhile((skb=skb_dequeue(&sk->back_log))!=NULL) {
sk378net/inet/sock.cif (sk->pair) 
sk380net/inet/sock.csk->pair->dead = 1;
sk381net/inet/sock.csk->pair->prot->close(sk->pair, 0);
sk382net/inet/sock.csk->pair = NULL;
sk390net/inet/sock.cif (sk->dead && sk->rmem_alloc == 0 && sk->wmem_alloc == 0) 
sk392net/inet/sock.ckfree_s((void *)sk,sizeof(*sk));
sk398net/inet/sock.cDPRINTF((DBG_INET, "possible memory leak in socket = %X\n", sk));
sk399net/inet/sock.csk->destroy = 1;
sk400net/inet/sock.csk->ack_backlog = 0;
sk401net/inet/sock.csk->inuse = 0;
sk402net/inet/sock.creset_timer(sk, TIME_DESTROY, SOCK_DESTROY_TIME);
sk411net/inet/sock.cstruct sock *sk;
sk413net/inet/sock.csk = (struct sock *) sock->data;
sk424net/inet/sock.csk->proc = arg;
sk427net/inet/sock.creturn(sk->proc);
sk440net/inet/sock.cstruct sock *sk = (struct sock *) sock->data;  
sk442net/inet/sock.creturn sock_setsockopt(sk,level,optname,optval,optlen);
sk443net/inet/sock.cif (sk->prot->setsockopt==NULL)
sk446net/inet/sock.creturn sk->prot->setsockopt(sk,level,optname,optval,optlen);
sk455net/inet/sock.cstruct sock *sk = (struct sock *) sock->data;    
sk457net/inet/sock.creturn sock_getsockopt(sk,level,optname,optval,optlen);
sk458net/inet/sock.cif(sk->prot->getsockopt==NULL)    
sk461net/inet/sock.creturn sk->prot->getsockopt(sk,level,optname,optval,optlen);
sk469net/inet/sock.cint sock_setsockopt(struct sock *sk, int level, int optname,
sk491net/inet/sock.csk->debug=val?1:0;
sk493net/inet/sock.csk->localroute=val?1:0;
sk496net/inet/sock.csk->broadcast=val?1:0;
sk503net/inet/sock.csk->sndbuf=val;
sk511net/inet/sock.csk->linger=0;
sk514net/inet/sock.csk->lingertime=ling.l_linger;
sk515net/inet/sock.csk->linger=1;
sk523net/inet/sock.csk->rcvbuf=val;
sk528net/inet/sock.csk->reuse = 1;
sk530net/inet/sock.csk->reuse = 0;
sk535net/inet/sock.csk->keepopen = 1;
sk537net/inet/sock.csk->keepopen = 0;
sk542net/inet/sock.csk->urginline = 1;
sk544net/inet/sock.csk->urginline = 0;
sk549net/inet/sock.csk->no_check = 1;
sk551net/inet/sock.csk->no_check = 0;
sk557net/inet/sock.csk->priority = val;
sk571net/inet/sock.cint sock_getsockopt(struct sock *sk, int level, int optname,
sk581net/inet/sock.cval = sk->debug;
sk585net/inet/sock.cval = sk->localroute;
sk589net/inet/sock.cval= sk->broadcast;
sk600net/inet/sock.cling.l_onoff=sk->linger;
sk601net/inet/sock.cling.l_linger=sk->lingertime;
sk606net/inet/sock.cval=sk->sndbuf;
sk610net/inet/sock.cval =sk->rcvbuf;
sk614net/inet/sock.cval = sk->reuse;
sk618net/inet/sock.cval = sk->keepopen;
sk622net/inet/sock.cif (sk->prot == &tcp_prot) 
sk629net/inet/sock.cval = sk->err;
sk630net/inet/sock.csk->err = 0;
sk634net/inet/sock.cval = sk->urginline;
sk638net/inet/sock.cval = sk->no_check;
sk642net/inet/sock.cval = sk->priority;
sk667net/inet/sock.cstruct sock *sk;
sk669net/inet/sock.csk = (struct sock *) sock->data;
sk670net/inet/sock.cif (sk == NULL) {
sk676net/inet/sock.cif (sk->num == 0) {
sk677net/inet/sock.csk->num = get_new_socknum(sk->prot, 0);
sk678net/inet/sock.cif (sk->num == 0) return(-EAGAIN);
sk679net/inet/sock.cput_sock(sk->num, sk);
sk680net/inet/sock.csk->dummy_th.source = ntohs(sk->num);
sk684net/inet/sock.csk->max_ack_backlog = backlog;
sk685net/inet/sock.cif (sk->state != TCP_LISTEN) {
sk686net/inet/sock.csk->ack_backlog = 0;
sk687net/inet/sock.csk->state = TCP_LISTEN;
sk697net/inet/sock.cstatic void def_callback1(struct sock *sk)
sk699net/inet/sock.cif(!sk->dead)
sk700net/inet/sock.cwake_up_interruptible(sk->sleep);
sk703net/inet/sock.cstatic void def_callback2(struct sock *sk,int len)
sk705net/inet/sock.cif(!sk->dead)
sk706net/inet/sock.cwake_up_interruptible(sk->sleep);
sk713net/inet/sock.cstruct sock *sk;
sk717net/inet/sock.csk = (struct sock *) kmalloc(sizeof(*sk), GFP_KERNEL);
sk718net/inet/sock.cif (sk == NULL) 
sk720net/inet/sock.csk->num = 0;
sk721net/inet/sock.csk->reuse = 0;
sk726net/inet/sock.ckfree_s((void *)sk, sizeof(*sk));
sk730net/inet/sock.csk->no_check = TCP_NO_CHECK;
sk736net/inet/sock.ckfree_s((void *)sk, sizeof(*sk));
sk740net/inet/sock.csk->no_check = UDP_NO_CHECK;
sk746net/inet/sock.ckfree_s((void *)sk, sizeof(*sk));
sk750net/inet/sock.ckfree_s((void *)sk, sizeof(*sk));
sk754net/inet/sock.csk->reuse = 1;
sk755net/inet/sock.csk->no_check = 0;  /*
sk759net/inet/sock.csk->num = protocol;
sk764net/inet/sock.ckfree_s((void *)sk, sizeof(*sk));
sk768net/inet/sock.ckfree_s((void *)sk, sizeof(*sk));
sk772net/inet/sock.csk->reuse = 1;
sk773net/inet/sock.csk->no_check = 0;  /* Doesn't matter no checksum is
sk776net/inet/sock.csk->num = protocol;
sk780net/inet/sock.ckfree_s((void *)sk, sizeof(*sk));
sk783net/inet/sock.csk->socket = sock;
sk785net/inet/sock.csk->nonagle = 1;
sk787net/inet/sock.csk->nonagle = 0;
sk789net/inet/sock.csk->type = sock->type;
sk790net/inet/sock.csk->stamp.tv_sec=0;
sk791net/inet/sock.csk->protocol = protocol;
sk792net/inet/sock.csk->wmem_alloc = 0;
sk793net/inet/sock.csk->rmem_alloc = 0;
sk794net/inet/sock.csk->sndbuf = SK_WMEM_MAX;
sk795net/inet/sock.csk->rcvbuf = SK_RMEM_MAX;
sk796net/inet/sock.csk->pair = NULL;
sk797net/inet/sock.csk->opt = NULL;
sk798net/inet/sock.csk->write_seq = 0;
sk799net/inet/sock.csk->acked_seq = 0;
sk800net/inet/sock.csk->copied_seq = 0;
sk801net/inet/sock.csk->fin_seq = 0;
sk802net/inet/sock.csk->urg_seq = 0;
sk803net/inet/sock.csk->urg_data = 0;
sk804net/inet/sock.csk->proc = 0;
sk805net/inet/sock.csk->rtt = TCP_WRITE_TIME << 3;
sk806net/inet/sock.csk->rto = TCP_WRITE_TIME;
sk807net/inet/sock.csk->mdev = 0;
sk808net/inet/sock.csk->backoff = 0;
sk809net/inet/sock.csk->packets_out = 0;
sk810net/inet/sock.csk->cong_window = 1; /* start with only sending one packet at a time. */
sk811net/inet/sock.csk->cong_count = 0;
sk812net/inet/sock.csk->ssthresh = 0;
sk813net/inet/sock.csk->max_window = 0;
sk814net/inet/sock.csk->urginline = 0;
sk815net/inet/sock.csk->intr = 0;
sk816net/inet/sock.csk->linger = 0;
sk817net/inet/sock.csk->destroy = 0;
sk819net/inet/sock.csk->priority = 1;
sk820net/inet/sock.csk->shutdown = 0;
sk821net/inet/sock.csk->keepopen = 0;
sk822net/inet/sock.csk->zapped = 0;
sk823net/inet/sock.csk->done = 0;
sk824net/inet/sock.csk->ack_backlog = 0;
sk825net/inet/sock.csk->window = 0;
sk826net/inet/sock.csk->bytes_rcv = 0;
sk827net/inet/sock.csk->state = TCP_CLOSE;
sk828net/inet/sock.csk->dead = 0;
sk829net/inet/sock.csk->ack_timed = 0;
sk830net/inet/sock.csk->partial = NULL;
sk831net/inet/sock.csk->user_mss = 0;
sk832net/inet/sock.csk->debug = 0;
sk835net/inet/sock.csk->max_unacked = 2048; /* needs to be at most 2 full packets. */
sk839net/inet/sock.csk->max_ack_backlog = 0;
sk840net/inet/sock.csk->inuse = 0;
sk841net/inet/sock.csk->delay_acks = 0;
sk842net/inet/sock.cskb_queue_head_init(&sk->write_queue);
sk843net/inet/sock.cskb_queue_head_init(&sk->receive_queue);
sk844net/inet/sock.csk->mtu = 576;
sk845net/inet/sock.csk->prot = prot;
sk846net/inet/sock.csk->sleep = sock->wait;
sk847net/inet/sock.csk->daddr = 0;
sk848net/inet/sock.csk->saddr = ip_my_addr();
sk849net/inet/sock.csk->err = 0;
sk850net/inet/sock.csk->next = NULL;
sk851net/inet/sock.csk->pair = NULL;
sk852net/inet/sock.csk->send_tail = NULL;
sk853net/inet/sock.csk->send_head = NULL;
sk854net/inet/sock.csk->timeout = 0;
sk855net/inet/sock.csk->broadcast = 0;
sk856net/inet/sock.csk->localroute = 0;
sk857net/inet/sock.csk->timer.data = (unsigned long)sk;
sk858net/inet/sock.csk->timer.function = &net_timer;
sk859net/inet/sock.cskb_queue_head_init(&sk->back_log);
sk860net/inet/sock.csk->blog = 0;
sk861net/inet/sock.csock->data =(void *) sk;
sk862net/inet/sock.csk->dummy_th.doff = sizeof(sk->dummy_th)/4;
sk863net/inet/sock.csk->dummy_th.res1=0;
sk864net/inet/sock.csk->dummy_th.res2=0;
sk865net/inet/sock.csk->dummy_th.urg_ptr = 0;
sk866net/inet/sock.csk->dummy_th.fin = 0;
sk867net/inet/sock.csk->dummy_th.syn = 0;
sk868net/inet/sock.csk->dummy_th.rst = 0;
sk869net/inet/sock.csk->dummy_th.psh = 0;
sk870net/inet/sock.csk->dummy_th.ack = 0;
sk871net/inet/sock.csk->dummy_th.urg = 0;
sk872net/inet/sock.csk->dummy_th.dest = 0;
sk874net/inet/sock.csk->ip_tos=0;
sk875net/inet/sock.csk->ip_ttl=64;
sk877net/inet/sock.csk->state_change = def_callback1;
sk878net/inet/sock.csk->data_ready = def_callback2;
sk879net/inet/sock.csk->write_space = def_callback1;
sk880net/inet/sock.csk->error_report = def_callback1;
sk882net/inet/sock.cif (sk->num) {
sk889net/inet/sock.cput_sock(sk->num, sk);
sk890net/inet/sock.csk->dummy_th.source = ntohs(sk->num);
sk893net/inet/sock.cif (sk->prot->init) {
sk894net/inet/sock.cerr = sk->prot->init(sk);
sk896net/inet/sock.cdestroy_sock(sk);
sk916net/inet/sock.cstruct sock *sk;
sk918net/inet/sock.csk = (struct sock *) sock->data;
sk919net/inet/sock.cif (sk == NULL) return(0);
sk922net/inet/sock.csk->state_change(sk);
sk930net/inet/sock.cif (sk->linger == 0) {
sk931net/inet/sock.csk->prot->close(sk,0);
sk932net/inet/sock.csk->dead = 1;
sk935net/inet/sock.csk->prot->close(sk, 0);
sk937net/inet/sock.cif (sk->lingertime)
sk938net/inet/sock.ccurrent->timeout = jiffies + HZ*sk->lingertime;
sk939net/inet/sock.cwhile(sk->state != TCP_CLOSE && current->timeout>0) {
sk940net/inet/sock.cinterruptible_sleep_on(sk->sleep);
sk953net/inet/sock.csk->dead = 1;
sk955net/inet/sock.csk->inuse = 1;
sk958net/inet/sock.crelease_sock(sk);
sk974net/inet/sock.cstruct sock *sk, *sk2;
sk979net/inet/sock.csk = (struct sock *) sock->data;
sk981net/inet/sock.cif (sk->state != TCP_CLOSE) return(-EIO);
sk982net/inet/sock.cif (sk->num != 0) return(-EINVAL);
sk990net/inet/sock.cDPRINTF((DBG_INET, "bind sk =%X to port = %d\n", sk, snum));
sk991net/inet/sock.csk = (struct sock *) sock->data;
sk999net/inet/sock.csnum = get_new_socknum(sk->prot, 0);
sk1008net/inet/sock.csk->saddr = addr.sin_addr.s_addr;
sk1011net/inet/sock.csk->prot->sock_array[snum &(SOCK_ARRAY_SIZE -1)]));
sk1016net/inet/sock.cfor(sk2 = sk->prot->sock_array[snum & (SOCK_ARRAY_SIZE -1)];
sk1026net/inet/sock.cif (!sk->reuse) {
sk1031net/inet/sock.cif (sk2->saddr != sk->saddr) continue;  /* socket per slot ! -FB */
sk1039net/inet/sock.cremove_sock(sk);
sk1040net/inet/sock.cput_sock(snum, sk);
sk1041net/inet/sock.csk->dummy_th.source = ntohs(sk->num);
sk1042net/inet/sock.csk->daddr = 0;
sk1043net/inet/sock.csk->dummy_th.dest = 0;
sk1052net/inet/sock.cstruct sock *sk;
sk1056net/inet/sock.csk = (struct sock *) sock->data;
sk1058net/inet/sock.cif (sock->state == SS_CONNECTING && sk->state == TCP_ESTABLISHED)
sk1065net/inet/sock.cif (sock->state == SS_CONNECTING && sk->protocol == IPPROTO_TCP &&
sk1071net/inet/sock.cif (sk->num == 0) {
sk1072net/inet/sock.csk->num = get_new_socknum(sk->prot, 0);
sk1073net/inet/sock.cif (sk->num == 0) 
sk1075net/inet/sock.cput_sock(sk->num, sk);
sk1076net/inet/sock.csk->dummy_th.source = htons(sk->num);
sk1079net/inet/sock.cif (sk->prot->connect == NULL) 
sk1082net/inet/sock.cerr = sk->prot->connect(sk, (struct sockaddr_in *)uaddr, addr_len);
sk1088net/inet/sock.cif (sk->state != TCP_ESTABLISHED &&(flags & O_NONBLOCK)) 
sk1092net/inet/sock.cwhile(sk->state == TCP_SYN_SENT || sk->state == TCP_SYN_RECV) 
sk1094net/inet/sock.cinterruptible_sleep_on(sk->sleep);
sk1101net/inet/sock.cif(sk->err && sk->protocol == IPPROTO_TCP)
sk1105net/inet/sock.cerr = -sk->err;
sk1106net/inet/sock.csk->err=0;
sk1113net/inet/sock.cif (sk->state != TCP_ESTABLISHED && sk->err) {
sk1115net/inet/sock.cerr=sk->err;
sk1116net/inet/sock.csk->err=0;
sk1145net/inet/sock.cstruct sock *sk=(struct sock *)newsock->data;
sk1147net/inet/sock.csk->dead = 1;
sk1148net/inet/sock.cdestroy_sock(sk);
sk1203net/inet/sock.cstruct sock *sk;
sk1222net/inet/sock.csk = (struct sock *) sock->data;
sk1223net/inet/sock.cif (sk == NULL) {
sk1228net/inet/sock.cif (!tcp_connected(sk->state)) return(-ENOTCONN);
sk1229net/inet/sock.csin.sin_port = sk->dummy_th.dest;
sk1230net/inet/sock.csin.sin_addr.s_addr = sk->daddr;
sk1232net/inet/sock.csin.sin_port = sk->dummy_th.source;
sk1233net/inet/sock.cif (sk->saddr == 0) sin.sin_addr.s_addr = ip_my_addr();
sk1234net/inet/sock.celse sin.sin_addr.s_addr = sk->saddr;
sk1248net/inet/sock.cstruct sock *sk;
sk1250net/inet/sock.csk = (struct sock *) sock->data;
sk1253net/inet/sock.cif (sk->num == 0) {
sk1254net/inet/sock.csk->num = get_new_socknum(sk->prot, 0);
sk1255net/inet/sock.cif (sk->num == 0) return(-EAGAIN);
sk1256net/inet/sock.cput_sock(sk->num, sk);
sk1257net/inet/sock.csk->dummy_th.source = ntohs(sk->num);
sk1259net/inet/sock.creturn(sk->prot->read(sk, (unsigned char *) ubuf, size, noblock,0));
sk1267net/inet/sock.cstruct sock *sk;
sk1269net/inet/sock.csk = (struct sock *) sock->data;
sk1272net/inet/sock.cif (sk->num == 0) {
sk1273net/inet/sock.csk->num = get_new_socknum(sk->prot, 0);
sk1274net/inet/sock.cif (sk->num == 0) return(-EAGAIN);
sk1275net/inet/sock.cput_sock(sk->num, sk);
sk1276net/inet/sock.csk->dummy_th.source = ntohs(sk->num);
sk1278net/inet/sock.creturn(sk->prot->read(sk, (unsigned char *) ubuf, size, noblock, flags));
sk1285net/inet/sock.cstruct sock *sk;
sk1287net/inet/sock.csk = (struct sock *) sock->data;
sk1288net/inet/sock.cif (sk->shutdown & SEND_SHUTDOWN) {
sk1294net/inet/sock.cif (sk->num == 0) {
sk1295net/inet/sock.csk->num = get_new_socknum(sk->prot, 0);
sk1296net/inet/sock.cif (sk->num == 0) return(-EAGAIN);
sk1297net/inet/sock.cput_sock(sk->num, sk);
sk1298net/inet/sock.csk->dummy_th.source = ntohs(sk->num);
sk1301net/inet/sock.creturn(sk->prot->write(sk, (unsigned char *) ubuf, size, noblock, 0));
sk1309net/inet/sock.cstruct sock *sk;
sk1311net/inet/sock.csk = (struct sock *) sock->data;
sk1312net/inet/sock.cif (sk->shutdown & SEND_SHUTDOWN) {
sk1318net/inet/sock.cif (sk->num == 0) {
sk1319net/inet/sock.csk->num = get_new_socknum(sk->prot, 0);
sk1320net/inet/sock.cif (sk->num == 0) return(-EAGAIN);
sk1321net/inet/sock.cput_sock(sk->num, sk);
sk1322net/inet/sock.csk->dummy_th.source = ntohs(sk->num);
sk1325net/inet/sock.creturn(sk->prot->write(sk, (unsigned char *) ubuf, size, noblock, flags));
sk1333net/inet/sock.cstruct sock *sk;
sk1335net/inet/sock.csk = (struct sock *) sock->data;
sk1336net/inet/sock.cif (sk->shutdown & SEND_SHUTDOWN) {
sk1341net/inet/sock.cif (sk->prot->sendto == NULL) return(-EOPNOTSUPP);
sk1344net/inet/sock.cif (sk->num == 0) {
sk1345net/inet/sock.csk->num = get_new_socknum(sk->prot, 0);
sk1346net/inet/sock.cif (sk->num == 0) return(-EAGAIN);
sk1347net/inet/sock.cput_sock(sk->num, sk);
sk1348net/inet/sock.csk->dummy_th.source = ntohs(sk->num);
sk1351net/inet/sock.creturn(sk->prot->sendto(sk, (unsigned char *) ubuf, size, noblock, flags, 
sk1360net/inet/sock.cstruct sock *sk;
sk1362net/inet/sock.csk = (struct sock *) sock->data;
sk1364net/inet/sock.cif (sk->prot->recvfrom == NULL) return(-EOPNOTSUPP);
sk1367net/inet/sock.cif (sk->num == 0) {
sk1368net/inet/sock.csk->num = get_new_socknum(sk->prot, 0);
sk1369net/inet/sock.cif (sk->num == 0) return(-EAGAIN);
sk1370net/inet/sock.cput_sock(sk->num, sk);
sk1371net/inet/sock.csk->dummy_th.source = ntohs(sk->num);
sk1374net/inet/sock.creturn(sk->prot->recvfrom(sk, (unsigned char *) ubuf, size, noblock, flags,
sk1382net/inet/sock.cstruct sock *sk;
sk1392net/inet/sock.csk = (struct sock *) sock->data;
sk1393net/inet/sock.cif (sk == NULL) {
sk1397net/inet/sock.cif (sock->state == SS_CONNECTING && sk->state == TCP_ESTABLISHED)
sk1400net/inet/sock.cif (!tcp_connected(sk->state)) return(-ENOTCONN);
sk1401net/inet/sock.csk->shutdown |= how;
sk1402net/inet/sock.cif (sk->prot->shutdown) sk->prot->shutdown(sk, how);
sk1410net/inet/sock.cstruct sock *sk;
sk1412net/inet/sock.csk = (struct sock *) sock->data;
sk1414net/inet/sock.cif (sk->prot->select == NULL) {
sk1418net/inet/sock.creturn(sk->prot->select(sk, sel_type, wait));
sk1425net/inet/sock.cstruct sock *sk;
sk1429net/inet/sock.csk = NULL;
sk1430net/inet/sock.cif (sock && (sk = (struct sock *) sock->data) == NULL) {
sk1441net/inet/sock.cif (sk)
sk1442net/inet/sock.csk->proc = get_fs_long((int *) arg);
sk1446net/inet/sock.cif (sk) {
sk1450net/inet/sock.cput_fs_long(sk->proc,(int *)arg);
sk1455net/inet/sock.cif (sk)
sk1457net/inet/sock.cif(sk->stamp.tv_sec==0)
sk1462net/inet/sock.cmemcpy_tofs((void *)arg,&sk->stamp,sizeof(struct timeval));
sk1509net/inet/sock.cif (!sk || !sk->prot->ioctl) return(-EINVAL);
sk1510net/inet/sock.creturn(sk->prot->ioctl(sk, cmd, arg));
sk1518net/inet/sock.csock_wmalloc(struct sock *sk, unsigned long size, int force,
sk1521net/inet/sock.cif (sk) {
sk1522net/inet/sock.cif (sk->wmem_alloc + size < sk->sndbuf || force) {
sk1526net/inet/sock.csk->wmem_alloc+= c->mem_len;
sk1532net/inet/sock.csk, size, force, priority));
sk1540net/inet/sock.csock_rmalloc(struct sock *sk, unsigned long size, int force, int priority)
sk1542net/inet/sock.cif (sk) {
sk1543net/inet/sock.cif (sk->rmem_alloc + size < sk->rcvbuf || force) {
sk1547net/inet/sock.csk->rmem_alloc += c->mem_len;
sk1553net/inet/sock.csk,size,force, priority));
sk1561net/inet/sock.csock_rspace(struct sock *sk)
sk1565net/inet/sock.cif (sk != NULL) {
sk1566net/inet/sock.cif (sk->rmem_alloc >= sk->rcvbuf-2*MIN_WINDOW) return(0);
sk1567net/inet/sock.camt = min((sk->rcvbuf-sk->rmem_alloc)/2-MIN_WINDOW, MAX_WINDOW);
sk1576net/inet/sock.csock_wspace(struct sock *sk)
sk1578net/inet/sock.cif (sk != NULL) {
sk1579net/inet/sock.cif (sk->shutdown & SEND_SHUTDOWN) return(0);
sk1580net/inet/sock.cif (sk->wmem_alloc >= sk->sndbuf) return(0);
sk1581net/inet/sock.creturn(sk->sndbuf-sk->wmem_alloc );
sk1588net/inet/sock.csock_wfree(struct sock *sk, void *mem, unsigned long size)
sk1590net/inet/sock.cDPRINTF((DBG_INET, "sock_wfree(sk=%X, mem=%X, size=%d)\n", sk, mem, size));
sk1594net/inet/sock.cif (sk) {
sk1595net/inet/sock.csk->wmem_alloc -= size;
sk1598net/inet/sock.cif (!sk->dead) sk->write_space(sk);
sk1599net/inet/sock.cif (sk->destroy && sk->wmem_alloc == 0 && sk->rmem_alloc == 0) {
sk1601net/inet/sock.c"recovered lost memory, sock = %X\n", sk));
sk1609net/inet/sock.csock_rfree(struct sock *sk, void *mem, unsigned long size)
sk1611net/inet/sock.cDPRINTF((DBG_INET, "sock_rfree(sk=%X, mem=%X, size=%d)\n", sk, mem, size));
sk1614net/inet/sock.cif (sk) {
sk1615net/inet/sock.csk->rmem_alloc -= size;
sk1616net/inet/sock.cif (sk->destroy && sk->wmem_alloc == 0 && sk->rmem_alloc == 0) {
sk1618net/inet/sock.c"recovered lot memory, sock = %X\n", sk));
sk1668net/inet/sock.cvoid release_sock(struct sock *sk)
sk1672net/inet/sock.cif (!sk->prot)
sk1675net/inet/sock.cif (sk->blog) return;
sk1678net/inet/sock.csk->inuse = 1;
sk1679net/inet/sock.cwhile((skb = skb_dequeue(&sk->back_log)) != NULL) {
sk1680net/inet/sock.csk->blog = 1;
sk1682net/inet/sock.cif (sk->prot->rcv) sk->prot->rcv(skb, skb->dev, sk->opt,
sk1685net/inet/sock.c(struct inet_protocol *)sk->pair); 
sk1687net/inet/sock.csk->blog = 0;
sk1688net/inet/sock.csk->inuse = 0;
sk1689net/inet/sock.cif (sk->dead && sk->state == TCP_CLOSE) {
sk1691net/inet/sock.creset_timer(sk, TIME_DONE, min(sk->rtt * 2, TCP_DONE_TIME));
sk167net/inet/sock.hvoid        (*state_change)(struct sock *sk);
sk168net/inet/sock.hvoid        (*data_ready)(struct sock *sk,int bytes);
sk169net/inet/sock.hvoid        (*write_space)(struct sock *sk);
sk170net/inet/sock.hvoid        (*error_report)(struct sock *sk);
sk175net/inet/sock.hstruct sk_buff *  (*wmalloc)(struct sock *sk,
sk178net/inet/sock.hstruct sk_buff *  (*rmalloc)(struct sock *sk,
sk181net/inet/sock.hvoid      (*wfree)(struct sock *sk, void *mem,
sk183net/inet/sock.hvoid      (*rfree)(struct sock *sk, void *mem,
sk185net/inet/sock.hunsigned long    (*rspace)(struct sock *sk);
sk186net/inet/sock.hunsigned long    (*wspace)(struct sock *sk);
sk187net/inet/sock.hvoid      (*close)(struct sock *sk, int timeout);
sk188net/inet/sock.hint      (*read)(struct sock *sk, unsigned char *to,
sk190net/inet/sock.hint      (*write)(struct sock *sk, unsigned char *to,
sk192net/inet/sock.hint      (*sendto)(struct sock *sk,
sk196net/inet/sock.hint      (*recvfrom)(struct sock *sk,
sk205net/inet/sock.hint      (*connect)(struct sock *sk,
sk207net/inet/sock.hstruct sock *    (*accept) (struct sock *sk, int flags);
sk208net/inet/sock.hvoid      (*queue_xmit)(struct sock *sk,
sk211net/inet/sock.hvoid      (*retransmit)(struct sock *sk, int all);
sk212net/inet/sock.hvoid      (*write_wakeup)(struct sock *sk);
sk213net/inet/sock.hvoid      (*read_wakeup)(struct sock *sk);
sk218net/inet/sock.hint      (*select)(struct sock *sk, int which,
sk220net/inet/sock.hint      (*ioctl)(struct sock *sk, int cmd,
sk222net/inet/sock.hint      (*init)(struct sock *sk);
sk223net/inet/sock.hvoid      (*shutdown)(struct sock *sk, int how);
sk224net/inet/sock.hint      (*setsockopt)(struct sock *sk, int level, int optname,
sk226net/inet/sock.hint      (*getsockopt)(struct sock *sk, int level, int optname,
sk249net/inet/sock.hextern void      destroy_sock(struct sock *sk);
sk252net/inet/sock.hextern void      release_sock(struct sock *sk);
sk257net/inet/sock.hextern struct sk_buff    *sock_wmalloc(struct sock *sk,
sk260net/inet/sock.hextern struct sk_buff    *sock_rmalloc(struct sock *sk,
sk263net/inet/sock.hextern void      sock_wfree(struct sock *sk, void *mem,
sk265net/inet/sock.hextern void      sock_rfree(struct sock *sk, void *mem,
sk267net/inet/sock.hextern unsigned long    sock_rspace(struct sock *sk);
sk268net/inet/sock.hextern unsigned long    sock_wspace(struct sock *sk);
sk270net/inet/sock.hextern int      sock_setsockopt(struct sock *sk,int level,int op,char *optval,int optlen);
sk271net/inet/sock.hextern int      sock_getsockopt(struct sock *sk,int level,int op,char *optval,int *optlen);
sk162net/inet/tcp.cstatic int tcp_select_window(struct sock *sk)
sk164net/inet/tcp.cint new_window = sk->prot->rspace(sk);
sk175net/inet/tcp.cif (new_window < min(sk->mss, MAX_WINDOW/2) ||
sk176net/inet/tcp.cnew_window < sk->window)
sk177net/inet/tcp.creturn(sk->window);
sk183net/inet/tcp.cstatic void tcp_time_wait(struct sock *sk)
sk185net/inet/tcp.csk->state = TCP_TIME_WAIT;
sk186net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk187net/inet/tcp.cif (!sk->dead)
sk188net/inet/tcp.csk->state_change(sk);
sk189net/inet/tcp.creset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN);
sk200net/inet/tcp.ctcp_retransmit(struct sock *sk, int all)
sk203net/inet/tcp.cip_retransmit(sk, all);
sk207net/inet/tcp.csk->ssthresh = sk->cong_window >> 1; /* remember window where we lost */
sk209net/inet/tcp.csk->cong_count = 0;
sk211net/inet/tcp.csk->cong_window = 1;
sk214net/inet/tcp.cip_retransmit(sk, all);
sk231net/inet/tcp.cstruct sock *sk;
sk240net/inet/tcp.csk = get_sock(&tcp_prot, th->source/*dest*/, daddr, th->dest/*source*/, saddr);
sk243net/inet/tcp.cif (sk == NULL) return;
sk247net/inet/tcp.csk->err = -err;
sk248net/inet/tcp.csk->error_report(sk);
sk258net/inet/tcp.cif (sk->cong_window > 4) sk->cong_window--;
sk263net/inet/tcp.csk->err = icmp_err_convert[err & 0xff].errno;
sk270net/inet/tcp.cif (sk->state == TCP_SYN_SENT) {
sk272net/inet/tcp.csk->state = TCP_CLOSE;
sk273net/inet/tcp.csk->error_report(sk);    /* Wake people up to see the error (see connect in sock.c) */
sk286net/inet/tcp.ctcp_readable(struct sock *sk)
sk294net/inet/tcp.cDPRINTF((DBG_TCP, "tcp_readable(sk=%X)\n", sk));
sk295net/inet/tcp.cif(sk && sk->debug)
sk296net/inet/tcp.cprintk("tcp_readable: %p - ",sk);
sk300net/inet/tcp.cif (sk == NULL || (skb = skb_peek(&sk->receive_queue)) == NULL)
sk303net/inet/tcp.cif(sk && sk->debug) 
sk308net/inet/tcp.ccounted = sk->copied_seq+1;  /* Where we are at the moment */
sk325net/inet/tcp.c} while(skb != (struct sk_buff *)&sk->receive_queue);
sk326net/inet/tcp.cif (amount && !sk->urginline && sk->urg_data &&
sk327net/inet/tcp.c(sk->urg_seq - sk->copied_seq) <= (counted - sk->copied_seq))
sk331net/inet/tcp.cif(sk->debug)
sk343net/inet/tcp.ctcp_select(struct sock *sk, int sel_type, select_table *wait)
sk346net/inet/tcp.csk, sel_type, wait));
sk348net/inet/tcp.csk->inuse = 1;
sk351net/inet/tcp.cif(sk->debug)
sk353net/inet/tcp.cselect_wait(sk->sleep, wait);
sk354net/inet/tcp.cif(sk->debug)
sk356net/inet/tcp.cif (skb_peek(&sk->receive_queue) != NULL) {
sk357net/inet/tcp.cif (sk->state == TCP_LISTEN || tcp_readable(sk)) {
sk358net/inet/tcp.crelease_sock(sk);
sk359net/inet/tcp.cif(sk->debug)
sk364net/inet/tcp.cif (sk->err != 0)  /* Receiver error */
sk366net/inet/tcp.crelease_sock(sk);
sk367net/inet/tcp.cif(sk->debug)
sk371net/inet/tcp.cif (sk->shutdown & RCV_SHUTDOWN) {
sk372net/inet/tcp.crelease_sock(sk);
sk373net/inet/tcp.cif(sk->debug)
sk377net/inet/tcp.crelease_sock(sk);
sk378net/inet/tcp.cif(sk->debug)
sk383net/inet/tcp.cselect_wait(sk->sleep, wait);
sk384net/inet/tcp.cif (sk->shutdown & SEND_SHUTDOWN) {
sk389net/inet/tcp.crelease_sock(sk);
sk398net/inet/tcp.cif (sk->prot->wspace(sk) >= sk->mss) {
sk399net/inet/tcp.crelease_sock(sk);
sk401net/inet/tcp.cif (sk->state == TCP_SYN_RECV ||
sk402net/inet/tcp.csk->state == TCP_SYN_SENT) return(0);
sk409net/inet/tcp.csk->wmem_alloc, sk->packets_out,
sk410net/inet/tcp.csk->write_seq, sk->window_seq));
sk412net/inet/tcp.crelease_sock(sk);
sk415net/inet/tcp.cselect_wait(sk->sleep,wait);
sk416net/inet/tcp.cif (sk->err || sk->urg_data) {
sk417net/inet/tcp.crelease_sock(sk);
sk420net/inet/tcp.crelease_sock(sk);
sk424net/inet/tcp.crelease_sock(sk);
sk430net/inet/tcp.ctcp_ioctl(struct sock *sk, int cmd, unsigned long arg)
sk433net/inet/tcp.cDPRINTF((DBG_TCP, "tcp_ioctl(sk=%X, cmd = %d, arg=%X)\n", sk, cmd, arg));
sk445net/inet/tcp.cif (sk->state == TCP_LISTEN) return(-EINVAL);
sk447net/inet/tcp.csk->inuse = 1;
sk448net/inet/tcp.camount = tcp_readable(sk);
sk449net/inet/tcp.crelease_sock(sk);
sk460net/inet/tcp.cint answ = sk->urg_data && sk->urg_seq == sk->copied_seq+1;
sk473net/inet/tcp.cif (sk->state == TCP_LISTEN) return(-EINVAL);
sk474net/inet/tcp.camount = sk->prot->wspace(sk);
sk552net/inet/tcp.cunsigned long daddr, int len, struct sock *sk)
sk559net/inet/tcp.cstatic void tcp_send_skb(struct sock *sk, struct sk_buff *skb)
sk587net/inet/tcp.ctcp_send_check(th, sk->saddr, sk->daddr, size, sk);
sk590net/inet/tcp.cif (after(skb->h.seq, sk->window_seq) ||
sk591net/inet/tcp.c(sk->retransmits && sk->timeout == TIME_WRITE) ||
sk592net/inet/tcp.csk->packets_out >= sk->cong_window) {
sk594net/inet/tcp.csk->cong_window, sk->packets_out));
sk596net/inet/tcp.csk->write_seq, sk->window_seq));
sk601net/inet/tcp.cskb_queue_tail(&sk->write_queue, skb);
sk602net/inet/tcp.cif (before(sk->window_seq, sk->write_queue.next->h.seq) &&
sk603net/inet/tcp.csk->send_head == NULL &&
sk604net/inet/tcp.csk->ack_backlog == 0)
sk605net/inet/tcp.creset_timer(sk, TIME_PROBE0, sk->rto);
sk607net/inet/tcp.csk->sent_seq = sk->write_seq;
sk608net/inet/tcp.csk->prot->queue_xmit(sk, skb->dev, skb, 0);
sk612net/inet/tcp.cstruct sk_buff * tcp_dequeue_partial(struct sock * sk)
sk619net/inet/tcp.cskb = sk->partial;
sk621net/inet/tcp.csk->partial = NULL;
sk622net/inet/tcp.cdel_timer(&sk->partial_timer);
sk628net/inet/tcp.cstatic void tcp_send_partial(struct sock *sk)
sk632net/inet/tcp.cif (sk == NULL)
sk634net/inet/tcp.cwhile ((skb = tcp_dequeue_partial(sk)) != NULL)
sk635net/inet/tcp.ctcp_send_skb(sk, skb);
sk638net/inet/tcp.cvoid tcp_enqueue_partial(struct sk_buff * skb, struct sock * sk)
sk645net/inet/tcp.ctmp = sk->partial;
sk647net/inet/tcp.cdel_timer(&sk->partial_timer);
sk648net/inet/tcp.csk->partial = skb;
sk649net/inet/tcp.csk->partial_timer.expires = HZ;
sk650net/inet/tcp.csk->partial_timer.function = (void (*)(unsigned long)) tcp_send_partial;
sk651net/inet/tcp.csk->partial_timer.data = (unsigned long) sk;
sk652net/inet/tcp.cadd_timer(&sk->partial_timer);
sk655net/inet/tcp.ctcp_send_skb(sk, tmp);
sk662net/inet/tcp.cstruct sock *sk,
sk670net/inet/tcp.cif(sk->zapped)
sk677net/inet/tcp.cbuff = sk->prot->wmalloc(sk, MAX_ACK_SIZE, 1, GFP_ATOMIC);
sk681net/inet/tcp.csk->ack_backlog++;
sk682net/inet/tcp.cif (sk->timeout != TIME_WRITE && tcp_connected(sk->state)) 
sk684net/inet/tcp.creset_timer(sk, TIME_WRITE, 10);
sk692net/inet/tcp.cbuff->sk = sk;
sk693net/inet/tcp.cbuff->localroute = sk->localroute;
sk697net/inet/tcp.ctmp = sk->prot->build_header(buff, sk->saddr, daddr, &dev,
sk698net/inet/tcp.cIPPROTO_TCP, sk->opt, MAX_ACK_SIZE,sk->ip_tos,sk->ip_ttl);
sk702net/inet/tcp.csk->prot->wfree(sk, buff->mem_addr, buff->mem_len);
sk720net/inet/tcp.csk->window = tcp_select_window(sk);
sk721net/inet/tcp.ct1->window = ntohs(sk->window);
sk729net/inet/tcp.cif (ack == sk->acked_seq) 
sk731net/inet/tcp.csk->ack_backlog = 0;
sk732net/inet/tcp.csk->bytes_rcv = 0;
sk733net/inet/tcp.csk->ack_timed = 0;
sk734net/inet/tcp.cif (sk->send_head == NULL && skb_peek(&sk->write_queue) == NULL
sk735net/inet/tcp.c&& sk->timeout == TIME_WRITE) 
sk737net/inet/tcp.cif(sk->keepopen)
sk738net/inet/tcp.creset_timer(sk,TIME_KEEPOPEN,TCP_TIMEOUT_LEN);
sk740net/inet/tcp.cdelete_timer(sk);
sk745net/inet/tcp.ctcp_send_check(t1, sk->saddr, daddr, sizeof(*t1), sk);
sk746net/inet/tcp.cif (sk->debug)
sk749net/inet/tcp.csk->prot->queue_xmit(sk, dev, buff, 1);
sk755net/inet/tcp.ctcp_build_header(struct tcphdr *th, struct sock *sk, int push)
sk759net/inet/tcp.cmemcpy(th,(void *) &(sk->dummy_th), sizeof(*th));
sk760net/inet/tcp.cth->seq = htonl(sk->write_seq);
sk765net/inet/tcp.csk->ack_backlog = 0;
sk766net/inet/tcp.csk->bytes_rcv = 0;
sk767net/inet/tcp.csk->ack_timed = 0;
sk768net/inet/tcp.cth->ack_seq = htonl(sk->acked_seq);
sk769net/inet/tcp.csk->window = tcp_select_window(sk)/*sk->prot->rspace(sk)*/;
sk770net/inet/tcp.cth->window = htons(sk->window);
sk779net/inet/tcp.cstatic int tcp_write(struct sock *sk, unsigned char *from,
sk792net/inet/tcp.csk, from, len, nonblock, flags));
sk794net/inet/tcp.csk->inuse=1;
sk795net/inet/tcp.cprot = sk->prot;
sk798net/inet/tcp.cif (sk->err) 
sk800net/inet/tcp.crelease_sock(sk);
sk803net/inet/tcp.ctmp = -sk->err;
sk804net/inet/tcp.csk->err = 0;
sk812net/inet/tcp.cif (sk->shutdown & SEND_SHUTDOWN) 
sk814net/inet/tcp.crelease_sock(sk);
sk815net/inet/tcp.csk->err = EPIPE;
sk818net/inet/tcp.csk->err = 0;
sk827net/inet/tcp.cwhile(sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT) 
sk829net/inet/tcp.cif (sk->err) 
sk831net/inet/tcp.crelease_sock(sk);
sk834net/inet/tcp.ctmp = -sk->err;
sk835net/inet/tcp.csk->err = 0;
sk839net/inet/tcp.cif (sk->state != TCP_SYN_SENT && sk->state != TCP_SYN_RECV) 
sk841net/inet/tcp.crelease_sock(sk);
sk846net/inet/tcp.cif (sk->err) 
sk848net/inet/tcp.ctmp = -sk->err;
sk849net/inet/tcp.csk->err = 0;
sk853net/inet/tcp.cif (sk->keepopen) 
sk862net/inet/tcp.crelease_sock(sk);
sk869net/inet/tcp.crelease_sock(sk);
sk872net/inet/tcp.cif (sk->state != TCP_ESTABLISHED &&
sk873net/inet/tcp.csk->state != TCP_CLOSE_WAIT && sk->err == 0) 
sk875net/inet/tcp.cinterruptible_sleep_on(sk->sleep);
sk885net/inet/tcp.csk->inuse = 1;
sk905net/inet/tcp.cif ((skb = tcp_dequeue_partial(sk)) != NULL) 
sk916net/inet/tcp.ccopy = min(sk->mss - (skb->len - hdrlen), len);
sk929net/inet/tcp.csk->write_seq += copy;
sk931net/inet/tcp.cif ((skb->len - hdrlen) >= sk->mss ||
sk932net/inet/tcp.c(flags & MSG_OOB) || !sk->packets_out)
sk933net/inet/tcp.ctcp_send_skb(sk, skb);
sk935net/inet/tcp.ctcp_enqueue_partial(skb, sk);
sk951net/inet/tcp.ccopy = sk->window_seq - sk->write_seq;
sk952net/inet/tcp.cif (copy <= 0 || copy < (sk->max_window >> 1) || copy > sk->mss)
sk953net/inet/tcp.ccopy = sk->mss;
sk962net/inet/tcp.cif (copy < sk->mss && !(flags & MSG_OOB)) 
sk967net/inet/tcp.crelease_sock(sk);
sk972net/inet/tcp.cskb = prot->wmalloc(sk, sk->mtu + 128 + prot->max_header, 0, GFP_KERNEL);
sk973net/inet/tcp.csk->inuse = 1;
sk981net/inet/tcp.crelease_sock(sk);
sk982net/inet/tcp.cskb = prot->wmalloc(sk, copy + prot->max_header , 0, GFP_KERNEL);
sk983net/inet/tcp.csk->inuse = 1;
sk994net/inet/tcp.crelease_sock(sk);
sk1005net/inet/tcp.ctmp = sk->wmem_alloc;
sk1006net/inet/tcp.crelease_sock(sk);
sk1011net/inet/tcp.cif (tmp <= sk->wmem_alloc &&
sk1012net/inet/tcp.c(sk->state == TCP_ESTABLISHED||sk->state == TCP_CLOSE_WAIT)
sk1013net/inet/tcp.c&& sk->err == 0) 
sk1015net/inet/tcp.cinterruptible_sleep_on(sk->sleep);
sk1025net/inet/tcp.csk->inuse = 1;
sk1031net/inet/tcp.cskb->sk = sk;
sk1033net/inet/tcp.cskb->localroute = sk->localroute|(flags&MSG_DONTROUTE);
sk1042net/inet/tcp.ctmp = prot->build_header(skb, sk->saddr, sk->daddr, &dev,
sk1043net/inet/tcp.cIPPROTO_TCP, sk->opt, skb->mem_len,sk->ip_tos,sk->ip_ttl);
sk1046net/inet/tcp.cprot->wfree(sk, skb->mem_addr, skb->mem_len);
sk1047net/inet/tcp.crelease_sock(sk);
sk1057net/inet/tcp.ctmp = tcp_build_header((struct tcphdr *)buff, sk, len-copy);
sk1060net/inet/tcp.cprot->wfree(sk, skb->mem_addr, skb->mem_len);
sk1061net/inet/tcp.crelease_sock(sk);
sk1081net/inet/tcp.csk->write_seq += copy;
sk1083net/inet/tcp.cif (send_tmp != NULL && sk->packets_out) 
sk1085net/inet/tcp.ctcp_enqueue_partial(send_tmp, sk);
sk1088net/inet/tcp.ctcp_send_skb(sk, skb);
sk1090net/inet/tcp.csk->err = 0;
sk1103net/inet/tcp.cif(sk->partial && ((!sk->packets_out) 
sk1105net/inet/tcp.c|| (sk->nonagle && before(sk->write_seq , sk->window_seq))
sk1107net/inet/tcp.ctcp_send_partial(sk);
sk1109net/inet/tcp.crelease_sock(sk);
sk1115net/inet/tcp.cstatic int tcp_sendto(struct sock *sk, unsigned char *from,
sk1128net/inet/tcp.cif (sin.sin_port != sk->dummy_th.dest) 
sk1130net/inet/tcp.cif (sin.sin_addr.s_addr != sk->daddr) 
sk1132net/inet/tcp.creturn(tcp_write(sk, from, len, nonblock, flags));
sk1137net/inet/tcp.ctcp_read_wakeup(struct sock *sk)
sk1145net/inet/tcp.cif (!sk->ack_backlog) 
sk1159net/inet/tcp.cbuff = sk->prot->wmalloc(sk,MAX_ACK_SIZE,1, GFP_ATOMIC);
sk1163net/inet/tcp.creset_timer(sk, TIME_WRITE, 10);
sk1168net/inet/tcp.cbuff->sk = sk;
sk1169net/inet/tcp.cbuff->localroute = sk->localroute;
sk1175net/inet/tcp.ctmp = sk->prot->build_header(buff, sk->saddr, sk->daddr, &dev,
sk1176net/inet/tcp.cIPPROTO_TCP, sk->opt, MAX_ACK_SIZE,sk->ip_tos,sk->ip_ttl);
sk1180net/inet/tcp.csk->prot->wfree(sk, buff->mem_addr, buff->mem_len);
sk1187net/inet/tcp.cmemcpy(t1,(void *) &sk->dummy_th, sizeof(*t1));
sk1188net/inet/tcp.ct1->seq = htonl(sk->sent_seq);
sk1196net/inet/tcp.csk->ack_backlog = 0;
sk1197net/inet/tcp.csk->bytes_rcv = 0;
sk1198net/inet/tcp.csk->window = tcp_select_window(sk);/*sk->prot->rspace(sk);*/
sk1199net/inet/tcp.ct1->window = ntohs(sk->window);
sk1200net/inet/tcp.ct1->ack_seq = ntohl(sk->acked_seq);
sk1202net/inet/tcp.ctcp_send_check(t1, sk->saddr, sk->daddr, sizeof(*t1), sk);
sk1203net/inet/tcp.csk->prot->queue_xmit(sk, dev, buff, 1);
sk1215net/inet/tcp.cstatic void cleanup_rbuf(struct sock *sk)
sk1221net/inet/tcp.cif(sk->debug)
sk1222net/inet/tcp.cprintk("cleaning rbuf for sk=%p\n", sk);
sk1227net/inet/tcp.cleft = sk->prot->rspace(sk);
sk1234net/inet/tcp.cwhile((skb=skb_peek(&sk->receive_queue)) != NULL) 
sk1239net/inet/tcp.cskb->sk = sk;
sk1253net/inet/tcp.csk->window - sk->bytes_rcv, sk->prot->rspace(sk)));
sk1255net/inet/tcp.cif(sk->debug)
sk1256net/inet/tcp.cprintk("sk->rspace = %lu, was %d\n", sk->prot->rspace(sk),
sk1258net/inet/tcp.cif (sk->prot->rspace(sk) != left) 
sk1270net/inet/tcp.csk->ack_backlog++;
sk1280net/inet/tcp.cif ((sk->prot->rspace(sk) > (sk->window - sk->bytes_rcv + sk->mtu))) 
sk1283net/inet/tcp.ctcp_read_wakeup(sk);
sk1288net/inet/tcp.cint was_active = del_timer(&sk->timer);
sk1289net/inet/tcp.cif (!was_active || TCP_ACK_TIME < sk->timer.expires) 
sk1291net/inet/tcp.creset_timer(sk, TIME_WRITE, TCP_ACK_TIME);
sk1294net/inet/tcp.cadd_timer(&sk->timer);
sk1302net/inet/tcp.ctcp_read_urg(struct sock * sk, int nonblock,
sk1308net/inet/tcp.cif (sk->urginline || !sk->urg_data || sk->urg_data == URG_READ)
sk1310net/inet/tcp.cif (sk->urg_data & URG_VALID) {
sk1311net/inet/tcp.cchar c = sk->urg_data;
sk1313net/inet/tcp.csk->urg_data = URG_READ;
sk1318net/inet/tcp.cif (sk->err) {
sk1319net/inet/tcp.cint tmp = -sk->err;
sk1320net/inet/tcp.csk->err = 0;
sk1324net/inet/tcp.cif (sk->state == TCP_CLOSE || sk->done) {
sk1325net/inet/tcp.cif (!sk->done) {
sk1326net/inet/tcp.csk->done = 1;
sk1332net/inet/tcp.cif (sk->shutdown & RCV_SHUTDOWN) {
sk1333net/inet/tcp.csk->done = 1;
sk1344net/inet/tcp.cadd_wait_queue(sk->sleep, &wait);
sk1345net/inet/tcp.cif ((sk->urg_data & URG_NOTYET) && sk->err == 0 &&
sk1346net/inet/tcp.c!(sk->shutdown & RCV_SHUTDOWN))
sk1348net/inet/tcp.cremove_wait_queue(sk->sleep, &wait);
sk1356net/inet/tcp.cstatic int tcp_read(struct sock *sk, unsigned char *to,
sk1377net/inet/tcp.cif (sk->state == TCP_LISTEN)
sk1382net/inet/tcp.creturn tcp_read_urg(sk, nonblock, to, len, flags);
sk1384net/inet/tcp.cpeek_seq = sk->copied_seq;
sk1385net/inet/tcp.cseq = &sk->copied_seq;
sk1389net/inet/tcp.cadd_wait_queue(sk->sleep, &wait);
sk1390net/inet/tcp.csk->inuse = 1;
sk1398net/inet/tcp.cif (copied && sk->urg_data && sk->urg_seq == 1+*seq)
sk1403net/inet/tcp.cskb = skb_peek(&sk->receive_queue);
sk1417net/inet/tcp.c} while (skb != (struct sk_buff *)&sk->receive_queue);
sk1422net/inet/tcp.cif (sk->err) {
sk1423net/inet/tcp.ccopied = -sk->err;
sk1424net/inet/tcp.csk->err = 0;
sk1428net/inet/tcp.cif (sk->state == TCP_CLOSE) {
sk1429net/inet/tcp.cif (!sk->done) {
sk1430net/inet/tcp.csk->done = 1;
sk1437net/inet/tcp.cif (sk->shutdown & RCV_SHUTDOWN) {
sk1438net/inet/tcp.csk->done = 1;
sk1447net/inet/tcp.ccleanup_rbuf(sk);
sk1448net/inet/tcp.crelease_sock(sk);
sk1450net/inet/tcp.csk->inuse = 1;
sk1464net/inet/tcp.cif (sk->urg_data) {
sk1465net/inet/tcp.cunsigned long urg_offset = sk->urg_seq - (1 + *seq);
sk1468net/inet/tcp.cif (!sk->urginline) {
sk1484net/inet/tcp.cif (after(sk->copied_seq+1,sk->urg_seq))
sk1485net/inet/tcp.csk->urg_data = 0;
sk1489net/inet/tcp.cremove_wait_queue(sk->sleep, &wait);
sk1493net/inet/tcp.ccleanup_rbuf(sk);
sk1494net/inet/tcp.crelease_sock(sk);
sk1505net/inet/tcp.cvoid tcp_shutdown(struct sock *sk, int how)
sk1525net/inet/tcp.cif (sk->state == TCP_FIN_WAIT1 || sk->state == TCP_FIN_WAIT2) 
sk1529net/inet/tcp.csk->inuse = 1;
sk1535net/inet/tcp.cif (sk->partial)
sk1536net/inet/tcp.ctcp_send_partial(sk);
sk1538net/inet/tcp.cprot =(struct proto *)sk->prot;
sk1539net/inet/tcp.cth =(struct tcphdr *)&sk->dummy_th;
sk1540net/inet/tcp.crelease_sock(sk); /* incase the malloc sleeps. */
sk1541net/inet/tcp.cbuff = prot->wmalloc(sk, MAX_RESET_SIZE,1 , GFP_KERNEL);
sk1544net/inet/tcp.csk->inuse = 1;
sk1547net/inet/tcp.cbuff->sk = sk;
sk1549net/inet/tcp.cbuff->localroute = sk->localroute;
sk1556net/inet/tcp.ctmp = prot->build_header(buff,sk->saddr, sk->daddr, &dev,
sk1557net/inet/tcp.cIPPROTO_TCP, sk->opt,
sk1558net/inet/tcp.csizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl);
sk1565net/inet/tcp.cprot->wfree(sk,buff->mem_addr, buff->mem_len);
sk1566net/inet/tcp.cif(sk->state==TCP_ESTABLISHED)
sk1567net/inet/tcp.csk->state=TCP_FIN_WAIT1;
sk1569net/inet/tcp.csk->state=TCP_FIN_WAIT2;
sk1570net/inet/tcp.crelease_sock(sk);
sk1579net/inet/tcp.ct1->seq = ntohl(sk->write_seq);
sk1580net/inet/tcp.csk->write_seq++;
sk1581net/inet/tcp.cbuff->h.seq = sk->write_seq;
sk1583net/inet/tcp.ct1->ack_seq = ntohl(sk->acked_seq);
sk1584net/inet/tcp.ct1->window = ntohs(sk->window=tcp_select_window(sk)/*sk->prot->rspace(sk)*/);
sk1588net/inet/tcp.ctcp_send_check(t1, sk->saddr, sk->daddr, sizeof(*t1), sk);
sk1595net/inet/tcp.cif (skb_peek(&sk->write_queue) != NULL) 
sk1603net/inet/tcp.cskb_queue_tail(&sk->write_queue, buff);
sk1607net/inet/tcp.csk->sent_seq = sk->write_seq;
sk1608net/inet/tcp.csk->prot->queue_xmit(sk, dev, buff, 0);
sk1611net/inet/tcp.cif (sk->state == TCP_ESTABLISHED) 
sk1612net/inet/tcp.csk->state = TCP_FIN_WAIT1;
sk1614net/inet/tcp.csk->state = TCP_FIN_WAIT2;
sk1616net/inet/tcp.crelease_sock(sk);
sk1621net/inet/tcp.ctcp_recvfrom(struct sock *sk, unsigned char *to,
sk1643net/inet/tcp.cresult=tcp_read(sk, to, to_len, nonblock, flags);
sk1648net/inet/tcp.csin.sin_port = sk->dummy_th.dest;
sk1649net/inet/tcp.csin.sin_addr.s_addr = sk->daddr;
sk1680net/inet/tcp.cbuff->sk = NULL;
sk1748net/inet/tcp.ctcp_options(struct sock *sk, struct tcphdr *th)
sk1776net/inet/tcp.csk->mtu=min(sk->mtu,ntohs(*(unsigned short *)ptr));
sk1788net/inet/tcp.csk->mtu=min(sk->mtu, 536);  /* default MSS if none sent */
sk1790net/inet/tcp.csk->mss = min(sk->max_window, sk->mtu);
sk1811net/inet/tcp.ctcp_conn_request(struct sock *sk, struct sk_buff *skb,
sk1825net/inet/tcp.csk, skb, daddr, saddr, opt, dev));
sk1830net/inet/tcp.cif (!sk->dead) {
sk1831net/inet/tcp.csk->data_ready(sk,0);
sk1834net/inet/tcp.ctcp_reset(daddr, saddr, th, sk->prot, opt, dev, sk->ip_tos,sk->ip_ttl);
sk1844net/inet/tcp.cif (sk->ack_backlog >= sk->max_ack_backlog) {
sk1866net/inet/tcp.cmemcpy(newsk, sk, sizeof(*newsk));
sk1888net/inet/tcp.cnewsk->localroute = sk->localroute;
sk1929net/inet/tcp.cnewsk->ip_ttl=sk->ip_ttl;
sk1934net/inet/tcp.cif (sk->user_mss)
sk1935net/inet/tcp.cnewsk->mtu = sk->user_mss;
sk1954net/inet/tcp.csk->err = -ENOMEM;
sk1963net/inet/tcp.cbuff->sk = newsk;
sk1969net/inet/tcp.ctmp = sk->prot->build_header(buff, newsk->saddr, newsk->daddr, &ndev,
sk1970net/inet/tcp.cIPPROTO_TCP, NULL, MAX_SYN_SIZE,sk->ip_tos,sk->ip_ttl);
sk1974net/inet/tcp.csk->err = tmp;
sk1979net/inet/tcp.cskb->sk = sk;
sk2018net/inet/tcp.cskb->sk = newsk;
sk2021net/inet/tcp.csk->rmem_alloc -= skb->mem_len;
sk2024net/inet/tcp.cskb_queue_tail(&sk->receive_queue,skb);
sk2025net/inet/tcp.csk->ack_backlog++;
sk2031net/inet/tcp.cstatic void tcp_close(struct sock *sk, int timeout)
sk2044net/inet/tcp.cDPRINTF((DBG_TCP, "tcp_close((struct sock *)%X, %d)\n",sk, timeout));
sk2045net/inet/tcp.csk->inuse = 1;
sk2046net/inet/tcp.csk->keepopen = 1;
sk2047net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk2049net/inet/tcp.cif (!sk->dead) 
sk2050net/inet/tcp.csk->state_change(sk);
sk2056net/inet/tcp.cif (skb_peek(&sk->receive_queue) != NULL) 
sk2059net/inet/tcp.cif(sk->debug)
sk2061net/inet/tcp.cwhile((skb=skb_dequeue(&sk->receive_queue))!=NULL)
sk2063net/inet/tcp.cif(skb->len > 0 && after(skb->h.th->seq + skb->len + 1 , sk->copied_seq))
sk2067net/inet/tcp.cif(sk->debug)
sk2075net/inet/tcp.cif (sk->partial) 
sk2077net/inet/tcp.ctcp_send_partial(sk);
sk2080net/inet/tcp.cswitch(sk->state) 
sk2091net/inet/tcp.creset_timer(sk, TIME_CLOSE, 4 * sk->rto);
sk2093net/inet/tcp.ctcp_time_wait(sk);
sk2094net/inet/tcp.crelease_sock(sk);
sk2099net/inet/tcp.csk->state = TCP_CLOSE;
sk2101net/inet/tcp.crelease_sock(sk);
sk2104net/inet/tcp.csk->state = TCP_CLOSE;
sk2105net/inet/tcp.crelease_sock(sk);
sk2108net/inet/tcp.crelease_sock(sk);
sk2114net/inet/tcp.cprot =(struct proto *)sk->prot;
sk2115net/inet/tcp.cth =(struct tcphdr *)&sk->dummy_th;
sk2116net/inet/tcp.cbuff = prot->wmalloc(sk, MAX_FIN_SIZE, 1, GFP_ATOMIC);
sk2122net/inet/tcp.crelease_sock(sk);
sk2123net/inet/tcp.cif (sk->state != TCP_CLOSE_WAIT)
sk2124net/inet/tcp.csk->state = TCP_ESTABLISHED;
sk2125net/inet/tcp.creset_timer(sk, TIME_CLOSE, 100);
sk2128net/inet/tcp.cbuff->sk = sk;
sk2131net/inet/tcp.cbuff->localroute = sk->localroute;
sk2137net/inet/tcp.ctmp = prot->build_header(buff,sk->saddr, sk->daddr, &dev,
sk2138net/inet/tcp.cIPPROTO_TCP, sk->opt,
sk2139net/inet/tcp.csizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl);
sk2143net/inet/tcp.cif(sk->state==TCP_ESTABLISHED)
sk2144net/inet/tcp.csk->state=TCP_FIN_WAIT1;
sk2146net/inet/tcp.csk->state=TCP_FIN_WAIT2;
sk2147net/inet/tcp.creset_timer(sk, TIME_CLOSE,4*sk->rto);
sk2149net/inet/tcp.ctcp_time_wait(sk);
sk2152net/inet/tcp.crelease_sock(sk);
sk2160net/inet/tcp.ct1->seq = ntohl(sk->write_seq);
sk2161net/inet/tcp.csk->write_seq++;
sk2162net/inet/tcp.cbuff->h.seq = sk->write_seq;
sk2169net/inet/tcp.csk->delay_acks = 0;
sk2170net/inet/tcp.ct1->ack_seq = ntohl(sk->acked_seq);
sk2171net/inet/tcp.ct1->window = ntohs(sk->window=tcp_select_window(sk)/*sk->prot->rspace(sk)*/);
sk2175net/inet/tcp.ctcp_send_check(t1, sk->saddr, sk->daddr, sizeof(*t1), sk);
sk2179net/inet/tcp.cif (skb_peek(&sk->write_queue) == NULL) 
sk2181net/inet/tcp.csk->sent_seq = sk->write_seq;
sk2182net/inet/tcp.cprot->queue_xmit(sk, dev, buff, 0);
sk2186net/inet/tcp.creset_timer(sk, TIME_WRITE, sk->rto);
sk2192net/inet/tcp.cskb_queue_tail(&sk->write_queue, buff);
sk2195net/inet/tcp.cif (sk->state == TCP_CLOSE_WAIT) 
sk2197net/inet/tcp.csk->state = TCP_FIN_WAIT2;
sk2201net/inet/tcp.csk->state = TCP_FIN_WAIT1;
sk2204net/inet/tcp.crelease_sock(sk);
sk2213net/inet/tcp.ctcp_write_xmit(struct sock *sk)
sk2217net/inet/tcp.cDPRINTF((DBG_TCP, "tcp_write_xmit(sk=%X)\n", sk));
sk2221net/inet/tcp.cif(sk->zapped)
sk2224net/inet/tcp.cwhile((skb = skb_peek(&sk->write_queue)) != NULL &&
sk2225net/inet/tcp.cbefore(skb->h.seq, sk->window_seq + 1) &&
sk2226net/inet/tcp.c(sk->retransmits == 0 ||
sk2227net/inet/tcp.csk->timeout != TIME_WRITE ||
sk2228net/inet/tcp.cbefore(skb->h.seq, sk->rcv_ack_seq + 1))
sk2229net/inet/tcp.c&& sk->packets_out < sk->cong_window) {
sk2235net/inet/tcp.cif (before(skb->h.seq, sk->rcv_ack_seq +1)) {
sk2236net/inet/tcp.csk->retransmits = 0;
sk2238net/inet/tcp.cif (!sk->dead) sk->write_space(sk);
sk2240net/inet/tcp.csk->sent_seq = skb->h.seq;
sk2241net/inet/tcp.csk->prot->queue_xmit(sk, skb->dev, skb, skb->free);
sk2252net/inet/tcp.csort_send(struct sock *sk)
sk2257net/inet/tcp.cfor (skb = sk->send_head; skb != NULL; skb = skb2) {
sk2261net/inet/tcp.csk->send_tail = skb;
sk2269net/inet/tcp.cif (skb->link3 == NULL) sk->send_tail = skb;
sk2275net/inet/tcp.csk->send_head = list;
sk2281net/inet/tcp.ctcp_ack(struct sock *sk, struct tcphdr *th, unsigned long saddr, int len)
sk2292net/inet/tcp.cif(sk->zapped)
sk2298net/inet/tcp.cack, ntohs(th->window), sk->rcv_ack_seq, sk->window_seq));
sk2300net/inet/tcp.cif (ntohs(th->window) > sk->max_window) {
sk2301net/inet/tcp.csk->max_window = ntohs(th->window);
sk2302net/inet/tcp.csk->mss = min(sk->max_window, sk->mtu);
sk2305net/inet/tcp.cif (sk->retransmits && sk->timeout == TIME_KEEPOPEN)
sk2306net/inet/tcp.csk->retransmits = 0;
sk2309net/inet/tcp.cif (after(ack, sk->sent_seq+1) || before(ack, sk->rcv_ack_seq-1)) {
sk2310net/inet/tcp.cif (after(ack, sk->sent_seq) ||
sk2311net/inet/tcp.c(sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT)) {
sk2314net/inet/tcp.cif (sk->keepopen) {
sk2315net/inet/tcp.creset_timer(sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
sk2323net/inet/tcp.cif (after(sk->window_seq, ack+ntohs(th->window))) {
sk2335net/inet/tcp.cskb2 = sk->send_head;
sk2336net/inet/tcp.csk->send_head = NULL;
sk2337net/inet/tcp.csk->send_tail = NULL;
sk2341net/inet/tcp.csk->window_seq = ack + ntohs(th->window);
sk2347net/inet/tcp.cif (after(skb->h.seq, sk->window_seq)) {
sk2348net/inet/tcp.cif (sk->packets_out > 0) sk->packets_out--;
sk2355net/inet/tcp.cskb_queue_head(&sk->write_queue,skb);
sk2360net/inet/tcp.cif (sk->send_head == NULL) {
sk2361net/inet/tcp.csk->send_head = skb;
sk2362net/inet/tcp.csk->send_tail = skb;
sk2364net/inet/tcp.csk->send_tail->link3 = skb;
sk2365net/inet/tcp.csk->send_tail = skb;
sk2373net/inet/tcp.cif (sk->send_tail == NULL || sk->send_head == NULL) {
sk2374net/inet/tcp.csk->send_head = NULL;
sk2375net/inet/tcp.csk->send_tail = NULL;
sk2376net/inet/tcp.csk->packets_out= 0;
sk2379net/inet/tcp.csk->window_seq = ack + ntohs(th->window);
sk2382net/inet/tcp.cif (sk->timeout == TIME_WRITE && 
sk2383net/inet/tcp.csk->cong_window < 2048 && after(ack, sk->rcv_ack_seq)) {
sk2393net/inet/tcp.cif (sk->cong_window < sk->ssthresh)  
sk2395net/inet/tcp.csk->cong_window++;
sk2400net/inet/tcp.cif (sk->cong_count >= sk->cong_window) {
sk2401net/inet/tcp.csk->cong_window++;
sk2402net/inet/tcp.csk->cong_count = 0;
sk2404net/inet/tcp.csk->cong_count++;
sk2409net/inet/tcp.csk->rcv_ack_seq = ack;
sk2416net/inet/tcp.cif (sk->timeout == TIME_PROBE0) {
sk2417net/inet/tcp.cif (skb_peek(&sk->write_queue) != NULL &&   /* should always be non-null */
sk2418net/inet/tcp.c! before (sk->window_seq, sk->write_queue.next->h.seq)) {
sk2419net/inet/tcp.csk->retransmits = 0;
sk2420net/inet/tcp.csk->backoff = 0;
sk2422net/inet/tcp.csk->rto = ((sk->rtt >> 2) + sk->mdev) >> 1;
sk2423net/inet/tcp.cif (sk->rto > 120*HZ)
sk2424net/inet/tcp.csk->rto = 120*HZ;
sk2425net/inet/tcp.cif (sk->rto < 1*HZ)
sk2426net/inet/tcp.csk->rto = 1*HZ;
sk2431net/inet/tcp.cwhile(sk->send_head != NULL) {
sk2433net/inet/tcp.cif (sk->send_head->link3 &&
sk2434net/inet/tcp.cafter(sk->send_head->h.seq, sk->send_head->link3->h.seq)) {
sk2436net/inet/tcp.csort_send(sk);
sk2439net/inet/tcp.cif (before(sk->send_head->h.seq, ack+1)) {
sk2442net/inet/tcp.cif (sk->retransmits) {
sk2455net/inet/tcp.cif (sk->send_head->link3)
sk2456net/inet/tcp.csk->retransmits = 1;
sk2458net/inet/tcp.csk->retransmits = 0;
sk2475net/inet/tcp.cif (sk->packets_out > 0) sk->packets_out --;
sk2477net/inet/tcp.csk->send_head, sk->send_head->h.seq, ack));
sk2480net/inet/tcp.cif (!sk->dead) sk->write_space(sk);
sk2482net/inet/tcp.coskb = sk->send_head;
sk2495net/inet/tcp.cm -= (sk->rtt >> 3);       /* m is now error in rtt est */
sk2496net/inet/tcp.csk->rtt += m;              /* rtt = 7/8 rtt + 1/8 new */
sk2499net/inet/tcp.cm -= (sk->mdev >> 2);      /* similar update on mdev */
sk2500net/inet/tcp.csk->mdev += m;       /* mdev = 3/4 mdev + 1/4 new */
sk2503net/inet/tcp.csk->rto = ((sk->rtt >> 2) + sk->mdev) >> 1;
sk2504net/inet/tcp.cif (sk->rto > 120*HZ)
sk2505net/inet/tcp.csk->rto = 120*HZ;
sk2506net/inet/tcp.cif (sk->rto < 1*HZ)
sk2507net/inet/tcp.csk->rto = 1*HZ;
sk2508net/inet/tcp.csk->backoff = 0;
sk2515net/inet/tcp.coskb = sk->send_head;
sk2517net/inet/tcp.csk->send_head = oskb->link3;
sk2518net/inet/tcp.cif (sk->send_head == NULL) {
sk2519net/inet/tcp.csk->send_tail = NULL;
sk2527net/inet/tcp.cif (!sk->dead) sk->write_space(sk);
sk2537net/inet/tcp.cif (skb_peek(&sk->write_queue) != NULL) {
sk2538net/inet/tcp.cif (after (sk->window_seq+1, sk->write_queue.next->h.seq) &&
sk2539net/inet/tcp.c(sk->retransmits == 0 || 
sk2540net/inet/tcp.csk->timeout != TIME_WRITE ||
sk2541net/inet/tcp.cbefore(sk->write_queue.next->h.seq, sk->rcv_ack_seq + 1))
sk2542net/inet/tcp.c&& sk->packets_out < sk->cong_window) {
sk2544net/inet/tcp.ctcp_write_xmit(sk);
sk2545net/inet/tcp.c} else if (before(sk->window_seq, sk->write_queue.next->h.seq) &&
sk2546net/inet/tcp.csk->send_head == NULL &&
sk2547net/inet/tcp.csk->ack_backlog == 0 &&
sk2548net/inet/tcp.csk->state != TCP_TIME_WAIT) {
sk2549net/inet/tcp.creset_timer(sk, TIME_PROBE0, sk->rto);
sk2552net/inet/tcp.cif (sk->send_head == NULL && sk->ack_backlog == 0 &&
sk2553net/inet/tcp.csk->state != TCP_TIME_WAIT && !sk->keepopen) {
sk2555net/inet/tcp.cif (!sk->dead) sk->write_space(sk);
sk2557net/inet/tcp.cif (sk->keepopen)
sk2558net/inet/tcp.creset_timer(sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
sk2560net/inet/tcp.cdelete_timer(sk);
sk2562net/inet/tcp.cif (sk->state != (unsigned char) sk->keepopen) {
sk2563net/inet/tcp.creset_timer(sk, TIME_WRITE, sk->rto);
sk2565net/inet/tcp.cif (sk->state == TCP_TIME_WAIT) {
sk2566net/inet/tcp.creset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN);
sk2571net/inet/tcp.cif (sk->packets_out == 0 && sk->partial != NULL &&
sk2572net/inet/tcp.cskb_peek(&sk->write_queue) == NULL && sk->send_head == NULL) {
sk2574net/inet/tcp.ctcp_send_partial(sk);
sk2578net/inet/tcp.cif (sk->state == TCP_TIME_WAIT) {
sk2579net/inet/tcp.cif (!sk->dead)
sk2580net/inet/tcp.csk->state_change(sk);
sk2581net/inet/tcp.cif (sk->rcv_ack_seq == sk->write_seq && sk->acked_seq == sk->fin_seq) {
sk2583net/inet/tcp.csk->state = TCP_CLOSE;
sk2584net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk2588net/inet/tcp.cif (sk->state == TCP_LAST_ACK || sk->state == TCP_FIN_WAIT2) {
sk2589net/inet/tcp.cif (!sk->dead) sk->state_change(sk);
sk2590net/inet/tcp.cif (sk->rcv_ack_seq == sk->write_seq) {
sk2592net/inet/tcp.cif (sk->acked_seq != sk->fin_seq) {
sk2593net/inet/tcp.ctcp_time_wait(sk);
sk2595net/inet/tcp.cDPRINTF((DBG_TCP, "tcp_ack closing socket - %X\n", sk));
sk2596net/inet/tcp.ctcp_send_ack(sk->sent_seq, sk->acked_seq, sk,
sk2597net/inet/tcp.cth, sk->daddr);
sk2598net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk2599net/inet/tcp.csk->state = TCP_CLOSE;
sk2633net/inet/tcp.cif (((!flag) || (flag&4)) && sk->send_head != NULL &&
sk2634net/inet/tcp.c(((flag&2) && sk->retransmits) ||
sk2635net/inet/tcp.c(sk->send_head->when + sk->rto < jiffies))) {
sk2636net/inet/tcp.cip_do_retransmit(sk, 1);
sk2637net/inet/tcp.creset_timer(sk, TIME_WRITE, sk->rto);
sk2651net/inet/tcp.ctcp_data(struct sk_buff *skb, struct sock *sk, 
sk2662net/inet/tcp.cDPRINTF((DBG_TCP, "tcp_data len = %d sk = %X:\n", skb->len, sk));
sk2664net/inet/tcp.csk->bytes_rcv += skb->len;
sk2667net/inet/tcp.cif (!th->ack) tcp_send_ack(sk->sent_seq, sk->acked_seq,sk, th, saddr);
sk2672net/inet/tcp.cif (sk->shutdown & RCV_SHUTDOWN) {
sk2673net/inet/tcp.csk->acked_seq = th->seq + skb->len + th->syn + th->fin;
sk2674net/inet/tcp.ctcp_reset(sk->saddr, sk->daddr, skb->h.th,
sk2675net/inet/tcp.csk->prot, NULL, skb->dev, sk->ip_tos, sk->ip_ttl);
sk2677net/inet/tcp.csk->state = TCP_CLOSE;
sk2678net/inet/tcp.csk->err = EPIPE;
sk2679net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk2680net/inet/tcp.cDPRINTF((DBG_TCP, "tcp_data: closing socket - %X\n", sk));
sk2682net/inet/tcp.cif (!sk->dead) sk->state_change(sk);
sk2695net/inet/tcp.cif (skb_peek(&sk->receive_queue) == NULL) {
sk2697net/inet/tcp.cskb_queue_head(&sk->receive_queue,skb);
sk2700net/inet/tcp.cDPRINTF((DBG_TCP, "tcp_data adding to chain sk = %X:\n", sk));
sk2701net/inet/tcp.cfor(skb1=sk->receive_queue.prev; ; skb1 = skb1->prev) {
sk2702net/inet/tcp.cif(sk->debug)
sk2707net/inet/tcp.cprintk("copied_seq = %ld acked_seq = %ld\n", sk->copied_seq,
sk2708net/inet/tcp.csk->acked_seq);
sk2724net/inet/tcp.cif (skb1 == skb_peek(&sk->receive_queue))
sk2726net/inet/tcp.cskb_queue_head(&sk->receive_queue, skb);
sk2737net/inet/tcp.cif (before(sk->acked_seq, sk->copied_seq)) {
sk2739net/inet/tcp.csk->acked_seq = sk->copied_seq;
sk2743net/inet/tcp.cif ((!dup_dumped && (skb1 == NULL || skb1->acked)) || before(th->seq, sk->acked_seq+1)) {
sk2744net/inet/tcp.cif (before(th->seq, sk->acked_seq+1)) {
sk2747net/inet/tcp.cif (after(th->ack_seq, sk->acked_seq)) {
sk2748net/inet/tcp.cnewwindow = sk->window -
sk2749net/inet/tcp.c(th->ack_seq - sk->acked_seq);
sk2752net/inet/tcp.csk->window = newwindow;
sk2753net/inet/tcp.csk->acked_seq = th->ack_seq;
sk2759net/inet/tcp.cif (!sk->dead) sk->state_change(sk);
sk2760net/inet/tcp.csk->shutdown |= RCV_SHUTDOWN;
sk2764net/inet/tcp.cskb2 != (struct sk_buff *)&sk->receive_queue;
sk2766net/inet/tcp.cif (before(skb2->h.th->seq, sk->acked_seq+1)) {
sk2767net/inet/tcp.cif (after(skb2->h.th->ack_seq, sk->acked_seq))
sk2769net/inet/tcp.cnewwindow = sk->window -
sk2770net/inet/tcp.c(skb2->h.th->ack_seq - sk->acked_seq);
sk2773net/inet/tcp.csk->window = newwindow;
sk2774net/inet/tcp.csk->acked_seq = skb2->h.th->ack_seq;
sk2783net/inet/tcp.csk->shutdown |= RCV_SHUTDOWN;
sk2784net/inet/tcp.cif (!sk->dead) sk->state_change(sk);
sk2788net/inet/tcp.csk->ack_backlog = sk->max_ack_backlog;
sk2798net/inet/tcp.cif (!sk->delay_acks ||
sk2799net/inet/tcp.csk->ack_backlog >= sk->max_ack_backlog || 
sk2800net/inet/tcp.csk->bytes_rcv > sk->max_unacked || th->fin) {
sk2803net/inet/tcp.csk->ack_backlog++;
sk2804net/inet/tcp.cif(sk->debug)
sk2806net/inet/tcp.creset_timer(sk, TIME_WRITE, TCP_ACK_TIME);
sk2822net/inet/tcp.cwhile (sk->prot->rspace(sk) < sk->mtu) {
sk2823net/inet/tcp.cskb1 = skb_peek(&sk->receive_queue);
sk2837net/inet/tcp.ctcp_send_ack(sk->sent_seq, sk->acked_seq, sk, th, saddr);
sk2838net/inet/tcp.csk->ack_backlog++;
sk2839net/inet/tcp.creset_timer(sk, TIME_WRITE, TCP_ACK_TIME);
sk2842net/inet/tcp.ctcp_send_ack(sk->sent_seq, sk->acked_seq, sk, th, saddr);
sk2846net/inet/tcp.cif (!sk->dead) {
sk2847net/inet/tcp.cif(sk->debug)
sk2849net/inet/tcp.csk->data_ready(sk,0);
sk2854net/inet/tcp.cif (sk->state == TCP_FIN_WAIT2 &&
sk2855net/inet/tcp.csk->acked_seq == sk->fin_seq && sk->rcv_ack_seq == sk->write_seq) {
sk2856net/inet/tcp.cDPRINTF((DBG_TCP, "tcp_data: entering last_ack state sk = %X\n", sk));
sk2859net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk2860net/inet/tcp.csk->state = TCP_LAST_ACK;
sk2861net/inet/tcp.cif (!sk->dead) sk->state_change(sk);
sk2868net/inet/tcp.cstatic void tcp_check_urg(struct sock * sk, struct tcphdr * th)
sk2877net/inet/tcp.cif (after(sk->copied_seq+1, ptr))
sk2881net/inet/tcp.cif (sk->urg_data && !after(ptr, sk->urg_seq))
sk2885net/inet/tcp.cif (sk->proc != 0) {
sk2886net/inet/tcp.cif (sk->proc > 0) {
sk2887net/inet/tcp.ckill_proc(sk->proc, SIGURG, 1);
sk2889net/inet/tcp.ckill_pg(-sk->proc, SIGURG, 1);
sk2892net/inet/tcp.csk->urg_data = URG_NOTYET;
sk2893net/inet/tcp.csk->urg_seq = ptr;
sk2896net/inet/tcp.cstatic inline int tcp_urg(struct sock *sk, struct tcphdr *th,
sk2903net/inet/tcp.ctcp_check_urg(sk,th);
sk2906net/inet/tcp.cif (sk->urg_data != URG_NOTYET)
sk2910net/inet/tcp.cptr = sk->urg_seq - th->seq + th->doff*4;
sk2915net/inet/tcp.csk->urg_data = URG_VALID | *(ptr + (unsigned char *) th);
sk2916net/inet/tcp.cif (!sk->dead)
sk2917net/inet/tcp.csk->data_ready(sk,0);
sk2926net/inet/tcp.cstatic int tcp_fin(struct sock *sk, struct tcphdr *th, 
sk2930net/inet/tcp.csk, th, saddr, dev));
sk2932net/inet/tcp.cif (!sk->dead) 
sk2934net/inet/tcp.csk->state_change(sk);
sk2937net/inet/tcp.cswitch(sk->state) 
sk2943net/inet/tcp.creset_timer(sk, TIME_CLOSE, TCP_TIMEOUT_LEN);
sk2944net/inet/tcp.csk->fin_seq = th->seq+1;
sk2946net/inet/tcp.csk->state = TCP_CLOSE_WAIT;
sk2948net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk2957net/inet/tcp.csk->fin_seq = th->seq+1;
sk2958net/inet/tcp.csk->state = TCP_FIN_WAIT2;
sk2963net/inet/tcp.csk->state = TCP_LAST_ACK;
sk2966net/inet/tcp.creset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN);
sk2969net/inet/tcp.csk->ack_backlog++;
sk2977net/inet/tcp.ctcp_accept(struct sock *sk, int flags)
sk2983net/inet/tcp.csk, flags, in_ntoa(sk->saddr)));
sk2989net/inet/tcp.cif (sk->state != TCP_LISTEN) {
sk2990net/inet/tcp.csk->err = EINVAL;
sk2996net/inet/tcp.csk->inuse = 1;
sk2997net/inet/tcp.cwhile((skb = skb_dequeue(&sk->receive_queue)) == NULL) {
sk3000net/inet/tcp.crelease_sock(sk);
sk3001net/inet/tcp.csk->err = EAGAIN;
sk3005net/inet/tcp.crelease_sock(sk);
sk3006net/inet/tcp.cinterruptible_sleep_on(sk->sleep);
sk3009net/inet/tcp.csk->err = ERESTARTSYS;
sk3012net/inet/tcp.csk->inuse = 1;
sk3017net/inet/tcp.cnewsk = skb->sk;
sk3020net/inet/tcp.csk->ack_backlog--;
sk3021net/inet/tcp.crelease_sock(sk);
sk3030net/inet/tcp.cstatic int tcp_connect(struct sock *sk, struct sockaddr_in *usin, int addr_len)
sk3040net/inet/tcp.cif (sk->state != TCP_CLOSE) 
sk3077net/inet/tcp.cif(sk->saddr == sin.sin_addr.s_addr && sk->num==ntohs(sin.sin_port))
sk3080net/inet/tcp.csk->inuse = 1;
sk3081net/inet/tcp.csk->daddr = sin.sin_addr.s_addr;
sk3082net/inet/tcp.csk->write_seq = jiffies * SEQ_TICK - seq_offset;
sk3083net/inet/tcp.csk->window_seq = sk->write_seq;
sk3084net/inet/tcp.csk->rcv_ack_seq = sk->write_seq -1;
sk3085net/inet/tcp.csk->err = 0;
sk3086net/inet/tcp.csk->dummy_th.dest = sin.sin_port;
sk3087net/inet/tcp.crelease_sock(sk);
sk3089net/inet/tcp.cbuff = sk->prot->wmalloc(sk,MAX_SYN_SIZE,0, GFP_KERNEL);
sk3094net/inet/tcp.csk->inuse = 1;
sk3096net/inet/tcp.cbuff->sk = sk;
sk3098net/inet/tcp.cbuff->localroute = sk->localroute;
sk3110net/inet/tcp.ctmp = sk->prot->build_header(buff, sk->saddr, sk->daddr, &dev,
sk3111net/inet/tcp.cIPPROTO_TCP, NULL, MAX_SYN_SIZE,sk->ip_tos,sk->ip_ttl);
sk3114net/inet/tcp.csk->prot->wfree(sk, buff->mem_addr, buff->mem_len);
sk3115net/inet/tcp.crelease_sock(sk);
sk3122net/inet/tcp.cmemcpy(t1,(void *)&(sk->dummy_th), sizeof(*t1));
sk3123net/inet/tcp.ct1->seq = ntohl(sk->write_seq++);
sk3124net/inet/tcp.csk->sent_seq = sk->write_seq;
sk3125net/inet/tcp.cbuff->h.seq = sk->write_seq;
sk3138net/inet/tcp.cif (sk->user_mss)
sk3139net/inet/tcp.csk->mtu = sk->user_mss;
sk3143net/inet/tcp.cif ((sk->saddr ^ sk->daddr) & default_mask(sk->saddr))
sk3145net/inet/tcp.cif ((sk->saddr ^ sk->daddr) & dev->pa_mask)
sk3147net/inet/tcp.csk->mtu = 576 - HEADER_SIZE;
sk3149net/inet/tcp.csk->mtu = MAX_WINDOW;
sk3155net/inet/tcp.csk->mtu = min(sk->mtu, dev->mtu - HEADER_SIZE);
sk3164net/inet/tcp.cptr[2] = (sk->mtu) >> 8;
sk3165net/inet/tcp.cptr[3] = (sk->mtu) & 0xff;
sk3166net/inet/tcp.ctcp_send_check(t1, sk->saddr, sk->daddr,
sk3167net/inet/tcp.csizeof(struct tcphdr) + 4, sk);
sk3173net/inet/tcp.csk->state = TCP_SYN_SENT;
sk3174net/inet/tcp.csk->rtt = TCP_CONNECT_TIME;
sk3175net/inet/tcp.creset_timer(sk, TIME_WRITE, TCP_CONNECT_TIME);  /* Timer for repeating the SYN until an answer */
sk3176net/inet/tcp.csk->retransmits = TCP_RETR2 - TCP_SYN_RETRIES;
sk3178net/inet/tcp.csk->prot->queue_xmit(sk, dev, buff, 0);  
sk3182net/inet/tcp.crelease_sock(sk);
sk3189net/inet/tcp.ctcp_sequence(struct sock *sk, struct tcphdr *th, short len,
sk3198net/inet/tcp.cif (next_seq && !sk->window)
sk3210net/inet/tcp.cif (!after(next_seq+1, sk->acked_seq))
sk3213net/inet/tcp.cif (!before(th->seq, sk->acked_seq + sk->window + 1))
sk3232net/inet/tcp.cif (sk->state==TCP_SYN_SENT || sk->state==TCP_SYN_RECV) {
sk3233net/inet/tcp.ctcp_reset(sk->saddr,sk->daddr,th,sk->prot,NULL,dev, sk->ip_tos,sk->ip_ttl);
sk3238net/inet/tcp.ctcp_send_ack(sk->sent_seq, sk->acked_seq, sk, th, saddr);
sk3249net/inet/tcp.cstruct sock *sk;
sk3267net/inet/tcp.csk = get_sock(&tcp_prot, th->dest, saddr, th->source, daddr);
sk3273net/inet/tcp.cif (sk!=NULL && sk->zapped)
sk3274net/inet/tcp.csk=NULL;
sk3276net/inet/tcp.cif (sk) {
sk3277net/inet/tcp.cDPRINTF((DBG_TCP, "sk = %X:\n", sk));
sk3282net/inet/tcp.cskb->sk = NULL;
sk3296net/inet/tcp.cif (sk == NULL) {
sk3299net/inet/tcp.cskb->sk = NULL;
sk3305net/inet/tcp.cskb->sk = sk;
sk3314net/inet/tcp.cif (sk->inuse) {
sk3315net/inet/tcp.cskb_queue_head(&sk->back_log, skb);
sk3319net/inet/tcp.csk->inuse = 1;
sk3322net/inet/tcp.cif (!sk) {
sk3328net/inet/tcp.cif (!sk->prot) {
sk3334net/inet/tcp.cif (sk->rmem_alloc + skb->mem_len >= sk->rcvbuf) {
sk3335net/inet/tcp.cskb->sk = NULL;
sk3338net/inet/tcp.crelease_sock(sk);
sk3341net/inet/tcp.csk->rmem_alloc += skb->mem_len;
sk3346net/inet/tcp.cswitch(sk->state) {
sk3353net/inet/tcp.csk->zapped=1;
sk3354net/inet/tcp.csk->err = ECONNRESET;
sk3355net/inet/tcp.csk->state = TCP_CLOSE;
sk3356net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk3357net/inet/tcp.cif (!sk->dead) {
sk3358net/inet/tcp.csk->state_change(sk);
sk3361net/inet/tcp.crelease_sock(sk);
sk3370net/inet/tcp.cif (!tcp_sequence(sk, th, len, opt, saddr,dev)) {
sk3374net/inet/tcp.crelease_sock(sk);
sk3382net/inet/tcp.csk->zapped=1;
sk3384net/inet/tcp.csk->err = ECONNRESET;
sk3386net/inet/tcp.cif (sk->state == TCP_CLOSE_WAIT) 
sk3388net/inet/tcp.csk->err = EPIPE;
sk3395net/inet/tcp.csk->state = TCP_CLOSE;
sk3396net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk3397net/inet/tcp.cif (!sk->dead) 
sk3399net/inet/tcp.csk->state_change(sk);
sk3402net/inet/tcp.crelease_sock(sk);
sk3409net/inet/tcp.csk->err = ECONNRESET;
sk3410net/inet/tcp.csk->state = TCP_CLOSE;
sk3411net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk3412net/inet/tcp.ctcp_reset(daddr, saddr,  th, sk->prot, opt,dev, sk->ip_tos,sk->ip_ttl);
sk3413net/inet/tcp.cif (!sk->dead) {
sk3414net/inet/tcp.csk->state_change(sk);
sk3417net/inet/tcp.crelease_sock(sk);
sk3421net/inet/tcp.cif (th->ack && !tcp_ack(sk, th, saddr, len)) {
sk3423net/inet/tcp.crelease_sock(sk);
sk3427net/inet/tcp.cif (tcp_urg(sk, th, saddr, len)) {
sk3429net/inet/tcp.crelease_sock(sk);
sk3433net/inet/tcp.cif (tcp_data(skb, sk, saddr, len)) {
sk3435net/inet/tcp.crelease_sock(sk);
sk3440net/inet/tcp.cif (th->fin && tcp_fin(sk, th, saddr, dev)) {
sk3442net/inet/tcp.crelease_sock(sk);
sk3446net/inet/tcp.crelease_sock(sk);
sk3450net/inet/tcp.cif (sk->dead || sk->daddr) {
sk3453net/inet/tcp.crelease_sock(sk);
sk3460net/inet/tcp.ctcp_reset(daddr, saddr, th, sk->prot, opt,dev,sk->ip_tos,sk->ip_ttl);
sk3463net/inet/tcp.crelease_sock(sk);
sk3469net/inet/tcp.crelease_sock(sk);
sk3473net/inet/tcp.ctcp_reset(daddr, saddr, th, sk->prot, opt,dev,sk->ip_tos,sk->ip_ttl);
sk3475net/inet/tcp.crelease_sock(sk);
sk3487net/inet/tcp.ctcp_conn_request(sk, skb, daddr, saddr, opt, dev);
sk3488net/inet/tcp.crelease_sock(sk);
sk3493net/inet/tcp.crelease_sock(sk);
sk3500net/inet/tcp.crelease_sock(sk);
sk3506net/inet/tcp.cif (!tcp_sequence(sk, th, len, opt, saddr,dev)) 
sk3509net/inet/tcp.crelease_sock(sk);
sk3517net/inet/tcp.csk->err = ECONNREFUSED;
sk3518net/inet/tcp.csk->state = TCP_CLOSE;
sk3519net/inet/tcp.csk->shutdown = SHUTDOWN_MASK;
sk3520net/inet/tcp.csk->zapped = 1;
sk3521net/inet/tcp.cif (!sk->dead) 
sk3523net/inet/tcp.csk->state_change(sk);
sk3526net/inet/tcp.crelease_sock(sk);
sk3533net/inet/tcp.csk->state = TCP_SYN_RECV;
sk3537net/inet/tcp.crelease_sock(sk);
sk3541net/inet/tcp.cswitch(sk->state) 
sk3544net/inet/tcp.cif (!tcp_ack(sk, th, saddr, len)) 
sk3548net/inet/tcp.csk->prot, opt,dev,sk->ip_tos,sk->ip_ttl);
sk3550net/inet/tcp.crelease_sock(sk);
sk3561net/inet/tcp.crelease_sock(sk);
sk3566net/inet/tcp.csk->acked_seq = th->seq+1;
sk3567net/inet/tcp.csk->fin_seq = th->seq;
sk3568net/inet/tcp.ctcp_send_ack(sk->sent_seq, th->seq+1,
sk3569net/inet/tcp.csk, th, sk->daddr);
sk3572net/inet/tcp.cif (!tcp_ack(sk, th, saddr, len)) 
sk3576net/inet/tcp.csk->prot, opt, dev,sk->ip_tos,sk->ip_ttl);
sk3578net/inet/tcp.crelease_sock(sk);
sk3583net/inet/tcp.csk->state = TCP_ESTABLISHED;
sk3590net/inet/tcp.ctcp_options(sk, th);
sk3591net/inet/tcp.csk->dummy_th.dest = th->source;
sk3592net/inet/tcp.csk->copied_seq = sk->acked_seq-1;
sk3593net/inet/tcp.cif (!sk->dead) {
sk3594net/inet/tcp.csk->state_change(sk);
sk3606net/inet/tcp.cif (sk->max_window == 0) {
sk3607net/inet/tcp.csk->max_window = 32;
sk3608net/inet/tcp.csk->mss = min(sk->max_window, sk->mtu);
sk3616net/inet/tcp.cif (tcp_urg(sk, th, saddr, len)) { 
sk3618net/inet/tcp.crelease_sock(sk);
sk3622net/inet/tcp.cif (tcp_data(skb, sk, saddr, len))
sk3625net/inet/tcp.cif (th->fin) tcp_fin(sk, th, saddr, dev);
sk3626net/inet/tcp.crelease_sock(sk);
sk3631net/inet/tcp.cif (tcp_urg(sk, th, saddr, len)) {
sk3633net/inet/tcp.crelease_sock(sk);
sk3638net/inet/tcp.cif (tcp_data(skb, sk, saddr, len)) {
sk3640net/inet/tcp.crelease_sock(sk);
sk3645net/inet/tcp.crelease_sock(sk);
sk3648net/inet/tcp.ctcp_fin(sk, th, saddr, dev);
sk3649net/inet/tcp.crelease_sock(sk);
sk3660net/inet/tcp.cstatic void tcp_write_wakeup(struct sock *sk)
sk3667net/inet/tcp.cif (sk->zapped)
sk3670net/inet/tcp.cif (sk -> state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT &&
sk3671net/inet/tcp.csk -> state != TCP_FIN_WAIT1 && sk->state != TCP_FIN_WAIT2)
sk3674net/inet/tcp.cbuff = sk->prot->wmalloc(sk,MAX_ACK_SIZE,1, GFP_ATOMIC);
sk3680net/inet/tcp.cbuff->sk = sk;
sk3681net/inet/tcp.cbuff->localroute = sk->localroute;
sk3687net/inet/tcp.ctmp = sk->prot->build_header(buff, sk->saddr, sk->daddr, &dev,
sk3688net/inet/tcp.cIPPROTO_TCP, sk->opt, MAX_ACK_SIZE,sk->ip_tos,sk->ip_ttl);
sk3691net/inet/tcp.csk->prot->wfree(sk, buff->mem_addr, buff->mem_len);
sk3698net/inet/tcp.cmemcpy(t1,(void *) &sk->dummy_th, sizeof(*t1));
sk3704net/inet/tcp.ct1->seq = htonl(sk->sent_seq-1);
sk3713net/inet/tcp.ct1->ack_seq = ntohl(sk->acked_seq);
sk3714net/inet/tcp.ct1->window = ntohs(tcp_select_window(sk)/*sk->prot->rspace(sk)*/);
sk3716net/inet/tcp.ctcp_send_check(t1, sk->saddr, sk->daddr, sizeof(*t1), sk);
sk3721net/inet/tcp.csk->prot->queue_xmit(sk, dev, buff, 1);
sk3726net/inet/tcp.ctcp_send_probe0(struct sock *sk)
sk3728net/inet/tcp.cif (sk->zapped)
sk3731net/inet/tcp.ctcp_write_wakeup(sk);
sk3733net/inet/tcp.csk->backoff++;
sk3734net/inet/tcp.csk->rto = min(sk->rto << 1, 120*HZ);
sk3735net/inet/tcp.creset_timer (sk, TIME_PROBE0, sk->rto);
sk3736net/inet/tcp.csk->retransmits++;
sk3737net/inet/tcp.csk->prot->retransmits ++;
sk3744net/inet/tcp.cint tcp_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen)
sk3749net/inet/tcp.creturn ip_setsockopt(sk,level,optname,optval,optlen);
sk3771net/inet/tcp.csk->user_mss=val;
sk3774net/inet/tcp.csk->nonagle=(val==0)?0:1;
sk3781net/inet/tcp.cint tcp_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen)
sk3786net/inet/tcp.creturn ip_getsockopt(sk,level,optname,optval,optlen);
sk3791net/inet/tcp.cval=sk->user_mss;
sk3794net/inet/tcp.cval=sk->nonagle;  /* Until Johannes stuff is in */
sk118net/inet/tcp.hextern void  tcp_shutdown (struct sock *sk, int how);
sk124net/inet/tcp.hextern int  tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
sk126net/inet/tcp.hextern void tcp_send_probe0(struct sock *sk);
sk91net/inet/timer.cstruct sock *sk = (struct sock*)data;
sk92net/inet/timer.cint why = sk->timeout;
sk96net/inet/timer.cif (sk->inuse || in_bh) {
sk97net/inet/timer.csk->timer.expires = 10;
sk98net/inet/timer.cadd_timer(&sk->timer);
sk102net/inet/timer.csk->inuse = 1;
sk105net/inet/timer.cDPRINTF ((DBG_TMR, "net_timer: found sk=%X why = %d\n", sk, why));
sk106net/inet/timer.cif (skb_peek(&sk->write_queue) && 
sk107net/inet/timer.cbefore(sk->window_seq, sk->write_queue.next->h.seq) &&
sk108net/inet/timer.csk->send_head == NULL &&
sk109net/inet/timer.csk->ack_backlog == 0 &&
sk110net/inet/timer.csk->state != TCP_TIME_WAIT)
sk111net/inet/timer.creset_timer(sk, TIME_PROBE0, sk->rto);
sk112net/inet/timer.celse if (sk->keepopen)
sk113net/inet/timer.creset_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
sk116net/inet/timer.cif (sk->ack_backlog) {
sk117net/inet/timer.csk->prot->read_wakeup (sk);
sk118net/inet/timer.cif (! sk->dead)
sk119net/inet/timer.csk->data_ready(sk,0);
sk125net/inet/timer.cif (! sk->dead || sk->state != TCP_CLOSE) {
sk127net/inet/timer.crelease_sock (sk);
sk130net/inet/timer.cdestroy_sock (sk);
sk136net/inet/timer.cif(sk->wmem_alloc!=0 || sk->rmem_alloc!=0)
sk138net/inet/timer.cDPRINTF ((DBG_TMR, "possible memory leak.  sk = %X\n", sk));
sk139net/inet/timer.csk->wmem_alloc++;  /* So it DOESNT go away */
sk140net/inet/timer.cdestroy_sock (sk);
sk141net/inet/timer.csk->wmem_alloc--;  /* Might now have hit 0 - fall through and do it again if so */
sk142net/inet/timer.csk->inuse = 0;  /* This will be ok, the destroy won't totally work */
sk144net/inet/timer.cif(sk->wmem_alloc==0 && sk->rmem_alloc==0)
sk145net/inet/timer.cdestroy_sock(sk);  /* Socket gone, DONT update sk->inuse! */
sk149net/inet/timer.csk->state = TCP_CLOSE;
sk150net/inet/timer.cdelete_timer (sk);
sk152net/inet/timer.carp_destroy (sk->daddr, 0);
sk153net/inet/timer.cif (!sk->dead)
sk154net/inet/timer.csk->state_change(sk);
sk155net/inet/timer.csk->shutdown = SHUTDOWN_MASK;
sk156net/inet/timer.creset_timer (sk, TIME_DESTROY, TCP_DONE_TIME);
sk157net/inet/timer.crelease_sock (sk);
sk160net/inet/timer.ctcp_send_probe0(sk);
sk161net/inet/timer.crelease_sock (sk);
sk173net/inet/timer.cskb = sk->send_head;
sk177net/inet/timer.cif (jiffies < skb->when + sk->rto) {
sk178net/inet/timer.creset_timer (sk, TIME_WRITE, skb->when + sk->rto - jiffies);
sk180net/inet/timer.crelease_sock (sk);
sk187net/inet/timer.csk->prot->retransmit (sk, 0);
sk188net/inet/timer.cif ((sk->state == TCP_ESTABLISHED && sk->retransmits && !(sk->retransmits & 7))
sk189net/inet/timer.c|| (sk->state != TCP_ESTABLISHED && sk->retransmits > TCP_RETR1)) {
sk191net/inet/timer.carp_destroy (sk->daddr, 0);
sk192net/inet/timer.cip_route_check (sk->daddr);
sk194net/inet/timer.cif (sk->state != TCP_ESTABLISHED && sk->retransmits > TCP_RETR2) {
sk196net/inet/timer.csk->err = ETIMEDOUT;
sk197net/inet/timer.cif (sk->state == TCP_FIN_WAIT1 || sk->state == TCP_FIN_WAIT2
sk198net/inet/timer.c|| sk->state == TCP_LAST_ACK) {
sk199net/inet/timer.csk->state = TCP_TIME_WAIT;
sk200net/inet/timer.creset_timer (sk, TIME_CLOSE, TCP_TIMEWAIT_LEN);
sk202net/inet/timer.csk->prot->close (sk, 1);
sk207net/inet/timer.crelease_sock (sk);
sk212net/inet/timer.cif (sk->prot->write_wakeup)
sk213net/inet/timer.csk->prot->write_wakeup (sk);
sk214net/inet/timer.csk->retransmits++;
sk215net/inet/timer.cif (sk->shutdown == SHUTDOWN_MASK) {
sk216net/inet/timer.csk->prot->close (sk, 1);
sk217net/inet/timer.csk->state = TCP_CLOSE;
sk220net/inet/timer.cif ((sk->state == TCP_ESTABLISHED && sk->retransmits && !(sk->retransmits & 7))
sk221net/inet/timer.c|| (sk->state != TCP_ESTABLISHED && sk->retransmits > TCP_RETR1)) {
sk223net/inet/timer.carp_destroy (sk->daddr, 0);
sk224net/inet/timer.cip_route_check (sk->daddr);
sk225net/inet/timer.crelease_sock (sk);
sk228net/inet/timer.cif (sk->state != TCP_ESTABLISHED && sk->retransmits > TCP_RETR2) {
sk230net/inet/timer.carp_destroy (sk->daddr, 0);
sk231net/inet/timer.csk->err = ETIMEDOUT;
sk232net/inet/timer.cif (sk->state == TCP_FIN_WAIT1 || sk->state == TCP_FIN_WAIT2) {
sk233net/inet/timer.csk->state = TCP_TIME_WAIT;
sk234net/inet/timer.cif (!sk->dead)
sk235net/inet/timer.csk->state_change(sk);
sk236net/inet/timer.crelease_sock (sk);
sk238net/inet/timer.csk->prot->close (sk, 1);
sk242net/inet/timer.crelease_sock (sk);
sk246net/inet/timer.crelease_sock (sk);
sk111net/inet/udp.cstruct sock *sk;
sk124net/inet/udp.csk = get_sock(&udp_prot, th->source, daddr, th->dest, saddr);
sk126net/inet/udp.cif (sk == NULL) 
sk131net/inet/udp.cif (sk->cong_window > 1) 
sk132net/inet/udp.csk->cong_window = sk->cong_window/2;
sk136net/inet/udp.csk->err = icmp_err_convert[err & 0xff].errno;
sk143net/inet/udp.cif (icmp_err_convert[err & 0xff].fatal && sk->state == TCP_ESTABLISHED) 
sk145net/inet/udp.csk->err=ECONNREFUSED;
sk148net/inet/udp.csk->error_report(sk);
sk236net/inet/udp.cunsigned long daddr, int len, struct sock *sk)
sk239net/inet/udp.cif (sk && sk->no_check) 
sk253net/inet/udp.cstatic int udp_send(struct sock *sk, struct sockaddr_in *sin,
sk276net/inet/udp.csize = sk->prot->max_header + len;
sk277net/inet/udp.cskb = sk->prot->wmalloc(sk, size, 0, GFP_KERNEL);
sk283net/inet/udp.cskb->sk       = NULL;  /* to avoid changing sk->saddr */
sk285net/inet/udp.cskb->localroute = sk->localroute|(rt&MSG_DONTROUTE);
sk296net/inet/udp.ctmp = sk->prot->build_header(skb, saddr, sin->sin_addr.s_addr,
sk297net/inet/udp.c&dev, IPPROTO_UDP, sk->opt, skb->mem_len,sk->ip_tos,sk->ip_ttl);
sk298net/inet/udp.cskb->sk=sk;  /* So memory is freed correctly */
sk306net/inet/udp.csk->prot->wfree(sk, skb->mem_addr, skb->mem_len);
sk323net/inet/udp.cuh->source = sk->dummy_th.source;
sk337net/inet/udp.cudp_send_check(uh, saddr, sin->sin_addr.s_addr, skb->len - tmp, sk);
sk345net/inet/udp.csk->prot->queue_xmit(sk, dev, skb, 1);
sk350net/inet/udp.cstatic int udp_sendto(struct sock *sk, unsigned char *from, int len, int noblock,
sk388net/inet/udp.cif (sk->state != TCP_ESTABLISHED) 
sk391net/inet/udp.csin.sin_port = sk->dummy_th.dest;
sk392net/inet/udp.csin.sin_addr.s_addr = sk->daddr;
sk403net/inet/udp.cif(!sk->broadcast && ip_chk_addr(sin.sin_addr.s_addr)==IS_BROADCAST)
sk406net/inet/udp.csk->inuse = 1;
sk409net/inet/udp.ctmp = udp_send(sk, &sin, from, len, flags);
sk412net/inet/udp.crelease_sock(sk);
sk420net/inet/udp.cstatic int udp_write(struct sock *sk, unsigned char *buff, int len, int noblock,
sk423net/inet/udp.creturn(udp_sendto(sk, buff, len, noblock, flags, NULL, 0));
sk431net/inet/udp.cint udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
sk461net/inet/udp.cif (sk->state == TCP_LISTEN) return(-EINVAL);
sk462net/inet/udp.camount = sk->prot->wspace(sk)/*/2*/;
sk476net/inet/udp.cif (sk->state == TCP_LISTEN) return(-EINVAL);
sk478net/inet/udp.cskb = skb_peek(&sk->receive_queue);
sk507net/inet/udp.cint udp_recvfrom(struct sock *sk, unsigned char *to, int len,
sk521net/inet/udp.cif (sk->err) 
sk525net/inet/udp.cerr = -sk->err;
sk526net/inet/udp.csk->err = 0;
sk567net/inet/udp.cskb=skb_recv_datagram(sk,flags,noblock,&er);
sk578net/inet/udp.csk->stamp=skb->stamp;
sk592net/inet/udp.crelease_sock(sk);
sk600net/inet/udp.cint udp_read(struct sock *sk, unsigned char *buff, int len, int noblock,
sk603net/inet/udp.creturn(udp_recvfrom(sk, buff, len, noblock, flags, NULL, NULL));
sk608net/inet/udp.cudp_connect(struct sock *sk, struct sockaddr_in *usin, int addr_len)
sk626net/inet/udp.cif(!sk->broadcast && ip_chk_addr(sin.sin_addr.s_addr)==IS_BROADCAST)
sk629net/inet/udp.csk->daddr = sin.sin_addr.s_addr;
sk630net/inet/udp.csk->dummy_th.dest = sin.sin_port;
sk631net/inet/udp.csk->state = TCP_ESTABLISHED;
sk637net/inet/udp.cudp_close(struct sock *sk, int timeout)
sk639net/inet/udp.csk->inuse = 1;
sk640net/inet/udp.csk->state = TCP_CLOSE;
sk641net/inet/udp.cif (sk->dead) destroy_sock(sk);
sk642net/inet/udp.celse release_sock(sk);
sk654net/inet/udp.cstruct sock *sk;
sk665net/inet/udp.csk = get_sock(&udp_prot, uh->dest, saddr, uh->source, daddr);
sk666net/inet/udp.cif (sk == NULL) 
sk677net/inet/udp.cskb->sk = NULL;
sk691net/inet/udp.cskb->sk = sk;
sk707net/inet/udp.cif (sk->rmem_alloc + skb->mem_len >= sk->rcvbuf) 
sk712net/inet/udp.cskb->sk = NULL;
sk714net/inet/udp.crelease_sock(sk);
sk717net/inet/udp.csk->rmem_alloc += skb->mem_len;
sk732net/inet/udp.cskb_queue_tail(&sk->receive_queue,skb);
sk735net/inet/udp.cif (!sk->dead) 
sk736net/inet/udp.csk->data_ready(sk,skb->len);
sk738net/inet/udp.crelease_sock(sk);
sk36net/inet/udp.hextern int  udp_recvfrom(struct sock *sk, unsigned char *to,
sk39net/inet/udp.hextern int  udp_read(struct sock *sk, unsigned char *buff,
sk41net/inet/udp.hextern int  udp_connect(struct sock *sk,
sk47net/inet/udp.hextern int  udp_ioctl(struct sock *sk, int cmd, unsigned long arg);