diff options
author | Ren Kararou <[email protected]> | 2024-12-26 01:50:22 -0600 |
---|---|---|
committer | Ren Kararou <[email protected]> | 2024-12-26 01:50:22 -0600 |
commit | 746cd14f273a96c0348f4e64f9b347ce49a93f45 (patch) | |
tree | 813aee86d27bd8ec0b4416ea6cd5f22603666a89 /src/main.c | |
parent | 6b0cf95d75935308e142232fe646d56d0f9d418c (diff) | |
download | nbtpd-746cd14f273a96c0348f4e64f9b347ce49a93f45.tar.gz nbtpd-746cd14f273a96c0348f4e64f9b347ce49a93f45.tar.bz2 nbtpd-746cd14f273a96c0348f4e64f9b347ce49a93f45.zip |
add ci; update packet structs; add makefile
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index 15d3008..159b0b5 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,20 @@ +#include <stdint.h> +#include <stdio.h> +#include <sys/socket.h> +#include <pthread.h> -int main() { +#include "packet.h" +#include "netascii.h" + +int main(int argc, char** argv) { + //TODO: use getopt() to parse args + int s = socket(AF_INET, SOCK_DGRAM, 0); + if (s <= 0) { + fprintf(stderr, "error: socket cannot be created.\n"); + return -1; + } + //TODO: threading! + //TODO: daemonize! + fprintf(stderr, "error: routine completed successfully.\n"); return 0; } |