diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-08-02 18:26:23 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-08-02 18:26:23 +0200 |
commit | db1f6609d13a888dd7212c9ed2840846e70a284e (patch) | |
tree | e8a4c777bb5feafda1a50feb9c6280a36d0a0dfb /src/net/ipv4.h | |
parent | 7d40548496f4d3cdfce828fc8e4f0fd4286e873a (diff) | |
download | abaos-db1f6609d13a888dd7212c9ed2840846e70a284e.tar.gz abaos-db1f6609d13a888dd7212c9ed2840846e70a284e.tar.bz2 |
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
Diffstat (limited to 'src/net/ipv4.h')
-rw-r--r-- | src/net/ipv4.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/net/ipv4.h b/src/net/ipv4.h new file mode 100644 index 0000000..acf7f7f --- /dev/null +++ b/src/net/ipv4.h @@ -0,0 +1,18 @@ +#ifndef IPV4_H +#define IPV4_H + +#include "stdint.h" +#include "stddef.h" + +#define NETWORK_PROTOCOL_IPV4_ADDR_STRING 4 * 4 + 1 + +// protocol_address_len +#define NETWORK_PROTOCOL_IPV4_ADDRESS_LENGTH 4 + +typedef struct { + uint8_t byte[NETWORK_PROTOCOL_IPV4_ADDRESS_LENGTH]; +} network_ipv4_address_t; + +char *network_ipv4_address_to_string( network_ipv4_address_t addr, char *buf, size_t buflen ); + +#endif // IPV4_H |