summaryrefslogtreecommitdiff
path: root/icmpd.h
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-08-02 18:19:21 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-08-02 18:21:15 +0200
commit134bec17a10030fc7d1b2060b57bf19799f6c780 (patch)
tree287deb14de65bd1676e04aa6bd40b72ef785c6af /icmpd.h
parent8ff7ed58020b46d0bcb3b6dcbc0c5b02e85275a8 (diff)
Proper event-driven icmpd recv
Diffstat (limited to 'icmpd.h')
-rw-r--r--icmpd.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/icmpd.h b/icmpd.h
index 7a87ec6..cb574ee 100644
--- a/icmpd.h
+++ b/icmpd.h
@@ -16,7 +16,8 @@ struct icmpd_received {
struct icmpd;
-// Pass 0 as client_addr to listen for messages from any IP (this channel will then only receive unassigned messages)
+// Pass 0 as client_addr to listen for messages from any IP (this channel
+// will then only receive unassigned messages)
// Pass -1 as id to listen for messages with any id
struct icmpd* icmpd_create_server(int id, uint32_t client_addr);
@@ -28,4 +29,9 @@ bool icmpd_peek(struct icmpd *d);
struct icmpd_received icmpd_recv(struct icmpd *d);
void icmpd_send(struct icmpd *d, const void *data, size_t length);
+// File descriptor that select(2) reports readable when a message might be ready.
+// Do not read from this file descriptor.
+// Use icmpd_peek() to verify that a message is actually ready.
+int icmpd_get_select_fd(struct icmpd *d);
+
void icmpd_destroy(struct icmpd *d);