1a6085186SLina Ceballos /* 290cf64d3SJiao Xianjun * Author: Michael Mehari 390cf64d3SJiao Xianjun * SPDX-FileCopyrightText: 2019 UGent 4a6085186SLina Ceballos * SPDX-License-Identifier: AGPL-3.0-or-later 5a6085186SLina Ceballos */ 6a6085186SLina Ceballos 77273ec43Smmehari #include <stdlib.h> 87273ec43Smmehari #include <resolv.h> 97273ec43Smmehari #include <string.h> 107273ec43Smmehari #include <unistd.h> 117273ec43Smmehari #include <getopt.h> 127273ec43Smmehari #include <pcap.h> 137273ec43Smmehari #include <errno.h> 147273ec43Smmehari 15*51e498afSXianjun Jiao typedef unsigned long long int u64; 167273ec43Smmehari typedef unsigned int u32; 177273ec43Smmehari typedef unsigned short u16; 187273ec43Smmehari typedef unsigned char u8; 197273ec43Smmehari typedef u32 __le32; 207273ec43Smmehari 217273ec43Smmehari #if __BYTE_ORDER == __LITTLE_ENDIAN 227273ec43Smmehari #define le16_to_cpu(x) (x) 237273ec43Smmehari #define le32_to_cpu(x) (x) 247273ec43Smmehari #else 257273ec43Smmehari #define le16_to_cpu(x) ((((x)&0xff)<<8)|(((x)&0xff00)>>8)) 267273ec43Smmehari #define le32_to_cpu(x) \ 277273ec43Smmehari ((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)&0xff0000)>>8)|(((x)&0xff000000)>>24)) 287273ec43Smmehari #endif 297273ec43Smmehari #define unlikely(x) (x) 307273ec43Smmehari 317273ec43Smmehari 327273ec43Smmehari 337273ec43Smmehari 34