summaryrefslogtreecommitdiff
path: root/src/dnsstub/dns_nd.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-09 14:41:53 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-09 14:41:53 +0200
commit5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b (patch)
tree684758441f5b431d0008253243034b6a4a29417c /src/dnsstub/dns_nd.c
parent249866e3d1e11dc72eaa1305f4bb479ded92ef38 (diff)
initial clang-format
Diffstat (limited to 'src/dnsstub/dns_nd.c')
-rw-r--r--src/dnsstub/dns_nd.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/dnsstub/dns_nd.c b/src/dnsstub/dns_nd.c
index 6ce8ed9..3bbbeca 100644
--- a/src/dnsstub/dns_nd.c
+++ b/src/dnsstub/dns_nd.c
@@ -1,7 +1,7 @@
#include "byte.h"
+#include "dnsresolv.h"
#include "fmt.h"
#include "ip.h"
-#include "dnsresolv.h"
/**
@file dns_nd.c
@@ -10,29 +10,29 @@
@brief DNS domain name for ip (wire format)
*/
-int dns_name4_domain(char name[DNS_NAME4_DOMAIN],const char ip[4])
+int dns_name4_domain(char name[DNS_NAME4_DOMAIN], const char ip[4])
{
unsigned int namelen;
unsigned int i;
namelen = 0;
- i = fmt_ulong(name + namelen + 1,(unsigned long) (unsigned char) ip[3]);
+ i = fmt_ulong(name + namelen + 1, (unsigned long)(unsigned char)ip[3]);
name[namelen++] = i;
namelen += i;
- i = fmt_ulong(name + namelen + 1,(unsigned long) (unsigned char) ip[2]);
+ i = fmt_ulong(name + namelen + 1, (unsigned long)(unsigned char)ip[2]);
name[namelen++] = i;
namelen += i;
- i = fmt_ulong(name + namelen + 1,(unsigned long) (unsigned char) ip[1]);
+ i = fmt_ulong(name + namelen + 1, (unsigned long)(unsigned char)ip[1]);
name[namelen++] = i;
namelen += i;
- i = fmt_ulong(name + namelen + 1,(unsigned long) (unsigned char) ip[0]);
+ i = fmt_ulong(name + namelen + 1, (unsigned long)(unsigned char)ip[0]);
name[namelen++] = i;
namelen += i;
- byte_copy(name + namelen,14,"\7in-addr\4arpa\0");
- return namelen+14;
+ byte_copy(name + namelen, 14, "\7in-addr\4arpa\0");
+ return namelen + 14;
}
-int dns_name6_domain(char name[DNS_NAME6_DOMAIN],const char ip[16])
+int dns_name6_domain(char name[DNS_NAME6_DOMAIN], const char ip[16])
{
unsigned int j;
@@ -42,7 +42,6 @@ int dns_name6_domain(char name[DNS_NAME6_DOMAIN],const char ip[16])
name[j * 4 + 2] = 1;
name[j * 4 + 3] = tohex((unsigned char)ip[15 - j] >> 4);
}
- byte_copy(name + 4 * 16,10,"\3ip6\4arpa\0");
+ byte_copy(name + 4 * 16, 10, "\3ip6\4arpa\0");
return 4 * 16 + 10;
}
-