icmp.c File Reference

ICMP module implementation. More...

#include <async.h>
#include <atomic.h>
#include <fibril.h>
#include <fibril_synch.h>
#include <stdint.h>
#include <string.h>
#include <ipc/ipc.h>
#include <ipc/services.h>
#include <sys/time.h>
#include <sys/types.h>
#include "../../err.h"
#include "../../messages.h"
#include "../../modules.h"
#include "../../structures/packet/packet_client.h"
#include "../../include/byteorder.h"
#include "../../include/checksum.h"
#include "../../include/icmp_api.h"
#include "../../include/icmp_client.h"
#include "../../include/icmp_codes.h"
#include "../../include/icmp_common.h"
#include "../../include/icmp_interface.h"
#include "../../include/il_interface.h"
#include "../../include/inet.h"
#include "../../include/ip_client.h"
#include "../../include/ip_interface.h"
#include "../../include/ip_protocols.h"
#include "../../include/net_interface.h"
#include "../../include/socket_codes.h"
#include "../../include/socket_errno.h"
#include "../../tl/tl_messages.h"
#include "icmp.h"
#include "icmp_header.h"
#include "icmp_messages.h"
#include "icmp_module.h"
Include dependency graph for icmp.c:

Defines

#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.

Functions

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_connect_module (services_t service, suseconds_t timeout)
 Connects to the ICMP module.
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.
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.

Variables

icmp_globals_t icmp_globals
 ICMP global data.

Detailed Description

ICMP module implementation.

See also:
icmp.h

Generated on Thu Mar 11 20:46:18 2010 for Networking and TCP/IP stack for HelenOS system by  doxygen 1.6.1