Tools/NetTest - Add a runner to test networking stack
[tpg/acess2.git] / Tools / NetTest_Runner / include / common.h
1 /*
2  */
3 #ifndef _COMMON_H_
4 #define _COMMON_H_
5
6 #include <stdint.h>
7
8 #define HOST_IP_STR     "10.1.1.2"
9 #define HOST_IP         0x0A,0x01,0x01,0x02
10 #define HOST_MAC        0x54,0x56,0x00,0x12,0x34,0x11
11
12 #define TEST_IP         0x0A,0x01,0x01,0x01
13 #define TEST_MAC        0x54,0x56,0x00,0x12,0x34,0x56
14
15 #define BLOB(bytes)     (const char[]){bytes}
16
17 #if BIG_ENDIAN
18 # define htons(x)       ((uint16_t)(x))
19 # define htonl(x)       ((uint32_t)(x))
20 #else
21 static inline uint16_t  htons(uint16_t x) {
22         return (x >> 8) | (x << 8);
23 }
24 static inline uint32_t  htonl(uint32_t x) {
25         return ((x >> 24) & 0xFF) <<  0
26               |((x >> 16) & 0xFF) <<  8
27               |((x >>  8) & 0xFF) << 16
28               |((x >>  0) & 0xFF) << 24;
29 }
30 #endif
31 #define ntohs(x)        htons(x)
32 #define ntohl(x)        htonl(x)
33
34
35 #endif
36

UCC git Repository :: git.ucc.asn.au