diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2012-12-15 03:09:01 +0100 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2012-12-15 03:09:01 +0100 |
commit | 6411a3107aabdcd24a4b5c25ea97292ab8b25535 (patch) | |
tree | 4731a083bb7b92e0bd25848fd7c8c24bb1f5aeb0 /libglouglou/libggnet.c | |
parent | remove all reference to libglouglou. (diff) | |
download | glouglou-6411a3107aabdcd24a4b5c25ea97292ab8b25535.tar.xz glouglou-6411a3107aabdcd24a4b5c25ea97292ab8b25535.zip |
integrate gg_sniff dns handling into libggnet
it can be enabled in ggnet by calling ggnet_set_dns(), or can be used
independently by including <libggnet_dns.h> an calling ggnet_dns_new(),
ggnet_dns_free() and ggnet_dns_reverse()
WARNING: not tested yet, only compiles
Diffstat (limited to 'libglouglou/libggnet.c')
-rw-r--r-- | libglouglou/libggnet.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libglouglou/libggnet.c b/libglouglou/libggnet.c index e6df4bd..7367372 100644 --- a/libglouglou/libggnet.c +++ b/libglouglou/libggnet.c @@ -3,6 +3,7 @@ #include <stdio.h> #include "libggnet.h" +#include "libggnet_dns.h" static struct ggnet_nodegroup *nodegroup_add(struct ggnet *, enum ggnet_grouptype, void *, @@ -38,6 +39,7 @@ ggnet_new(int manage_connid) * * Note: Must be set before any use of ggnet */ +// XXX break API to ggnet_set_grouping() void ggnet_grouping_set(struct ggnet *net, int set, void (*cb_addgroup)(struct ggnet *, struct ggnet_nodegroup *, struct ggnet_nodegroup *), @@ -49,6 +51,20 @@ ggnet_grouping_set(struct ggnet *net, int set, } void +ggnet_set_dns(struct ggnet *net, int set, + struct event_base *ev_base, + void (*cb_nodename)(struct ggnet_node *)) +{ + net->use_dns = set; + if (set) { + net->ggdns = ggnet_dns_new(ev_base); + net->cb_nodename = cb_nodename; + } + else if (net->use_dns) + ggnet_dns_free(net->ggdns); +} + +void ggnet_debug_set(struct ggnet *net, int set) { net->debug = set; |