diff options
author | Patrick McHardy <kaber@trash.net> | 2009-05-23 00:53:28 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2009-05-23 00:53:28 +0200 |
commit | e795362c3761092d1c7346f6021d38dc95f8338d (patch) | |
tree | 29acad636de62dc5df6f730d101c9abbf4681e5d /include/utils.h | |
parent | a28db0bc1ad069eda3078918d855746a6c87d126 (diff) |
utils: add fd initialization helper
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/utils.h')
-rw-r--r-- | include/utils.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/utils.h b/include/utils.h index 320ce76..e999c04 100644 --- a/include/utils.h +++ b/include/utils.h @@ -15,6 +15,9 @@ #define __aligned(x) __attribute__((aligned(x))) #define __packed __attribute__((packed)) +extern void dect_debug(const char *fmt, ...) __fmtstring(1, 2); +extern void dect_hexdump(const char *prefix, const uint8_t *buf, size_t size); + extern void *dect_malloc(const struct dect_handle *dh, size_t size); extern void *dect_zalloc(const struct dect_handle *dh, size_t size); extern void dect_free(const struct dect_handle *dh, void *ptr); @@ -27,12 +30,12 @@ extern void dect_start_timer(const struct dect_handle *dh, struct dect_timer *timer, unsigned int timeout); extern void dect_stop_timer(const struct dect_handle *dh, struct dect_timer *timer); -struct dect_fd *dect_alloc_fd(const struct dect_handle *dh); +extern struct dect_fd *dect_alloc_fd(const struct dect_handle *dh); +extern void dect_setup_fd(struct dect_fd *fd, + void (*cb)(struct dect_handle *, struct dect_fd *, uint32_t), + void *data); extern void dect_close(const struct dect_handle *dh, struct dect_fd *dfd); -extern void dect_debug(const char *fmt, ...) __fmtstring(1, 2); -extern void dect_hexdump(const char *prefix, const uint8_t *buf, size_t size); - #include <sys/socket.h> // FIXME: socklen_t extern struct dect_fd *dect_socket(const struct dect_handle *dh, int type, int protocol); |