aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2014-10-23 16:30:58 +0100
committerMichael Brown <mcb30@ipxe.org>2014-10-23 16:39:42 +0100
commit1c34ca70d199ceee9d663986e377b7f74c826d0c (patch)
tree31fd9def4bbf41ed099b33d3d86bb03134a2a41f /src/include/usr
parentd1afe731eae1f0f97238de5213df1610d0ccf4ed (diff)
downloadipxe-1c34ca70d199ceee9d663986e377b7f74c826d0c.tar.gz
[ping] Allow termination after a specified number of packets
Add the "-c <count>" option to the "ping" command, allowing for automatic termination after a specified number of packets. When a number of packets is specified: - if a serious error (i.e. length mismatch or content mismatch) occurs, then the ping will be immediately terminated with the relevant status code; - if at least one response is received successfully, and all errors are non-serious (i.e. timeouts or out-of-sequence responses), then the ping will be terminated after the final response (or timeout) with a success status; - if no responses are received successfully, then the ping will be terminated after the final timeout with ETIMEDOUT. If no number of packets is specified, then the ping will continue until manually interrupted. Originally-implemented-by: Cedric Levasseur <cyr-ius@ipocus.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/pingmgmt.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/usr/pingmgmt.h b/src/include/usr/pingmgmt.h
index 45ad5d394..8bded3849 100644
--- a/src/include/usr/pingmgmt.h
+++ b/src/include/usr/pingmgmt.h
@@ -11,6 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <stdint.h>
-extern int ping ( const char *hostname, unsigned long timeout, size_t len );
+extern int ping ( const char *hostname, unsigned long timeout, size_t len,
+ unsigned int count );
#endif /* _USR_PINGMGMT_H */