Rev 4558 | Rev 4704 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4558 | Rev 4589 | ||
---|---|---|---|
Line 65... | Line 65... | ||
65 | header->protocol = protocol; |
65 | header->protocol = protocol; |
66 | if( dont_fragment ) header->flags = IPFLAG_DONT_FRAGMENT; |
66 | if( dont_fragment ) header->flags = IPFLAG_DONT_FRAGMENT; |
67 | return EOK; |
67 | return EOK; |
68 | } |
68 | } |
69 | 69 | ||
- | 70 | int ip_client_process_packet( packet_t packet, ip_protocol_t * protocol, ip_ttl_t * ttl, ip_tos_t * tos, int * dont_fragment, size_t * ipopt_length ){ |
|
- | 71 | ip_header_ref header; |
|
- | 72 | ||
- | 73 | header = ( ip_header_ref ) packet_get_data( packet ); |
|
- | 74 | if( ! header ) return ENOMEM; |
|
- | 75 | if( protocol ) * protocol = header->protocol; |
|
- | 76 | if( ttl ) * ttl = header->ttl; |
|
- | 77 | if( tos ) * tos = header->tos; |
|
- | 78 | if( dont_fragment ) * dont_fragment = header->flags & IPFLAG_DONT_FRAGMENT; |
|
- | 79 | if( ipopt_length ){ |
|
- | 80 | * ipopt_length = header->ihl * 4 - sizeof( ip_header_t ); |
|
- | 81 | return packet_trim( packet, sizeof( ip_header_t ), 0 ); |
|
- | 82 | }else{ |
|
- | 83 | return packet_trim( packet, header->ihl * 4, 0 ); |
|
- | 84 | } |
|
- | 85 | } |
|
- | 86 | ||
70 | /** @} |
87 | /** @} |
71 | */ |
88 | */ |