Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
util.h
00001 #ifndef UTIL_H 00002 #define UTIL_H 00003 00004 #define htons(x) (u16_t) ((((u16_t) (x)) << 8) | (((u16_t) (x)) >> 8)) 00005 //#define ntohs(x) htons(x) 00006 #define htonl(x) (((x) << 24 & 0xFF000000UL) | ((x) << 8 & 0x00FF0000UL) | ((x) >> 8 & 0x0000FF00UL) | ((x) >> 24 & 0x000000FFUL)) 00007 #define ntohl(x) htonl(x) 00008 #define UIPETHERNET_FREEPACKET 1 00009 #define UIPETHERNET_SENDPACKET 2 00010 00011 #define uip_ip_addr(addr, ip) \ 00012 do { \ 00013 ((u16_t *) (addr))[0] = (((ip[1]) << 8) | (ip[0])); \ 00014 ((u16_t *) (addr))[1] = (((ip[3]) << 8) | (ip[2])); \ 00015 } while (0) 00016 #define ip_addr_uip(a) IpAddress(a[0] & 0xFF, a[0] >> 8, a[1] & 0xFF, a[1] >> 8) //TODO this is not IPV6 capable 00017 00018 #define uip_seteth_addr(eaddr) \ 00019 do { \ 00020 uip_ethaddr.addr[0] = eaddr[0]; \ 00021 uip_ethaddr.addr[1] = eaddr[1]; \ 00022 uip_ethaddr.addr[2] = eaddr[2]; \ 00023 uip_ethaddr.addr[3] = eaddr[3]; \ 00024 uip_ethaddr.addr[4] = eaddr[4]; \ 00025 uip_ethaddr.addr[5] = eaddr[5]; \ 00026 } while (0) 00027 #define BUF ((struct uip_tcpip_hdr*) &uip_buf[UIP_LLH_LEN]) 00028 00029 #endif
Generated on Sun Feb 26 2023 10:14:24 by
1.7.2