summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils.h b/utils.h
new file mode 100644
index 0000000..8148518
--- /dev/null
+++ b/utils.h
@@ -0,0 +1,15 @@
+#pragma once
+
+/*! Determine number of elements in an array of static size */
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+/* add a file descriptor from the list of to-be-traced ones */
+void add_fd(int fd);
+
+/* delete a file descriptor from the list of to-be-traced ones */
+void del_fd(int fd);
+
+/* is the given file descriptor part of the to-be-traced unix domain fd's? */
+bool is_unix_socket(int fd);
+
+char *udtrace_hexdump(const unsigned char *buf, int len, char *delim);
personal git repositories of Harald Welte. Your mileage may vary