diff options
Diffstat (limited to 'tests/unit/stubs/lwip/ip4_addr.h')
| -rw-r--r-- | tests/unit/stubs/lwip/ip4_addr.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/stubs/lwip/ip4_addr.h b/tests/unit/stubs/lwip/ip4_addr.h new file mode 100644 index 0000000..174211b --- /dev/null +++ b/tests/unit/stubs/lwip/ip4_addr.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef STUBS_LWIP_IP4_ADDR_H | ||
| 2 | #define STUBS_LWIP_IP4_ADDR_H | ||
| 3 | |||
| 4 | #include <stdint.h> | ||
| 5 | |||
| 6 | typedef struct { | ||
| 7 | uint32_t addr; | ||
| 8 | } ip4_addr_t; | ||
| 9 | |||
| 10 | typedef ip4_addr_t esp_ip4_addr_t; | ||
| 11 | |||
| 12 | #define IPSTR "%d.%d.%d.%d" | ||
| 13 | #define IP2STR(ip) ((ip)->addr & 0xff), (((ip)->addr >> 8) & 0xff), (((ip)->addr >> 16) & 0xff), (((ip)->addr >> 24) & 0xff) | ||
| 14 | |||
| 15 | static inline void IP4_ADDR(esp_ip4_addr_t *ip, uint8_t a, uint8_t b, uint8_t c, uint8_t d) { | ||
| 16 | ip->addr = ((uint32_t)a) | ((uint32_t)b << 8) | ((uint32_t)c << 16) | ((uint32_t)d << 24); | ||
| 17 | } | ||
| 18 | |||
| 19 | #endif | ||