aboutsummaryrefslogtreecommitdiffstats
path: root/libglouglou/libggnet_dns.h
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-12-15 04:18:51 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-12-15 04:18:51 +0100
commitb6f9d1cb1fc279d0f5ab6e2fbc00b7bd0d2861ae (patch)
tree21b34d206a25b913ea3c63e9e50b211e62851b2e /libglouglou/libggnet_dns.h
parentadd (struct ggnet *) in cb_nodename() arguments (diff)
downloadglouglou-b6f9d1cb1fc279d0f5ab6e2fbc00b7bd0d2861ae.tar.xz
glouglou-b6f9d1cb1fc279d0f5ab6e2fbc00b7bd0d2861ae.zip
add necessary code in libggnet to do resolving of nodes names.
modify libggnet_dns structure to fit with these changes.
Diffstat (limited to 'libglouglou/libggnet_dns.h')
-rw-r--r--libglouglou/libggnet_dns.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/libglouglou/libggnet_dns.h b/libglouglou/libggnet_dns.h
index f74f696..ae7b634 100644
--- a/libglouglou/libggnet_dns.h
+++ b/libglouglou/libggnet_dns.h
@@ -8,15 +8,27 @@
#include <bsd/sys/queue.h>
#endif
+struct ggnet_dns_req {
+ LIST_ENTRY(ggnet_dns_req) entry;
+ struct ggnet_dns *ggdns;
+ struct evdns_request *ereq;
+ struct in_addr ip;
+ char *name;
+ void (*cb_usr)(struct in_addr *, char *, void *);
+ void *data;
+};
+
struct ggnet_dns {
struct event_base *ev_base;
struct evdns_base *evdns_base;
- int req_reverse_pending;
- LIST_HEAD(, req_reverse) req_reverse_list; /* XXX for now unused. remove ? */
+ int req_pending;
+ LIST_HEAD(, ggnet_dns_req) req_list; /* XXX for now unused. remove ? */
};
-struct ggnet_dns *ggnet_dns_new(struct event_base *);
-void ggnet_dns_free(struct ggnet_dns *);
-int ggnet_dns_reverse(struct ggnet_dns *, struct in_addr *,
- void (*cb_usr)(struct in_addr *, char *, void *),
- void *);
+struct ggnet_dns *ggnet_dns_new(struct event_base *);
+void ggnet_dns_free(struct ggnet_dns *);
+struct ggnet_dns_req *ggnet_dns_reverse(struct ggnet_dns *, struct in_addr *,
+ void (*cb_usr)(struct in_addr *, char *, void *),
+ void *);
+void ggnet_dns_cancel(struct ggnet_dns *,
+ struct ggnet_dns_req *);