From b6f9d1cb1fc279d0f5ab6e2fbc00b7bd0d2861ae Mon Sep 17 00:00:00 2001 From: Laurent Ghigonis Date: Sat, 15 Dec 2012 04:18:51 +0100 Subject: add necessary code in libggnet to do resolving of nodes names. modify libggnet_dns structure to fit with these changes. --- libglouglou/libggnet_dns.h | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'libglouglou/libggnet_dns.h') 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 #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 *); -- cgit v1.2.3-59-g8ed1b