1 /* 2 * Author: Michael Mehari 3 * SPDX-FileCopyrightText: 2019 UGent 4 * SPDX-License-Identifier: AGPL-3.0-or-later 5 */ 6 7 #include <stdlib.h> 8 #include <resolv.h> 9 #include <string.h> 10 #include <unistd.h> 11 #include <getopt.h> 12 #include <pcap.h> 13 #include <errno.h> 14 15 typedef unsigned long long int u64; 16 typedef unsigned int u32; 17 typedef unsigned short u16; 18 typedef unsigned char u8; 19 typedef u32 __le32; 20 21 #if __BYTE_ORDER == __LITTLE_ENDIAN 22 #define le16_to_cpu(x) (x) 23 #define le32_to_cpu(x) (x) 24 #else 25 #define le16_to_cpu(x) ((((x)&0xff)<<8)|(((x)&0xff00)>>8)) 26 #define le32_to_cpu(x) \ 27 ((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)&0xff0000)>>8)|(((x)&0xff000000)>>24)) 28 #endif 29 #define unlikely(x) (x) 30 31 32 33 34