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

Committer:
andrewboyson
Date:
Mon Jul 03 14:29:07 2017 +0000
Revision:
22:914b970356f0
Parent:
15:6ca6778168b1
Child:
37:793b39683406
Corrected NTP client function

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 15:6ca6778168b1 1 #pragma once
andrewboyson 15:6ca6778168b1 2 #include "mbed.h"
andrewboyson 2:849103b5a16d 3
andrewboyson 0:faa09bd4e6bf 4 extern int16_t NetToHost16(int16_t n);
andrewboyson 0:faa09bd4e6bf 5 extern int32_t NetToHost32(int32_t n);
andrewboyson 0:faa09bd4e6bf 6 extern int64_t NetToHost64(int64_t n);
andrewboyson 0:faa09bd4e6bf 7 extern uint16_t NetCheckSum(int count, void* pData);
andrewboyson 2:849103b5a16d 8 extern uint16_t NetCheckSumTwo(int count1, void* pData1, int count2, void* pData2);
andrewboyson 2:849103b5a16d 9
andrewboyson 10:f0854784e960 10 extern int NetInit(char* name);
andrewboyson 7:b794780e33b4 11 extern int NetMain();
andrewboyson 7:b794780e33b4 12
andrewboyson 10:f0854784e960 13 extern char* NetName;
andrewboyson 10:f0854784e960 14
andrewboyson 15:6ca6778168b1 15 struct NetAction
andrewboyson 15:6ca6778168b1 16 {
andrewboyson 15:6ca6778168b1 17 char dst; //none, reply, specified, dns, dhcp, all nodes, all routers, mdns, llmnr,
andrewboyson 15:6ca6778168b1 18 char cst; //none, unicast, multicast, broadcast, solicited
andrewboyson 15:6ca6778168b1 19 char pro; //none, IPv4 or IPv6
andrewboyson 15:6ca6778168b1 20 char dbg; //false or true
andrewboyson 15:6ca6778168b1 21 };
andrewboyson 15:6ca6778168b1 22
andrewboyson 15:6ca6778168b1 23 #define NET_DO_NOTHING 0
andrewboyson 15:6ca6778168b1 24 #define NET_REPLY 1
andrewboyson 15:6ca6778168b1 25 #define NET_SPECIFIED 2
andrewboyson 15:6ca6778168b1 26 #define NET_ALL_NODES 3
andrewboyson 15:6ca6778168b1 27 #define NET_ALL_ROUTERS 4
andrewboyson 15:6ca6778168b1 28 #define NET_DNS 5
andrewboyson 15:6ca6778168b1 29 #define NET_MDNS 6
andrewboyson 15:6ca6778168b1 30 #define NET_LLMNR 7
andrewboyson 15:6ca6778168b1 31 #define NET_DHCP 8
andrewboyson 15:6ca6778168b1 32
andrewboyson 15:6ca6778168b1 33 #define NET_UNICAST 1
andrewboyson 15:6ca6778168b1 34 #define NET_MULTICAST 2
andrewboyson 15:6ca6778168b1 35 #define NET_SOLICITED 3
andrewboyson 15:6ca6778168b1 36 #define NET_BROADCAST 4
andrewboyson 15:6ca6778168b1 37
andrewboyson 9:91dae5300a4d 38
andrewboyson 9:91dae5300a4d 39 #define DO_NOTHING 0
andrewboyson 10:f0854784e960 40 #define UNICAST 1
andrewboyson 10:f0854784e960 41 #define UNICAST_DNS 2
andrewboyson 10:f0854784e960 42 #define UNICAST_DHCP 3
andrewboyson 22:914b970356f0 43 #define UNICAST_NTP 4
andrewboyson 22:914b970356f0 44 #define MULTICAST_NODE 5
andrewboyson 22:914b970356f0 45 #define MULTICAST_ROUTER 6
andrewboyson 22:914b970356f0 46 #define MULTICAST_MDNS 7
andrewboyson 22:914b970356f0 47 #define MULTICAST_LLMNR 8
andrewboyson 22:914b970356f0 48 #define SOLICITED_NODE 9
andrewboyson 22:914b970356f0 49 #define BROADCAST 10