summaryrefslogtreecommitdiff
path: root/client/include/util.h
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2023-06-13 23:56:17 -0500
committerDanny Holman <dholman@gymli.org>2023-06-13 23:56:17 -0500
commitf78b26fdd889ee687061bb9adf7633954ad90d51 (patch)
tree83723069144e091489b4020646dddae8755a7827 /client/include/util.h
parentf934c195b3b89357de1052dfdcb5ce8ec6b834d0 (diff)
client: add a reference client
Add a reference client that will act as an example of what the client program should accomplish given a command from the C&C server. Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'client/include/util.h')
-rw-r--r--client/include/util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/client/include/util.h b/client/include/util.h
new file mode 100644
index 0000000..39c130b
--- /dev/null
+++ b/client/include/util.h
@@ -0,0 +1,13 @@
+#ifndef MRAT_UTIL_H
+#define MRAT_UTIL_H
+
+#include <stddef.h>
+
+#define container_of(ptr, type, member) ({ \
+ const typeof(((type*)0)->member)*__mptr = (ptr); \
+ (type*)((char*)__mptr - offsetof(type, member)); })
+
+char* str_strip(char *str);
+char** str_split(char *str, const char *delim);
+
+#endif