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
net.h
- Committer:
- andrewboyson
- Date:
- 2017-05-09
- Revision:
- 15:6ca6778168b1
- Parent:
- 14:e75a59c1123d
- Child:
- 22:914b970356f0
File content as of revision 15:6ca6778168b1:
#pragma once #include "mbed.h" extern int16_t NetToHost16(int16_t n); extern int32_t NetToHost32(int32_t n); extern int64_t NetToHost64(int64_t n); extern uint16_t NetCheckSum(int count, void* pData); extern uint16_t NetCheckSumTwo(int count1, void* pData1, int count2, void* pData2); extern int NetInit(char* name); extern int NetMain(); extern char* NetName; struct NetAction { char dst; //none, reply, specified, dns, dhcp, all nodes, all routers, mdns, llmnr, char cst; //none, unicast, multicast, broadcast, solicited char pro; //none, IPv4 or IPv6 char dbg; //false or true }; #define NET_DO_NOTHING 0 #define NET_REPLY 1 #define NET_SPECIFIED 2 #define NET_ALL_NODES 3 #define NET_ALL_ROUTERS 4 #define NET_DNS 5 #define NET_MDNS 6 #define NET_LLMNR 7 #define NET_DHCP 8 #define NET_UNICAST 1 #define NET_MULTICAST 2 #define NET_SOLICITED 3 #define NET_BROADCAST 4 #define DO_NOTHING 0 #define UNICAST 1 #define UNICAST_DNS 2 #define UNICAST_DHCP 3 #define MULTICAST_NODE 4 #define MULTICAST_ROUTER 5 #define MULTICAST_MDNS 6 #define MULTICAST_LLMNR 7 #define SOLICITED_NODE 8 #define BROADCAST 9