diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-09 14:41:53 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-09 14:41:53 +0200 |
commit | 5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b (patch) | |
tree | 684758441f5b431d0008253243034b6a4a29417c /src/socket_if.c | |
parent | 249866e3d1e11dc72eaa1305f4bb479ded92ef38 (diff) |
initial clang-format
Diffstat (limited to 'src/socket_if.c')
-rw-r--r-- | src/socket_if.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/socket_if.c b/src/socket_if.c index f55af4e..e8e1d54 100644 --- a/src/socket_if.c +++ b/src/socket_if.c @@ -1,9 +1,10 @@ -#include <sys/types.h> +#include "socket_if.h" + +#include <net/if.h> +#include <netinet/in.h> #include <sys/param.h> #include <sys/socket.h> -#include <netinet/in.h> -#include <net/if.h> -#include "socket_if.h" +#include <sys/types.h> /** @file socket_if.c @@ -12,23 +13,23 @@ @brief interface handling for LLU */ -const unsigned char V4loopback[4] = {127,0,0,1}; -const unsigned char V4localnet[4] = {0,0,0,0}; +const unsigned char V4loopback[4] = {127, 0, 0, 1}; +const unsigned char V4localnet[4] = {0, 0, 0, 0}; /* the 'V4mappedprefix' constant is needed by 'ip.a' too */ -const unsigned char V4mappedprefix[12] = {0,0,0,0, 0,0,0,0, 0,0,0xff,0xff}; -const unsigned char V6localnet[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0}; -const unsigned char V6loopback[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1}; +const unsigned char V4mappedprefix[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff}; +const unsigned char V6localnet[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +const unsigned char V6loopback[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; -uint32 socket_getifidx(const char *ifname) +uint32 socket_getifidx(const char *ifname) { return if_nametoindex(ifname); } static char ifname[IFNAMSIZ]; -const char* socket_getifname(uint32 scope_id) +const char *socket_getifname(uint32 scope_id) { - char *tmp = if_indextoname(scope_id,ifname); + char *tmp = if_indextoname(scope_id, ifname); if (tmp) return tmp; else |