summaryrefslogtreecommitdiffhomepage
path: root/public/tools/ping
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-29 10:51:53 +0200
committerGitHub <noreply@github.com>2025-05-29 10:51:53 +0200
commit5c0bb7ee7b1b0fee02cc179fb21f4c57a61d6c2d (patch)
treecb17577bcdc9714c97a84ce417a075117097f146 /public/tools/ping
parentd608230b1350b064ceb01e6572519b108f6139b0 (diff)
parent3167f59dbb401d6a79b1524537e04218baf49ee3 (diff)
Merge pull request #32 from nekernel-org/dev
0.0.2e3
Diffstat (limited to 'public/tools/ping')
-rw-r--r--public/tools/ping/.keep0
-rw-r--r--public/tools/ping/ping.json19
-rw-r--r--public/tools/ping/src/.keep0
-rw-r--r--public/tools/ping/src/CommandLine.cc29
-rw-r--r--public/tools/ping/vendor/.keep0
5 files changed, 48 insertions, 0 deletions
diff --git a/public/tools/ping/.keep b/public/tools/ping/.keep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/public/tools/ping/.keep
diff --git a/public/tools/ping/ping.json b/public/tools/ping/ping.json
new file mode 100644
index 00000000..d8d4133a
--- /dev/null
+++ b/public/tools/ping/ping.json
@@ -0,0 +1,19 @@
+{
+ "compiler_path": "clang++",
+ "compiler_std": "c++20",
+ "headers_path": [
+ "./",
+ "../../../dev/kernel",
+ "../../../public/frameworks/",
+ "../../../dev/",
+ "./"
+ ],
+ "sources_path": [],
+ "output_name": "./dist/ping",
+ "cpp_macros": [
+ "kSampleFWVersion=0x0100",
+ "kSampleFWVersionHighest=0x0100",
+ "kSampleFWVersionLowest=0x0100",
+ "__NE_SDK__"
+ ]
+} \ No newline at end of file
diff --git a/public/tools/ping/src/.keep b/public/tools/ping/src/.keep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/public/tools/ping/src/.keep
diff --git a/public/tools/ping/src/CommandLine.cc b/public/tools/ping/src/CommandLine.cc
new file mode 100644
index 00000000..f5c82b80
--- /dev/null
+++ b/public/tools/ping/src/CommandLine.cc
@@ -0,0 +1,29 @@
+#include <libSystem/System.h>
+
+SInt32 _NeMain(SInt32 argc, Char* argv[]) {
+ SCI_UNUSED(argc);
+
+ if (argc < 2) {
+ PrintOut(nullptr, "HELP: ping <hostname>\n");
+ return EXIT_FAILURE;
+ }
+
+ PrintOut(nullptr, "Pinging %s...\n", argv[1]);
+
+ for (SizeT i = 0U; i < 4; ++i) {
+ SInt32 result = 0;
+
+ if (result != 0) {
+ PrintOut(nullptr, "Request timed out.\n");
+ return EXIT_FAILURE;
+ }
+
+ SInt32 bytes = 64; // Simulated response size
+ SInt32 time = 100 + (i * 10); // Simulated response time
+ SInt32 ttl = 64;
+
+ PrintOut(nullptr, "Reply from %s: bytes=%i time=%ims TTL=%i\n", argv[1], bytes, time, ttl);
+ }
+
+ return EXIT_SUCCESS;
+} \ No newline at end of file
diff --git a/public/tools/ping/vendor/.keep b/public/tools/ping/vendor/.keep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/public/tools/ping/vendor/.keep