4 #define IPT_SCTP_SRC_PORTS 0x01
5 #define IPT_SCTP_DEST_PORTS 0x02
6 #define IPT_SCTP_CHUNK_TYPES 0x04
8 #define IPT_SCTP_VALID_FLAGS 0x07
11 struct ipt_sctp_flag_info {
17 #define IPT_NUM_SCTP_FLAGS 4
19 struct ipt_sctp_info {
20 u_int16_t dpts[2]; /* Min, Max */
21 u_int16_t spts[2]; /* Min, Max */
23 u_int32_t chunkmap[256 / sizeof (u_int32_t)]; /* Bit mask of chunks to be matched according to RFC 2960 */
25 #define SCTP_CHUNK_MATCH_ANY 0x01 /* Match if any of the chunk types are present */
26 #define SCTP_CHUNK_MATCH_ALL 0x02 /* Match if all of the chunk types are present */
27 #define SCTP_CHUNK_MATCH_ONLY 0x04 /* Match if these are the only chunk types present */
29 u_int32_t chunk_match_type;
30 struct ipt_sctp_flag_info flag_info[IPT_NUM_SCTP_FLAGS];
37 #define bytes(type) (sizeof(type) * 8)
39 #define SCTP_CHUNKMAP_SET(chunkmap, type) \
41 chunkmap[type / bytes(u_int32_t)] |= \
42 1 << (type % bytes(u_int32_t)); \
45 #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
47 chunkmap[type / bytes(u_int32_t)] &= \
48 ~(1 << (type % bytes(u_int32_t))); \
51 #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
53 (chunkmap[type / bytes (u_int32_t)] & \
54 (1 << (type % bytes (u_int32_t)))) ? 1: 0; \
57 #define SCTP_CHUNKMAP_RESET(chunkmap) \
60 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
64 #define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
67 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
71 #define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
74 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
75 destmap[i] = srcmap[i]; \
78 #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
82 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
91 #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
95 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
96 if (chunkmap[i] != ~0) { \
104 #endif /* _IPT_SCTP_H_ */