SimpleLink CC3100/CC3200 Host Driver  Version 1.0.1.6
Simplifies the implementation of Internet connectivity
wlan_rx_filters.h
1 /*
2  * wlan_rx_filters.h - CC31xx/CC32xx Host Driver Implementation
3  *
4  * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/
5  *
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution.
18  *
19  * Neither the name of Texas Instruments Incorporated nor the names of
20  * its contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35 */
36 
37 
38 /*****************************************************************************/
39 /* Include files */
40 /*****************************************************************************/
41 #include "simplelink.h"
42 
43 #ifndef RX_FILTERS_PREPROCESSOR_CLI_IF_H_
44 #define RX_FILTERS_PREPROCESSOR_CLI_IF_H_
45 
46 
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 
53 /*****************************************************************************/
54 /* Macro declarations */
55 /*****************************************************************************/
56 
61 #define SL_RX_FILTER_MAX_FILTERS 64
62 
67 #define SL_RX_FILTER_MAX_PRE_PREPARED_FILTERS_SETS (32)
68 
72 #define SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS (2)
73 
77 #define SL_RX_FILTER_NUM_OF_FILTER_PAYLOAD_ARGS (2)
78 
82 #define SL_RX_FILTER_NUM_OF_COMBINATION_TYPE_ARGS (2)
83 
87 #define SL_RX_FILTER_LENGTH_OF_REGX_PATTERN_LENGTH (32)
88 
89 
90 /* List of possible error numbers */
91 #define RXFL_OK (0) /* O.K */
92 #define RXFL_OUTPUT_OR_INPUT_BUFFER_LENGTH_TOO_SMALL (76) /* ! The output buffer length is smaller than required for that operation */
93 #define RXFL_DEPENDENT_FILTER_SOFTWARE_FILTER_NOT_FIT (75) /* Node filter can't be child of software filter and vice_versa */
94 #define RXFL_DEPENDENCY_IS_NOT_PERSISTENT (74) /* Dependency filter is not persistent */
95 #define RXFL_SYSTEM_STATE_NOT_SUPPORTED_FOR_THIS_FILTER (72) /* System state is not supported */
96 #define RXFL_TRIGGER_USE_REG5_TO_REG8 (71) /* Only counters 5 - 8 are allowed, for Tigger */
97 #define RXFL_TRIGGER_USE_REG1_TO_REG4 (70) /* Only counters 1 - 4 are allowed, for trigger */
98 #define RXFL_ACTION_USE_REG5_TO_REG8 (69) /* Only counters 5 - 8 are allowed, for action */
99 #define RXFL_ACTION_USE_REG1_TO_REG4 (68) /* Only counters 1 - 4 are allowed, for action */
100 #define RXFL_FIELD_SUPPORT_ONLY_EQUAL_AND_NOTEQUAL (67) /* Rule compare function Id is out of range */
101 #define RXFL_WRONG_MULTICAST_BROADCAST_ADDRESS (66) /* The address should be of type mutlicast or broadcast */
102 #define RXFL_THE_FILTER_IS_NOT_OF_HEADER_TYPE (65) /* The filter should be of header type */
103 #define RXFL_WRONG_COMPARE_FUNC_FOR_BROADCAST_ADDRESS (64) /* The compare funcion is not suitable for broadcast address */
104 #define RXFL_WRONG_MULTICAST_ADDRESS (63) /* The address should be of muticast type */
105 #define RXFL_DEPENDENT_FILTER_IS_NOT_PERSISTENT (62) /* The dependency filter is not persistent */
106 #define RXFL_DEPENDENT_FILTER_IS_NOT_ENABLED (61) /* The dependency filter is not enabled */
107 #define RXFL_FILTER_HAS_CHILDS (60) /* The filter has childs and can't be removed */
108 #define RXFL_CHILD_IS_ENABLED (59) /* Can't disable filter while the child is enabled */
109 #define RXFL_DEPENDENCY_IS_DISABLED (58) /* Can't enable filetr in case its depndency filter is disabled */
110 #define RXFL_NUMBER_OF_CONNECTION_POINTS_EXCEEDED (52) /* Number of connection points exceeded */
111 #define RXFL_DEPENDENT_FILTER_DEPENDENCY_ACTION_IS_DROP (51) /* The dependent filter has Drop action, thus the filter can't be created */
112 #define RXFL_FILTER_DO_NOT_EXISTS (50) /* The filter doesn't exists */
113 #define RXFL_DEPEDENCY_NOT_ON_THE_SAME_LAYER (49) /* The filter and its dependency must be on the same layer */
114 #define RXFL_NUMBER_OF_ARGS_EXCEEDED (48) /* Number of arguments excceded */
115 #define RXFL_ACTION_NO_REG_NUMBER (47) /* Action require counter number */
116 #define RXFL_DEPENDENT_FILTER_LAYER_DO_NOT_FIT (46) /* the filter and its dependency should be from the same layer */
117 #define RXFL_DEPENDENT_FILTER_SYSTEM_STATE_DO_NOT_FIT (45) /* The filter and its dependency system state don't fit */
118 #define RXFL_DEPENDENT_FILTER_DO_NOT_EXIST_2 (44) /* The parent filter don't exist */
119 #define RXFL_DEPENDENT_FILTER_DO_NOT_EXIST_1 (43) /* The parent filter is null */
120 #define RXFL_RULE_HEADER_ACTION_TYPE_NOT_SUPPORTED (42) /* The action type is not supported */
121 #define RXFL_RULE_HEADER_TRIGGER_COMPARE_FUNC_OUT_OF_RANGE (41) /* The Trigger comparision function is out of range */
122 #define RXFL_RULE_HEADER_TRIGGER_OUT_OF_RANGE (40) /* The Trigger is out of range */
123 #define RXFL_RULE_HEADER_COMPARE_FUNC_OUT_OF_RANGE (39) /* The rule compare function is out of range */
124 #define RXFL_FRAME_TYPE_NOT_SUPPORTED (38) /* ASCII frame type string is illegal */
125 #define RXFL_RULE_FIELD_ID_NOT_SUPPORTED (37) /* Rule field ID is out of range */
126 #define RXFL_RULE_HEADER_FIELD_ID_ASCII_NOT_SUPPORTED (36) /* This ASCII field ID is not supported */
127 #define RXFL_RULE_HEADER_NOT_SUPPORTED (35) /* The header rule is not supported on current release */
128 #define RXFL_RULE_HEADER_OUT_OF_RANGE (34) /* The header rule is out of range */
129 #define RXFL_RULE_HEADER_COMBINATION_OPERATOR_OUT_OF_RANGE (33) /* Combination function Id is out of ramge */
130 #define RXFL_RULE_HEADER_FIELD_ID_OUT_OF_RANGE (32) /* rule field Id is out of range */
131 #define RXFL_UPDATE_NOT_SUPPORTED (31) /* Update not supported */
132 #define RXFL_NO_FILTERS_ARE_DEFINED (24) /* No filters are defined in the system */
133 #define RXFL_NUMBER_OF_FILTER_EXCEEDED (23) /* Number of max filters excceded */
134 
135 
136 /******************************************************************************/
137 /* Type declarations */
138 /******************************************************************************/
139 
146 typedef _i8 SlrxFilterID_t;
147 
148 
153 typedef _u8 SlrxFilterCompareMask_t;
154 
162 typedef _u8 SlrxFilterIdMask_t[128/8];
163 
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)
173 
174 
175 
182 typedef _u8 SlrxFilterPrePreparedFiltersMask_t[SL_RX_FILTER_MAX_PRE_PREPARED_FILTERS_SETS/8];
183 
184 
190 {
191  _u8 x[SL_RX_FILTER_LENGTH_OF_REGX_PATTERN_LENGTH];
193 
194 
199 typedef _u8 SlrxFilterAsciiArg_t;
200 
201 
205 typedef _u8 SlrxFilterBinaryArg_t ;
206 
207 
214 typedef _u8 SlrxFilterActionArg_t ;
215 
216 
217 
222 typedef _u32 SlrxFilterOffset_t;
223 
224 
225 
230 typedef _u8 SlrxFilterRuleType_t;
231 /* possible values for SlrxFilterRuleType_t */
232 #define HEADER (0)
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)
238 
239 
245 #define RX_FILTER_BINARY (0x1)
246 #define RX_FILTER_PERSISTENT (0x8)
247 #define RX_FILTER_ENABLE (0x10)
248 
249 typedef union SlrxFilterFlags_t
250 {
251 
252  /* struct
253  { */
258  /* _u8 Binary: 1; */
262  /* _u8 AutoSort : 1; */
266  /* _u8 AutoFaultDetect : 1; */
270  /* _u8 Enabled : 1; */
271  /* _u8 padding : 3; */
272  /*
273  };*/
274 
276 
278 
283 typedef _u8 SlrxFilterCompareFunction_t;
284 /* Possible values for 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)
290 
295 typedef _u8 SlrxTriggerCompareFunction_t;
296 /* Possible values for SlrxTriggerCompareFunction_t */
297 #define TRIGGER_COMPARE_FUNC_EQUAL (0)
298 /* arg1 == protocolVal ,not supported in current release */
299 #define TRIGGER_COMPARE_FUNC_NOT_EQUAL_TO (1)
300 /* arg1 == protocolVal */
301 #define TRIGGER_COMPARE_FUNC_SMALLER_THAN (2)
302 /* arg1 == protocolVal */
303 #define TRIGGER_COMPARE_FUNC_BIGGER_THAN (3)
304 /* definition */
305 #define TRIGGER_COMPARE_FUNC_NUM_OF_FILTER_COMPARE_FUNC (4)
306 
307 
312 typedef _u8 SlrxFilterHdrField_t;
313 /* Possible values for SlrxFilterHdrField_t */
314 #define NULL_FIELD_ID_TYPE (0)
315 /* 802.11 control\data\management */
316 #define FRAME_TYPE_FIELD (1)
317 /* 802.11 beacon\probe\.. */
318 #define FRAME_SUBTYPE_FIELD (2)
319  /* 802.11 bssid type */
320 #define BSSID_FIELD (3)
321  /* */
322 #define MAC_SRC_ADDRESS_FIELD (4)
323  /* */
324 #define MAC_DST_ADDRESS_FIELD (5)
325 /* */
326 #define FRAME_LENGTH_FIELD (6)
327 /* */
328 #define PROTOCOL_TYPE_FIELD (7)
329  /* */
330 #define IP_VERSION_FIELD (8)
331  /* TCP / UDP */
332 #define IP_PROTOCOL_FIELD (9)
333  /* */
334 #define IPV4_SRC_ADRRESS_FIELD (10)
335 /* */
336 #define IPV4_DST_ADDRESS_FIELD (11)
337 /* */
338 #define IPV6_SRC_ADRRESS_FIELD (12)
339 /* */
340 #define IPV6_DST_ADDRESS_FIELD (13)
341  /* */
342 #define SRC_PORT_FIELD (14)
343  /* */
344 #define DST_PORT_FIELD (15)
345  /* Definition */
346 #define NUM_OF_FIELD_NAME_FIELD (16)
347 
351 /* -- 36 bytes */
353 {
354  /*----------------------------- Large size ---------------------------------*/
360  SlrxFilterBinaryArg_t RxFilterDB16BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][16 ]; /* Binary Values for comparition */
366  /*----------------------------- Medium size ---------------------------------*/
370  SlrxFilterBinaryArg_t RxFilterDB6BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][6]; /* Binary Values for comparition */
376  SlrxFilterAsciiArg_t RxFilterDB18BytesAsciiRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][18]; /* Ascii Values for comparison */
377  /*----------------------------- Small size ---------------------------------*/
382  SlrxFilterBinaryArg_t RxFilterDB4BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][4]; /* Binary Values for comparison */
386  SlrxFilterAsciiArg_t RxFilterDB5BytesRuleAsciiArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][5]; /* Ascii Values for comparison */
387  /*----------------------------- 1 byte size ---------------------------------*/
390  SlrxFilterBinaryArg_t RxFilterDB1BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][1]; /* Binary Values for comparison */
392 
393 
394 
398 /* -- 52 bytes */
400 {
402  /* -- 36 byte */
404 
408  /* -- 16 bytes */
409  SlrxFilterCompareMask_t RuleHeaderArgsMask[16];
410 
412 
419 /* -- 56 byte */
421 {
423  /* -- 52 bytes */
425 
427  /* -- 1 byte */
428  SlrxFilterHdrField_t RuleHeaderfield;
429 
430  /* -- 1 byte */
434  SlrxFilterCompareFunction_t RuleCompareFunc;
435 
437  /* -- 2 bytes */
438  _u8 RulePadding[2];
439 
441 
446 /* -- 40 byte */
448 {
450  /* -- 32 byte */
453  /* -- 4 byte */
454  SlrxFilterOffset_t LowerOffset;
456  /* -- 4 byte */
457  SlrxFilterOffset_t UpperOffset;
459 
464 typedef _u8 SlrxFilterCombinationTypeOperator_t;
465 /* Possible values for SlrxFilterCombinationTypeOperator_t */
467 #define COMBINED_FUNC_NOT (0)
468 
469 #define COMBINED_FUNC_AND (1)
470 
471 #define COMBINED_FUNC_OR (2)
472 
479 /* -- 4 byte */
481 {
482  /* ! combination operator */
483  /* -- 1 byte */
484  SlrxFilterCombinationTypeOperator_t CombinationTypeOperator;
485  /* ! filterID, may be one or two depends on the combination operator type */
486  /* -- 2 byte */
487  SlrxFilterID_t CombinationFilterId[SL_RX_FILTER_NUM_OF_COMBINATION_TYPE_ARGS];
488  /* ! Padding */
489  /* -- 1 byte */
490  _u8 Padding;
492 
493 
498 /* -- 56 byte */
499 typedef union SlrxFilterRule_t
500 {
501  /* ! Header type rule , see explanation on the ::SlrxFilterHeaderType_t structure */
502  /* -- 56 byte */
503  SlrxFilterHeaderType_t HeaderType;
504  /* ! Payload rule, not supported in current release */
505  /* -- 40 byte */
506  SlrxFilterPayloadType_t PayLoadHeaderType; /* future for exact pattern or like hood pattern */
507  /* ! Combined type rule , see explanation in ::SlrxFilterCombinationType_t structure */
508  /* -- 4 byte */
509  SlrxFilterCombinationType_t CombinationType;
511 
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)
520 
522 {
523 /* struct */
524 /* { */
525 /* _u8 RoleAP :1; */
526 /* _u8 RoleStation :1; */
527  /* The filter is activated only in Promiscuous mode */
528 /* _u8 PromiscuousMode :1; */
529 /* _u8 RoleReserved :5; */
530 /* }; */
531  /* ! Bit fiels of the Filter role */
532  _u8 IntRepresentation;
533 
535 
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)
544 
546 {
547 /* struct */
548 /* { */
549 /* _u8 RoleStationWiFiConnected :1; */
550 /* _u8 RoleStationWiFiDisconneted:1; */
551 /* _u8 RoleStationWiFiHasIp:1; */
552 /* _u8 RoleStationWiFiHasNoIp:1; */
553 /* _u8 RoleStationWiFiSocketOpened:1; */
554 /* _u8 RoleStationWiFiSocketclosed:1; */
555 /* }; */
556 /* */
557  /* ! */
558  _u8 IntRepresentation;
559 
561 
569 typedef _u32 SlrxFilterDBTriggerArg_t;
570 
571 
572 
576 typedef _u8 SlrxFilterCounterId_t;
577 /* Possible values for 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)
588 
589 
590 
596 typedef _u8 SlrxFilterActionArgs_t;
597 /* Possible values for SlrxFilterActionArgs_t */
598 #define ACTION_ARG_REG_1_4 (0)
599  /* ! Can be use as counter */
600 #define ACTION_ARG_TEMPLATE (1)
601  /* ! Can be use as counter */
602 #define ACTION_ARG_EVENT (2)
603 
604 /* ! GPIO number */
605 #define ACTION_ARG_GPIO (4)
606 
610 #define SL_RX_FILTER_NUM_OF_BYTES_FOR_ACTIONS_ARGS (5)
611 
612 
613 
614 
623 /* -- 12 byte */
624 typedef struct SlrxFilterTrigger_t
625 {
627  /* NULL value means tree root.
628  */
629  /* -- 1 byte */
630  SlrxFilterID_t ParentFilterID;
631  /* ! See ::SlrxFilterCounterId_t explanation */
632  /* -- 1 byte */
633  SlrxFilterCounterId_t Trigger;
634  /* ! See :: SlrxFilterTriggerConnectionStates_t */
635  /* -- 1 byte */
636  SlrxFilterTriggerConnectionStates_t TriggerArgConnectionState;
637  /* ! See ::SlrxFilterTriggerRoles_t */
638  /* -- 1 byte */
639  SlrxFilterTriggerRoles_t TriggerArgRoleStatus;
640  /* ! The Trigger arguments are in the same order as the Trigger bit field order. */
641  /* -- 4 byte */
642  SlrxFilterDBTriggerArg_t TriggerArg;
647  /* -- 1 byte */
648  SlrxTriggerCompareFunction_t TriggerCompareFunction;
649 
650  /* ! padding */
651  /* -- 3 byte */
652  _u8 Padding[3];
654 
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) /* unsupported */
669 #define RX_FILTER_ACTION_EVENT_TO_HOST (0x40) /* unsupported */
670 
672 {
673 /* struct */
674 /* { */
675  /* ! No action to execute the packet is dropped,drop is always on leaf. */
676  /* ! If not dropped ,The packet is passed to the next filter or in case it is the last filter to the host */
677 /* _u8 ActionDrop : 1; */
678  /* ! Not Supported in the current release */
679 /* _u8 ActionGpio : 1; */
685 /* _u8 ActionOnREGIncrease : 1; */
686 /* _u8 ActionOnREGDecrease : 1; */
687 /* _u8 ActionOnREGReset : 1; */
688 
689  /* ! Not Supported in the current release */
690 /* _u8 ActionSendTemplate : 1; */
691  /* ! Not Supported in the current release */
692 /* _u8 ActionEventToHost: 1; */
693 /* _u8 padding: 1; */
694 /* }; */
695 
697 
699 
704 /* -- 8 byte */
705 typedef struct SlrxFilterAction_t
706 {
707  /* -- 1 byte */
708  /* ! Determine which actions are supported */
709  SlrxFilterActionType_t ActionType;
710  /* ! Buffer for the action arguments */
719  /* -- 5 byte */
720  SlrxFilterActionArg_t ActionArg[SL_RX_FILTER_NUM_OF_BYTES_FOR_ACTIONS_ARGS];
721 
722  /* ! Padding */
723  /* - 2 Bytes */
724  _u8 Padding[2];
725 
727 
728 
736 /* 20 bytes */
738 {
739  /* -- 16 bytes */
740  SlrxFilterIdMask_t FilterIdMask;
741  /* 4 bytes */
742  _u8 Padding[4];
744 
745 
746 
747 /* -- 56 bytes */
749 {
750  /* -- 1 bytes */
751  _u8 FilterId;
752 
753  /* -- 1 bytes */
754  /* ! the args representation */
755  _u8 BinaryRepresentation;
756 
757  /* -- 52 byte */
758  SlrxFilterRuleHeaderArgsAndMask_t FilterRuleHeaderArgsAndMask;
759 
760  /* -- 2 bytes */
761  _u8 Padding[2];
763 
764 
769 /* -- 16 bytes */
771 {
772 
773  /* ! the filter set bit map */
774  /* -- 16 bytes */
775  SlrxFilterIdMask_t FilterIdMask;
776 
778 
779 
785 {
786  /* ! the filter set bit map */
787  /* -- 4 bytes */
788  SlrxFilterPrePreparedFiltersMask_t FilterPrePreparedFiltersMask;
789 
791 
792 
796 /*-- 4 bytes */
798 {
799  /* -- 4 bytes */
800  /* ! the filter set bit map */
801  SlrxFilterPrePreparedFiltersMask_t FilterPrePreparedFiltersMask;
802 
804 
805 
806 
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)
815 
816 
817 /* Bit manipulation for 8 bit */
818 #define ISBITSET8(x,i) ((x[i>>3] & (0x80>>(i&7)))!=0) /* < Is bit set, 8 bit unsigned numbers = x , location = i */
819 #define SETBIT8(x,i) x[i>>3]|=(0x80>>(i&7)); /* < Set bit,8 bit unsigned numbers = x , location = i */
820 #define CLEARBIT8(x,i) x[i>>3]&=(0x80>>(i&7))^0xFF; /* < Clear bit,8 bit unsigned numbers = x , location = i */
821 
822 
823 /*********************************************************************************************/
824 /* Function prototypes */
825 /*********************************************************************************************/
826 
847 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterAdd)
848 _i16 sl_WlanRxFilterAdd( SlrxFilterRuleType_t RuleType,
849  SlrxFilterFlags_t FilterFlags,
850  const SlrxFilterRule_t* const Rule,
851  const SlrxFilterTrigger_t* const Trigger,
852  const SlrxFilterAction_t* const Action,
853  SlrxFilterID_t* pFilterId);
854 
855 #endif
856 
857 
858 
859 
860 
887 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterSet)
888 _i16 sl_WlanRxFilterSet( const SLrxFilterOperation_t RxFilterOperation,
889  const _u8* const pInputBuffer,
890  _u16 InputbufferLength);
891 #endif
892 
912 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterGet)
913 _i16 sl_WlanRxFilterGet(const SLrxFilterOperation_t RxFilterOperation,
914  _u8* pOutputBuffer,
915  _u16 OutputbufferLength);
916 #endif
917 
918 
926 #ifdef __cplusplus
927 }
928 #endif /* __cplusplus */
929 
930 #endif /* RX_FILTERS_PREPROCESSOR_CLI_IF_H_ */
931 
932 
SlrxFilterRegxPattern_t RegxPattern
SlrxFilterHeaderArg_t RuleHeaderArgs
SlrxFilterCompareFunction_t RuleCompareFunc
SlrxFilterActionArg_t ActionArg[SL_RX_FILTER_NUM_OF_BYTES_FOR_ACTIONS_ARGS]
SlrxFilterBinaryArg_t RxFilterDB1BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][1]
SlrxFilterOffset_t LowerOffset
SlrxFilterBinaryArg_t RxFilterDB4BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][4]
SlrxFilterAsciiArg_t RxFilterDB18BytesAsciiRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][18]
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.
SlrxFilterRuleHeaderArgsAndMask_t RuleHeaderArgsAndMask
_i16 sl_WlanRxFilterSet(const SLrxFilterOperation_t RxFilterOperation, const _u8 *const pInputBuffer, _u16 InputbufferLength)
Sets parameters to Rx filters.
SlrxFilterHdrField_t RuleHeaderfield
SlrxFilterOffset_t UpperOffset
_i16 sl_WlanRxFilterGet(const SLrxFilterOperation_t RxFilterOperation, _u8 *pOutputBuffer, _u16 OutputbufferLength)
Gets parameters of Rx filters.
SlrxFilterBinaryArg_t RxFilterDB6BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][6]
SlrxFilterID_t ParentFilterID
SlrxFilterAsciiArg_t RxFilterDB5BytesRuleAsciiArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][5]
SlrxFilterBinaryArg_t RxFilterDB16BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][16]