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:
Wed Aug 23 18:02:42 2017 +0000
Revision:
33:714a0345e59b
Parent:
14:e75a59c1123d
Child:
47:73af5c0b0dc2
Made DNS names case insensitive

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 14:e75a59c1123d 1 #include "mbed.h"
andrewboyson 14:e75a59c1123d 2 #include "ip.h"
andrewboyson 14:e75a59c1123d 3
andrewboyson 14:e75a59c1123d 4 void IpProtocolToString(uint8_t protocol, int size, char* text)
andrewboyson 14:e75a59c1123d 5 {
andrewboyson 14:e75a59c1123d 6 switch (protocol)
andrewboyson 14:e75a59c1123d 7 {
andrewboyson 33:714a0345e59b 8 case ICMP: strncpy(text, "ICMP" , size); break;
andrewboyson 33:714a0345e59b 9 case IGMP: strncpy(text, "IGMP" , size); break;
andrewboyson 33:714a0345e59b 10 case ICMP6: strncpy(text, "ICMP6" , size); break;
andrewboyson 33:714a0345e59b 11 case TCP: strncpy(text, "TCP" , size); break;
andrewboyson 33:714a0345e59b 12 case UDP: strncpy(text, "UDP" , size); break;
andrewboyson 33:714a0345e59b 13 case IP6IN4: strncpy(text, "IP6IN4", size); break;
andrewboyson 14:e75a59c1123d 14 default: snprintf(text, size, "%d", protocol); break;
andrewboyson 14:e75a59c1123d 15 }
andrewboyson 14:e75a59c1123d 16 }