21 #include <avrio/defs.h> 36 #if defined(__DOXYGEN__) 51 uint16_t
ntohs(uint16_t n);
59 uint16_t
htons(uint16_t h);
67 uint32_t
ntohl(uint32_t n);
75 uint32_t
htonl(uint32_t h);
83 uint64_t
ntohll(uint64_t n);
91 uint64_t
htonll(uint64_t h);
96 uint8_t *
pushs (uint8_t * netdata, uint16_t hostshort);
100 uint8_t *
pops (uint8_t * netdata, uint16_t * hostshort);
105 uint8_t *
pushl (uint8_t * netdata, uint32_t hostlong);
109 uint8_t *
popl (uint8_t * netdata, uint32_t * hostlong);
113 uint8_t *
pushll (uint8_t * netdata, uint32_t hostlonglong);
117 uint8_t *
popll (uint8_t * netdata, uint32_t * hostlonglong);
130 #if !defined(ntohs) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) 132 #include <avrio/util.h> 139 # define htons(n) ntohs(n) 140 #elif !defined(ntohs) 142 # define ntohs(n) ((uint16_t)(n)) 143 # define htons(n) ntohs(n) 146 #if !defined(ntohl) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) 148 #include <avrio/util.h> 155 # define htonl(n) ntohl(n) 156 #elif !defined(ntohl) 158 # define ntohl(n) ((uint32_t)(n)) 159 # define htonl(n) ntohl(n) 162 #if !defined(ntohll) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) 164 #include <avrio/util.h> 171 # define htonll(n) ntohll(n) 173 #elif !defined(ntohll) 175 # define ntohll(n) ((uint64_t)(n)) 176 # define htonll(n) ntohll(n) 182 pushs (uint8_t * netdata, uint16_t hostshort) {
184 netdata +=
sizeof(hostshort);
190 pops (uint8_t * netdata, uint16_t * hostshort) {
192 netdata +=
sizeof(hostshort);
198 pushl (uint8_t * netdata, uint32_t hostlong) {
200 netdata +=
sizeof(hostlong);
206 popl (uint8_t * netdata, uint32_t * hostlong) {
208 netdata +=
sizeof(hostlong);
214 pushll (uint8_t * netdata, uint32_t hostlonglong) {
216 netdata +=
sizeof(hostlonglong);
222 popll (uint8_t * netdata, uint32_t * hostlonglong) {
224 netdata +=
sizeof(hostlonglong);
#define PUINT64(p)
Cast p vers un pointeur de type uint64_t *.
uint8_t * pops(uint8_t *netdata, uint16_t *hostshort)
uint8_t * pushll(uint8_t *netdata, uint32_t hostlonglong)
uint8_t * pushl(uint8_t *netdata, uint32_t hostlong)
uint16_t ntohs(uint16_t n)
Convertir entier court de l'ordre des octets du réseau vers l'hôte.
uint8_t * popl(uint8_t *netdata, uint32_t *hostlong)
void vSwapBytes(uint8_t *pucBytes, uint8_t ucSize)
Permute les octets 2 à 2.
#define PUINT16(p)
Cast p vers un pointeur de type uint16_t *.
uint64_t htonll(uint64_t h)
Convertir entier long long de l'ordre des octets de l'hôte vers le réseau.
uint16_t htons(uint16_t h)
Convertir entier court de l'ordre des octets de l'hôte vers le réseau.
uint8_t * popll(uint8_t *netdata, uint32_t *hostlonglong)
uint8_t * pushs(uint8_t *netdata, uint16_t hostshort)
uint32_t htonl(uint32_t h)
Convertir entier long de l'ordre des octets de l'hôte vers le réseau.
uint32_t ntohl(uint32_t n)
Convertir entier long de l'ordre des octets du réseau vers l'hôte.
#define PUINT32(p)
Cast p vers un pointeur de type uint32_t *.
uint64_t ntohll(uint64_t n)
Convertir entier long long de l'ordre des octets du réseau vers l'hôte.