aboutsummaryrefslogtreecommitdiffstats
path: root/libglouglou/examples
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-06-05 18:14:30 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2013-06-05 18:14:30 +0200
commit29193b6c4c13d885681c42a87632cf65fbf5b70d (patch)
tree82ec9be903a239eda1f73a1d5b6fef31b6702c07 /libglouglou/examples
parentgg_map: fix dependencies description (diff)
downloadglouglou-29193b6c4c13d885681c42a87632cf65fbf5b70d.tar.xz
glouglou-29193b6c4c13d885681c42a87632cf65fbf5b70d.zip
convert to tabs, and fix some indent manualy
no functionnal change
Diffstat (limited to 'libglouglou/examples')
-rw-r--r--libglouglou/examples/dnsreverse.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/libglouglou/examples/dnsreverse.c b/libglouglou/examples/dnsreverse.c
index 5111391..e6504b0 100644
--- a/libglouglou/examples/dnsreverse.c
+++ b/libglouglou/examples/dnsreverse.c
@@ -15,39 +15,39 @@ int _answer = 0;
int
main(int argc, char *argv[])
{
- struct ggnet_dns *ggdns;
- struct in_addr ip;
- struct timeval tv;
+ struct ggnet_dns *ggdns;
+ struct in_addr ip;
+ struct timeval tv;
- if (argc < 2) {
- printf("usage: dnsreverse <fqdn>\n");
- exit(1);
- }
- inet_aton(argv[1], &ip);
- ip.s_addr = ntohl(ip.s_addr);
+ if (argc < 2) {
+ printf("usage: dnsreverse <fqdn>\n");
+ exit(1);
+ }
+ inet_aton(argv[1], &ip);
+ ip.s_addr = ntohl(ip.s_addr);
- bzero(&tv, sizeof(struct timeval));
- tv.tv_sec = 5;
+ bzero(&tv, sizeof(struct timeval));
+ tv.tv_sec = 5;
- _ev_base = event_base_new();
+ _ev_base = event_base_new();
- ggdns = ggnet_dns_new(_ev_base);
- ggnet_dns_reverse(ggdns, &ip, _cb_dns, NULL);
+ ggdns = ggnet_dns_new(_ev_base);
+ ggnet_dns_reverse(ggdns, &ip, _cb_dns, NULL);
- event_base_loopexit(_ev_base, &tv);
- event_base_dispatch(_ev_base);
+ event_base_loopexit(_ev_base, &tv);
+ event_base_dispatch(_ev_base);
- if (_answer)
- printf("%x: %s\n", ip.s_addr, _name);
- else
- printf("no answer\n");
- return 0;
+ if (_answer)
+ printf("%x: %s\n", ip.s_addr, _name);
+ else
+ printf("no answer\n");
+ return 0;
}
static void
_cb_dns(struct in_addr *ip, char *name, void *data)
{
- _name = name;
- _answer = 1;
- event_base_loopexit(_ev_base, NULL);
+ _name = name;
+ _answer = 1;
+ event_base_loopexit(_ev_base, NULL);
}