Data Structures | |
struct | icmp_reply |
ICMP reply data. More... | |
struct | icmp_globals |
ICMP global data. More... | |
struct | icmp_echo |
Echo specific data. More... | |
struct | icmp_header |
Internet control message header. More... | |
Files | |
file | icmp_api.h |
ICMP module application interface. | |
file | icmp_client.h |
ICMP client interface. | |
file | icmp_codes.h |
ICMP types and codes according to the on-line IANA - ICMP Type Numbers - <http://http://www.iana.org/assignments/icmp-parameters>, cited September 14 2009. | |
file | icmp_common.h |
ICMP module common interface. | |
file | icmp_interface.h |
ICMP module interface. | |
file | icmp.c |
ICMP module implementation. | |
file | icmp.h |
ICMP module. | |
file | icmp_api.c |
ICMP application interface implementation. | |
file | icmp_client.c |
ICMP client interface implementation. | |
file | icmp_common.c |
ICMP common interface implementation. | |
file | icmp_header.h |
ICMP header definition. | |
file | icmp_messages.h |
ICMP module messages. | |
file | icmp_module.c |
ICMP standalone module implementation. | |
file | icmp_module.h |
ICMP module functions. | |
file | icmp_remote.c |
ICMP interface implementation for standalone remote modules. | |
Defines | |
#define | ICMP_CONNECT_TIMEOUT (1 * 1000 * 1000) |
Default timeout for incoming connections in microseconds. | |
#define | NET_DEFAULT_ICMP_ERROR_REPORTING true |
Default ICMP error reporting. | |
#define | NET_DEFAULT_ICMP_ECHO_REPLYING true |
Default ICMP echo replying. | |
#define | ICMP_KEEP_LENGTH 8 |
Original datagram length in bytes transfered to the error notification message. | |
#define | ICMP_FREE_IDS_START 1 |
Free identifier numbers pool start. | |
#define | ICMP_FREE_IDS_END MAX_UINT16 |
Free identifier numbers pool end. | |
#define | ICMP_CHECKSUM(header, length) htons(ip_checksum((uint8_t *) (header), (length))) |
Computes the ICMP datagram checksum. | |
#define | ICMP_ECHO_TEXT "Hello from HelenOS." |
An echo request datagrams pattern. | |
#define | ICMP_GET_REPLY_KEY(id, sequence) (((id) << 16) | (sequence &0xFFFF)) |
Computes an ICMP reply data key. | |
#define | ICMP_HEADER_SIZE sizeof(icmp_header_t) |
ICMP header size in bytes. | |
#define | NAME "ICMP protocol" |
ICMP module name. | |
Typedefs | |
typedef size_t | mseconds_t |
Miliseconds type definition. | |
typedef uint8_t | icmp_type_t |
ICMP type type definition. | |
typedef uint8_t | icmp_code_t |
ICMP code type definition. | |
typedef uint16_t | icmp_param_t |
ICMP parameter type definition. | |
typedef struct icmp_reply | icmp_reply_t |
Type definition of the ICMP reply data. | |
typedef icmp_reply_t * | icmp_reply_ref |
Type definition of the ICMP reply data pointer. | |
typedef struct icmp_globals | icmp_globals_t |
Type definition of the ICMP global data. | |
typedef struct icmp_echo | icmp_echo_t |
Type definition of the echo specific data. | |
typedef icmp_echo_t * | icmp_echo_ref |
Type definition of the echo specific data pointer. | |
typedef struct icmp_header | icmp_header_t |
Type definition of the internet control message header. | |
typedef icmp_header_t * | icmp_header_ref |
Type definition of the internet control message header pointer. | |
Enumerations | |
enum | icmp_messages { NET_ICMP_ECHO = NET_ICMP_FIRST, NET_ICMP_DEST_UNREACH, NET_ICMP_SOURCE_QUENCH, NET_ICMP_TIME_EXCEEDED, NET_ICMP_PARAMETERPROB, NET_ICMP_INIT } |
ICMP module messages. More... | |
Functions | |
int | icmp_client_process_packet (packet_t packet, icmp_type_t *type, icmp_code_t *code, icmp_param_t *pointer, icmp_param_t *mtu) |
Processes the received packet prefixed with an ICMP header. | |
size_t | icmp_client_header_length (packet_t packet) |
Returns the ICMP header length. | |
int | icmp_connect_module (services_t service, suseconds_t timeout) |
Connects to the ICMP module. | |
int | icmp_received_msg (device_id_t device_id, packet_t packet, services_t receiver, services_t error) |
Processes the received ICMP packet. | |
int | icmp_process_packet (packet_t packet, services_t error) |
Processes the received ICMP packet. | |
int | icmp_process_client_messages (ipc_callid_t callid, ipc_call_t call) |
Processes the client messages. | |
int | icmp_process_message (ipc_call_t *call) |
Processes the generic client messages. | |
int | icmp_release_and_return (packet_t packet, int result) |
Releases the packet and returns the result. | |
int | icmp_echo (icmp_param_t id, icmp_param_t sequence, size_t size, mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, const struct sockaddr *addr, socklen_t addrlen) |
Requests an echo message. | |
icmp_header_ref | icmp_prepare_packet (packet_t packet) |
Prepares the ICMP error packet. | |
int | icmp_send_packet (icmp_type_t type, icmp_code_t code, packet_t packet, icmp_header_ref header, services_t error, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment) |
Sends the ICMP message. | |
int | icmp_process_echo_reply (packet_t packet, icmp_header_ref header, icmp_type_t type, icmp_code_t code) |
Tries to set the pending reply result as the received message type. | |
int | icmp_bind_free_id (icmp_echo_ref echo_data) |
Assigns a new identifier for the connection. | |
INT_MAP_IMPLEMENT (icmp_replies, icmp_reply_t) | |
INT_MAP_IMPLEMENT (icmp_echo_data, icmp_echo_t) | |
int | icmp_initialize (async_client_conn_t client_connection) |
Initializes the ICMP module. | |
int | icmp_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, int *answer_count) |
Processes the ICMP message. | |
INT_MAP_DECLARE (icmp_replies, icmp_reply_t) | |
Pending replies map. | |
INT_MAP_DECLARE (icmp_echo_data, icmp_echo_t) | |
Echo specific data map. | |
void | module_print_name (void) |
Prints the module name. | |
int | module_start (async_client_conn_t client_connection) |
Starts the ICMP module. | |
int | module_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, int *answer_count) |
Processes the ICMP message. | |
Variables | |
icmp_globals_t | icmp_globals |
ICMP global data. | |
icmp_globals_t | icmp_globals |
ICMP module global data. | |
ICMP module application interface | |
This interface is used by other application modules. | |
int | icmp_echo_msg (int icmp_phone, size_t size, mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, const struct sockaddr *addr, socklen_t addrlen) |
Requests an echo message. | |
ICMP module interface | |
This interface is used by other modules. | |
int | icmp_destination_unreachable_msg (int icmp_phone, icmp_code_t code, icmp_param_t mtu, packet_t packet) |
Sends the Destination Unreachable error notification packet. | |
int | icmp_source_quench_msg (int icmp_phone, packet_t packet) |
Sends the Source Quench error notification packet. | |
int | icmp_time_exceeded_msg (int icmp_phone, icmp_code_t code, packet_t packet) |
Sends the Time Exceeded error notification packet. | |
int | icmp_parameter_problem_msg (int icmp_phone, icmp_code_t code, icmp_param_t pointer, packet_t packet) |
Sends the Parameter Problem error notification packet. | |
ICMP types definitions | |
| |
#define | ICMP_ECHOREPLY 0 |
Echo Reply. | |
#define | ICMP_DEST_UNREACH 3 |
Destination Unreachable. | |
#define | ICMP_SOURCE_QUENCH 4 |
Source Quench. | |
#define | ICMP_REDIRECT 5 |
Redirect. | |
#define | ICMP_ALTERNATE_ADDR 6 |
Alternate Host Address. | |
#define | ICMP_ECHO 8 |
Echo Request. | |
#define | ICMP_ROUTER_ADV 9 |
Router Advertisement. | |
#define | ICMP_ROUTER_SOL 10 |
Router solicitation. | |
#define | ICMP_TIME_EXCEEDED 11 |
Time Exceeded. | |
#define | ICMP_PARAMETERPROB 12 |
Parameter Problem. | |
#define | ICMP_TIMESTAMP 13 |
Timestamp Request. | |
#define | ICMP_TIMESTAMPREPLY 14 |
Timestamp Reply. | |
#define | ICMP_INFO_REQUEST 15 |
Information Request. | |
#define | ICMP_INFO_REPLY 16 |
Information Reply. | |
#define | ICMP_ADDRESS 17 |
Address Mask Request. | |
#define | ICMP_ADDRESSREPLY 18 |
Address Mask Reply. | |
#define | ICMP_TRACEROUTE 30 |
Traceroute. | |
#define | ICMP_CONVERSION_ERROR 31 |
Datagram Conversion Error. | |
#define | ICMP_REDIRECT_MOBILE 32 |
Mobile Host Redirect. | |
#define | ICMP_IPV6_WHERE_ARE_YOU 33 |
IPv6 Where-Are-You. | |
#define | ICMP_IPV6_I_AM_HERE 34 |
IPv6 I-Am-Here. | |
#define | ICMP_MOBILE_REQUEST 35 |
Mobile Registration Request. | |
#define | ICMP_MOBILE_REPLY 36 |
Mobile Registration Reply. | |
#define | ICMP_DN_REQUEST 37 |
Domain name request. | |
#define | ICMP_DN_REPLY 38 |
Domain name reply. | |
#define | ICMP_SKIP 39 |
SKIP. | |
#define | ICMP_PHOTURIS 40 |
Photuris. | |
ICMP_DEST_UNREACH codes definitions | |
| |
#define | ICMP_NET_UNREACH 0 |
Network Unreachable. | |
#define | ICMP_HOST_UNREACH 1 |
Host Unreachable. | |
#define | ICMP_PROT_UNREACH 2 |
Protocol Unreachable. | |
#define | ICMP_PORT_UNREACH 3 |
Port Unreachable. | |
#define | ICMP_FRAG_NEEDED 4 |
Fragmentation needed but the Do Not Fragment bit was set. | |
#define | ICMP_SR_FAILED 5 |
Source Route failed. | |
#define | ICMP_NET_UNKNOWN 6 |
Destination network unknown. | |
#define | ICMP_HOST_UNKNOWN 7 |
Destination host unknown. | |
#define | ICMP_HOST_ISOLATED 8 |
Source host isolated (obsolete). | |
#define | ICMP_NET_ANO 9 |
Destination network administratively prohibited. | |
#define | ICMP_HOST_ANO 10 |
Destination host administratively prohibited. | |
#define | ICMP_NET_UNR_TOS 11 |
Network unreachable for this type of service. | |
#define | ICMP_HOST_UNR_TOS 12 |
Host unreachable for this type of service. | |
#define | ICMP_PKT_FILTERED 13 |
Communication administratively prohibited by filtering. | |
#define | ICMP_PREC_VIOLATION 14 |
Host precedence violation. | |
#define | ICMP_PREC_CUTOFF 15 |
Precedence cutoff in effect. | |
ICMP_REDIRECT codes definitions | |
| |
#define | ICMP_REDIR_NET 0 |
Network redirect (or subnet). | |
#define | ICMP_REDIR_HOST 1 |
Host redirect. | |
#define | ICMP_REDIR_NETTOS 2 |
Network redirect for this type of service. | |
#define | ICMP_REDIR_HOSTTOS 3 |
Host redirect for this type of service. | |
ICMP_ALTERNATE_ADDRESS codes definitions | |
| |
#define | ICMP_ALTERNATE_HOST 0 |
Alternate address for host. | |
ICMP_ROUTER_ADV codes definitions | |
| |
#define | ICMP_ROUTER_NORMAL 0 |
Normal router advertisement. | |
#define | ICMP_ROUTER_NO_NORMAL_TRAFFIC 16 |
Does not route common traffic. | |
ICMP_TIME_EXCEEDED codes definitions | |
| |
#define | ICMP_EXC_TTL 0 |
Transit TTL exceeded. | |
#define | ICMP_EXC_FRAGTIME 1 |
Reassembly TTL exceeded. | |
ICMP_PARAMETERPROB codes definitions | |
| |
#define | ICMP_PARAM_POINTER 0 |
Pointer indicates the error. | |
#define | ICMP_PARAM_MISSING 1 |
Missing required option. | |
#define | ICMP_PARAM_LENGTH 2 |
Bad length. | |
ICMP_PHOTURIS codes definitions | |
| |
#define | ICMP_PHOTURIS_BAD_SPI 0 |
Bad SPI. | |
#define | ICMP_PHOTURIS_AUTHENTICATION 1 |
Authentication failed. | |
#define | ICMP_PHOTURIS_DECOMPRESSION 2 |
Decompression failed. | |
#define | ICMP_PHOTURIS_DECRYPTION 3 |
Decryption failed. | |
#define | ICMP_PHOTURIS_NEED_AUTHENTICATION 4 |
Need authentication. | |
#define | ICMP_PHOTURIS_NEED_AUTHORIZATION 5 |
Need authorization. | |
ICMP specific message parameters definitions | |
| |
#define | ICMP_GET_CODE(call) (icmp_code_t) IPC_GET_ARG1(*call) |
Returns the ICMP code message parameter. | |
#define | ICMP_GET_MTU(call) (icmp_param_t) IPC_GET_ARG3(*call) |
Returns the ICMP link MTU message parameter. | |
#define | ICMP_GET_POINTER(call) (icmp_param_t) IPC_GET_ARG3(*call) |
Returns the pointer message parameter. | |
#define | ICMP_GET_SIZE(call) (size_t) IPC_GET_ARG1(call) |
Returns the size message parameter. | |
#define | ICMP_GET_TIMEOUT(call) ((suseconds_t) IPC_GET_ARG2(call)) |
Returns the timeout message parameter. | |
#define | ICMP_GET_TTL(call) (ip_ttl_t) IPC_GET_ARG3(call) |
Returns the time to live message parameter. | |
#define | ICMP_GET_TOS(call) (ip_tos_t) IPC_GET_ARG4(call) |
Returns the type of service message parameter. | |
#define | ICMP_GET_DONT_FRAGMENT(call) (int) IPC_GET_ARG5(call) |
Returns the dont fragment message parameter. |
#define ICMP_ADDRESS 17 |
Address Mask Request.
#define ICMP_ADDRESSREPLY 18 |
Address Mask Reply.
#define ICMP_ALTERNATE_ADDR 6 |
Alternate Host Address.
Referenced by icmp_process_packet().
#define ICMP_ALTERNATE_HOST 0 |
Alternate address for host.
#define ICMP_CHECKSUM | ( | header, | |||
length | ) | htons(ip_checksum((uint8_t *) (header), (length))) |
Computes the ICMP datagram checksum.
[in,out] | header | The ICMP datagram header. |
[in] | length | The total datagram length. |
Referenced by icmp_process_packet(), and icmp_send_packet().
#define ICMP_CONNECT_TIMEOUT (1 * 1000 * 1000) |
Default timeout for incoming connections in microseconds.
Referenced by main().
#define ICMP_CONVERSION_ERROR 31 |
Datagram Conversion Error.
Referenced by icmp_process_packet().
#define ICMP_DEST_UNREACH 3 |
Destination Unreachable.
Referenced by icmp_process_packet().
#define ICMP_DN_REPLY 38 |
Domain name reply.
#define ICMP_DN_REQUEST 37 |
Domain name request.
#define ICMP_ECHO 8 |
Echo Request.
Referenced by icmp_echo(), icmp_process_packet(), and main().
#define ICMP_ECHO_TEXT "Hello from HelenOS." |
An echo request datagrams pattern.
Referenced by icmp_echo().
#define ICMP_ECHOREPLY 0 |
Echo Reply.
Referenced by icmp_process_packet().
#define ICMP_EXC_FRAGTIME 1 |
Reassembly TTL exceeded.
#define ICMP_EXC_TTL 0 |
Transit TTL exceeded.
Referenced by ip_process_packet().
#define ICMP_FRAG_NEEDED 4 |
Fragmentation needed but the Do Not Fragment bit was set.
Referenced by ip_split_packet().
#define ICMP_FREE_IDS_END MAX_UINT16 |
Free identifier numbers pool end.
Referenced by icmp_bind_free_id().
#define ICMP_FREE_IDS_START 1 |
Free identifier numbers pool start.
Referenced by icmp_bind_free_id().
#define ICMP_GET_CODE | ( | call | ) | (icmp_code_t) IPC_GET_ARG1(*call) |
Returns the ICMP code message parameter.
[in] | call | The message call structure. |
Referenced by icmp_process_message().
#define ICMP_GET_DONT_FRAGMENT | ( | call | ) | (int) IPC_GET_ARG5(call) |
Returns the dont fragment message parameter.
[in] | call | The message call structure. |
Referenced by icmp_process_client_messages().
#define ICMP_GET_MTU | ( | call | ) | (icmp_param_t) IPC_GET_ARG3(*call) |
Returns the ICMP link MTU message parameter.
[in] | call | The message call structure. |
Referenced by icmp_process_message().
#define ICMP_GET_POINTER | ( | call | ) | (icmp_param_t) IPC_GET_ARG3(*call) |
Returns the pointer message parameter.
[in] | call | The message call structure. |
Referenced by icmp_process_message().
#define ICMP_GET_REPLY_KEY | ( | id, | |||
sequence | ) | (((id) << 16) | (sequence &0xFFFF)) |
Computes an ICMP reply data key.
[in] | id | The message identifier. |
[in] | sequence | The message sequence number. |
Referenced by icmp_echo(), and icmp_process_echo_reply().
#define ICMP_GET_SIZE | ( | call | ) | (size_t) IPC_GET_ARG1(call) |
Returns the size message parameter.
[in] | call | The message call structure. |
Referenced by icmp_process_client_messages().
#define ICMP_GET_TIMEOUT | ( | call | ) | ((suseconds_t) IPC_GET_ARG2(call)) |
Returns the timeout message parameter.
[in] | call | The message call structure. |
Referenced by icmp_process_client_messages().
#define ICMP_GET_TOS | ( | call | ) | (ip_tos_t) IPC_GET_ARG4(call) |
Returns the type of service message parameter.
[in] | call | The message call structure. |
Referenced by icmp_process_client_messages().
#define ICMP_GET_TTL | ( | call | ) | (ip_ttl_t) IPC_GET_ARG3(call) |
Returns the time to live message parameter.
[in] | call | The message call structure. |
Referenced by icmp_process_client_messages().
#define ICMP_HEADER_SIZE sizeof(icmp_header_t) |
ICMP header size in bytes.
Referenced by icmp_echo(), and icmp_process_packet().
#define ICMP_HOST_ANO 10 |
Destination host administratively prohibited.
#define ICMP_HOST_ISOLATED 8 |
Source host isolated (obsolete).
#define ICMP_HOST_UNKNOWN 7 |
Destination host unknown.
#define ICMP_HOST_UNR_TOS 12 |
Host unreachable for this type of service.
#define ICMP_HOST_UNREACH 1 |
Host Unreachable.
Referenced by ip_process_packet(), and ip_send_route().
#define ICMP_INFO_REPLY 16 |
Information Reply.
#define ICMP_INFO_REQUEST 15 |
Information Request.
#define ICMP_IPV6_I_AM_HERE 34 |
IPv6 I-Am-Here.
#define ICMP_IPV6_WHERE_ARE_YOU 33 |
IPv6 Where-Are-You.
#define ICMP_KEEP_LENGTH 8 |
Original datagram length in bytes transfered to the error notification message.
Referenced by icmp_prepare_packet().
#define ICMP_MOBILE_REPLY 36 |
Mobile Registration Reply.
#define ICMP_MOBILE_REQUEST 35 |
Mobile Registration Request.
#define ICMP_NET_ANO 9 |
Destination network administratively prohibited.
#define ICMP_NET_UNKNOWN 6 |
Destination network unknown.
#define ICMP_NET_UNR_TOS 11 |
Network unreachable for this type of service.
#define ICMP_NET_UNREACH 0 |
Network Unreachable.
#define ICMP_PARAM_LENGTH 2 |
Bad length.
#define ICMP_PARAM_MISSING 1 |
Missing required option.
#define ICMP_PARAM_POINTER 0 |
Pointer indicates the error.
Referenced by ip_process_packet(), tcp_process_packet(), and udp_process_packet().
#define ICMP_PARAMETERPROB 12 |
Parameter Problem.
Referenced by icmp_process_packet().
#define ICMP_PHOTURIS 40 |
Photuris.
Referenced by icmp_process_packet().
#define ICMP_PHOTURIS_AUTHENTICATION 1 |
Authentication failed.
#define ICMP_PHOTURIS_BAD_SPI 0 |
Bad SPI.
#define ICMP_PHOTURIS_DECOMPRESSION 2 |
Decompression failed.
#define ICMP_PHOTURIS_DECRYPTION 3 |
Decryption failed.
#define ICMP_PHOTURIS_NEED_AUTHENTICATION 4 |
Need authentication.
#define ICMP_PHOTURIS_NEED_AUTHORIZATION 5 |
Need authorization.
#define ICMP_PKT_FILTERED 13 |
Communication administratively prohibited by filtering.
#define ICMP_PORT_UNREACH 3 |
Port Unreachable.
Referenced by tcp_process_packet(), and udp_process_packet().
#define ICMP_PREC_CUTOFF 15 |
Precedence cutoff in effect.
#define ICMP_PREC_VIOLATION 14 |
Host precedence violation.
#define ICMP_PROT_UNREACH 2 |
Protocol Unreachable.
Referenced by ip_deliver_local().
#define ICMP_REDIR_HOST 1 |
Host redirect.
#define ICMP_REDIR_HOSTTOS 3 |
Host redirect for this type of service.
#define ICMP_REDIR_NET 0 |
Network redirect (or subnet).
#define ICMP_REDIR_NETTOS 2 |
Network redirect for this type of service.
#define ICMP_REDIRECT 5 |
Redirect.
Referenced by icmp_process_packet().
#define ICMP_REDIRECT_MOBILE 32 |
Mobile Host Redirect.
Referenced by icmp_process_packet().
#define ICMP_ROUTER_ADV 9 |
Router Advertisement.
Referenced by icmp_process_packet().
#define ICMP_ROUTER_NO_NORMAL_TRAFFIC 16 |
Does not route common traffic.
#define ICMP_ROUTER_NORMAL 0 |
Normal router advertisement.
#define ICMP_ROUTER_SOL 10 |
Router solicitation.
Referenced by icmp_process_packet().
#define ICMP_SKIP 39 |
SKIP.
Referenced by icmp_process_packet().
#define ICMP_SOURCE_QUENCH 4 |
Source Quench.
Referenced by icmp_process_packet().
#define ICMP_SR_FAILED 5 |
Source Route failed.
#define ICMP_TIME_EXCEEDED 11 |
Time Exceeded.
Referenced by icmp_process_packet().
#define ICMP_TIMESTAMP 13 |
Timestamp Request.
#define ICMP_TIMESTAMPREPLY 14 |
Timestamp Reply.
#define ICMP_TRACEROUTE 30 |
Traceroute.
#define NAME "ICMP protocol" |
ICMP module name.
#define NET_DEFAULT_ICMP_ECHO_REPLYING true |
Default ICMP echo replying.
#define NET_DEFAULT_ICMP_ERROR_REPORTING true |
Default ICMP error reporting.
typedef uint8_t icmp_code_t |
ICMP code type definition.
typedef icmp_echo_t* icmp_echo_ref |
Type definition of the echo specific data pointer.
typedef struct icmp_echo icmp_echo_t |
Type definition of the echo specific data.
typedef struct icmp_globals icmp_globals_t |
Type definition of the ICMP global data.
typedef icmp_header_t* icmp_header_ref |
Type definition of the internet control message header pointer.
typedef struct icmp_header icmp_header_t |
Type definition of the internet control message header.
typedef uint16_t icmp_param_t |
ICMP parameter type definition.
typedef icmp_reply_t* icmp_reply_ref |
Type definition of the ICMP reply data pointer.
typedef struct icmp_reply icmp_reply_t |
Type definition of the ICMP reply data.
typedef uint8_t icmp_type_t |
ICMP type type definition.
typedef size_t mseconds_t |
Miliseconds type definition.
enum icmp_messages |
ICMP module messages.
NET_ICMP_ECHO |
Sends echo request.
|
NET_ICMP_DEST_UNREACH |
Sends destination unreachable error message.
|
NET_ICMP_SOURCE_QUENCH |
Sends source quench error message.
|
NET_ICMP_TIME_EXCEEDED |
Sends time exceeded error message.
|
NET_ICMP_PARAMETERPROB |
Sends parameter problem error message.
|
NET_ICMP_INIT |
Initializes new connection. |
int icmp_bind_free_id | ( | icmp_echo_ref | echo_data | ) |
Assigns a new identifier for the connection.
Fills the echo data parameter with the assigned values.
[in,out] | echo_data | The echo data to be bound. |
References icmp_globals::echo_data, ENOTCONN, ICMP_FREE_IDS_END, ICMP_FREE_IDS_START, icmp_echo::identifier, icmp_globals::last_used_id, and icmp_echo::sequence_number.
Referenced by icmp_process_client_messages().
size_t icmp_client_header_length | ( | packet_t | packet | ) |
Returns the ICMP header length.
References packet_get_data_length().
int icmp_client_process_packet | ( | packet_t | packet, | |
icmp_type_t * | type, | |||
icmp_code_t * | code, | |||
icmp_param_t * | pointer, | |||
icmp_param_t * | mtu | |||
) |
Processes the received packet prefixed with an ICMP header.
[in] | packet | The received packet. |
[out] | type | The ICMP header type. |
[out] | code | The ICMP header code. |
[out] | pointer | The ICMP header pointer. |
[out] | mtu | The ICMP header MTU. |
References icmp_header::code, icmp_header::frag, packet_get_data(), packet_get_data_length(), packet_get_id(), icmp_header::param, icmp_header::type, and icmp_header::un.
Referenced by icmp_process_packet(), tcp_process_packet(), and udp_process_packet().
int icmp_connect_module | ( | services_t | service, | |
suseconds_t | timeout | |||
) |
Connects to the ICMP module.
service | The ICMP module service. Ignored parameter. | |
[in] | timeout | The connection timeout in microseconds. No timeout if set to zero (0). |
References connect_to_service_timeout(), and NET_ICMP_INIT.
Referenced by main().
int icmp_destination_unreachable_msg | ( | int | icmp_phone, | |
icmp_code_t | code, | |||
icmp_param_t | mtu, | |||
packet_t | packet | |||
) |
Sends the Destination Unreachable error notification packet.
Beginning of the packet is sent as the notification packet data. The source and the destination addresses should be set in the original packet.
[in] | icmp_phone | The ICMP module phone used for (semi)remote calls. |
[in] | code | The error specific code. |
[in] | mtu | The error MTU value. |
[in] | packet | The original packet. |
References NET_ICMP_DEST_UNREACH, and packet_get_id().
Referenced by icmp_process_message(), ip_deliver_local(), ip_process_packet(), ip_send_route(), ip_split_packet(), tcp_process_packet(), and udp_process_packet().
int icmp_echo | ( | icmp_param_t | id, | |
icmp_param_t | sequence, | |||
size_t | size, | |||
mseconds_t | timeout, | |||
ip_ttl_t | ttl, | |||
ip_tos_t | tos, | |||
int | dont_fragment, | |||
const struct sockaddr * | addr, | |||
socklen_t | addrlen | |||
) |
Requests an echo message.
Sends a packet with specified parameters to the target host and waits for the reply upto the given timeout. Blocks the caller until the reply or the timeout occurs.
[in] | id | The message identifier. |
[in] | sequence | The message sequence parameter. |
[in] | size | The message data length in bytes. |
[in] | timeout | The timeout in miliseconds. |
[in] | ttl | The time to live. |
[in] | tos | The type of service. |
[in] | dont_fragment | The value indicating whether the datagram must not be fragmented. Is used as a MTU discovery. |
[in] | addr | The target host address. |
[in] | addrlen | The torget host address length. |
References packet_dimension::addr_len, icmp_reply::condvar, icmp_header::echo, ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, ERROR_PROPAGATE, free, ICMP_ECHO, ICMP_ECHO_TEXT, ICMP_GET_REPLY_KEY, ICMP_HEADER_SIZE, icmp_release_and_return(), icmp_send_packet(), icmp_echo::identifier, ip_packet_size_req(), icmp_globals::ip_phone, packet::length, icmp_globals::lock, icmp_reply::mutex, icmp_globals::net_phone, icmp_globals::packet_dimension, packet_get_4(), PACKET_PREFIX, packet_set_addr(), packet_suffix(), packet_dimension::prefix, icmp_globals::replies, reply(), icmp_reply::result, icmp_echo::sequence_number, packet_dimension::suffix, and icmp_header::un.
Referenced by icmp_process_client_messages().
int icmp_echo_msg | ( | int | icmp_phone, | |
size_t | size, | |||
mseconds_t | timeout, | |||
ip_ttl_t | ttl, | |||
ip_tos_t | tos, | |||
int | dont_fragment, | |||
const struct sockaddr * | addr, | |||
socklen_t | addrlen | |||
) |
Requests an echo message.
Sends a packet with specified parameters to the target host and waits for the reply upto the given timeout. Blocks the caller until the reply or the timeout occurres.
[in] | icmp_phone | The ICMP module phone used for (semi)remote calls. |
[in] | size | The message data length in bytes. |
[in] | timeout | The timeout in miliseconds. |
[in] | ttl | The time to live. |
[in] | tos | The type of service. |
[in] | dont_fragment | The value indicating whether the datagram must not be fragmented. Is used as a MTU discovery. |
[in] | addr | The target host address. |
[in] | addrlen | The torget host address length. |
References NET_ICMP_ECHO.
Referenced by main().
int icmp_initialize | ( | async_client_conn_t | client_connection | ) |
Initializes the ICMP module.
[in] | client_connection | The client connection processing function. The module skeleton propagates its own one. |
Referenced by module_start().
int icmp_message | ( | ipc_callid_t | callid, | |
ipc_call_t * | call, | |||
ipc_call_t * | answer, | |||
int * | answer_count | |||
) |
Processes the ICMP message.
[in] | callid | The message identifier. |
[in] | call | The message parameters. |
[out] | answer | The message answer parameters. |
[out] | answer_count | The last parameter for the actual answer in the answer parameter. |
Referenced by module_message().
int icmp_parameter_problem_msg | ( | int | icmp_phone, | |
icmp_code_t | code, | |||
icmp_param_t | pointer, | |||
packet_t | packet | |||
) |
Sends the Parameter Problem error notification packet.
Beginning of the packet is sent as the notification packet data. The source and the destination addresses should be set in the original packet.
[in] | icmp_phone | The ICMP module phone used for (semi)remote calls. |
[in] | code | The error specific code. |
[in] | pointer | The problematic parameter offset. |
[in] | packet | The original packet. |
References NET_ICMP_PARAMETERPROB, and packet_get_id().
Referenced by icmp_process_message(), ip_process_packet(), tcp_process_packet(), and udp_process_packet().
icmp_header_ref icmp_prepare_packet | ( | packet_t | packet | ) |
Prepares the ICMP error packet.
Truncates the original packet if longer than ICMP_KEEP_LENGTH bytes. Prefixes and returns the ICMP header.
References ICMP_KEEP_LENGTH, ip_client_header_length(), packet_get_data_length(), PACKET_PREFIX, and packet_trim().
int icmp_process_client_messages | ( | ipc_callid_t | callid, | |
ipc_call_t | call | |||
) |
Processes the client messages.
Remembers the assigned identifier and sequence numbers. Runs until the client module disconnects.
[in] | callid | The message identifier. |
[in] | call | The message parameters. |
References answer_call(), icmp_globals::echo_data, ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, free, icmp_bind_free_id(), icmp_echo(), ICMP_GET_DONT_FRAGMENT, ICMP_GET_SIZE, ICMP_GET_TIMEOUT, ICMP_GET_TOS, ICMP_GET_TTL, icmp_process_message(), icmp_echo::identifier, packet::length, icmp_globals::lock, NET_ICMP_ECHO, refresh_answer(), and icmp_echo::sequence_number.
int icmp_process_echo_reply | ( | packet_t | packet, | |
icmp_header_ref | header, | |||
icmp_type_t | type, | |||
icmp_code_t | code | |||
) |
Tries to set the pending reply result as the received message type.
If the reply data is not present, the reply timed out and the other fibril is already awake. Releases the packet.
[in] | packet | The received reply message. |
[in] | header | The ICMP message header. |
[in] | type | The received reply message type. |
[in] | code | The received reply message code. |
References icmp_reply::condvar, icmp_header::echo, ICMP_GET_REPLY_KEY, icmp_echo::identifier, icmp_globals::lock, icmp_globals::net_phone, packet_get_id(), pq_release(), icmp_globals::replies, reply(), icmp_reply::result, icmp_echo::sequence_number, and icmp_header::un.
Referenced by icmp_process_packet().
int icmp_process_message | ( | ipc_call_t * | call | ) |
Processes the generic client messages.
[in] | call | The message parameters. |
References ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, icmp_destination_unreachable_msg(), ICMP_GET_CODE, ICMP_GET_MTU, ICMP_GET_POINTER, icmp_parameter_problem_msg(), icmp_source_quench_msg(), icmp_time_exceeded_msg(), IPC_GET_PACKET, NET_ICMP_DEST_UNREACH, NET_ICMP_PARAMETERPROB, NET_ICMP_SOURCE_QUENCH, NET_ICMP_TIME_EXCEEDED, icmp_globals::net_phone, and packet_translate().
Referenced by icmp_process_client_messages().
int icmp_process_packet | ( | packet_t | packet, | |
services_t | error | |||
) |
Processes the received ICMP packet.
Notifies the destination socket application.
[in,out] | packet | The received packet. |
[in] | error | The packet error reporting service. Prefixes the received packet. |
References icmp_header::checksum, icmp_globals::echo_replying, ERROR_DECLARE, ERROR_PROPAGATE, ICMP_ALTERNATE_ADDR, ICMP_CHECKSUM, icmp_client_process_packet(), ICMP_CONVERSION_ERROR, ICMP_DEST_UNREACH, ICMP_ECHO, ICMP_ECHOREPLY, ICMP_HEADER_SIZE, ICMP_PARAMETERPROB, ICMP_PHOTURIS, icmp_process_echo_reply(), ICMP_REDIRECT, ICMP_REDIRECT_MOBILE, ICMP_ROUTER_ADV, ICMP_ROUTER_SOL, icmp_send_packet(), ICMP_SKIP, ICMP_SOURCE_QUENCH, ICMP_TIME_EXCEEDED, IP_CHECKSUM_ZERO, ip_client_header_length(), icmp_globals::ip_phone, ip_received_error_msg(), packet::length, packet_get_addr(), packet_get_data(), packet_get_data_length(), packet_set_addr(), packet_trim(), and icmp_header::type.
Referenced by icmp_received_msg().
int icmp_received_msg | ( | device_id_t | device_id, | |
packet_t | packet, | |||
services_t | receiver, | |||
services_t | error | |||
) |
Processes the received ICMP packet.
Is used as an entry point from the underlying IP module. Releases the packet on error.
device_id | The device identifier. Ignored parameter. | |
[in,out] | packet | The received packet. |
receiver | The target service. Ignored parameter. | |
[in] | error | The packet error reporting service. Prefixes the received packet. |
References ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, icmp_process_packet(), and icmp_release_and_return().
int icmp_release_and_return | ( | packet_t | packet, | |
int | result | |||
) |
Releases the packet and returns the result.
References icmp_globals::net_phone, packet_get_id(), and pq_release().
Referenced by icmp_echo(), icmp_received_msg(), and icmp_send_packet().
int icmp_send_packet | ( | icmp_type_t | type, | |
icmp_code_t | code, | |||
packet_t | packet, | |||
icmp_header_ref | header, | |||
services_t | error, | |||
ip_ttl_t | ttl, | |||
ip_tos_t | tos, | |||
int | dont_fragment | |||
) |
Sends the ICMP message.
Sets the message type and code and computes the checksum. Error messages are sent only if allowed in the configuration. Releases the packet on errors.
[in] | type | The message type. |
[in] | code | The message code. |
[in] | packet | The message packet to be sent. |
[in] | header | The ICMP header. |
[in] | error | The error service to be announced. Should be SERVICE_ICMP or zero (0). |
[in] | ttl | The time to live. |
[in] | tos | The type of service. |
[in] | dont_fragment | The value indicating whether the datagram must not be fragmented. Is used as a MTU discovery. |
References icmp_header::checksum, icmp_header::code, ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, icmp_globals::error_reporting, ICMP_CHECKSUM, icmp_release_and_return(), ip_client_prepare_packet(), icmp_globals::ip_phone, ip_send_msg(), IPPROTO_ICMP, packet_get_data_length(), and icmp_header::type.
Referenced by icmp_echo(), and icmp_process_packet().
int icmp_source_quench_msg | ( | int | icmp_phone, | |
packet_t | packet | |||
) |
Sends the Source Quench error notification packet.
Beginning of the packet is sent as the notification packet data. The source and the destination addresses should be set in the original packet.
[in] | icmp_phone | The ICMP module phone used for (semi)remote calls. |
[in] | packet | The original packet. |
References NET_ICMP_SOURCE_QUENCH, and packet_get_id().
Referenced by icmp_process_message().
int icmp_time_exceeded_msg | ( | int | icmp_phone, | |
icmp_code_t | code, | |||
packet_t | packet | |||
) |
Sends the Time Exceeded error notification packet.
Beginning of the packet is sent as the notification packet data. The source and the destination addresses should be set in the original packet.
[in] | icmp_phone | The ICMP module phone used for (semi)remote calls. |
[in] | code | The error specific code. |
[in] | packet | The original packet. |
References NET_ICMP_TIME_EXCEEDED, and packet_get_id().
Referenced by icmp_process_message(), and ip_process_packet().
INT_MAP_DECLARE | ( | icmp_echo_data | , | |
icmp_echo_t | ||||
) |
Echo specific data map.
The bundle module gets an identifier of the assigned echo specific data while connecting. The identifier is used in the future semi-remote calls instead of the ICMP phone.
INT_MAP_DECLARE | ( | icmp_replies | , | |
icmp_reply_t | ||||
) |
Pending replies map.
Maps message identifiers to the pending replies. Sending fibril waits for its associated reply event. Receiving fibril sets the associated reply with the return value and signals the event.
INT_MAP_IMPLEMENT | ( | icmp_echo_data | , | |
icmp_echo_t | ||||
) |
INT_MAP_IMPLEMENT | ( | icmp_replies | , | |
icmp_reply_t | ||||
) |
int module_message | ( | ipc_callid_t | callid, | |
ipc_call_t * | call, | |||
ipc_call_t * | answer, | |||
int * | answer_count | |||
) |
Processes the ICMP message.
[in] | callid | The message identifier. |
[in] | call | The message parameters. |
[out] | answer | The message answer parameters. |
[out] | answer_count | The last parameter for the actual answer in the answer parameter. |
References icmp_message().
int module_start | ( | async_client_conn_t | client_connection | ) |
Starts the ICMP module.
Initializes the client connection serving function, initializes the module, registers the module service and starts the async manager, processing IPC messages in an infinite loop.
[in] | client_connection | The client connection processing function. The module skeleton propagates its own one. |
References ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, ERROR_PROPAGATE, icmp_initialize(), net_connect_module(), icmp_globals::net_phone, pm_destroy(), pm_init(), and REGISTER_ME.
ICMP module global data.
ICMP global data.
ICMP module global data.