Home | History | Annotate | Download | only in netfilter_ipv4
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      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.
      9  ***
     10  ****************************************************************************
     11  ****************************************************************************/
     12 #ifndef _IPT_SCTP_H_
     13 #define _IPT_SCTP_H_
     14 
     15 #define IPT_SCTP_SRC_PORTS 0x01
     16 #define IPT_SCTP_DEST_PORTS 0x02
     17 #define IPT_SCTP_CHUNK_TYPES 0x04
     18 
     19 #define IPT_SCTP_VALID_FLAGS 0x07
     20 
     21 struct ipt_sctp_flag_info {
     22  u_int8_t chunktype;
     23  u_int8_t flag;
     24  u_int8_t flag_mask;
     25 };
     26 
     27 #define IPT_NUM_SCTP_FLAGS 4
     28 
     29 struct ipt_sctp_info {
     30  u_int16_t dpts[2];
     31  u_int16_t spts[2];
     32 
     33  u_int32_t chunkmap[256 / sizeof (u_int32_t)];
     34 
     35 #define SCTP_CHUNK_MATCH_ANY 0x01
     36 #define SCTP_CHUNK_MATCH_ALL 0x02
     37 #define SCTP_CHUNK_MATCH_ONLY 0x04
     38 
     39  u_int32_t chunk_match_type;
     40  struct ipt_sctp_flag_info flag_info[IPT_NUM_SCTP_FLAGS];
     41  int flag_count;
     42 
     43  u_int32_t flags;
     44  u_int32_t invflags;
     45 };
     46 
     47 #define bytes(type) (sizeof(type) * 8)
     48 
     49 #define SCTP_CHUNKMAP_SET(chunkmap, type)   do {   chunkmap[type / bytes(u_int32_t)] |=   1 << (type % bytes(u_int32_t));   } while (0)
     50 
     51 #define SCTP_CHUNKMAP_CLEAR(chunkmap, type)   do {   chunkmap[type / bytes(u_int32_t)] &=   ~(1 << (type % bytes(u_int32_t)));   } while (0)
     52 
     53 #define SCTP_CHUNKMAP_IS_SET(chunkmap, type)  ({   (chunkmap[type / bytes (u_int32_t)] &   (1 << (type % bytes (u_int32_t)))) ? 1: 0;  })
     54 
     55 #define SCTP_CHUNKMAP_RESET(chunkmap)   do {   int i;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++)   chunkmap[i] = 0;   } while (0)
     56 
     57 #define SCTP_CHUNKMAP_SET_ALL(chunkmap)   do {   int i;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++)   chunkmap[i] = ~0;   } while (0)
     58 
     59 #define SCTP_CHUNKMAP_COPY(destmap, srcmap)   do {   int i;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++)   destmap[i] = srcmap[i];   } while (0)
     60 
     61 #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap)  ({   int i;   int flag = 1;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++) {   if (chunkmap[i]) {   flag = 0;   break;   }   }   flag;  })
     62 
     63 #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap)  ({   int i;   int flag = 1;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++) {   if (chunkmap[i] != ~0) {   flag = 0;   break;   }   }   flag;  })
     64 
     65 #endif
     66 
     67