diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-12-14 16:00:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 16:00:40 +0100 |
commit | fcef0e01ff656f0d87dc451604d35c253721d567 (patch) | |
tree | 837a4d4cfa318008f68e1004a6a9dee3d14a0e0d /utils.h | |
parent | e041c4f4a9a8683699879df696cfcbd1e60cccdb (diff) | |
parent | 04ac4751701a28b7bec0c812a98d8a7ca1008a69 (diff) |
Merge pull request #1 from axilirator/fixeria/parent_fd
Properly handle multiple child connections
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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); |