Rev 4721 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4721 | Rev 4743 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | * ICMP client interface implementation. |
34 | * ICMP client interface implementation. |
35 | * @see icmp_client.h |
35 | * @see icmp_client.h |
36 | */ |
36 | */ |
37 | 37 | ||
38 | #include <errno.h> |
38 | #include <errno.h> |
- | 39 | //#include <stdio.h> |
|
39 | 40 | ||
40 | #include <sys/types.h> |
41 | #include <sys/types.h> |
41 | 42 | ||
42 | #include "../../include/icmp_codes.h" |
43 | #include "../../include/icmp_codes.h" |
43 | #include "../../include/icmp_client.h" |
44 | #include "../../include/icmp_client.h" |
Line 57... | Line 58... | ||
57 | } |
58 | } |
58 | if( type ) * type = header->type; |
59 | if( type ) * type = header->type; |
59 | if( code ) * code = header->code; |
60 | if( code ) * code = header->code; |
60 | if( pointer ) * pointer = header->un.param.pointer; |
61 | if( pointer ) * pointer = header->un.param.pointer; |
61 | if( mtu ) * mtu = header->un.frag.mtu; |
62 | if( mtu ) * mtu = header->un.frag.mtu; |
- | 63 | // remove debug dump |
|
- | 64 | // printf( "ICMP error %d (%d) in packet %d\n", header->type, header->code, packet_get_id( packet )); |
|
62 | return sizeof( icmp_header_t ); |
65 | return sizeof( icmp_header_t ); |
63 | } |
66 | } |
64 | 67 | ||
65 | size_t icmp_client_header_length( packet_t packet ){ |
68 | size_t icmp_client_header_length( packet_t packet ){ |
66 | if( packet_get_data_length( packet ) < sizeof( icmp_header_t )){ |
69 | if( packet_get_data_length( packet ) < sizeof( icmp_header_t )){ |