2021-01-20 12:30:12 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2019 Jiao Xianjun <putaoshu@msn.com>
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
*/
|
|
|
|
|
2020-11-05 17:28:31 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <resolv.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <pcap.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
typedef unsigned int u32;
|
|
|
|
typedef unsigned short u16;
|
|
|
|
typedef unsigned char u8;
|
|
|
|
typedef u32 __le32;
|
|
|
|
|
|
|
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
|
|
#define le16_to_cpu(x) (x)
|
|
|
|
#define le32_to_cpu(x) (x)
|
|
|
|
#else
|
|
|
|
#define le16_to_cpu(x) ((((x)&0xff)<<8)|(((x)&0xff00)>>8))
|
|
|
|
#define le32_to_cpu(x) \
|
|
|
|
((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)&0xff0000)>>8)|(((x)&0xff000000)>>24))
|
|
|
|
#endif
|
|
|
|
#define unlikely(x) (x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|