taglinefilesource code
iph110arch/alpha/lib/checksum.cunsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl)
iph112arch/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))
iph1794drivers/net/ppp.cstruct iphdr *iph = (struct iphdr *)skb->data;
iph1796drivers/net/ppp.cdev->name, (int) proto, (int) len, (int) iph->saddr,
iph1797drivers/net/ppp.c(int) iph->daddr, (int) iph->protocol))
iph125drivers/net/tunnel.cstruct iphdr *iph;    /* Our new IP header */
iph161drivers/net/tunnel.ciph=(struct iphdr *)skb->data;
iph162drivers/net/tunnel.cif ( iph->version != 4 ) 
iph167drivers/net/tunnel.cprintk("%s: Bad IP packet: ip version %d\n", dev->name, iph->version);
iph178drivers/net/tunnel.cif ( iph->protocol == IPPROTO_IPIP && iph->saddr == dev->pa_addr ) 
iph189drivers/net/tunnel.cif ( iph->daddr == dev->pa_addr ) 
iph199drivers/net/tunnel.cprint_ip(iph);
iph219drivers/net/tunnel.ciph=skb2->h.iph=(struct iphdr *)skb2->data;
iph220drivers/net/tunnel.cmemcpy(skb2->h.iph, skb->data, ip_header_len );
iph226drivers/net/tunnel.c++iph->ttl;  /* Note: ip_forward() decrements ttl, so compensate */
iph227drivers/net/tunnel.ciph->saddr = dev->pa_addr;
iph228drivers/net/tunnel.ciph->daddr = dev->pa_dstaddr;
iph229drivers/net/tunnel.ciph->protocol = IPPROTO_IPIP;
iph230drivers/net/tunnel.ciph->ihl = 5;
iph231drivers/net/tunnel.ciph->tot_len = htons(skb2->len);
iph232drivers/net/tunnel.ciph->frag_off = 0;
iph236drivers/net/tunnel.ciph->check = 0;
iph237drivers/net/tunnel.ciph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
iph241drivers/net/tunnel.cprint_ip(iph);
iph247drivers/net/tunnel.cip_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;
iph79include/net/head_explode.hextern __inline__ unsigned char *ip_explode(unsigned char *iph, struct ip_header *ip)
iph81include/net/head_explode.hip->version=*iph>>4;    /* Avoid the shift. We do our equality checks shifted too */
iph82include/net/head_explode.hip->ihl=(*iph++)&0xF;    /* Length in long words */
iph83include/net/head_explode.hip->tos=*iph++;      /* Service type */
iph84include/net/head_explode.hiph=exp_getu16(iph,&ip->tot_len);  /* Length of packet */
iph85include/net/head_explode.hiph=exp_getu16(iph,&ip->id);    /* Packet identity */
iph86include/net/head_explode.hiph=exp_getu16(iph,&ip->frag_off);  /* Fragment offset */
iph87include/net/head_explode.hip->ttl=*iph++;
iph88include/net/head_explode.hip->protocol=*iph++;
iph89include/net/head_explode.hiph=exp_getn16(iph,&ip->check);
iph90include/net/head_explode.hiph=exp_getn32(iph,&ip->saddr);
iph91include/net/head_explode.hiph=exp_getn32(iph,&ip->daddr);
iph92include/net/head_explode.hreturn iph;
iph65include/net/ip.hstruct iphdr  *iph;    /* pointer to IP header      */
iph104net/ipv4/icmp.cstruct iphdr *iph;
iph116net/ipv4/icmp.ciph = (struct iphdr *) skb_in->data;
iph129net/ipv4/icmp.catype=ip_chk_addr(iph->daddr);
iph137net/ipv4/icmp.cif(ntohs(iph->frag_off)&IP_OFFSET)
iph151net/ipv4/icmp.cif(iph->protocol==IPPROTO_ICMP)
iph153net/ipv4/icmp.cicmph = (struct icmphdr *) ((char *) iph +
iph154net/ipv4/icmp.c4 * iph->ihl);
iph230net/ipv4/icmp.cif (iph->daddr != our_addr && ip_chk_addr(iph->daddr) == IS_MYADDR)
iph231net/ipv4/icmp.cour_addr = iph->daddr;
iph232net/ipv4/icmp.coffset = ip_build_header(skb, our_addr, iph->saddr,
iph260net/ipv4/icmp.cmemcpy(icmph + 1, iph, sizeof(struct iphdr) + 8);
iph279net/ipv4/icmp.cstruct iphdr *iph;
iph284net/ipv4/icmp.ciph = (struct iphdr *) (icmph + 1);
iph295net/ipv4/icmp.cin_ntoa(iph->daddr), ntohs(iph->protocol));
iph303net/ipv4/icmp.cin_ntoa(iph->daddr));
iph308net/ipv4/icmp.cprintk("ICMP: %s: Source Route Failed.\n", in_ntoa(iph->daddr));
iph319net/ipv4/icmp.chash = iph->protocol & (MAX_INET_PROTOS -1);
iph335net/ipv4/icmp.cif (iph->protocol == ipprot->protocol && ipprot->err_handler) 
iph338net/ipv4/icmp.ciph->daddr, iph->saddr, ipprot);
iph357net/ipv4/icmp.cstruct iphdr *iph;
iph364net/ipv4/icmp.ciph = (struct iphdr *) (icmph + 1);
iph365net/ipv4/icmp.cip = iph->daddr;
iph215net/ipv4/ip.cstruct iphdr *iph;
iph309net/ipv4/ip.ciph=(struct iphdr *)skb_put(skb,sizeof(struct iphdr));
iph311net/ipv4/ip.ciph->version  = 4;
iph312net/ipv4/ip.ciph->ihl      = 5;
iph313net/ipv4/ip.ciph->tos      = tos;
iph314net/ipv4/ip.ciph->frag_off = 0;
iph315net/ipv4/ip.ciph->ttl      = ttl;
iph316net/ipv4/ip.ciph->daddr    = daddr;
iph317net/ipv4/ip.ciph->saddr    = saddr;
iph318net/ipv4/ip.ciph->protocol = type;
iph319net/ipv4/ip.cskb->ip_hdr   = iph;
iph329net/ipv4/ip.cvoid ip_send_check(struct iphdr *iph)
iph331net/ipv4/ip.ciph->check = 0;
iph332net/ipv4/ip.ciph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
iph377net/ipv4/ip.cstatic struct ipq *ip_find(struct iphdr *iph)
iph386net/ipv4/ip.cif (iph->id== qp->iph->id && iph->saddr == qp->iph->saddr &&
iph387net/ipv4/ip.ciph->daddr == qp->iph->daddr && iph->protocol == qp->iph->protocol)
iph444net/ipv4/ip.ckfree_s(qp->iph, 64 + 8);
iph487net/ipv4/ip.cstatic struct ipq *ip_create(struct sk_buff *skb, struct iphdr *iph, struct device *dev)
iph505net/ipv4/ip.cihlen = iph->ihl * 4;
iph506net/ipv4/ip.cqp->iph = (struct iphdr *) kmalloc(64 + 8, GFP_ATOMIC);
iph507net/ipv4/ip.cif (qp->iph == NULL)
iph514net/ipv4/ip.cmemcpy(qp->iph, iph, ihlen + 8);
iph578net/ipv4/ip.cstruct iphdr *iph;
iph603net/ipv4/ip.cmemcpy(ptr, ((unsigned char *) qp->iph), qp->ihlen);
iph629net/ipv4/ip.ciph = skb->h.iph;
iph630net/ipv4/ip.ciph->frag_off = 0;
iph631net/ipv4/ip.ciph->tot_len = htons((iph->ihl * 4) + count);
iph632net/ipv4/ip.cskb->ip_hdr = iph;
iph643net/ipv4/ip.cstatic struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct device *dev)
iph656net/ipv4/ip.cqp = ip_find(iph);
iph659net/ipv4/ip.coffset = ntohs(iph->frag_off);
iph690net/ipv4/ip.cif ((qp = ip_create(skb, iph, dev)) == NULL)
iph703net/ipv4/ip.cihl = iph->ihl * 4;
iph704net/ipv4/ip.cend = offset + ntohs(iph->tot_len) - ihl;
iph839net/ipv4/ip.cstruct iphdr *iph;
iph852net/ipv4/ip.ciph = (struct iphdr *) (raw + dev->hard_header_len);
iph854net/ipv4/ip.cskb->ip_hdr = iph;
iph860net/ipv4/ip.chlen = iph->ihl * 4;
iph861net/ipv4/ip.cleft = ntohs(iph->tot_len) - hlen;  /* Space per frame */
iph870net/ipv4/ip.cif (ntohs(iph->frag_off) & IP_DF)
iph904net/ipv4/ip.coffset = (ntohs(iph->frag_off) & IP_OFFSET) << 3;
iph979net/ipv4/ip.ciph = (struct iphdr *)(skb2->h.raw/*+dev->hard_header_len*/);
iph980net/ipv4/ip.ciph->frag_off = htons((offset >> 3));
iph986net/ipv4/ip.ciph->frag_off |= htons(IP_MF);
iph1012net/ipv4/ip.cstruct iphdr *iph;  /* Our header */
iph1026net/ipv4/ip.cif(!(is_frag&4) && (fw_res=ip_fw_chk(skb->h.iph, dev, ip_fw_fwd_chain, ip_fw_fwd_policy, 0))!=1)
iph1044net/ipv4/ip.ciph = skb->h.iph;
iph1045net/ipv4/ip.ciph->ttl--;
iph1053net/ipv4/ip.ciph->check = ntohs(iph->check) + 0x0100;
iph1054net/ipv4/ip.cif ((iph->check & 0xFF00) == 0)
iph1055net/ipv4/ip.ciph->check++;    /* carry overflow */
iph1056net/ipv4/ip.ciph->check = htons(iph->check);
iph1058net/ipv4/ip.cif (iph->ttl <= 0)
iph1137net/ipv4/ip.cif (dev == dev2 && !((iph->saddr^iph->daddr)&dev->pa_mask) && rt->rt_flags&RTF_MODIFIED)
iph1210net/ipv4/ip.cip_fw_chk(iph,dev,ip_acct_chain,IP_FW_F_ACCEPT,1);
iph1218net/ipv4/ip.cif(iph->tos & IPTOS_LOWDELAY)
iph1220net/ipv4/ip.celse if(iph->tos & IPTOS_THROUGHPUT)
iph1240net/ipv4/ip.cstruct iphdr *iph = skb->h.iph;
iph1259net/ipv4/ip.cskb->ip_hdr = iph;
iph1274net/ipv4/ip.cif (skb->len<sizeof(struct iphdr) || iph->ihl<5 || iph->version != 4 || ip_fast_csum((unsigned char *)iph, iph->ihl) !=0
iph1275net/ipv4/ip.c|| skb->len < ntohs(iph->tot_len))
iph1287net/ipv4/ip.cskb_trim(skb,ntohs(iph->tot_len));
iph1295net/ipv4/ip.cif ((err=ip_fw_chk(iph,dev,ip_fw_blk_chain,ip_fw_blk_policy, 0))<1)
iph1311net/ipv4/ip.ctarget_addr = iph->daddr;
iph1313net/ipv4/ip.cif (iph->ihl != 5)
iph1325net/ipv4/ip.cint opt_space=4*(iph->ihl-5);
iph1367net/ipv4/ip.cif (iph->daddr!=skb->dev->pa_addr && (brd = ip_chk_addr(iph->daddr)) == 0) 
iph1371net/ipv4/ip.cif(ip_chk_addr(iph->daddr))
iph1387net/ipv4/ip.cif(ip_chk_addr(iph->daddr))
iph1416net/ipv4/ip.cif(iph->frag_off)
iph1418net/ipv4/ip.cif (iph->frag_off & htons(IP_MF))
iph1424net/ipv4/ip.cif (iph->frag_off & htons(IP_OFFSET))
iph1440net/ipv4/ip.cif ( iph->daddr == skb->dev->pa_addr || (brd = ip_chk_addr(iph->daddr)) != 0)
iph1444net/ipv4/ip.cif(brd==IS_MULTICAST && iph->daddr!=IGMP_ALL_HOSTS && !(dev->flags&IFF_LOOPBACK))
iph1457net/ipv4/ip.cif(ip_mc->multiaddr==iph->daddr)
iph1471net/ipv4/ip.cstruct iphdr *iph=skb->h.iph;
iph1472net/ipv4/ip.cip_forward(skb, dev, is_frag|4, iph->daddr, 0);
iph1483net/ipv4/ip.cip_fw_chk(iph,dev,ip_acct_chain,IP_FW_F_ACCEPT,1);
iph1493net/ipv4/ip.cskb=ip_defrag(iph,skb,dev);
iph1497net/ipv4/ip.ciph=skb->h.iph;
iph1504net/ipv4/ip.cskb->ip_hdr = iph;
iph1505net/ipv4/ip.cskb->h.raw += iph->ihl*4;
iph1513net/ipv4/ip.chash = iph->protocol & (SOCK_ARRAY_SIZE-1);
iph1523net/ipv4/ip.craw_sk=get_sock_raw(raw_sk, hash,  iph->saddr, iph->daddr);
iph1529net/ipv4/ip.csknext=get_sock_raw(raw_sk->next, hash, iph->saddr, iph->daddr);
iph1535net/ipv4/ip.craw_rcv(raw_sk, skb1, dev, iph->saddr,iph->daddr);
iph1554net/ipv4/ip.chash = iph->protocol & (MAX_INET_PROTOS -1);
iph1559net/ipv4/ip.cif (ipprot->protocol != iph->protocol)
iph1586net/ipv4/ip.cipprot->handler(skb2, dev, NULL, iph->daddr,
iph1587net/ipv4/ip.c(ntohs(iph->tot_len) - (iph->ihl * 4)),
iph1588net/ipv4/ip.ciph->saddr, 0, ipprot);
iph1600net/ipv4/ip.craw_rcv(raw_sk, skb, dev, iph->saddr, iph->daddr);
iph1711net/ipv4/ip.cstruct iphdr *iph;
iph1741net/ipv4/ip.ciph = (struct iphdr *)ptr;
iph1742net/ipv4/ip.cskb->ip_hdr = iph;
iph1743net/ipv4/ip.ciph->tot_len = ntohs(skb->len-dev->hard_header_len);
iph1746net/ipv4/ip.cif(ip_fw_chk(iph, dev, ip_fw_blk_chain, ip_fw_blk_policy, 0) != 1)
iph1756net/ipv4/ip.ciph->id      = htons(ip_id_count++);
iph1784net/ipv4/ip.cip_send_check(iph);
iph1848net/ipv4/ip.cip_fw_chk(iph,dev,ip_acct_chain,IP_FW_F_ACCEPT,1);
iph1857net/ipv4/ip.cif (MULTICAST(iph->daddr) && !(dev->flags&IFF_LOOPBACK))
iph1861net/ipv4/ip.cif(iph->daddr==IGMP_ALL_HOSTS)
iph1868net/ipv4/ip.cif(imc->multiaddr==iph->daddr)
iph1886net/ipv4/ip.cif((dev->flags&IFF_BROADCAST) && iph->daddr==dev->pa_brdaddr && !(dev->flags&IFF_LOOPBACK))
iph2332net/ipv4/ip.cstruct iphdr *iph;
iph2518net/ipv4/ip.ciph = (struct iphdr *)data;
iph2527net/ipv4/ip.ciph->version = 4;
iph2528net/ipv4/ip.ciph->ihl = 5; /* ugh */
iph2529net/ipv4/ip.ciph->tos = sk->ip_tos;
iph2530net/ipv4/ip.ciph->tot_len = htons(fraglen - fragheaderlen + iph->ihl*4);
iph2531net/ipv4/ip.ciph->id = id;
iph2532net/ipv4/ip.ciph->frag_off = htons(offset>>3);
iph2533net/ipv4/ip.ciph->frag_off |= mf;
iph2536net/ipv4/ip.ciph->ttl = sk->ip_mc_ttl;
iph2539net/ipv4/ip.ciph->ttl = sk->ip_ttl;
iph2540net/ipv4/ip.ciph->protocol = type;
iph2541net/ipv4/ip.ciph->check = 0;
iph2542net/ipv4/ip.ciph->saddr = saddr;
iph2543net/ipv4/ip.ciph->daddr = daddr;
iph2544net/ipv4/ip.ciph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
iph2545net/ipv4/ip.cdata += iph->ihl*4;
iph2566net/ipv4/ip.cip_fw_chk(iph, dev, ip_acct_chain, IP_FW_F_ACCEPT, 1);
iph520net/ipv4/ip_fw.cstruct iphdr *iph = skb->h.iph;
iph521net/ipv4/ip_fw.cstruct tcphdr *th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]);
iph580net/ipv4/ip_fw.cms->dst      = iph->daddr;
iph657net/ipv4/ip_fw.cstruct iphdr  *iph = skb->h.iph;
iph666net/ipv4/ip_fw.cif (iph->protocol!=IPPROTO_UDP && iph->protocol!=IPPROTO_TCP)
iph673net/ipv4/ip_fw.cportptr = (unsigned short *)&(((char *)iph)[iph->ihl*4]);
iph678net/ipv4/ip_fw.cstrProt[iph->protocol==IPPROTO_TCP],
iph679net/ipv4/ip_fw.cntohl(iph->saddr), ntohs(portptr[0]),
iph680net/ipv4/ip_fw.cntohl(iph->daddr), ntohs(portptr[1]));
iph684net/ipv4/ip_fw.cif (iph->protocol == ms->protocol &&
iph685net/ipv4/ip_fw.ciph->saddr == ms->src   && iph->daddr == ms->dst &&
iph706net/ipv4/ip_fw.cms->protocol = iph->protocol;
iph707net/ipv4/ip_fw.cms->src      = iph->saddr;
iph708net/ipv4/ip_fw.cms->dst      = iph->daddr;
iph718net/ipv4/ip_fw.ciph->saddr = dev->pa_addr; /* my own address */
iph725net/ipv4/ip_fw.cif (iph->protocol==IPPROTO_UDP) 
iph728net/ipv4/ip_fw.crecalc_check((struct udphdr *)portptr,iph->saddr,iph->daddr,size);
iph737net/ipv4/ip_fw.ciph = skb->h.iph;
iph738net/ipv4/ip_fw.cportptr = (unsigned short *)&(((char *)iph)[iph->ihl*4]);
iph752net/ipv4/ip_fw.ctcp_send_check(th,iph->saddr,iph->daddr,size,skb->sk);
iph755net/ipv4/ip_fw.cip_send_check(iph);
iph773net/ipv4/ip_fw.cstruct iphdr  *iph = skb_ptr->h.iph;
iph776net/ipv4/ip_fw.cstruct tcphdr   *th = (struct tcphdr *)(skb_ptr->h.raw+(iph->ihl<<2));
iph778net/ipv4/ip_fw.cif (iph->protocol!=IPPROTO_UDP && iph->protocol!=IPPROTO_TCP)
iph781net/ipv4/ip_fw.cportptr = (unsigned short *)&(((char *)iph)[iph->ihl*4]);
iph788net/ipv4/ip_fw.cstrProt[iph->protocol==IPPROTO_TCP],
iph789net/ipv4/ip_fw.cntohl(iph->saddr), ntohs(portptr[0]),
iph790net/ipv4/ip_fw.cntohl(iph->daddr), ntohs(portptr[1]));
iph804net/ipv4/ip_fw.cif (iph->protocol==ms->protocol &&
iph805net/ipv4/ip_fw.c(iph->saddr==ms->dst || iph->protocol==IPPROTO_UDP) && 
iph810net/ipv4/ip_fw.ciph->daddr = ms->src;
iph816net/ipv4/ip_fw.cif (iph->protocol==IPPROTO_UDP)
iph817net/ipv4/ip_fw.crecalc_check((struct udphdr *)portptr,iph->saddr,iph->daddr,size);
iph829net/ipv4/ip_fw.ctcp_send_check((struct tcphdr *)portptr,iph->saddr,iph->daddr,size,skb_ptr->sk);
iph831net/ipv4/ip_fw.cip_send_check(iph);
iph833net/ipv4/ip_fw.cprintk("I-routed to %lX:%X\n",ntohl(iph->daddr),ntohs(portptr[1]));
iph1192net/ipv4/ip_fw.cvoid ip_acct_cnt(struct iphdr *iph, struct device *dev, struct ip_fw *f)
iph1194net/ipv4/ip_fw.c(void) ip_fw_chk(iph, dev, f, 0, 1);
iph144net/ipv4/raw.cstruct iphdr *iph=(struct iphdr *)to;
iph145net/ipv4/raw.ciph->saddr=saddr;
iph146net/ipv4/raw.ciph->check=0;
iph147net/ipv4/raw.ciph->tot_len=htons(fraglen);  /* This is right as you cant frag
iph153net/ipv4/raw.ciph->id = htons(ip_id_count++);
iph154net/ipv4/raw.ciph->check=ip_fast_csum((unsigned char *)iph, iph->ihl);
iph449net/ipv4/tcp.cstruct iphdr *iph;
iph465net/ipv4/tcp.ciph = (struct iphdr *)(skb->data + dev->hard_header_len);
iph466net/ipv4/tcp.cth = (struct tcphdr *)(((char *)iph) + (iph->ihl << 2));
iph477net/ipv4/tcp.ciph->id = htons(ip_id_count++);
iph478net/ipv4/tcp.cip_send_check(iph);
iph811net/ipv4/tcp.cstruct iphdr *iph=(struct iphdr *)header;
iph813net/ipv4/tcp.cheader+=4*iph->ihl;
iph3028net/ipv4/tcp.cstruct iphdr *iph;
iph3037net/ipv4/tcp.ciph = (struct iphdr *)(skb->data +
iph3039net/ipv4/tcp.cth = (struct tcphdr *)(((char *)iph) +(iph->ihl << 2));
iph4904net/ipv4/tcp.cstruct iphdr *iph;
iph4920net/ipv4/tcp.ciph = (struct iphdr *)(skb->data + skb->dev->hard_header_len);
iph4921net/ipv4/tcp.cth = (struct tcphdr *)(((char *)iph) +(iph->ihl << 2));
iph4928net/ipv4/tcp.c(iph->ihl << 2) +
iph4981net/ipv4/tcp.c(iph->ihl << 2) + th->doff * 4;