diff options
author | dzwdz | 2022-08-21 22:33:09 +0200 |
---|---|---|
committer | dzwdz | 2022-08-21 22:33:09 +0200 |
commit | e35d6a4fde9a0671bc7d2527ff6b55b0ce1b4b1e (patch) | |
tree | beb45a1ea334c18a29297684c009e9fb479bebeb /src/user | |
parent | dc5098f83ac55722744a97d2950f50ef2a221f1a (diff) |
user: rename ethdump to netstack
Diffstat (limited to 'src/user')
-rw-r--r-- | src/user/app/init/init.c | 2 | ||||
-rw-r--r-- | src/user/app/netstack/arp.c (renamed from src/user/app/ethdump/arp.c) | 0 | ||||
-rw-r--r-- | src/user/app/netstack/ether.c (renamed from src/user/app/ethdump/ether.c) | 0 | ||||
-rw-r--r-- | src/user/app/netstack/fs.c (renamed from src/user/app/ethdump/fs.c) | 0 | ||||
-rw-r--r-- | src/user/app/netstack/icmp.c (renamed from src/user/app/ethdump/icmp.c) | 0 | ||||
-rw-r--r-- | src/user/app/netstack/ipv4.c (renamed from src/user/app/ethdump/ipv4.c) | 0 | ||||
-rw-r--r-- | src/user/app/netstack/netstack.c (renamed from src/user/app/ethdump/ethdump.c) | 12 | ||||
-rw-r--r-- | src/user/app/netstack/proto.h (renamed from src/user/app/ethdump/proto.h) | 0 | ||||
-rw-r--r-- | src/user/app/netstack/udp.c (renamed from src/user/app/ethdump/udp.c) | 0 | ||||
-rw-r--r-- | src/user/app/netstack/util.c (renamed from src/user/app/ethdump/util.c) | 0 | ||||
-rw-r--r-- | src/user/app/netstack/util.h (renamed from src/user/app/ethdump/util.h) | 2 |
11 files changed, 9 insertions, 7 deletions
diff --git a/src/user/app/init/init.c b/src/user/app/init/init.c index acf9b03..7b7afc4 100644 --- a/src/user/app/init/init.c +++ b/src/user/app/init/init.c @@ -68,7 +68,7 @@ int main(void) { execv(argv[0], (void*)argv); } MOUNT_AT("/net/") { - const char *argv[] = {"/bin/ethdump", NULL}; + const char *argv[] = {"/bin/netstack", "/kdev/eth", NULL}; execv(argv[0], (void*)argv); } diff --git a/src/user/app/ethdump/arp.c b/src/user/app/netstack/arp.c index cfb1e04..cfb1e04 100644 --- a/src/user/app/ethdump/arp.c +++ b/src/user/app/netstack/arp.c diff --git a/src/user/app/ethdump/ether.c b/src/user/app/netstack/ether.c index 5893632..5893632 100644 --- a/src/user/app/ethdump/ether.c +++ b/src/user/app/netstack/ether.c diff --git a/src/user/app/ethdump/fs.c b/src/user/app/netstack/fs.c index b8c2f7b..b8c2f7b 100644 --- a/src/user/app/ethdump/fs.c +++ b/src/user/app/netstack/fs.c diff --git a/src/user/app/ethdump/icmp.c b/src/user/app/netstack/icmp.c index 0c6a502..0c6a502 100644 --- a/src/user/app/ethdump/icmp.c +++ b/src/user/app/netstack/icmp.c diff --git a/src/user/app/ethdump/ipv4.c b/src/user/app/netstack/ipv4.c index 3243d3c..3243d3c 100644 --- a/src/user/app/ethdump/ipv4.c +++ b/src/user/app/netstack/ipv4.c diff --git a/src/user/app/ethdump/ethdump.c b/src/user/app/netstack/netstack.c index 17592a1..0451511 100644 --- a/src/user/app/ethdump/ethdump.c +++ b/src/user/app/netstack/netstack.c @@ -26,14 +26,16 @@ void network_thread(void *arg) { (void)arg; void fs_thread(void *arg); -int main(void) { - const char *path = "/kdev/eth"; - state.raw_h = _syscall_open(path, strlen(path), 0); +int main(int argc, char **argv) { + if (argc < 2) { + eprintf("no argument"); + return 1; + } + state.raw_h = _syscall_open(argv[1], strlen(argv[1]), 0); if (state.raw_h < 0) { - eprintf("couldn't open %s", path); + eprintf("couldn't open %s", argv[1]); return 1; } - thread_create(0, network_thread, NULL); thread_create(0, fs_thread, NULL); _syscall_await(); diff --git a/src/user/app/ethdump/proto.h b/src/user/app/netstack/proto.h index 106f286..106f286 100644 --- a/src/user/app/ethdump/proto.h +++ b/src/user/app/netstack/proto.h diff --git a/src/user/app/ethdump/udp.c b/src/user/app/netstack/udp.c index 8129a48..8129a48 100644 --- a/src/user/app/ethdump/udp.c +++ b/src/user/app/netstack/udp.c diff --git a/src/user/app/ethdump/util.c b/src/user/app/netstack/util.c index 7c484f3..7c484f3 100644 --- a/src/user/app/ethdump/util.c +++ b/src/user/app/netstack/util.c diff --git a/src/user/app/ethdump/util.h b/src/user/app/netstack/util.h index bfff6e3..5472b05 100644 --- a/src/user/app/ethdump/util.h +++ b/src/user/app/netstack/util.h @@ -4,7 +4,7 @@ #include <stdlib.h> #include <string.h> -#define eprintf(fmt, ...) fprintf(stderr, "ethdump: "fmt"\n" __VA_OPT__(,) __VA_ARGS__) +#define eprintf(fmt, ...) fprintf(stderr, "netstack: "fmt"\n" __VA_OPT__(,) __VA_ARGS__) uint32_t crc32(const uint8_t *buf, size_t len); uint16_t ip_checksum(const uint8_t *buf, size_t len); |