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
index f1f52f4..6829ffe 100644
--- a/utils.h
+++ b/utils.h
@@ -6,9 +6,24 @@
#define LOG(fmt, args ...) \
fprintf(stderr, ">>> UDTRACE: " fmt, ## args)
+typedef void (*udtrace_dissector)(int fd, bool is_out, const char *fn,
+ const uint8_t *data, unsigned int len);
+
+struct sock_state {
+ int fd;
+ const char *path;
+ udtrace_dissector dissector;
+};
+
+/* find the state corresponding to a given file descriptor */
+struct sock_state *udtrace_sstate_by_fd(int fd);
+
/* add a file descriptor from the list of to-be-traced ones */
void udtrace_add_fd(int fd);
+/* add a file descriptor from the list of to-be-traced ones */
+void udtrace_add_fd_child(int pfd, int cfd);
+
/* delete a file descriptor from the list of to-be-traced ones */
void udtrace_del_fd(int fd);
personal git repositories of Harald Welte. Your mileage may vary