core: use string instead of compound literal
[rofl0r-proxychains-ng.git] / src / ip_type.h
blobc09400b542dffd9d16628afe962e2a8c4f7593fd
1 #ifndef IP_TYPE_H
2 #define IP_TYPE_H
4 #include <stdint.h>
6 typedef union {
7 unsigned char octet[4];
8 uint32_t as_int;
9 } ip_type4;
11 typedef struct {
12 union {
13 ip_type4 v4;
14 unsigned char v6[16];
15 } addr;
16 char is_v6;
17 } ip_type;
19 #define IPT4_INT(X) (ip_type4){.as_int = (X)}
20 #define IPT4_INVALID IPT4_INT(-1)
22 #define IPT4_BYTES(A,B,C,D) (ip_type4){.octet = {(A), (B), (C), (D)} }
23 #define IPT4_LOCALHOST IPT4_BYTES(127,0,0,1)
25 #endif