A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.
Dependents: oldheating gps motorhome heating
Diff: net.h
- Revision:
- 9:91dae5300a4d
- Parent:
- 7:b794780e33b4
- Child:
- 10:f0854784e960
--- a/net.h Tue Mar 14 19:26:24 2017 +0000 +++ b/net.h Tue Apr 04 10:41:25 2017 +0000 @@ -1,7 +1,7 @@ extern int NetIp4AddressToString(uint32_t ip, int size, char* text); extern int NetIp6AddressToString(char* ip, int size, char* text); extern int NetMacToString(char* mac, int size, char* text); -extern void NetProtocolToString(uint16_t protocol, int size, char* text); +extern void NetProtocolToString(uint8_t protocol, int size, char* text); extern int16_t NetToHost16(int16_t n); extern int32_t NetToHost32(int32_t n); @@ -12,7 +12,21 @@ extern int NetInit(); extern int NetMain(); -#define ICMP_PROTOCOL 1 -#define TCP_PROTOCOL 6 -#define ICMP6_PROTOCOL 58 -#define UDP_PROTOCOL 17 + +#define ETHERNET 1 + +#define IPV4 0x0800 +#define ARP 0x0806 +#define IPV6 0x86DD + +#define ICMP 1 +#define TCP 6 +#define UDP 17 +#define ICMP6 58 + + +#define DO_NOTHING 0 +#define UNICAST 1 +#define MULTICAST_NODE 2 +#define MULTICAST_ROUTER 3 +#define BROADCAST 4