/**
 * @file icmp-light_types.h
 *
 * @brief Internet Control Message Protocol (ICMP) - minimal implemenation (types).
 *
 * Copyright 2007-2008, Freie Universitaet Berlin. All rights reserved.
 * Please refer to the COPYING file for detailed licensing information.
 *
 * @author Georg Wittenburg
 *
 * $Id: icmp-light_types.h 2685 2008-06-25 16:38:56Z wittenbu $
 */

#ifndef ICMP_LIGHT_TYPES_H
#define ICMP_LIGHT_TYPES_H

#include "../types.h"



/**
 * @brief Results of an echo request.
 */
typedef struct {
	list_t*			nodes;			///< List of nodes that replied. NULL, if no list was allocated by the caller.
	C_errno_t		error_code;		///< Error code.
	callback_parameter_t	parameter;		///< Parameter set by the calling function.
} ICMP_echo_request_result_t;

/**
 * @brief Echo request data structure.
 */
typedef struct {
	uint16_t			id;			///< Unique ID of the echo request.
	C_addr_t			address;		///< Destination address.
	uint16_t			replies;		///< Number of replies.
	uint16_t			callback_id;		///< ID of the timeout callback.
	callback_function_t		function;		///< Callback function.
	ICMP_echo_request_result_t*	echo_request_result;	///< Pointer to results.
} ICMP_echo_request_t;



/*
 * Packet types.
 */

/**
 * @brief ICMP ECHO packet header.
 */
typedef struct {
	uint16_t			id;	///< Unique ID of the echo request.
} ICMP_ECHO_packet_t;

#endif	// ICMP_LIGHT_TYPES_H
