From db1f6609d13a888dd7212c9ed2840846e70a284e Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 2 Aug 2017 18:26:23 +0200 Subject: added an IPv4 module, currently containg an address to string function started to add ARP packet definition, reading and printing ARP request now some renames in networking layer --- src/net/ipv4.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/net/ipv4.c (limited to 'src/net/ipv4.c') diff --git a/src/net/ipv4.c b/src/net/ipv4.c new file mode 100644 index 0000000..38ae7da --- /dev/null +++ b/src/net/ipv4.c @@ -0,0 +1,13 @@ +#include "ipv4.h" + +#include "stdio.h" + +char *network_ipv4_address_to_string( network_ipv4_address_t addr, char *buf, size_t buflen ) +{ + snprintf( buf, buflen, "%d.%d.%d.%d", + addr.byte[0], addr.byte[1], + addr.byte[2], addr.byte[3] ); + + return buf; +} + -- cgit v1.2.3-54-g00ecf