4 #define XT_SCTP_SRC_PORTS 0x01
5 #define XT_SCTP_DEST_PORTS 0x02
6 #define XT_SCTP_CHUNK_TYPES 0x04
8 #define XT_SCTP_VALID_FLAGS 0x07
10 struct xt_sctp_flag_info
{
16 #define XT_NUM_SCTP_FLAGS 4
19 u_int16_t dpts
[2]; /* Min, Max */
20 u_int16_t spts
[2]; /* Min, Max */
22 u_int32_t chunkmap
[256 / sizeof (u_int32_t
)]; /* Bit mask of chunks to be matched according to RFC 2960 */
24 #define SCTP_CHUNK_MATCH_ANY 0x01 /* Match if any of the chunk types are present */
25 #define SCTP_CHUNK_MATCH_ALL 0x02 /* Match if all of the chunk types are present */
26 #define SCTP_CHUNK_MATCH_ONLY 0x04 /* Match if these are the only chunk types present */
28 u_int32_t chunk_match_type
;
29 struct xt_sctp_flag_info flag_info
[XT_NUM_SCTP_FLAGS
];
36 #define bytes(type) (sizeof(type) * 8)
38 #define SCTP_CHUNKMAP_SET(chunkmap, type) \
40 chunkmap[type / bytes(u_int32_t)] |= \
41 1 << (type % bytes(u_int32_t)); \
44 #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
46 chunkmap[type / bytes(u_int32_t)] &= \
47 ~(1 << (type % bytes(u_int32_t))); \
50 #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
52 (chunkmap[type / bytes (u_int32_t)] & \
53 (1 << (type % bytes (u_int32_t)))) ? 1: 0; \
56 #define SCTP_CHUNKMAP_RESET(chunkmap) \
59 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
63 #define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
66 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
70 #define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
73 for (i = 0; i < ARRAY_SIZE(srcmap); i++) \
74 destmap[i] = srcmap[i]; \
77 #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
81 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
90 #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
94 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
95 if (chunkmap[i] != ~0) { \
103 #endif /* _XT_SCTP_H_ */