pmacros.h

来自「Firestorm NIDS是一个性能非常高的网络入侵检测系统 (NIDS)。目」· C头文件 代码 · 共 32 行

H
32
字号
#ifndef __PMACROS_HEADER_INCLUDED__#define __PMACROS_HEADER_INCLUDED__#define bswap16(x) \	((u_int16_t)( \		(((u_int16_t)(x) & (u_int16_t)0x00ffU) << 8) | \	 	(((u_int16_t)(x) & (u_int16_t)0xff00U) >> 8) ))#define bswap32(x) \	((u_int32_t)( \		(((u_int32_t)(x) & (u_int32_t)0x000000ffUL) << 24) | \		(((u_int32_t)(x) & (u_int32_t)0x0000ff00UL) <<  8) | \		(((u_int32_t)(x) & (u_int32_t)0x00ff0000UL) >>  8) | \		(((u_int32_t)(x) & (u_int32_t)0xff000000UL) >> 24) ))#if __BYTE_ORDER == __LITTLE_ENDIAN#define __swap_16(x) bswap16(x)#define __swap_32(x) bswap32(x)#elif __BYTE_ORDER == __BIG_ENDIAN#define __swap_16(x) (x)#define __swap_32(x) (x)#else#error "couldn't determine endianness"#endif/* Use to initialise constants */#define __constant_htons(x) __swap_16(x)#define __constant_ntohs(x) __swap_16(x)#define __constant_htonl(x) __swap_32(x)#define __constant_ntohl(x) __swap_32(x)#endif /* __PMACROS_HEADER_INCLUDED__ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?