Rev 4704 | Rev 4721 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4704 | Rev 4707 | ||
---|---|---|---|
Line 77... | Line 77... | ||
77 | if( ttl ) * ttl = header->ttl; |
77 | if( ttl ) * ttl = header->ttl; |
78 | if( tos ) * tos = header->tos; |
78 | if( tos ) * tos = header->tos; |
79 | if( dont_fragment ) * dont_fragment = header->flags & IPFLAG_DONT_FRAGMENT; |
79 | if( dont_fragment ) * dont_fragment = header->flags & IPFLAG_DONT_FRAGMENT; |
80 | if( ipopt_length ){ |
80 | if( ipopt_length ){ |
81 | * ipopt_length = header->ihl * 4 - sizeof( ip_header_t ); |
81 | * ipopt_length = header->ihl * 4 - sizeof( ip_header_t ); |
82 | return packet_trim( packet, sizeof( ip_header_t ), 0 ); |
82 | return sizeof( ip_header_t ); |
83 | }else{ |
83 | }else{ |
84 | return packet_trim( packet, header->ihl * 4, 0 ); |
84 | return header->ihl * 4; |
85 | } |
85 | } |
86 | } |
86 | } |
87 | 87 | ||
- | 88 | int ip_client_header_length( packet_t packet ){ |
|
- | 89 | ip_header_ref header; |
|
- | 90 | ||
- | 91 | header = ( ip_header_ref ) packet_get_data( packet ); |
|
- | 92 | if( ! header ) return ENOMEM; |
|
- | 93 | return header->ihl * 4; |
|
- | 94 | } |
|
- | 95 | ||
88 | /** @} |
96 | /** @} |
89 | */ |
97 | */ |