blob: f009537437974be34ec187fcf148b13cb708d199 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#ifndef STUBS_ESP_NETIF_H
#define STUBS_ESP_NETIF_H
#include <stdint.h>
typedef struct {
uint32_t addr;
} esp_ip4_addr_t;
#define IPSTR "%d.%d.%d.%d"
#define IP2STR(ip) ((ip)->addr & 0xff), (((ip)->addr >> 8) & 0xff), (((ip)->addr >> 16) & 0xff), (((ip)->addr >> 24) & 0xff)
static inline void IP4_ADDR(esp_ip4_addr_t *ip, uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
ip->addr = ((uint32_t)a) | ((uint32_t)b << 8) | ((uint32_t)c << 16) | ((uint32_t)d << 24);
}
#endif
|