taglinefilesource code
iph113arch/alpha/lib/checksum.cunsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl)
iph115arch/alpha/lib/checksum.creturn ~do_csum(iph,ihl*4);
iph1146drivers/net/ppp.cstruct iphdr *iph = (struct iphdr *) c;
iph1148drivers/net/ppp.ciph->saddr, iph->daddr, count))
iph1815drivers/net/ppp.cstruct iphdr *iph = (struct iphdr *)skb->data;
iph1817drivers/net/ppp.cdev->name, (int) proto, (int) len, (int) iph->saddr,
iph1818drivers/net/ppp.c(int) iph->daddr, (int) iph->protocol))
iph126drivers/net/tunnel.cstruct iphdr *iph;    /* Our new IP header */
iph162drivers/net/tunnel.ciph=(struct iphdr *)skb->data;
iph163drivers/net/tunnel.cif ( iph->version != 4 ) 
iph168drivers/net/tunnel.cprintk("%s: Bad IP packet: ip version %d\n", dev->name, iph->version);
iph179drivers/net/tunnel.cif ( iph->protocol == IPPROTO_IPIP && iph->saddr == dev->pa_addr ) 
iph190drivers/net/tunnel.cif ( iph->daddr == dev->pa_addr ) 
iph200drivers/net/tunnel.cprint_ip(iph);
iph220drivers/net/tunnel.ciph=skb2->h.iph=(struct iphdr *)skb2->data;
iph221drivers/net/tunnel.cmemcpy(skb2->h.iph, skb->data, ip_header_len );
iph227drivers/net/tunnel.c++iph->ttl;  /* Note: ip_forward() decrements ttl, so compensate */
iph228drivers/net/tunnel.ciph->saddr = dev->pa_addr;
iph229drivers/net/tunnel.ciph->daddr = dev->pa_dstaddr;
iph230drivers/net/tunnel.ciph->protocol = IPPROTO_IPIP;
iph231drivers/net/tunnel.ciph->ihl = 5;
iph232drivers/net/tunnel.ciph->tot_len = htons(skb2->len);
iph233drivers/net/tunnel.ciph->frag_off = 0;
iph237drivers/net/tunnel.ciph->check = 0;
iph238drivers/net/tunnel.ciph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
iph242drivers/net/tunnel.cprint_ip(iph);
iph248drivers/net/tunnel.cif(ip_forward(skb2, dev, 0, iph->daddr, 0))
iph9include/asm-alpha/checksum.hextern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl);
iph45include/asm-i386/checksum.hstatic inline unsigned short ip_fast_csum(unsigned char * iph,
iph68include/asm-i386/checksum.h: "=&r" (sum), "=&r" (iph), "=&r" (ihl)
iph69include/asm-i386/checksum.h: "1" (iph), "2" (ihl));
iph54include/linux/skbuff.hstruct iphdr  *iph;
iph64include/net/ip.hstruct iphdr  *iph;    /* pointer to IP header      */
iph241net/ethernet/eth.cstruct iphdr *iph;
iph259net/ethernet/eth.ciph=(struct iphdr*)(src+14);  /* 14 = Rx_addr+Tx_addr+type_field */
iph260net/ethernet/eth.cip_length = ntohs(iph->tot_len) - sizeof(struct iphdr);
iph168net/ipv4/icmp.cstruct iphdr *iph;
iph180net/ipv4/icmp.ciph = (struct iphdr *) skb_in->data;
iph193net/ipv4/icmp.catype=ip_chk_addr(iph->daddr);
iph201net/ipv4/icmp.cif(ntohs(iph->frag_off)&IP_OFFSET)
iph215net/ipv4/icmp.cif(iph->protocol==IPPROTO_ICMP)
iph217net/ipv4/icmp.cicmph = (struct icmphdr *) ((char *) iph +
iph218net/ipv4/icmp.c4 * iph->ihl);
iph302net/ipv4/icmp.cif (iph->daddr != our_addr && ip_chk_addr(iph->daddr) == IS_MYADDR)
iph303net/ipv4/icmp.cour_addr = iph->daddr;
iph304net/ipv4/icmp.coffset = ip_build_header(skb, our_addr, iph->saddr,
iph338net/ipv4/icmp.cmemcpy(icmph + 1, iph, sizeof(struct iphdr) + 8);
iph357net/ipv4/icmp.cstruct iphdr *iph;
iph362net/ipv4/icmp.ciph = (struct iphdr *) (icmph + 1);
iph373net/ipv4/icmp.cin_ntoa(iph->daddr), ntohs(iph->protocol));
iph381net/ipv4/icmp.cin_ntoa(iph->daddr));
iph386net/ipv4/icmp.cprintk("ICMP: %s: Source Route Failed.\n", in_ntoa(iph->daddr));
iph397net/ipv4/icmp.chash = iph->protocol & (MAX_INET_PROTOS -1);
iph417net/ipv4/icmp.cif (iph->protocol == ipprot->protocol && ipprot->err_handler) 
iph420net/ipv4/icmp.ciph->daddr, iph->saddr, ipprot);
iph439net/ipv4/icmp.cstruct iphdr *iph;
iph446net/ipv4/icmp.ciph = (struct iphdr *) (icmph + 1);
iph447net/ipv4/icmp.cip = iph->daddr;
iph247net/ipv4/ip.cstruct iphdr *iph;
iph344net/ipv4/ip.ciph=(struct iphdr *)skb_put(skb,sizeof(struct iphdr));
iph346net/ipv4/ip.ciph->version  = 4;
iph347net/ipv4/ip.ciph->ihl      = 5;
iph348net/ipv4/ip.ciph->tos      = tos;
iph349net/ipv4/ip.ciph->frag_off = 0;
iph350net/ipv4/ip.ciph->ttl      = ttl;
iph351net/ipv4/ip.ciph->daddr    = daddr;
iph352net/ipv4/ip.ciph->saddr    = saddr;
iph353net/ipv4/ip.ciph->protocol = type;
iph354net/ipv4/ip.cskb->ip_hdr   = iph;
iph364net/ipv4/ip.cvoid ip_send_check(struct iphdr *iph)
iph366net/ipv4/ip.ciph->check = 0;
iph367net/ipv4/ip.ciph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
iph412net/ipv4/ip.cstatic struct ipq *ip_find(struct iphdr *iph)
iph421net/ipv4/ip.cif (iph->id== qp->iph->id && iph->saddr == qp->iph->saddr &&
iph422net/ipv4/ip.ciph->daddr == qp->iph->daddr && iph->protocol == qp->iph->protocol)
iph479net/ipv4/ip.ckfree_s(qp->iph, 64 + 8);
iph522net/ipv4/ip.cstatic struct ipq *ip_create(struct sk_buff *skb, struct iphdr *iph, struct device *dev)
iph540net/ipv4/ip.cihlen = iph->ihl * 4;
iph541net/ipv4/ip.cqp->iph = (struct iphdr *) kmalloc(64 + 8, GFP_ATOMIC);
iph542net/ipv4/ip.cif (qp->iph == NULL)
iph549net/ipv4/ip.cmemcpy(qp->iph, iph, ihlen + 8);
iph613net/ipv4/ip.cstruct iphdr *iph;
iph638net/ipv4/ip.cmemcpy(ptr, ((unsigned char *) qp->iph), qp->ihlen);
iph664net/ipv4/ip.ciph = skb->h.iph;
iph665net/ipv4/ip.ciph->frag_off = 0;
iph666net/ipv4/ip.ciph->tot_len = htons((iph->ihl * 4) + count);
iph667net/ipv4/ip.cskb->ip_hdr = iph;
iph678net/ipv4/ip.cstatic struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct device *dev)
iph691net/ipv4/ip.cqp = ip_find(iph);
iph694net/ipv4/ip.coffset = ntohs(iph->frag_off);
iph725net/ipv4/ip.cif ((qp = ip_create(skb, iph, dev)) == NULL)
iph738net/ipv4/ip.cihl = iph->ihl * 4;
iph739net/ipv4/ip.cend = offset + ntohs(iph->tot_len) - ihl;
iph874net/ipv4/ip.cstruct iphdr *iph;
iph888net/ipv4/ip.ciph = (struct iphdr *) (raw + dev->hard_header_len);  
iph889net/ipv4/ip.cskb->ip_hdr = iph;
iph891net/ipv4/ip.ciph = skb->ip_hdr;
iph898net/ipv4/ip.chlen = iph->ihl * 4;
iph899net/ipv4/ip.cleft = ntohs(iph->tot_len) - hlen;  /* Space per frame */
iph908net/ipv4/ip.cif (ntohs(iph->frag_off) & IP_DF)
iph942net/ipv4/ip.coffset = (ntohs(iph->frag_off) & IP_OFFSET) << 3;
iph1017net/ipv4/ip.ciph = (struct iphdr *)(skb2->h.raw/*+dev->hard_header_len*/);
iph1018net/ipv4/ip.ciph->frag_off = htons((offset >> 3));
iph1019net/ipv4/ip.cskb2->ip_hdr = iph;
iph1025net/ipv4/ip.ciph->frag_off |= htons(IP_MF);
iph1051net/ipv4/ip.cstruct iphdr *iph;  /* Our header */
iph1067net/ipv4/ip.cfw_res=ip_fw_chk(skb->h.iph, dev, ip_fw_fwd_chain, ip_fw_fwd_policy, 0);
iph1093net/ipv4/ip.ciph = skb->h.iph;
iph1094net/ipv4/ip.ciph->ttl--;
iph1102net/ipv4/ip.ciph->check = ntohs(iph->check) + 0x0100;
iph1103net/ipv4/ip.cif ((iph->check & 0xFF00) == 0)
iph1104net/ipv4/ip.ciph->check++;    /* carry overflow */
iph1105net/ipv4/ip.ciph->check = htons(iph->check);
iph1107net/ipv4/ip.cif (iph->ttl <= 0)
iph1185net/ipv4/ip.cif (dev == dev2 && !((iph->saddr^iph->daddr)&dev->pa_mask) && (rt->rt_flags&RTF_MODIFIED))
iph1277net/ipv4/ip.cip_fw_chk(iph,dev,ip_acct_chain,IP_FW_F_ACCEPT,1);
iph1285net/ipv4/ip.cif(iph->tos & IPTOS_LOWDELAY)
iph1287net/ipv4/ip.celse if(iph->tos & IPTOS_THROUGHPUT)
iph1317net/ipv4/ip.cstruct iphdr *iph = skb->h.iph;
iph1335net/ipv4/ip.cif(iph->version == 6)
iph1345net/ipv4/ip.cskb->ip_hdr = iph;
iph1360net/ipv4/ip.cif (skb->len<sizeof(struct iphdr) || iph->ihl<5 || iph->version != 4 || ip_fast_csum((unsigned char *)iph, iph->ihl) !=0
iph1361net/ipv4/ip.c|| skb->len < ntohs(iph->tot_len))
iph1374net/ipv4/ip.cskb_trim(skb,ntohs(iph->tot_len));
iph1382net/ipv4/ip.cif ((err=ip_fw_chk(iph,dev,ip_fw_blk_chain,ip_fw_blk_policy, 0))<1)
iph1398net/ipv4/ip.ctarget_addr = iph->daddr;
iph1400net/ipv4/ip.cif (iph->ihl != 5)
iph1412net/ipv4/ip.cint opt_space=4*(iph->ihl-5);
iph1454net/ipv4/ip.cif (iph->daddr!=skb->dev->pa_addr && (brd = ip_chk_addr(iph->daddr)) == 0) 
iph1458net/ipv4/ip.cif(ip_chk_addr(iph->daddr))
iph1474net/ipv4/ip.cif(ip_chk_addr(iph->daddr))
iph1503net/ipv4/ip.cif(iph->frag_off)
iph1505net/ipv4/ip.cif (iph->frag_off & htons(IP_MF))
iph1511net/ipv4/ip.cif (iph->frag_off & htons(IP_OFFSET))
iph1527net/ipv4/ip.cif ( iph->daddr == skb->dev->pa_addr || (brd = ip_chk_addr(iph->daddr)) != 0)
iph1530net/ipv4/ip.cif(!(dev->flags&IFF_ALLMULTI) && brd==IS_MULTICAST && iph->daddr!=IGMP_ALL_HOSTS && !(dev->flags&IFF_LOOPBACK))
iph1543net/ipv4/ip.cif(ip_mc->multiaddr==iph->daddr)
iph1557net/ipv4/ip.cstruct iphdr *iph=skb->h.iph;
iph1558net/ipv4/ip.cif(ip_forward(skb, dev, is_frag|4, iph->daddr, 0))
iph1569net/ipv4/ip.cip_fw_chk(iph,dev,ip_acct_chain,IP_FW_F_ACCEPT,1);
iph1579net/ipv4/ip.cskb=ip_defrag(iph,skb,dev);
iph1583net/ipv4/ip.ciph=skb->h.iph;
iph1590net/ipv4/ip.cskb->ip_hdr = iph;
iph1591net/ipv4/ip.cskb->h.raw += iph->ihl*4;
iph1599net/ipv4/ip.chash = iph->protocol & (SOCK_ARRAY_SIZE-1);
iph1609net/ipv4/ip.craw_sk=get_sock_raw(raw_sk, iph->protocol,  iph->saddr, iph->daddr);
iph1615net/ipv4/ip.csknext=get_sock_raw(raw_sk->next, iph->protocol, iph->saddr, iph->daddr);
iph1621net/ipv4/ip.craw_rcv(raw_sk, skb1, dev, iph->saddr,iph->daddr);
iph1640net/ipv4/ip.chash = iph->protocol & (MAX_INET_PROTOS -1);
iph1645net/ipv4/ip.cif (ipprot->protocol != iph->protocol)
iph1672net/ipv4/ip.cipprot->handler(skb2, dev, NULL, iph->daddr,
iph1673net/ipv4/ip.c(ntohs(iph->tot_len) - (iph->ihl * 4)),
iph1674net/ipv4/ip.ciph->saddr, 0, ipprot);
iph1686net/ipv4/ip.craw_rcv(raw_sk, skb, dev, iph->saddr, iph->daddr);
iph1784net/ipv4/ip.cstruct iphdr *iph;
iph1815net/ipv4/ip.ciph = (struct iphdr *)ptr;  
iph1816net/ipv4/ip.cskb->ip_hdr = iph;
iph1818net/ipv4/ip.ciph = skb->ip_hdr;
iph1820net/ipv4/ip.ciph->tot_len = ntohs(skb->len-(((unsigned char *)iph)-skb->data));
iph1823net/ipv4/ip.cif(ip_fw_chk(iph, dev, ip_fw_blk_chain, ip_fw_blk_policy, 0) < 1)
iph1833net/ipv4/ip.ciph->id      = htons(ip_id_count++);
iph1849net/ipv4/ip.cif(ntohs(iph->tot_len)> dev->mtu)
iph1861net/ipv4/ip.cip_send_check(iph);
iph1925net/ipv4/ip.cip_fw_chk(iph,dev,ip_acct_chain,IP_FW_F_ACCEPT,1);
iph1934net/ipv4/ip.cif (MULTICAST(iph->daddr) && !(dev->flags&IFF_LOOPBACK))
iph1938net/ipv4/ip.cif(iph->daddr==IGMP_ALL_HOSTS || (dev->flags&IFF_ALLMULTI))
iph1947net/ipv4/ip.cif(imc->multiaddr==iph->daddr)
iph1965net/ipv4/ip.cif((dev->flags&IFF_BROADCAST) && (iph->daddr==dev->pa_brdaddr||iph->daddr==0xFFFFFFFF) && !(dev->flags&IFF_LOOPBACK))
iph2439net/ipv4/ip.cstruct iphdr *iph;
iph2560net/ipv4/ip.cskb->ip_hdr=iph=(struct iphdr *)skb_put(skb,length);
iph2564net/ipv4/ip.ciph->version=4;
iph2565net/ipv4/ip.ciph->ihl=5;
iph2566net/ipv4/ip.ciph->tos=sk->ip_tos;
iph2567net/ipv4/ip.ciph->tot_len = htons(length);
iph2568net/ipv4/ip.ciph->id=htons(ip_id_count++);
iph2569net/ipv4/ip.ciph->frag_off = 0;
iph2570net/ipv4/ip.ciph->ttl=sk->ip_ttl;
iph2571net/ipv4/ip.ciph->protocol=type;
iph2572net/ipv4/ip.ciph->saddr=saddr;
iph2573net/ipv4/ip.ciph->daddr=daddr;
iph2574net/ipv4/ip.ciph->check=0;
iph2575net/ipv4/ip.ciph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
iph2576net/ipv4/ip.cgetfrag(frag,saddr,(void *)(iph+1),0, length-20);
iph2579net/ipv4/ip.cgetfrag(frag,saddr,(void *)iph,0,length);
iph2712net/ipv4/ip.cskb->ip_hdr = iph = (struct iphdr *)data;
iph2721net/ipv4/ip.ciph->version = 4;
iph2722net/ipv4/ip.ciph->ihl = 5; /* ugh */
iph2723net/ipv4/ip.ciph->tos = sk->ip_tos;
iph2724net/ipv4/ip.ciph->tot_len = htons(fraglen - fragheaderlen + iph->ihl*4);
iph2725net/ipv4/ip.ciph->id = id;
iph2726net/ipv4/ip.ciph->frag_off = htons(offset>>3);
iph2727net/ipv4/ip.ciph->frag_off |= mf;
iph2730net/ipv4/ip.ciph->ttl = sk->ip_mc_ttl;
iph2733net/ipv4/ip.ciph->ttl = sk->ip_ttl;
iph2734net/ipv4/ip.ciph->protocol = type;
iph2735net/ipv4/ip.ciph->check = 0;
iph2736net/ipv4/ip.ciph->saddr = saddr;
iph2737net/ipv4/ip.ciph->daddr = daddr;
iph2738net/ipv4/ip.ciph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
iph2739net/ipv4/ip.cdata += iph->ihl*4;
iph2760net/ipv4/ip.cip_fw_chk(iph, dev, ip_acct_chain, IP_FW_F_ACCEPT, 1);
iph581net/ipv4/ip_fw.cstruct iphdr *iph = skb->h.iph;
iph582net/ipv4/ip_fw.cstruct tcphdr *th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]);
iph641net/ipv4/ip_fw.cms->dst      = iph->daddr;
iph719net/ipv4/ip_fw.cstruct iphdr  *iph = skb->h.iph;
iph728net/ipv4/ip_fw.cif (iph->protocol!=IPPROTO_UDP && iph->protocol!=IPPROTO_TCP)
iph735net/ipv4/ip_fw.cportptr = (unsigned short *)&(((char *)iph)[iph->ihl*4]);
iph740net/ipv4/ip_fw.cstrProt[iph->protocol==IPPROTO_TCP],
iph741net/ipv4/ip_fw.cntohl(iph->saddr), ntohs(portptr[0]),
iph742net/ipv4/ip_fw.cntohl(iph->daddr), ntohs(portptr[1]));
iph746net/ipv4/ip_fw.cif (iph->protocol == ms->protocol &&
iph747net/ipv4/ip_fw.ciph->saddr == ms->src   && iph->daddr == ms->dst &&
iph768net/ipv4/ip_fw.cms->protocol = iph->protocol;
iph769net/ipv4/ip_fw.cms->src      = iph->saddr;
iph770net/ipv4/ip_fw.cms->dst      = iph->daddr;
iph780net/ipv4/ip_fw.ciph->saddr = dev->pa_addr; /* my own address */
iph787net/ipv4/ip_fw.cif (iph->protocol==IPPROTO_UDP) 
iph790net/ipv4/ip_fw.crecalc_check((struct udphdr *)portptr,iph->saddr,iph->daddr,size);
iph799net/ipv4/ip_fw.ciph = skb->h.iph;
iph800net/ipv4/ip_fw.cportptr = (unsigned short *)&(((char *)iph)[iph->ihl*4]);
iph814net/ipv4/ip_fw.ctcp_send_check(th,iph->saddr,iph->daddr,size,skb->sk);
iph817net/ipv4/ip_fw.cip_send_check(iph);
iph835net/ipv4/ip_fw.cstruct iphdr  *iph = skb_ptr->h.iph;
iph838net/ipv4/ip_fw.cstruct tcphdr   *th = (struct tcphdr *)(skb_ptr->h.raw+(iph->ihl<<2));
iph840net/ipv4/ip_fw.cif (iph->protocol!=IPPROTO_UDP && iph->protocol!=IPPROTO_TCP)
iph843net/ipv4/ip_fw.cportptr = (unsigned short *)&(((char *)iph)[iph->ihl*4]);
iph850net/ipv4/ip_fw.cstrProt[iph->protocol==IPPROTO_TCP],
iph851net/ipv4/ip_fw.cntohl(iph->saddr), ntohs(portptr[0]),
iph852net/ipv4/ip_fw.cntohl(iph->daddr), ntohs(portptr[1]));
iph866net/ipv4/ip_fw.cif (iph->protocol==ms->protocol &&
iph867net/ipv4/ip_fw.c(iph->saddr==ms->dst || iph->protocol==IPPROTO_UDP) && 
iph872net/ipv4/ip_fw.ciph->daddr = ms->src;
iph878net/ipv4/ip_fw.cif (iph->protocol==IPPROTO_UDP)
iph879net/ipv4/ip_fw.crecalc_check((struct udphdr *)portptr,iph->saddr,iph->daddr,size);
iph891net/ipv4/ip_fw.ctcp_send_check((struct tcphdr *)portptr,iph->saddr,iph->daddr,size,skb_ptr->sk);
iph893net/ipv4/ip_fw.cip_send_check(iph);
iph895net/ipv4/ip_fw.cprintk("I-routed to %lX:%X\n",ntohl(iph->daddr),ntohs(portptr[1]));
iph1254net/ipv4/ip_fw.cvoid ip_acct_cnt(struct iphdr *iph, struct device *dev, struct ip_fw *f)
iph1256net/ipv4/ip_fw.c(void) ip_fw_chk(iph, dev, f, 0, 1);
iph85net/ipv4/ipip.cskb->h.iph=(struct iphdr *)skb->data;
iph151net/ipv4/raw.cstruct iphdr *iph=(struct iphdr *)to;
iph152net/ipv4/raw.ciph->saddr=saddr;
iph153net/ipv4/raw.ciph->check=0;
iph154net/ipv4/raw.ciph->tot_len=htons(fraglen);  /* This is right as you cant frag
iph160net/ipv4/raw.ciph->id = htons(ip_id_count++);
iph161net/ipv4/raw.ciph->check=ip_fast_csum((unsigned char *)iph, iph->ihl);
iph455net/ipv4/tcp.cstruct iphdr *iph;
iph477net/ipv4/tcp.ciph = (struct iphdr *)skb->data;
iph478net/ipv4/tcp.cth = (struct tcphdr *)(((char *)iph) + (iph->ihl << 2));
iph479net/ipv4/tcp.csize = ntohs(iph->tot_len) - (iph->ihl<<2);
iph486net/ipv4/tcp.ciph->id = htons(ip_id_count++);
iph487net/ipv4/tcp.cip_send_check(iph);
iph494net/ipv4/tcp.crt=ip_rt_local(iph->daddr,NULL,NULL);
iph496net/ipv4/tcp.crt=ip_rt_route(iph->daddr,NULL,NULL);
iph511net/ipv4/tcp.cskb->raddr=iph->daddr;
iph852net/ipv4/tcp.cstruct iphdr *iph=(struct iphdr *)header;
iph854net/ipv4/tcp.cheader+=4*iph->ihl;
iph3075net/ipv4/tcp.cstruct iphdr *iph;
iph3084net/ipv4/tcp.ciph = skb->ip_hdr;
iph3085net/ipv4/tcp.cth = (struct tcphdr *)(((char *)iph) +(iph->ihl << 2));
iph4950net/ipv4/tcp.cstruct iphdr *iph;
iph4966net/ipv4/tcp.ciph = (struct iphdr *)skb->ip_hdr;
iph4967net/ipv4/tcp.cth = (struct tcphdr *)(((char *)iph) +(iph->ihl << 2));
iph4974net/ipv4/tcp.c(iph->ihl << 2) +
iph5027net/ipv4/tcp.c(iph->ihl << 2) + th->doff * 4;