Lines Matching defs:iphdr

166 	struct iphdr *iphdr = iobuf->data;
173 if ( fragbuf->ident == iphdr->ident &&
174 fragbuf->src.s_addr == iphdr->src.s_addr ) {
183 ( iphdr->frags & IP_MASK_OFFSET ) ) {
188 iob_pull ( iobuf, sizeof ( *iphdr ) );
195 if ( ! ( iphdr->frags & IP_MASK_MOREFRAGS ) ) {
211 if ( iphdr->frags & IP_MASK_MOREFRAGS &&
212 ( ( iphdr->frags & IP_MASK_OFFSET ) == 0 ) ) {
216 fragbuf->ident = iphdr->ident;
217 fragbuf->src = iphdr->src;
221 iob_pull ( iobuf, sizeof ( *iphdr ) );
247 struct iphdr *iphdr = iobuf->data;
248 size_t hdrlen = ( ( iphdr->verhdrlen & IP_MASK_HLEN ) * 4 );
251 pshdr.src = iphdr->src;
252 pshdr.dest = iphdr->dest;
254 pshdr.protocol = iphdr->protocol;
307 struct iphdr *iphdr = iob_push ( iobuf, sizeof ( *iphdr ) );
316 memset ( iphdr, 0, sizeof ( *iphdr ) );
317 iphdr->verhdrlen = ( IP_VER | ( sizeof ( *iphdr ) / 4 ) );
318 iphdr->service = IP_TOS;
319 iphdr->len = htons ( iob_len ( iobuf ) );
320 iphdr->ident = htons ( ++next_ident );
321 iphdr->ttl = IP_TTL;
322 iphdr->protocol = tcpip_protocol->tcpip_proto;
323 iphdr->dest = sin_dest->sin_addr;
326 next_hop = iphdr->dest;
328 iphdr->src = sin_src->sin_addr;
332 iphdr->src = miniroute->address;
336 DBG ( "IPv4 has no route to %s\n", inet_ntoa ( iphdr->dest ) );
342 if ( ( rc = ipv4_ll_addr ( next_hop, iphdr->src, netdev,
352 iphdr->chksum = tcpip_chksum ( iphdr, sizeof ( *iphdr ) );
355 DBG ( "IPv4 TX %s->", inet_ntoa ( iphdr->src ) );
357 inet_ntoa ( iphdr->dest ), ntohs ( iphdr->len ), iphdr->protocol,
358 ntohs ( iphdr->ident ), ntohs ( iphdr->chksum ) );
386 struct iphdr *iphdr = iobuf->data;
398 if ( iob_len ( iobuf ) < sizeof ( *iphdr ) ) {
400 iob_len ( iobuf ), sizeof ( *iphdr ) );
403 if ( ( iphdr->verhdrlen & IP_MASK_VER ) != IP_VER ) {
404 DBG ( "IPv4 version %#02x not supported\n", iphdr->verhdrlen );
407 hdrlen = ( ( iphdr->verhdrlen & IP_MASK_HLEN ) * 4 );
408 if ( hdrlen < sizeof ( *iphdr ) ) {
410 hdrlen, sizeof ( *iphdr ) );
418 if ( ( csum = tcpip_chksum ( iphdr, hdrlen ) ) != 0 ) {
423 len = ntohs ( iphdr->len );
436 DBG ( "IPv4 RX %s<-", inet_ntoa ( iphdr->dest ) );
438 inet_ntoa ( iphdr->src ), ntohs ( iphdr->len ), iphdr->protocol,
439 ntohs ( iphdr->ident ), ntohs ( iphdr->chksum ) );
449 if ( ( iphdr->frags & htons ( IP_MASK_MOREFRAGS ) ) ||
450 ( ( iphdr->frags & htons ( IP_MASK_OFFSET ) ) != 0 ) ) {
462 src.sin.sin_addr = iphdr->src;
465 dest.sin.sin_addr = iphdr->dest;
466 if ( ( rc = tcpip_rx ( iobuf, iphdr->protocol, &src.st,