mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 10:02:42 +03:00
[ping] Add generic ping mechanism
Add generic pinger mechanism (analogous to the generic downloader mechanism) which opens a ping socket, transmits ping requests, and passes information about ping replies to a callback function. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -64,6 +64,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
#define ERRFILE_xferbuf ( ERRFILE_CORE | 0x00180000 )
|
||||
#define ERRFILE_pending ( ERRFILE_CORE | 0x00190000 )
|
||||
#define ERRFILE_null_reboot ( ERRFILE_CORE | 0x001a0000 )
|
||||
#define ERRFILE_pinger ( ERRFILE_CORE | 0x001b0000 )
|
||||
|
||||
#define ERRFILE_eisa ( ERRFILE_DRIVER | 0x00000000 )
|
||||
#define ERRFILE_isa ( ERRFILE_DRIVER | 0x00010000 )
|
||||
|
||||
23
src/include/ipxe/pinger.h
Normal file
23
src/include/ipxe/pinger.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _IPXE_PINGER_H
|
||||
#define _IPXE_PINGER_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* ICMP ping sender
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ipxe/interface.h>
|
||||
#include <ipxe/socket.h>
|
||||
|
||||
extern int create_pinger ( struct interface *job, const char *hostname,
|
||||
unsigned long timeout, size_t len,
|
||||
void ( * callback ) ( struct sockaddr *peer,
|
||||
unsigned int sequence,
|
||||
size_t len,
|
||||
int rc ) );
|
||||
|
||||
#endif /* _IPXE_PINGER_H */
|
||||
Reference in New Issue
Block a user