41 #include "simplelink.h"
43 #ifndef RX_FILTERS_PREPROCESSOR_CLI_IF_H_
44 #define RX_FILTERS_PREPROCESSOR_CLI_IF_H_
61 #define SL_RX_FILTER_MAX_FILTERS 64
67 #define SL_RX_FILTER_MAX_PRE_PREPARED_FILTERS_SETS (32)
72 #define SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS (2)
77 #define SL_RX_FILTER_NUM_OF_FILTER_PAYLOAD_ARGS (2)
82 #define SL_RX_FILTER_NUM_OF_COMBINATION_TYPE_ARGS (2)
87 #define SL_RX_FILTER_LENGTH_OF_REGX_PATTERN_LENGTH (32)
92 #define RXFL_OUTPUT_OR_INPUT_BUFFER_LENGTH_TOO_SMALL (76)
93 #define RXFL_DEPENDENT_FILTER_SOFTWARE_FILTER_NOT_FIT (75)
94 #define RXFL_DEPENDENCY_IS_NOT_PERSISTENT (74)
95 #define RXFL_SYSTEM_STATE_NOT_SUPPORTED_FOR_THIS_FILTER (72)
96 #define RXFL_TRIGGER_USE_REG5_TO_REG8 (71)
97 #define RXFL_TRIGGER_USE_REG1_TO_REG4 (70)
98 #define RXFL_ACTION_USE_REG5_TO_REG8 (69)
99 #define RXFL_ACTION_USE_REG1_TO_REG4 (68)
100 #define RXFL_FIELD_SUPPORT_ONLY_EQUAL_AND_NOTEQUAL (67)
101 #define RXFL_WRONG_MULTICAST_BROADCAST_ADDRESS (66)
102 #define RXFL_THE_FILTER_IS_NOT_OF_HEADER_TYPE (65)
103 #define RXFL_WRONG_COMPARE_FUNC_FOR_BROADCAST_ADDRESS (64)
104 #define RXFL_WRONG_MULTICAST_ADDRESS (63)
105 #define RXFL_DEPENDENT_FILTER_IS_NOT_PERSISTENT (62)
106 #define RXFL_DEPENDENT_FILTER_IS_NOT_ENABLED (61)
107 #define RXFL_FILTER_HAS_CHILDS (60)
108 #define RXFL_CHILD_IS_ENABLED (59)
109 #define RXFL_DEPENDENCY_IS_DISABLED (58)
110 #define RXFL_NUMBER_OF_CONNECTION_POINTS_EXCEEDED (52)
111 #define RXFL_DEPENDENT_FILTER_DEPENDENCY_ACTION_IS_DROP (51)
112 #define RXFL_FILTER_DO_NOT_EXISTS (50)
113 #define RXFL_DEPEDENCY_NOT_ON_THE_SAME_LAYER (49)
114 #define RXFL_NUMBER_OF_ARGS_EXCEEDED (48)
115 #define RXFL_ACTION_NO_REG_NUMBER (47)
116 #define RXFL_DEPENDENT_FILTER_LAYER_DO_NOT_FIT (46)
117 #define RXFL_DEPENDENT_FILTER_SYSTEM_STATE_DO_NOT_FIT (45)
118 #define RXFL_DEPENDENT_FILTER_DO_NOT_EXIST_2 (44)
119 #define RXFL_DEPENDENT_FILTER_DO_NOT_EXIST_1 (43)
120 #define RXFL_RULE_HEADER_ACTION_TYPE_NOT_SUPPORTED (42)
121 #define RXFL_RULE_HEADER_TRIGGER_COMPARE_FUNC_OUT_OF_RANGE (41)
122 #define RXFL_RULE_HEADER_TRIGGER_OUT_OF_RANGE (40)
123 #define RXFL_RULE_HEADER_COMPARE_FUNC_OUT_OF_RANGE (39)
124 #define RXFL_FRAME_TYPE_NOT_SUPPORTED (38)
125 #define RXFL_RULE_FIELD_ID_NOT_SUPPORTED (37)
126 #define RXFL_RULE_HEADER_FIELD_ID_ASCII_NOT_SUPPORTED (36)
127 #define RXFL_RULE_HEADER_NOT_SUPPORTED (35)
128 #define RXFL_RULE_HEADER_OUT_OF_RANGE (34)
129 #define RXFL_RULE_HEADER_COMBINATION_OPERATOR_OUT_OF_RANGE (33)
130 #define RXFL_RULE_HEADER_FIELD_ID_OUT_OF_RANGE (32)
131 #define RXFL_UPDATE_NOT_SUPPORTED (31)
132 #define RXFL_NO_FILTERS_ARE_DEFINED (24)
133 #define RXFL_NUMBER_OF_FILTER_EXCEEDED (23)
146 typedef _i8 SlrxFilterID_t;
153 typedef _u8 SlrxFilterCompareMask_t;
162 typedef _u8 SlrxFilterIdMask_t[128/8];
168 typedef _u8 SlrxFilterPrePreparedFilters_t;
169 #define SL_ARP_AUTO_REPLY_PRE_PREPARED_FILTERS (0)
170 #define SL_MULTICASTSIPV4_DROP_PREPREPARED_FILTERS (1)
171 #define SL_MULTICASTSIPV6_DROP_PREPREPARED_FILTERS (2)
172 #define SL_MULTICASTSWIFI_DROP_PREPREPARED_FILTERS (3)
182 typedef _u8 SlrxFilterPrePreparedFiltersMask_t[SL_RX_FILTER_MAX_PRE_PREPARED_FILTERS_SETS/8];
191 _u8 x[SL_RX_FILTER_LENGTH_OF_REGX_PATTERN_LENGTH];
199 typedef _u8 SlrxFilterAsciiArg_t;
205 typedef _u8 SlrxFilterBinaryArg_t ;
214 typedef _u8 SlrxFilterActionArg_t ;
222 typedef _u32 SlrxFilterOffset_t;
230 typedef _u8 SlrxFilterRuleType_t;
233 #define COMBINATION (1)
234 #define EXACT_PATTERN (2)
235 #define LIKELIHOOD_PATTERN (3)
236 #define ALWAYS_TRUE (4)
237 #define NUM_OF_FILTER_TYPES (5)
245 #define RX_FILTER_BINARY (0x1)
246 #define RX_FILTER_PERSISTENT (0x8)
247 #define RX_FILTER_ENABLE (0x10)
283 typedef _u8 SlrxFilterCompareFunction_t;
285 #define COMPARE_FUNC_IN_BETWEEN (0)
286 #define COMPARE_FUNC_EQUAL (1)
287 #define COMPARE_FUNC_NOT_EQUAL_TO (2)
288 #define COMPARE_FUNC_NOT_IN_BETWEEN (3)
289 #define COMPARE_FUNC_NUM_OF_FILTER_COMPARE_FUNC (4)
295 typedef _u8 SlrxTriggerCompareFunction_t;
297 #define TRIGGER_COMPARE_FUNC_EQUAL (0)
299 #define TRIGGER_COMPARE_FUNC_NOT_EQUAL_TO (1)
301 #define TRIGGER_COMPARE_FUNC_SMALLER_THAN (2)
303 #define TRIGGER_COMPARE_FUNC_BIGGER_THAN (3)
305 #define TRIGGER_COMPARE_FUNC_NUM_OF_FILTER_COMPARE_FUNC (4)
312 typedef _u8 SlrxFilterHdrField_t;
314 #define NULL_FIELD_ID_TYPE (0)
316 #define FRAME_TYPE_FIELD (1)
318 #define FRAME_SUBTYPE_FIELD (2)
320 #define BSSID_FIELD (3)
322 #define MAC_SRC_ADDRESS_FIELD (4)
324 #define MAC_DST_ADDRESS_FIELD (5)
326 #define FRAME_LENGTH_FIELD (6)
328 #define PROTOCOL_TYPE_FIELD (7)
330 #define IP_VERSION_FIELD (8)
332 #define IP_PROTOCOL_FIELD (9)
334 #define IPV4_SRC_ADRRESS_FIELD (10)
336 #define IPV4_DST_ADDRESS_FIELD (11)
338 #define IPV6_SRC_ADRRESS_FIELD (12)
340 #define IPV6_DST_ADDRESS_FIELD (13)
342 #define SRC_PORT_FIELD (14)
344 #define DST_PORT_FIELD (15)
346 #define NUM_OF_FIELD_NAME_FIELD (16)
464 typedef _u8 SlrxFilterCombinationTypeOperator_t;
467 #define COMBINED_FUNC_NOT (0)
469 #define COMBINED_FUNC_AND (1)
471 #define COMBINED_FUNC_OR (2)
484 SlrxFilterCombinationTypeOperator_t CombinationTypeOperator;
487 SlrxFilterID_t CombinationFilterId[SL_RX_FILTER_NUM_OF_COMBINATION_TYPE_ARGS];
516 #define RX_FILTER_ROLE_AP (1)
517 #define RX_FILTER_ROLE_STA (2)
518 #define RX_FILTER_ROLE_PROMISCUOUS (4)
519 #define RX_FILTER_ROLE_NULL (0)
532 _u8 IntRepresentation;
540 #define RX_FILTER_CONNECTION_STATE_STA_CONNECTED (1)
541 #define RX_FILTER_CONNECTION_STATE_STA_NOT_CONNECTED (2)
542 #define RX_FILTER_CONNECTION_STATE_STA_HAS_IP (4)
543 #define RX_FILTER_CONNECTION_STATE_STA_HAS_NO_IP (8)
558 _u8 IntRepresentation;
569 typedef _u32 SlrxFilterDBTriggerArg_t;
576 typedef _u8 SlrxFilterCounterId_t;
578 #define NO_TRIGGER (0)
579 #define RX_FILTER_COUNTER1 (1)
580 #define RX_FILTER_COUNTER2 (2)
581 #define RX_FILTER_COUNTER3 (3)
582 #define RX_FILTER_COUNTER4 (4)
583 #define RX_FILTER_COUNTER5 (5)
584 #define RX_FILTER_COUNTER6 (6)
585 #define RX_FILTER_COUNTER7 (7)
586 #define RX_FILTER_COUNTER8 (8)
587 #define MAX_RX_FILTER_COUNTER (9)
596 typedef _u8 SlrxFilterActionArgs_t;
598 #define ACTION_ARG_REG_1_4 (0)
600 #define ACTION_ARG_TEMPLATE (1)
602 #define ACTION_ARG_EVENT (2)
605 #define ACTION_ARG_GPIO (4)
610 #define SL_RX_FILTER_NUM_OF_BYTES_FOR_ACTIONS_ARGS (5)
633 SlrxFilterCounterId_t Trigger;
642 SlrxFilterDBTriggerArg_t TriggerArg;
662 #define RX_FILTER_ACTION_NULL (0x0)
663 #define RX_FILTER_ACTION_DROP (0x1)
664 #define RX_FILTER_ACTION_GPIO (0x2)
665 #define RX_FILTER_ACTION_ON_REG_INCREASE (0x4)
666 #define RX_FILTER_ACTION_ON_REG_DECREASE (0x8)
667 #define RX_FILTER_ACTION_ON_REG_RESET (0x10)
668 #define RX_FILTER_ACTION_SEND_TEMPLATE (0x20)
669 #define RX_FILTER_ACTION_EVENT_TO_HOST (0x40)
720 SlrxFilterActionArg_t
ActionArg[SL_RX_FILTER_NUM_OF_BYTES_FOR_ACTIONS_ARGS];
740 SlrxFilterIdMask_t FilterIdMask;
755 _u8 BinaryRepresentation;
775 SlrxFilterIdMask_t FilterIdMask;
788 SlrxFilterPrePreparedFiltersMask_t FilterPrePreparedFiltersMask;
801 SlrxFilterPrePreparedFiltersMask_t FilterPrePreparedFiltersMask;
807 typedef _u8 SLrxFilterOperation_t;
808 #define SL_ENABLE_DISABLE_RX_FILTER (0)
809 #define SL_REMOVE_RX_FILTER (1)
810 #define SL_STORE_RX_FILTERS (2)
811 #define SL_UPDATE_RX_FILTER_ARGS (3)
812 #define SL_FILTER_RETRIEVE_ENABLE_STATE (4)
813 #define SL_FILTER_PRE_PREPARED_RETRIEVE_CREATE_REMOVE_STATE (5)
814 #define SL_FILTER_PRE_PREPARED_SET_CREATE_REMOVE_STATE (6)
818 #define ISBITSET8(x,i) ((x[i>>3] & (0x80>>(i&7)))!=0)
819 #define SETBIT8(x,i) x[i>>3]|=(0x80>>(i&7));
820 #define CLEARBIT8(x,i) x[i>>3]&=(0x80>>(i&7))^0xFF;
847 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterAdd)
853 SlrxFilterID_t* pFilterId);
887 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterSet)
889 const _u8*
const pInputBuffer,
890 _u16 InputbufferLength);
912 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterGet)
915 _u16 OutputbufferLength);
SlrxFilterRegxPattern_t RegxPattern
SlrxFilterHeaderArg_t RuleHeaderArgs
SlrxFilterActionArg_t ActionArg[SL_RX_FILTER_NUM_OF_BYTES_FOR_ACTIONS_ARGS]
SlrxFilterOffset_t LowerOffset
SlrxFilterCompareMask_t RuleHeaderArgsMask[16]
SlrxTriggerCompareFunction_t TriggerCompareFunction
_i16 sl_WlanRxFilterAdd(SlrxFilterRuleType_t RuleType, SlrxFilterFlags_t FilterFlags, const SlrxFilterRule_t *const Rule, const SlrxFilterTrigger_t *const Trigger, const SlrxFilterAction_t *const Action, SlrxFilterID_t *pFilterId)
Adds new filter rule to the system.
_i16 sl_WlanRxFilterSet(const SLrxFilterOperation_t RxFilterOperation, const _u8 *const pInputBuffer, _u16 InputbufferLength)
Sets parameters to Rx filters.
SlrxFilterOffset_t UpperOffset
_i16 sl_WlanRxFilterGet(const SLrxFilterOperation_t RxFilterOperation, _u8 *pOutputBuffer, _u16 OutputbufferLength)
Gets parameters of Rx filters.
SlrxFilterID_t ParentFilterID