summaryrefslogtreecommitdiff
path: root/src/dnsip.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-03 15:52:39 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-03 15:52:39 +0200
commita6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f (patch)
treeb88cc7a8457658d67e0321718556ac807f6bccf3 /src/dnsip.c
parent00be7622c428f279872f84569f098ce16150f8a8 (diff)
format files
Diffstat (limited to 'src/dnsip.c')
-rw-r--r--src/dnsip.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/dnsip.c b/src/dnsip.c
index 2c84d04..bbb2557 100644
--- a/src/dnsip.c
+++ b/src/dnsip.c
@@ -1,14 +1,16 @@
-#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <unistd.h>
+
#include "buffer.h"
-#include "stralloc.h"
#include "dnsresolv.h"
-#include "ip.h"
#include "exit.h"
#include "fmt.h"
-#include "dns.h"
+#include "ip.h"
#include "logmsg.h"
+#include "stralloc.h"
+
+#include "dns.h"
#define WHO "dnsip"
@@ -21,26 +23,24 @@ int main(int argc, char **argv)
char ip4str[IP4_FMT];
char ip6str[IP6_FMT];
- if (!argv[1])
- logmsg(WHO,100,USAGE,"dnsip fqdn");
+ if (!argv[1]) logmsg(WHO, 100, USAGE, "dnsip fqdn");
- if (!stralloc_copys(&sa,argv[1]))
- logmsg(WHO,111,FATAL,"out of memory");
+ if (!stralloc_copys(&sa, argv[1])) logmsg(WHO, 111, FATAL, "out of memory");
DNS_INIT
- if (dns_ip6(&out,&sa) > 0) /* IPv6 first */
+ if (dns_ip6(&out, &sa) > 0) /* IPv6 first */
for (i = 0; i + 16 <= out.len; i += 16) {
- if (ip6_isv4mapped(out.s + i)) continue;
- buffer_put(buffer_1,ip6str,ip6_fmt(ip6str,out.s + i));
- buffer_puts(buffer_1,"\n");
+ if (ip6_isv4mapped(out.s + i)) continue;
+ buffer_put(buffer_1, ip6str, ip6_fmt(ip6str, out.s + i));
+ buffer_puts(buffer_1, "\n");
}
- if (dns_ip4(&out,&sa) > 0)
- for (i = 0; i + 4 <= out.len;i += 4) {
- buffer_put(buffer_1,ip4str,ip4_fmt(ip4str,out.s + i));
- buffer_puts(buffer_1,"\n");
+ if (dns_ip4(&out, &sa) > 0)
+ for (i = 0; i + 4 <= out.len; i += 4) {
+ buffer_put(buffer_1, ip4str, ip4_fmt(ip4str, out.s + i));
+ buffer_puts(buffer_1, "\n");
}
- buffer_putsflush(buffer_1,"");
+ buffer_putsflush(buffer_1, "");
_exit(0);
}