upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/unit/stubs/lwip/netif.h
blob: 9415539c00a011f02ab18ec4bb58703cbbfe7576 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef STUBS_LWIP_NETIF_H
#define STUBS_LWIP_NETIF_H

#include <stdint.h>
#include <stddef.h>

struct pbuf {
    void *payload;
    uint16_t len;
};

static inline uint32_t lwip_ntohl(uint32_t n) {
    return ((n & 0xFF) << 24) | ((n & 0xFF00) << 8) | ((n >> 8) & 0xFF00) | ((n >> 24) & 0xFF);
}

static inline uint16_t lwip_ntohs(uint16_t n) {
    return ((n & 0xFF) << 8) | ((n >> 8) & 0xFF);
}

#endif