summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-26 16:46:52 +0200
committerHarald Welte <laforge@gnumonks.org>2018-03-26 16:46:52 +0200
commit4bbf70b9f367afab929cb6c2f214475ee09b2403 (patch)
tree7286581fdd29535f7ab7526d6d231f0f5fd8a520 /utils.h
initial checkin of unix domain socket tracer
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