1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
15 #define XT_SCTP_SRC_PORTS 0x01
16 #define XT_SCTP_DEST_PORTS 0x02
17 #define XT_SCTP_CHUNK_TYPES 0x04
19 #define XT_SCTP_VALID_FLAGS 0x07
21 #define ELEMCOUNT(x) (sizeof(x)/sizeof(x[0]))
23 struct xt_sctp_flag_info {
29 #define XT_NUM_SCTP_FLAGS 4
35 u_int32_t chunkmap[256 / sizeof (u_int32_t)];
37 #define SCTP_CHUNK_MATCH_ANY 0x01
38 #define SCTP_CHUNK_MATCH_ALL 0x02
39 #define SCTP_CHUNK_MATCH_ONLY 0x04
41 u_int32_t chunk_match_type;
42 struct xt_sctp_flag_info flag_info[XT_NUM_SCTP_FLAGS];
49 #define bytes(type) (sizeof(type) * 8)
51 #define SCTP_CHUNKMAP_SET(chunkmap, type) do { chunkmap[type / bytes(u_int32_t)] |= 1 << (type % bytes(u_int32_t)); } while (0)
53 #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) do { chunkmap[type / bytes(u_int32_t)] &= ~(1 << (type % bytes(u_int32_t))); } while (0)
55 #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) ({ (chunkmap[type / bytes (u_int32_t)] & (1 << (type % bytes (u_int32_t)))) ? 1: 0; })
57 #define SCTP_CHUNKMAP_RESET(chunkmap) do { int i; for (i = 0; i < ELEMCOUNT(chunkmap); i++) chunkmap[i] = 0; } while (0)
59 #define SCTP_CHUNKMAP_SET_ALL(chunkmap) do { int i; for (i = 0; i < ELEMCOUNT(chunkmap); i++) chunkmap[i] = ~0; } while (0)
61 #define SCTP_CHUNKMAP_COPY(destmap, srcmap) do { int i; for (i = 0; i < ELEMCOUNT(chunkmap); i++) destmap[i] = srcmap[i]; } while (0)
63 #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) ({ int i; int flag = 1; for (i = 0; i < ELEMCOUNT(chunkmap); i++) { if (chunkmap[i]) { flag = 0; break; } } flag; })
65 #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) ({ int i; int flag = 1; for (i = 0; i < ELEMCOUNT(chunkmap); i++) { if (chunkmap[i] != ~0) { flag = 0; break; } } flag; })