[icmp] Add support for responding to pings

This commit is contained in:
Michael Brown
2009-02-17 06:59:15 +00:00
parent dbbd81c140
commit 06b5132fdc
4 changed files with 128 additions and 0 deletions

View File

@@ -139,6 +139,7 @@
#define ERRFILE_slam ( ERRFILE_NET | 0x00160000 )
#define ERRFILE_ib_sma ( ERRFILE_NET | 0x00170000 )
#define ERRFILE_ib_packet ( ERRFILE_NET | 0x00180000 )
#define ERRFILE_icmp ( ERRFILE_NET | 0x00190000 )
#define ERRFILE_image ( ERRFILE_IMAGE | 0x00000000 )
#define ERRFILE_elf ( ERRFILE_IMAGE | 0x00010000 )

23
src/include/gpxe/icmp.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _GPXE_ICMP_H
#define _GPXE_ICMP_H
/** @file
*
* ICMP protocol
*
*/
/** An ICMP header */
struct icmp_header {
/** Type */
uint8_t type;
/** Code */
uint8_t code;
/** Checksum */
uint16_t chksum;
} __attribute__ (( packed ));
#define ICMP_ECHO_RESPONSE 0
#define ICMP_ECHO_REQUEST 8
#endif /* _GPXE_ICMP_H */