Updated to use external spawn.

Fork of simplelink_V2 by David Fletcher

Committer:
dflet
Date:
Sat Jun 06 13:31:01 2015 +0000
Revision:
0:1a07906111ec
Changes made to use external spawn Freertos

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dflet 0:1a07906111ec 1 /*
dflet 0:1a07906111ec 2 * wlan_rx_filters.h - CC31xx/CC32xx Host Driver Implementation
dflet 0:1a07906111ec 3 *
dflet 0:1a07906111ec 4 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
dflet 0:1a07906111ec 5 *
dflet 0:1a07906111ec 6 *
dflet 0:1a07906111ec 7 * Redistribution and use in source and binary forms, with or without
dflet 0:1a07906111ec 8 * modification, are permitted provided that the following conditions
dflet 0:1a07906111ec 9 * are met:
dflet 0:1a07906111ec 10 *
dflet 0:1a07906111ec 11 * Redistributions of source code must retain the above copyright
dflet 0:1a07906111ec 12 * notice, this list of conditions and the following disclaimer.
dflet 0:1a07906111ec 13 *
dflet 0:1a07906111ec 14 * Redistributions in binary form must reproduce the above copyright
dflet 0:1a07906111ec 15 * notice, this list of conditions and the following disclaimer in the
dflet 0:1a07906111ec 16 * documentation and/or other materials provided with the
dflet 0:1a07906111ec 17 * distribution.
dflet 0:1a07906111ec 18 *
dflet 0:1a07906111ec 19 * Neither the name of Texas Instruments Incorporated nor the names of
dflet 0:1a07906111ec 20 * its contributors may be used to endorse or promote products derived
dflet 0:1a07906111ec 21 * from this software without specific prior written permission.
dflet 0:1a07906111ec 22 *
dflet 0:1a07906111ec 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dflet 0:1a07906111ec 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dflet 0:1a07906111ec 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dflet 0:1a07906111ec 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dflet 0:1a07906111ec 27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dflet 0:1a07906111ec 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dflet 0:1a07906111ec 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
dflet 0:1a07906111ec 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
dflet 0:1a07906111ec 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
dflet 0:1a07906111ec 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
dflet 0:1a07906111ec 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dflet 0:1a07906111ec 34 *
dflet 0:1a07906111ec 35 */
dflet 0:1a07906111ec 36
dflet 0:1a07906111ec 37
dflet 0:1a07906111ec 38 /*****************************************************************************/
dflet 0:1a07906111ec 39 /* Include files */
dflet 0:1a07906111ec 40 /*****************************************************************************/
dflet 0:1a07906111ec 41 #include "cc3100_simplelink.h"
dflet 0:1a07906111ec 42
dflet 0:1a07906111ec 43 #ifndef RX_FILTERS_PREPROCESSOR_CLI_IF_H_
dflet 0:1a07906111ec 44 #define RX_FILTERS_PREPROCESSOR_CLI_IF_H_
dflet 0:1a07906111ec 45
dflet 0:1a07906111ec 46 #include "cc3100_driver.h"
dflet 0:1a07906111ec 47
dflet 0:1a07906111ec 48 /*****************************************************************************/
dflet 0:1a07906111ec 49 /* Macro declarations */
dflet 0:1a07906111ec 50 /*****************************************************************************/
dflet 0:1a07906111ec 51
dflet 0:1a07906111ec 52 /*!
dflet 0:1a07906111ec 53 * \def SL_RX_FILTER_MAX_FILTERS
dflet 0:1a07906111ec 54 * The Max number of filters for 64 filters
dflet 0:1a07906111ec 55 */
dflet 0:1a07906111ec 56 #define SL_RX_FILTER_MAX_FILTERS 64
dflet 0:1a07906111ec 57
dflet 0:1a07906111ec 58 /*!
dflet 0:1a07906111ec 59 * \def SL_RX_FILTER_MAX_PRE_PREPARED_FILTERS_SETS
dflet 0:1a07906111ec 60 * The Max number of software filters
dflet 0:1a07906111ec 61 */
dflet 0:1a07906111ec 62 #define SL_RX_FILTER_MAX_PRE_PREPARED_FILTERS_SETS (32)
dflet 0:1a07906111ec 63 /*!
dflet 0:1a07906111ec 64 * \def SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS
dflet 0:1a07906111ec 65 *
dflet 0:1a07906111ec 66 */
dflet 0:1a07906111ec 67 #define SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS (2)
dflet 0:1a07906111ec 68 /*!
dflet 0:1a07906111ec 69 * \def SL_RX_FILTER_NUM_OF_FILTER_PAYLOAD_ARGS
dflet 0:1a07906111ec 70 *
dflet 0:1a07906111ec 71 */
dflet 0:1a07906111ec 72 #define SL_RX_FILTER_NUM_OF_FILTER_PAYLOAD_ARGS (2)
dflet 0:1a07906111ec 73 /*!
dflet 0:1a07906111ec 74 * \def SL_RX_FILTER_NUM_OF_FILTER_PAYLOAD_ARGS
dflet 0:1a07906111ec 75 *
dflet 0:1a07906111ec 76 */
dflet 0:1a07906111ec 77 #define SL_RX_FILTER_NUM_OF_COMBINATION_TYPE_ARGS (2)
dflet 0:1a07906111ec 78 /*!
dflet 0:1a07906111ec 79 * \def SL_RX_FILTER_LENGTH_OF_REGX_PATTERN_LENGTH
dflet 0:1a07906111ec 80 *
dflet 0:1a07906111ec 81 */
dflet 0:1a07906111ec 82 #define SL_RX_FILTER_LENGTH_OF_REGX_PATTERN_LENGTH (32)
dflet 0:1a07906111ec 83
dflet 0:1a07906111ec 84
dflet 0:1a07906111ec 85 /* List of possible error numbers */
dflet 0:1a07906111ec 86 #define RXFL_OK (0) /* O.K */
dflet 0:1a07906111ec 87 #define RXFL_OUTPUT_OR_INPUT_BUFFER_LENGTH_TOO_SMALL (76) /* ! The output buffer length is smaller than required for that operation */
dflet 0:1a07906111ec 88 #define RXFL_DEPENDENT_FILTER_SOFTWARE_FILTER_NOT_FIT (75) /* Node filter can't be child of software filter and vice_versa */
dflet 0:1a07906111ec 89 #define RXFL_DEPENDENCY_IS_NOT_PERSISTENT (74) /* Dependency filter is not persistent */
dflet 0:1a07906111ec 90 #define RXFL_SYSTEM_STATE_NOT_SUPPORTED_FOR_THIS_FILTER (72) /* System state is not supported */
dflet 0:1a07906111ec 91 #define RXFL_TRIGGER_USE_REG5_TO_REG8 (71) /* Only counters 5 - 8 are allowed, for Tigger */
dflet 0:1a07906111ec 92 #define RXFL_TRIGGER_USE_REG1_TO_REG4 (70) /* Only counters 1 - 4 are allowed, for trigger */
dflet 0:1a07906111ec 93 #define RXFL_ACTION_USE_REG5_TO_REG8 (69) /* Only counters 5 - 8 are allowed, for action */
dflet 0:1a07906111ec 94 #define RXFL_ACTION_USE_REG1_TO_REG4 (68) /* Only counters 1 - 4 are allowed, for action */
dflet 0:1a07906111ec 95 #define RXFL_FIELD_SUPPORT_ONLY_EQUAL_AND_NOTEQUAL (67) /* Rule compare function Id is out of range */
dflet 0:1a07906111ec 96 #define RXFL_WRONG_MULTICAST_BROADCAST_ADDRESS (66) /* The address should be of type mutlicast or broadcast */
dflet 0:1a07906111ec 97 #define RXFL_THE_FILTER_IS_NOT_OF_HEADER_TYPE (65) /* The filter should be of header type */
dflet 0:1a07906111ec 98 #define RXFL_WRONG_COMPARE_FUNC_FOR_BROADCAST_ADDRESS (64) /* The compare funcion is not suitable for broadcast address */
dflet 0:1a07906111ec 99 #define RXFL_WRONG_MULTICAST_ADDRESS (63) /* The address should be of muticast type */
dflet 0:1a07906111ec 100 #define RXFL_DEPENDENT_FILTER_IS_NOT_PERSISTENT (62) /* The dependency filter is not persistent */
dflet 0:1a07906111ec 101 #define RXFL_DEPENDENT_FILTER_IS_NOT_ENABLED (61) /* The dependency filter is not enabled */
dflet 0:1a07906111ec 102 #define RXFL_FILTER_HAS_CHILDS (60) /* The filter has childs and can't be removed */
dflet 0:1a07906111ec 103 #define RXFL_CHILD_IS_ENABLED (59) /* Can't disable filter while the child is enabled */
dflet 0:1a07906111ec 104 #define RXFL_DEPENDENCY_IS_DISABLED (58) /* Can't enable filetr in case its depndency filter is disabled */
dflet 0:1a07906111ec 105 #define RXFL_NUMBER_OF_CONNECTION_POINTS_EXCEEDED (52) /* Number of connection points exceeded */
dflet 0:1a07906111ec 106 #define RXFL_DEPENDENT_FILTER_DEPENDENCY_ACTION_IS_DROP (51) /* The dependent filter has Drop action, thus the filter can't be created */
dflet 0:1a07906111ec 107 #define RXFL_FILTER_DO_NOT_EXISTS (50) /* The filter doesn't exists */
dflet 0:1a07906111ec 108 #define RXFL_DEPEDENCY_NOT_ON_THE_SAME_LAYER (49) /* The filter and its dependency must be on the same layer */
dflet 0:1a07906111ec 109 #define RXFL_NUMBER_OF_ARGS_EXCEEDED (48) /* Number of arguments excceded */
dflet 0:1a07906111ec 110 #define RXFL_ACTION_NO_REG_NUMBER (47) /* Action require counter number */
dflet 0:1a07906111ec 111 #define RXFL_DEPENDENT_FILTER_LAYER_DO_NOT_FIT (46) /* the filter and its dependency should be from the same layer */
dflet 0:1a07906111ec 112 #define RXFL_DEPENDENT_FILTER_SYSTEM_STATE_DO_NOT_FIT (45) /* The filter and its dependency system state don't fit */
dflet 0:1a07906111ec 113 #define RXFL_DEPENDENT_FILTER_DO_NOT_EXIST_2 (44) /* The parent filter don't exist */
dflet 0:1a07906111ec 114 #define RXFL_DEPENDENT_FILTER_DO_NOT_EXIST_1 (43) /* The parent filter is null */
dflet 0:1a07906111ec 115 #define RXFL_RULE_HEADER_ACTION_TYPE_NOT_SUPPORTED (42) /* The action type is not supported */
dflet 0:1a07906111ec 116 #define RXFL_RULE_HEADER_TRIGGER_COMPARE_FUNC_OUT_OF_RANGE (41) /* The Trigger comparision function is out of range */
dflet 0:1a07906111ec 117 #define RXFL_RULE_HEADER_TRIGGER_OUT_OF_RANGE (40) /* The Trigger is out of range */
dflet 0:1a07906111ec 118 #define RXFL_RULE_HEADER_COMPARE_FUNC_OUT_OF_RANGE (39) /* The rule compare function is out of range */
dflet 0:1a07906111ec 119 #define RXFL_FRAME_TYPE_NOT_SUPPORTED (38) /* ASCII frame type string is illegal */
dflet 0:1a07906111ec 120 #define RXFL_RULE_FIELD_ID_NOT_SUPPORTED (37) /* Rule field ID is out of range */
dflet 0:1a07906111ec 121 #define RXFL_RULE_HEADER_FIELD_ID_ASCII_NOT_SUPPORTED (36) /* This ASCII field ID is not supported */
dflet 0:1a07906111ec 122 #define RXFL_RULE_HEADER_NOT_SUPPORTED (35) /* The header rule is not supported on current release */
dflet 0:1a07906111ec 123 #define RXFL_RULE_HEADER_OUT_OF_RANGE (34) /* The header rule is out of range */
dflet 0:1a07906111ec 124 #define RXFL_RULE_HEADER_COMBINATION_OPERATOR_OUT_OF_RANGE (33) /* Combination function Id is out of ramge */
dflet 0:1a07906111ec 125 #define RXFL_RULE_HEADER_FIELD_ID_OUT_OF_RANGE (32) /* rule field Id is out of range */
dflet 0:1a07906111ec 126 #define RXFL_UPDATE_NOT_SUPPORTED (31) /* Update not supported */
dflet 0:1a07906111ec 127 #define RXFL_NO_FILTERS_ARE_DEFINED (24) /* No filters are defined in the system */
dflet 0:1a07906111ec 128 #define RXFL_NUMBER_OF_FILTER_EXCEEDED (23) /* Number of max filters excceded */
dflet 0:1a07906111ec 129
dflet 0:1a07906111ec 130
dflet 0:1a07906111ec 131 /******************************************************************************/
dflet 0:1a07906111ec 132 /* Type declarations */
dflet 0:1a07906111ec 133 /******************************************************************************/
dflet 0:1a07906111ec 134
dflet 0:1a07906111ec 135 /*!
dflet 0:1a07906111ec 136
dflet 0:1a07906111ec 137
dflet 0:1a07906111ec 138 * \typedef SlrxFilterID_t
dflet 0:1a07906111ec 139 * Unique filter ID which is allocated by the system , negative number means error
dflet 0:1a07906111ec 140 */
dflet 0:1a07906111ec 141 typedef int8_t SlrxFilterID_t;
dflet 0:1a07906111ec 142
dflet 0:1a07906111ec 143
dflet 0:1a07906111ec 144 /*!
dflet 0:1a07906111ec 145 * \typedef SlrxFilterCompareMask_t
dflet 0:1a07906111ec 146 * The mask is used for the rule comparison function
dflet 0:1a07906111ec 147 */
dflet 0:1a07906111ec 148 typedef uint8_t SlrxFilterCompareMask_t;
dflet 0:1a07906111ec 149
dflet 0:1a07906111ec 150 /*!
dflet 0:1a07906111ec 151 * \typedef SlrxFilterIdMask_t
dflet 0:1a07906111ec 152 * Representation of filters Id as a bit field
dflet 0:1a07906111ec 153 * The bit field is used to declare which filters are involved
dflet 0:1a07906111ec 154 * in operation. Number of filter can be up to 128 filters. i.e. 128 bits are needed.
dflet 0:1a07906111ec 155 * On the current release, up to 64 filters can be defined.
dflet 0:1a07906111ec 156 */
dflet 0:1a07906111ec 157 typedef uint8_t SlrxFilterIdMask_t[128/8];
dflet 0:1a07906111ec 158
dflet 0:1a07906111ec 159 /*!
dflet 0:1a07906111ec 160 * \typedef SlrxFilterPrePreparedFilters_t
dflet 0:1a07906111ec 161 * Describes the supported software filter sets,
dflet 0:1a07906111ec 162 */
dflet 0:1a07906111ec 163 typedef uint8_t SlrxFilterPrePreparedFilters_t;
dflet 0:1a07906111ec 164 #define SL_ARP_AUTO_REPLY_PRE_PREPARED_FILTERS (0)
dflet 0:1a07906111ec 165 #define SL_MULTICASTSIPV4_DROP_PREPREPARED_FILTERS (1)
dflet 0:1a07906111ec 166 #define SL_MULTICASTSIPV6_DROP_PREPREPARED_FILTERS (2)
dflet 0:1a07906111ec 167 #define SL_MULTICASTSWIFI_DROP_PREPREPARED_FILTERS (3)
dflet 0:1a07906111ec 168
dflet 0:1a07906111ec 169
dflet 0:1a07906111ec 170
dflet 0:1a07906111ec 171 /*!
dflet 0:1a07906111ec 172 * \typedef SlrxFilterPrePreparedFiltersMask_t
dflet 0:1a07906111ec 173 * Describes the supported software filter sets,
dflet 0:1a07906111ec 174 * each bit represents different software filter set
dflet 0:1a07906111ec 175 * The filter sets are defined at SlrxFilterPrePreparedFilters_t
dflet 0:1a07906111ec 176 */
dflet 0:1a07906111ec 177 typedef uint8_t SlrxFilterPrePreparedFiltersMask_t[SL_RX_FILTER_MAX_PRE_PREPARED_FILTERS_SETS/8];
dflet 0:1a07906111ec 178
dflet 0:1a07906111ec 179
dflet 0:1a07906111ec 180 /*! \typedef SlrxFilterRegxPattern_t
dflet 0:1a07906111ec 181 * The struct contains the regular expression pattern which is used in case of payload rule.
dflet 0:1a07906111ec 182 * Not supported in the current release
dflet 0:1a07906111ec 183 */
dflet 0:1a07906111ec 184 typedef struct SlrxFilterRegxPattern_t {
dflet 0:1a07906111ec 185 uint8_t x[SL_RX_FILTER_LENGTH_OF_REGX_PATTERN_LENGTH];
dflet 0:1a07906111ec 186 } SlrxFilterRegxPattern_t;
dflet 0:1a07906111ec 187
dflet 0:1a07906111ec 188
dflet 0:1a07906111ec 189 /*! \typedef SlrxFilterAsciiArg_t
dflet 0:1a07906111ec 190 * The buffer is used to provide container for ASCII argument, which may be used in case of HEADER rule.
dflet 0:1a07906111ec 191 * example for ASCII argument can be : IP = 256.0.67.1
dflet 0:1a07906111ec 192 */
dflet 0:1a07906111ec 193 typedef uint8_t SlrxFilterAsciiArg_t;
dflet 0:1a07906111ec 194
dflet 0:1a07906111ec 195
dflet 0:1a07906111ec 196 /*! \typedef SlrxFilterBinaryArg_t
dflet 0:1a07906111ec 197 * The buffer provides container for binary argument, which may be used in case of HEADER rule
dflet 0:1a07906111ec 198 */
dflet 0:1a07906111ec 199 typedef uint8_t SlrxFilterBinaryArg_t ;
dflet 0:1a07906111ec 200
dflet 0:1a07906111ec 201
dflet 0:1a07906111ec 202 /*! \typedef SlrxFilterActionArg_t
dflet 0:1a07906111ec 203 * Provides container for the filter action argument.
dflet 0:1a07906111ec 204 * for example: in case action is to send automatic response , the argument is the template to be used for the automatic response.
dflet 0:1a07906111ec 205 *
dflet 0:1a07906111ec 206 *
dflet 0:1a07906111ec 207 */
dflet 0:1a07906111ec 208 typedef uint8_t SlrxFilterActionArg_t ;
dflet 0:1a07906111ec 209
dflet 0:1a07906111ec 210
dflet 0:1a07906111ec 211
dflet 0:1a07906111ec 212 /*! \typedef SlrxFilterOffset_t
dflet 0:1a07906111ec 213 * The offset relative to the packet payload start location.
dflet 0:1a07906111ec 214 * Not supported on current release
dflet 0:1a07906111ec 215 */
dflet 0:1a07906111ec 216 typedef uint32_t SlrxFilterOffset_t;
dflet 0:1a07906111ec 217
dflet 0:1a07906111ec 218
dflet 0:1a07906111ec 219
dflet 0:1a07906111ec 220 /*! \typedef SlrxFilterRuleType_t
dflet 0:1a07906111ec 221 * Enumerates the different filter types.
dflet 0:1a07906111ec 222 * On the current release only HEADER and COMBINATION are supported.
dflet 0:1a07906111ec 223 */
dflet 0:1a07906111ec 224 typedef uint8_t SlrxFilterRuleType_t;
dflet 0:1a07906111ec 225 /* possible values for SlrxFilterRuleType_t */
dflet 0:1a07906111ec 226 #define HEADER (0)
dflet 0:1a07906111ec 227 #define COMBINATION (1)
dflet 0:1a07906111ec 228 #define EXACT_PATTERN (2)
dflet 0:1a07906111ec 229 #define LIKELIHOOD_PATTERN (3)
dflet 0:1a07906111ec 230 #define ALWAYS_TRUE (4)
dflet 0:1a07906111ec 231 #define NUM_OF_FILTER_TYPES (5)
dflet 0:1a07906111ec 232
dflet 0:1a07906111ec 233
dflet 0:1a07906111ec 234 /*! \typedef SlrxFilterFlags_t
dflet 0:1a07906111ec 235 * Bit field which sets the behaviour of the RX filter
dflet 0:1a07906111ec 236 *
dflet 0:1a07906111ec 237 */
dflet 0:1a07906111ec 238
dflet 0:1a07906111ec 239 #define RX_FILTER_BINARY (0x1)
dflet 0:1a07906111ec 240 #define RX_FILTER_PERSISTENT (0x8)
dflet 0:1a07906111ec 241 #define RX_FILTER_ENABLE (0x10)
dflet 0:1a07906111ec 242
dflet 0:1a07906111ec 243 typedef union SlrxFilterFlags_t {
dflet 0:1a07906111ec 244
dflet 0:1a07906111ec 245 /* struct
dflet 0:1a07906111ec 246 { */
dflet 0:1a07906111ec 247 /*!
dflet 0:1a07906111ec 248 * The filter argument can be set as binary argument or ASCII arguments.
dflet 0:1a07906111ec 249 * When the bit is on the argument are binary.
dflet 0:1a07906111ec 250 */
dflet 0:1a07906111ec 251 /* uint8_t Binary: 1; */
dflet 0:1a07906111ec 252 /*!
dflet 0:1a07906111ec 253 *
dflet 0:1a07906111ec 254 */
dflet 0:1a07906111ec 255 /* uint8_t AutoSort : 1; */
dflet 0:1a07906111ec 256 /*!
dflet 0:1a07906111ec 257 *
dflet 0:1a07906111ec 258 */
dflet 0:1a07906111ec 259 /* uint8_t AutoFaultDetect : 1; */
dflet 0:1a07906111ec 260 /*!
dflet 0:1a07906111ec 261 * When the bit is on it means the the node is enabled .
dflet 0:1a07906111ec 262 */
dflet 0:1a07906111ec 263 /* uint8_t Enabled : 1; */
dflet 0:1a07906111ec 264 /* uint8_t padding : 3; */
dflet 0:1a07906111ec 265 /*
dflet 0:1a07906111ec 266 };*/
dflet 0:1a07906111ec 267
dflet 0:1a07906111ec 268 uint8_t IntRepresentation;
dflet 0:1a07906111ec 269
dflet 0:1a07906111ec 270 } SlrxFilterFlags_t;
dflet 0:1a07906111ec 271
dflet 0:1a07906111ec 272 /*! \typedef SlrxFilterCompareFunction_t
dflet 0:1a07906111ec 273 * Used as comparison function for the header type arguments
dflet 0:1a07906111ec 274 *
dflet 0:1a07906111ec 275 */
dflet 0:1a07906111ec 276 typedef uint8_t SlrxFilterCompareFunction_t;
dflet 0:1a07906111ec 277 /* Possible values for SlrxFilterCompareFunction_t */
dflet 0:1a07906111ec 278 #define COMPARE_FUNC_IN_BETWEEN (0)
dflet 0:1a07906111ec 279 #define COMPARE_FUNC_EQUAL (1)
dflet 0:1a07906111ec 280 #define COMPARE_FUNC_NOT_EQUAL_TO (2)
dflet 0:1a07906111ec 281 #define COMPARE_FUNC_NOT_IN_BETWEEN (3)
dflet 0:1a07906111ec 282 #define COMPARE_FUNC_NUM_OF_FILTER_COMPARE_FUNC (4)
dflet 0:1a07906111ec 283
dflet 0:1a07906111ec 284 /*! \typedef SlrxFilterCompareFunction_t
dflet 0:1a07906111ec 285 * Used as comparison function for the header type arguments
dflet 0:1a07906111ec 286 *
dflet 0:1a07906111ec 287 */
dflet 0:1a07906111ec 288 typedef uint8_t SlrxTriggerCompareFunction_t;
dflet 0:1a07906111ec 289 /* Possible values for SlrxTriggerCompareFunction_t */
dflet 0:1a07906111ec 290 #define TRIGGER_COMPARE_FUNC_EQUAL (0)
dflet 0:1a07906111ec 291 /* arg1 == protocolVal ,not supported in current release */
dflet 0:1a07906111ec 292 #define TRIGGER_COMPARE_FUNC_NOT_EQUAL_TO (1)
dflet 0:1a07906111ec 293 /* arg1 == protocolVal */
dflet 0:1a07906111ec 294 #define TRIGGER_COMPARE_FUNC_SMALLER_THAN (2)
dflet 0:1a07906111ec 295 /* arg1 == protocolVal */
dflet 0:1a07906111ec 296 #define TRIGGER_COMPARE_FUNC_BIGGER_THAN (3)
dflet 0:1a07906111ec 297 /* definition */
dflet 0:1a07906111ec 298 #define TRIGGER_COMPARE_FUNC_NUM_OF_FILTER_COMPARE_FUNC (4)
dflet 0:1a07906111ec 299
dflet 0:1a07906111ec 300
dflet 0:1a07906111ec 301 /*! \typedef SlrxFilterHdrField_t
dflet 0:1a07906111ec 302 * Provides list of possible header types which may be defined as part of the rule
dflet 0:1a07906111ec 303 *
dflet 0:1a07906111ec 304 */
dflet 0:1a07906111ec 305 typedef uint8_t SlrxFilterHdrField_t;
dflet 0:1a07906111ec 306 /* Possible values for SlrxFilterHdrField_t */
dflet 0:1a07906111ec 307 #define NULL_FIELD_ID_TYPE (0)
dflet 0:1a07906111ec 308 /* 802.11 control\data\management */
dflet 0:1a07906111ec 309 #define FRAME_TYPE_FIELD (1)
dflet 0:1a07906111ec 310 /* 802.11 beacon\probe\.. */
dflet 0:1a07906111ec 311 #define FRAME_SUBTYPE_FIELD (2)
dflet 0:1a07906111ec 312 /* 802.11 bssid type */
dflet 0:1a07906111ec 313 #define BSSID_FIELD (3)
dflet 0:1a07906111ec 314 /* */
dflet 0:1a07906111ec 315 #define MAC_SRC_ADDRESS_FIELD (4)
dflet 0:1a07906111ec 316 /* */
dflet 0:1a07906111ec 317 #define MAC_DST_ADDRESS_FIELD (5)
dflet 0:1a07906111ec 318 /* */
dflet 0:1a07906111ec 319 #define FRAME_LENGTH_FIELD (6)
dflet 0:1a07906111ec 320 /* */
dflet 0:1a07906111ec 321 #define PROTOCOL_TYPE_FIELD (7)
dflet 0:1a07906111ec 322 /* */
dflet 0:1a07906111ec 323 #define IP_VERSION_FIELD (8)
dflet 0:1a07906111ec 324 /* TCP / UDP */
dflet 0:1a07906111ec 325 #define IP_PROTOCOL_FIELD (9)
dflet 0:1a07906111ec 326 /* */
dflet 0:1a07906111ec 327 #define IPV4_SRC_ADRRESS_FIELD (10)
dflet 0:1a07906111ec 328 /* */
dflet 0:1a07906111ec 329 #define IPV4_DST_ADDRESS_FIELD (11)
dflet 0:1a07906111ec 330 /* */
dflet 0:1a07906111ec 331 #define IPV6_SRC_ADRRESS_FIELD (12)
dflet 0:1a07906111ec 332 /* */
dflet 0:1a07906111ec 333 #define IPV6_DST_ADDRESS_FIELD (13)
dflet 0:1a07906111ec 334 /* */
dflet 0:1a07906111ec 335 #define SRC_PORT_FIELD (14)
dflet 0:1a07906111ec 336 /* */
dflet 0:1a07906111ec 337 #define DST_PORT_FIELD (15)
dflet 0:1a07906111ec 338 /* Definition */
dflet 0:1a07906111ec 339 #define NUM_OF_FIELD_NAME_FIELD (16)
dflet 0:1a07906111ec 340
dflet 0:1a07906111ec 341 /*! \union SlrxFilterHeaderArg_t
dflet 0:1a07906111ec 342 * The structure holds the header ARGS which are used in case of HDR rule.
dflet 0:1a07906111ec 343 */
dflet 0:1a07906111ec 344 /* -- 36 bytes */
dflet 0:1a07906111ec 345 typedef union SlrxFilterHeaderArg_t {
dflet 0:1a07906111ec 346 /*----------------------------- Large size ---------------------------------*/
dflet 0:1a07906111ec 347 /*! buffer for binary arguments, number of argument may be up to SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS
dflet 0:1a07906111ec 348 * example : IPV6 16 bytes, 39 characters
dflet 0:1a07906111ec 349 * ipv6 Ascii address: 2001:0db8:3c4d:0015:0000:0000:abcd:ef12
dflet 0:1a07906111ec 350 */
dflet 0:1a07906111ec 351
dflet 0:1a07906111ec 352 SlrxFilterBinaryArg_t RxFilterDB16BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][16 ]; /* Binary Values for comparition */
dflet 0:1a07906111ec 353 /*! buffer for ASCII arguments, number of argument may be up to SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS
dflet 0:1a07906111ec 354 * example : IPV6 16 bytes, 39 characters
dflet 0:1a07906111ec 355 * ipv6 Ascii address: 2001:0db8:3c4d:0015:0000:0000:abcd:ef12
dflet 0:1a07906111ec 356 * Ascii format for ipV6 is not supported
dflet 0:1a07906111ec 357 */
dflet 0:1a07906111ec 358 /*----------------------------- Medium size ---------------------------------*/
dflet 0:1a07906111ec 359 /*! buffer for binary arguments, number of argument may be up to SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS
dflet 0:1a07906111ec 360 * MAC address: 6 bytes, 17 chars
dflet 0:1a07906111ec 361 */
dflet 0:1a07906111ec 362 SlrxFilterBinaryArg_t RxFilterDB6BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][6]; /* Binary Values for comparition */
dflet 0:1a07906111ec 363 /*!
dflet 0:1a07906111ec 364 * ! buffer for ASCII arguments, number of argument may be up to SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS
dflet 0:1a07906111ec 365 * IP address: 4 bytes, 15 chars
dflet 0:1a07906111ec 366 * 2 bytes are added for padding
dflet 0:1a07906111ec 367 */
dflet 0:1a07906111ec 368 SlrxFilterAsciiArg_t RxFilterDB18BytesAsciiRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][18]; /* Ascii Values for comparison */
dflet 0:1a07906111ec 369 /*----------------------------- Small size ---------------------------------*/
dflet 0:1a07906111ec 370 /*! buffer for binary arguments, number of argument may be up to SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS
dflet 0:1a07906111ec 371 * IP address: 4 bytes, 15 chars
dflet 0:1a07906111ec 372 * Port: 2 bytes, chars: 5 chars
dflet 0:1a07906111ec 373 */
dflet 0:1a07906111ec 374 SlrxFilterBinaryArg_t RxFilterDB4BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][4]; /* Binary Values for comparison */
dflet 0:1a07906111ec 375 /*! buffer for ASCII arguments, number of argument may be up to SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS
dflet 0:1a07906111ec 376 * Port: 2 bytes, chars: 5 chars
dflet 0:1a07906111ec 377 */
dflet 0:1a07906111ec 378 SlrxFilterAsciiArg_t RxFilterDB5BytesRuleAsciiArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][5]; /* Ascii Values for comparison */
dflet 0:1a07906111ec 379 /*----------------------------- 1 byte size ---------------------------------*/
dflet 0:1a07906111ec 380 /*! buffer for binary arguments, number of argument may be up to SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS
dflet 0:1a07906111ec 381 */
dflet 0:1a07906111ec 382 SlrxFilterBinaryArg_t RxFilterDB1BytesRuleArgs[SL_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][1]; /* Binary Values for comparison */
dflet 0:1a07906111ec 383 } SlrxFilterHeaderArg_t;
dflet 0:1a07906111ec 384
dflet 0:1a07906111ec 385
dflet 0:1a07906111ec 386
dflet 0:1a07906111ec 387 /*! \typedef SlrxFilterRuleHeaderArgsAndMask_t
dflet 0:1a07906111ec 388 * Structure which defines the Header Args and mask
dflet 0:1a07906111ec 389 */
dflet 0:1a07906111ec 390 /* -- 52 bytes */
dflet 0:1a07906111ec 391 typedef struct SlrxFilterRuleHeaderArgsAndMask_t {
dflet 0:1a07906111ec 392 /*! Argument for the comparison function */
dflet 0:1a07906111ec 393 /* -- 36 byte */
dflet 0:1a07906111ec 394 SlrxFilterHeaderArg_t RuleHeaderArgs;
dflet 0:1a07906111ec 395
dflet 0:1a07906111ec 396 /*! the mask is used in order to enable partial comparison,
dflet 0:1a07906111ec 397 * Use the 0xFFFFFFFF in case you don't want to use mask
dflet 0:1a07906111ec 398 */
dflet 0:1a07906111ec 399 /* -- 16 bytes */
dflet 0:1a07906111ec 400 SlrxFilterCompareMask_t RuleHeaderArgsMask[16];
dflet 0:1a07906111ec 401
dflet 0:1a07906111ec 402 } SlrxFilterRuleHeaderArgsAndMask_t;
dflet 0:1a07906111ec 403
dflet 0:1a07906111ec 404 /*! \typedef SlrxFilterHeaderType_t
dflet 0:1a07906111ec 405 * Structure which defines the Header rule
dflet 0:1a07906111ec 406 * The header rule defines compare function on the protocol header
dflet 0:1a07906111ec 407 * For example destMacAddre is between ( 12:6::78:77, 12:6::78:90 )
dflet 0:1a07906111ec 408 *
dflet 0:1a07906111ec 409 */
dflet 0:1a07906111ec 410 /* -- 56 byte */
dflet 0:1a07906111ec 411 typedef struct SlrxFilterHeaderType_t {
dflet 0:1a07906111ec 412 /*! see :: SlrxFilterRuleHeaderArgsAndMask_t */
dflet 0:1a07906111ec 413 /* -- 52 bytes */
dflet 0:1a07906111ec 414 SlrxFilterRuleHeaderArgsAndMask_t RuleHeaderArgsAndMask;
dflet 0:1a07906111ec 415
dflet 0:1a07906111ec 416 /*! Packet HDR field which will be compared to the argument */
dflet 0:1a07906111ec 417 /* -- 1 byte */
dflet 0:1a07906111ec 418 SlrxFilterHdrField_t RuleHeaderfield;
dflet 0:1a07906111ec 419
dflet 0:1a07906111ec 420 /* -- 1 byte */
dflet 0:1a07906111ec 421 /*! type of the comparison function
dflet 0:1a07906111ec 422 * see :: SlrxFilterCompareFunction_t
dflet 0:1a07906111ec 423 */
dflet 0:1a07906111ec 424 SlrxFilterCompareFunction_t RuleCompareFunc;
dflet 0:1a07906111ec 425
dflet 0:1a07906111ec 426 /*! padding */
dflet 0:1a07906111ec 427 /* -- 2 bytes */
dflet 0:1a07906111ec 428 uint8_t RulePadding[2];
dflet 0:1a07906111ec 429
dflet 0:1a07906111ec 430 } SlrxFilterHeaderType_t;
dflet 0:1a07906111ec 431
dflet 0:1a07906111ec 432 /*! \typedef SlrxFilterPayloadType_t
dflet 0:1a07906111ec 433 * Structure which defines payload rule.
dflet 0:1a07906111ec 434 * Not supported on current release.
dflet 0:1a07906111ec 435 */
dflet 0:1a07906111ec 436 /* -- 40 byte */
dflet 0:1a07906111ec 437 typedef struct SlrxFilterPayloadType_t {
dflet 0:1a07906111ec 438 /*! Not supported on current release */
dflet 0:1a07906111ec 439 /* -- 32 byte */
dflet 0:1a07906111ec 440 SlrxFilterRegxPattern_t RegxPattern;
dflet 0:1a07906111ec 441 /*! Not supported on current release */
dflet 0:1a07906111ec 442 /* -- 4 byte */
dflet 0:1a07906111ec 443 SlrxFilterOffset_t LowerOffset;
dflet 0:1a07906111ec 444 /*! Not supported on current release */
dflet 0:1a07906111ec 445 /* -- 4 byte */
dflet 0:1a07906111ec 446 SlrxFilterOffset_t UpperOffset;
dflet 0:1a07906111ec 447 } SlrxFilterPayloadType_t;
dflet 0:1a07906111ec 448
dflet 0:1a07906111ec 449 /*! \typedef SlrxFilterCombinationTypeOperator_t
dflet 0:1a07906111ec 450 * Enumerate the optional operators for the combination type
dflet 0:1a07906111ec 451 * filterID1 is located in the first arg , filterId2 is the second arg,see ::SlrxFilterCombinationType_t.CombinationFilterId
dflet 0:1a07906111ec 452 */
dflet 0:1a07906111ec 453 typedef uint8_t SlrxFilterCombinationTypeOperator_t;
dflet 0:1a07906111ec 454 /* Possible values for SlrxFilterCombinationTypeOperator_t */
dflet 0:1a07906111ec 455 /*! !filterID1 */
dflet 0:1a07906111ec 456 #define COMBINED_FUNC_NOT (0)
dflet 0:1a07906111ec 457 /*! filterID1 && filterID2 */
dflet 0:1a07906111ec 458 #define COMBINED_FUNC_AND (1)
dflet 0:1a07906111ec 459 /*! filterID1 && filterID2 */
dflet 0:1a07906111ec 460 #define COMBINED_FUNC_OR (2)
dflet 0:1a07906111ec 461
dflet 0:1a07906111ec 462 /*! \typedef SlrxFilterCombinationType_t
dflet 0:1a07906111ec 463 * Defines the structure which define the combination type filter
dflet 0:1a07906111ec 464 * The combined filter enable to make operation on one or two filter,
dflet 0:1a07906111ec 465 * for example !filterId1 or and(filterId2,filterId3).
dflet 0:1a07906111ec 466 *
dflet 0:1a07906111ec 467 */
dflet 0:1a07906111ec 468 /* -- 4 byte */
dflet 0:1a07906111ec 469 typedef struct SlrxFilterCombinationType_t {
dflet 0:1a07906111ec 470 /* ! combination operator */
dflet 0:1a07906111ec 471 /* -- 1 byte */
dflet 0:1a07906111ec 472 SlrxFilterCombinationTypeOperator_t CombinationTypeOperator;
dflet 0:1a07906111ec 473 /* ! filterID, may be one or two depends on the combination operator type */
dflet 0:1a07906111ec 474 /* -- 2 byte */
dflet 0:1a07906111ec 475 SlrxFilterID_t CombinationFilterId[SL_RX_FILTER_NUM_OF_COMBINATION_TYPE_ARGS];
dflet 0:1a07906111ec 476 /* ! Padding */
dflet 0:1a07906111ec 477 /* -- 1 byte */
dflet 0:1a07906111ec 478 uint8_t Padding;
dflet 0:1a07906111ec 479 } SlrxFilterCombinationType_t;
dflet 0:1a07906111ec 480
dflet 0:1a07906111ec 481
dflet 0:1a07906111ec 482 /*! \typedef SlrxFilterRule_t
dflet 0:1a07906111ec 483 * Rule structure composed of behavioral flags and the filter rule definitions
dflet 0:1a07906111ec 484 *
dflet 0:1a07906111ec 485 */
dflet 0:1a07906111ec 486 /* -- 56 byte */
dflet 0:1a07906111ec 487 typedef union SlrxFilterRule_t {
dflet 0:1a07906111ec 488 /* ! Header type rule , see explanation on the ::SlrxFilterHeaderType_t structure */
dflet 0:1a07906111ec 489 /* -- 56 byte */
dflet 0:1a07906111ec 490 SlrxFilterHeaderType_t HeaderType;
dflet 0:1a07906111ec 491 /* ! Payload rule, not supported in current release */
dflet 0:1a07906111ec 492 /* -- 40 byte */
dflet 0:1a07906111ec 493 SlrxFilterPayloadType_t PayLoadHeaderType; /* future for exact pattern or like hood pattern */
dflet 0:1a07906111ec 494 /* ! Combined type rule , see explanation in ::SlrxFilterCombinationType_t structure */
dflet 0:1a07906111ec 495 /* -- 4 byte */
dflet 0:1a07906111ec 496 SlrxFilterCombinationType_t CombinationType;
dflet 0:1a07906111ec 497 } SlrxFilterRule_t;
dflet 0:1a07906111ec 498
dflet 0:1a07906111ec 499 /*! \typedef SlrxFilterTriggerRoles_t
dflet 0:1a07906111ec 500 * Bit field which represents the roleId possible values
dflet 0:1a07906111ec 501 * In the current release only Station/AP roles are supported.
dflet 0:1a07906111ec 502 */
dflet 0:1a07906111ec 503 #define RX_FILTER_ROLE_AP (1)
dflet 0:1a07906111ec 504 #define RX_FILTER_ROLE_STA (2)
dflet 0:1a07906111ec 505 #define RX_FILTER_ROLE_PROMISCUOUS (4)
dflet 0:1a07906111ec 506 #define RX_FILTER_ROLE_NULL (0)
dflet 0:1a07906111ec 507
dflet 0:1a07906111ec 508 typedef union SlrxFilterTriggerRoles_t {
dflet 0:1a07906111ec 509 /* struct */
dflet 0:1a07906111ec 510 /* { */
dflet 0:1a07906111ec 511 /* uint8_t RoleAP :1; */
dflet 0:1a07906111ec 512 /* uint8_t RoleStation :1; */
dflet 0:1a07906111ec 513 /* The filter is activated only in Promiscuous mode */
dflet 0:1a07906111ec 514 /* uint8_t PromiscuousMode :1; */
dflet 0:1a07906111ec 515 /* uint8_t RoleReserved :5; */
dflet 0:1a07906111ec 516 /* }; */
dflet 0:1a07906111ec 517 /* ! Bit fiels of the Filter role */
dflet 0:1a07906111ec 518 uint8_t IntRepresentation;
dflet 0:1a07906111ec 519
dflet 0:1a07906111ec 520 } SlrxFilterTriggerRoles_t;
dflet 0:1a07906111ec 521
dflet 0:1a07906111ec 522 /*! \typedef SlrxFilterTriggerConnectionStates_t
dflet 0:1a07906111ec 523 * Bit field representing the possible values of the When section of the rule
dflet 0:1a07906111ec 524 *
dflet 0:1a07906111ec 525 */
dflet 0:1a07906111ec 526 #define RX_FILTER_CONNECTION_STATE_STA_CONNECTED (1)
dflet 0:1a07906111ec 527 #define RX_FILTER_CONNECTION_STATE_STA_NOT_CONNECTED (2)
dflet 0:1a07906111ec 528 #define RX_FILTER_CONNECTION_STATE_STA_HAS_IP (4)
dflet 0:1a07906111ec 529 #define RX_FILTER_CONNECTION_STATE_STA_HAS_NO_IP (8)
dflet 0:1a07906111ec 530
dflet 0:1a07906111ec 531 typedef union SlrxFilterTriggerConnectionStates_t {
dflet 0:1a07906111ec 532 /* struct */
dflet 0:1a07906111ec 533 /* { */
dflet 0:1a07906111ec 534 /* uint8_t RoleStationWiFiConnected :1; */
dflet 0:1a07906111ec 535 /* uint8_t RoleStationWiFiDisconneted:1; */
dflet 0:1a07906111ec 536 /* uint8_t RoleStationWiFiHasIp:1; */
dflet 0:1a07906111ec 537 /* uint8_t RoleStationWiFiHasNoIp:1; */
dflet 0:1a07906111ec 538 /* uint8_t RoleStationWiFiSocketOpened:1; */
dflet 0:1a07906111ec 539 /* uint8_t RoleStationWiFiSocketclosed:1; */
dflet 0:1a07906111ec 540 /* }; */
dflet 0:1a07906111ec 541 /* */
dflet 0:1a07906111ec 542 /* ! */
dflet 0:1a07906111ec 543 uint8_t IntRepresentation;
dflet 0:1a07906111ec 544
dflet 0:1a07906111ec 545 } SlrxFilterTriggerConnectionStates_t;
dflet 0:1a07906111ec 546
dflet 0:1a07906111ec 547 /*! \typedef SlrxFilterDBTriggerArg_t
dflet 0:1a07906111ec 548 * Provides container for entering the filter 'when' argument.
dflet 0:1a07906111ec 549 * The current release support 'When rules' which has no arguments.
dflet 0:1a07906111ec 550 * For example :
dflet 0:1a07906111ec 551 * When connect to specific AP -- the AP bssid is the argument.
dflet 0:1a07906111ec 552 *
dflet 0:1a07906111ec 553 */
dflet 0:1a07906111ec 554 typedef uint32_t SlrxFilterDBTriggerArg_t;
dflet 0:1a07906111ec 555
dflet 0:1a07906111ec 556
dflet 0:1a07906111ec 557
dflet 0:1a07906111ec 558 /*! \typedef SlrxFilterCounterId_t
dflet 0:1a07906111ec 559 * the counter ID we have 4 counters
dflet 0:1a07906111ec 560 */
dflet 0:1a07906111ec 561 typedef uint8_t SlrxFilterCounterId_t;
dflet 0:1a07906111ec 562 /* Possible values for SlrxFilterCounterId_t */
dflet 0:1a07906111ec 563 #define NO_TRIGGER (0)
dflet 0:1a07906111ec 564 #define RX_FILTER_COUNTER1 (1)
dflet 0:1a07906111ec 565 #define RX_FILTER_COUNTER2 (2)
dflet 0:1a07906111ec 566 #define RX_FILTER_COUNTER3 (3)
dflet 0:1a07906111ec 567 #define RX_FILTER_COUNTER4 (4)
dflet 0:1a07906111ec 568 #define RX_FILTER_COUNTER5 (5)
dflet 0:1a07906111ec 569 #define RX_FILTER_COUNTER6 (6)
dflet 0:1a07906111ec 570 #define RX_FILTER_COUNTER7 (7)
dflet 0:1a07906111ec 571 #define RX_FILTER_COUNTER8 (8)
dflet 0:1a07906111ec 572 #define MAX_RX_FILTER_COUNTER (9)
dflet 0:1a07906111ec 573
dflet 0:1a07906111ec 574
dflet 0:1a07906111ec 575
dflet 0:1a07906111ec 576 /*! \typedef SlrxFilterActionArgs_t
dflet 0:1a07906111ec 577 * Possible value for filter action args
dflet 0:1a07906111ec 578 *
dflet 0:1a07906111ec 579 */
dflet 0:1a07906111ec 580
dflet 0:1a07906111ec 581 typedef uint8_t SlrxFilterActionArgs_t;
dflet 0:1a07906111ec 582 /* Possible values for SlrxFilterActionArgs_t */
dflet 0:1a07906111ec 583 #define ACTION_ARG_REG_1_4 (0)
dflet 0:1a07906111ec 584 /* ! Can be use as counter */
dflet 0:1a07906111ec 585 #define ACTION_ARG_TEMPLATE (1)
dflet 0:1a07906111ec 586 /* ! Can be use as counter */
dflet 0:1a07906111ec 587 #define ACTION_ARG_EVENT (2)
dflet 0:1a07906111ec 588
dflet 0:1a07906111ec 589 /* ! GPIO number */
dflet 0:1a07906111ec 590 #define ACTION_ARG_GPIO (4)
dflet 0:1a07906111ec 591 /*!
dflet 0:1a07906111ec 592 * \def SL_RX_FILTER_NUM_OF_BYTES_FOR_ACTIONS_ARGS
dflet 0:1a07906111ec 593 *
dflet 0:1a07906111ec 594 */
dflet 0:1a07906111ec 595 #define SL_RX_FILTER_NUM_OF_BYTES_FOR_ACTIONS_ARGS (5)
dflet 0:1a07906111ec 596
dflet 0:1a07906111ec 597
dflet 0:1a07906111ec 598
dflet 0:1a07906111ec 599
dflet 0:1a07906111ec 600 /*! \typedef SlrxFilterTrigger_t
dflet 0:1a07906111ec 601 * The filter trigger, determine when the filter is triggered,
dflet 0:1a07906111ec 602 * The filter is triggered in the following condition :\n
dflet 0:1a07906111ec 603 * 1. The filter parent is triggered\n
dflet 0:1a07906111ec 604 * 2. The requested connection type exists, i.e. wlan_connect\n
dflet 0:1a07906111ec 605 * 3. The filter role is the same as the system role\n
dflet 0:1a07906111ec 606 *
dflet 0:1a07906111ec 607 */
dflet 0:1a07906111ec 608 /* -- 12 byte */
dflet 0:1a07906111ec 609 typedef struct SlrxFilterTrigger_t {
dflet 0:1a07906111ec 610 /*! The parent filter ID, this is the way to build filter tree. */
dflet 0:1a07906111ec 611 /* NULL value means tree root.
dflet 0:1a07906111ec 612 */
dflet 0:1a07906111ec 613 /* -- 1 byte */
dflet 0:1a07906111ec 614 SlrxFilterID_t ParentFilterID;
dflet 0:1a07906111ec 615 /* ! See ::SlrxFilterCounterId_t explanation */
dflet 0:1a07906111ec 616 /* -- 1 byte */
dflet 0:1a07906111ec 617 SlrxFilterCounterId_t Trigger;
dflet 0:1a07906111ec 618 /* ! See :: SlrxFilterTriggerConnectionStates_t */
dflet 0:1a07906111ec 619 /* -- 1 byte */
dflet 0:1a07906111ec 620 SlrxFilterTriggerConnectionStates_t TriggerArgConnectionState;
dflet 0:1a07906111ec 621 /* ! See ::SlrxFilterTriggerRoles_t */
dflet 0:1a07906111ec 622 /* -- 1 byte */
dflet 0:1a07906111ec 623 SlrxFilterTriggerRoles_t TriggerArgRoleStatus;
dflet 0:1a07906111ec 624 /* ! The Trigger arguments are in the same order as the Trigger bit field order. */
dflet 0:1a07906111ec 625 /* -- 4 byte */
dflet 0:1a07906111ec 626 SlrxFilterDBTriggerArg_t TriggerArg;
dflet 0:1a07906111ec 627 /** The compare function which will be operate for each bit that is turned on in the ::SlrxFilterTrigger_t.Trigger field,
dflet 0:1a07906111ec 628 * for example , in case the second bit in the Trigger function is on the second function in the list will be executed.
dflet 0:1a07906111ec 629 *
dflet 0:1a07906111ec 630 */
dflet 0:1a07906111ec 631 /* -- 1 byte */
dflet 0:1a07906111ec 632 SlrxTriggerCompareFunction_t TriggerCompareFunction;
dflet 0:1a07906111ec 633
dflet 0:1a07906111ec 634 /* ! padding */
dflet 0:1a07906111ec 635 /* -- 3 byte */
dflet 0:1a07906111ec 636 uint8_t Padding[3];
dflet 0:1a07906111ec 637 } SlrxFilterTrigger_t;
dflet 0:1a07906111ec 638
dflet 0:1a07906111ec 639 /*! \typedef SlrxFilterActionType_t
dflet 0:1a07906111ec 640 * The actions are executed only if the filter is matched,\n
dflet 0:1a07906111ec 641 * In case of false match the packet is transfered to the HOST. \n
dflet 0:1a07906111ec 642 * The action is composed of bit field structure,
dflet 0:1a07906111ec 643 * up to 2 actions can be defined per filter.
dflet 0:1a07906111ec 644 *
dflet 0:1a07906111ec 645 */
dflet 0:1a07906111ec 646 #define RX_FILTER_ACTION_NULL (0x0)
dflet 0:1a07906111ec 647 #define RX_FILTER_ACTION_DROP (0x1)
dflet 0:1a07906111ec 648 #define RX_FILTER_ACTION_GPIO (0x2)
dflet 0:1a07906111ec 649 #define RX_FILTER_ACTION_ON_REG_INCREASE (0x4)
dflet 0:1a07906111ec 650 #define RX_FILTER_ACTION_ON_REG_DECREASE (0x8)
dflet 0:1a07906111ec 651 #define RX_FILTER_ACTION_ON_REG_RESET (0x10)
dflet 0:1a07906111ec 652 #define RX_FILTER_ACTION_SEND_TEMPLATE (0x20) /* unsupported */
dflet 0:1a07906111ec 653 #define RX_FILTER_ACTION_EVENT_TO_HOST (0x40) /* unsupported */
dflet 0:1a07906111ec 654
dflet 0:1a07906111ec 655 typedef union SlrxFilterActionType_t {
dflet 0:1a07906111ec 656 /* struct */
dflet 0:1a07906111ec 657 /* { */
dflet 0:1a07906111ec 658 /* ! No action to execute the packet is dropped,drop is always on leaf. */
dflet 0:1a07906111ec 659 /* ! If not dropped ,The packet is passed to the next filter or in case it is the last filter to the host */
dflet 0:1a07906111ec 660 /* uint8_t ActionDrop : 1; */
dflet 0:1a07906111ec 661 /* ! Not Supported in the current release */
dflet 0:1a07906111ec 662 /* uint8_t ActionGpio : 1; */
dflet 0:1a07906111ec 663 /*! action can increase counter registers.
dflet 0:1a07906111ec 664 * 1 = Increase
dflet 0:1a07906111ec 665 * 2 = decrease
dflet 0:1a07906111ec 666 * 3 = reset
dflet 0:1a07906111ec 667 */
dflet 0:1a07906111ec 668 /* uint8_t ActionOnREGIncrease : 1; */
dflet 0:1a07906111ec 669 /* uint8_t ActionOnREGDecrease : 1; */
dflet 0:1a07906111ec 670 /* uint8_t ActionOnREGReset : 1; */
dflet 0:1a07906111ec 671
dflet 0:1a07906111ec 672 /* ! Not Supported in the current release */
dflet 0:1a07906111ec 673 /* uint8_t ActionSendTemplate : 1; */
dflet 0:1a07906111ec 674 /* ! Not Supported in the current release */
dflet 0:1a07906111ec 675 /* uint8_t ActionEventToHost: 1; */
dflet 0:1a07906111ec 676 /* uint8_t padding: 1; */
dflet 0:1a07906111ec 677 /* }; */
dflet 0:1a07906111ec 678
dflet 0:1a07906111ec 679 uint8_t IntRepresentation;
dflet 0:1a07906111ec 680
dflet 0:1a07906111ec 681 } SlrxFilterActionType_t;
dflet 0:1a07906111ec 682
dflet 0:1a07906111ec 683 /*! \typedef SlrxFilterAction_t
dflet 0:1a07906111ec 684 * Several actions can be defined,\n
dflet 0:1a07906111ec 685 * The action is executed in case the filter rule is matched.
dflet 0:1a07906111ec 686 */
dflet 0:1a07906111ec 687 /* -- 8 byte */
dflet 0:1a07906111ec 688 typedef struct SlrxFilterAction_t {
dflet 0:1a07906111ec 689 /* -- 1 byte */
dflet 0:1a07906111ec 690 /* ! Determine which actions are supported */
dflet 0:1a07906111ec 691 SlrxFilterActionType_t ActionType;
dflet 0:1a07906111ec 692 /* ! Buffer for the action arguments */
dflet 0:1a07906111ec 693 /**
dflet 0:1a07906111ec 694 * <b>location 0</b> - The counter to increase
dflet 0:1a07906111ec 695 * In case the action is of type "increase" the arg will contain the counter number,
dflet 0:1a07906111ec 696 * The counter number values are as in ::SlrxFilterCounterId_t.\n
dflet 0:1a07906111ec 697 * <b>location 1</b> - The template arg.\n
dflet 0:1a07906111ec 698 * <b>location 2</b> - The event arg.\n
dflet 0:1a07906111ec 699 *
dflet 0:1a07906111ec 700 */
dflet 0:1a07906111ec 701 /* -- 5 byte */
dflet 0:1a07906111ec 702 SlrxFilterActionArg_t ActionArg[SL_RX_FILTER_NUM_OF_BYTES_FOR_ACTIONS_ARGS];
dflet 0:1a07906111ec 703
dflet 0:1a07906111ec 704 /* ! Padding */
dflet 0:1a07906111ec 705 /* - 2 Bytes */
dflet 0:1a07906111ec 706 uint8_t Padding[2];
dflet 0:1a07906111ec 707
dflet 0:1a07906111ec 708 } SlrxFilterAction_t;
dflet 0:1a07906111ec 709
dflet 0:1a07906111ec 710
dflet 0:1a07906111ec 711 /*! \struct _WlanRxFilterOperationCommandBuff_t
dflet 0:1a07906111ec 712 * The structure is used for the interface HOST NWP.\n
dflet 0:1a07906111ec 713 * The supported operation : \n
dflet 0:1a07906111ec 714 * ::ENABLE_DISABLE_RX_FILTER,\n
dflet 0:1a07906111ec 715 * ::REMOVE_RX_FILTER,\n
dflet 0:1a07906111ec 716 *
dflet 0:1a07906111ec 717 */
dflet 0:1a07906111ec 718 /* 20 bytes */
dflet 0:1a07906111ec 719 typedef struct _WlanRxFilterOperationCommandBuff_t {
dflet 0:1a07906111ec 720 /* -- 16 bytes */
dflet 0:1a07906111ec 721 SlrxFilterIdMask_t FilterIdMask;
dflet 0:1a07906111ec 722 /* 4 bytes */
dflet 0:1a07906111ec 723 uint8_t Padding[4];
dflet 0:1a07906111ec 724 } _WlanRxFilterOperationCommandBuff_t;
dflet 0:1a07906111ec 725
dflet 0:1a07906111ec 726
dflet 0:1a07906111ec 727
dflet 0:1a07906111ec 728 /* -- 56 bytes */
dflet 0:1a07906111ec 729 typedef struct _WlanRxFilterUpdateArgsCommandBuff_t {
dflet 0:1a07906111ec 730 /* -- 1 bytes */
dflet 0:1a07906111ec 731 uint8_t FilterId;
dflet 0:1a07906111ec 732
dflet 0:1a07906111ec 733 /* -- 1 bytes */
dflet 0:1a07906111ec 734 /* ! the args representation */
dflet 0:1a07906111ec 735 uint8_t BinaryRepresentation;
dflet 0:1a07906111ec 736
dflet 0:1a07906111ec 737 /* -- 52 byte */
dflet 0:1a07906111ec 738 SlrxFilterRuleHeaderArgsAndMask_t FilterRuleHeaderArgsAndMask;
dflet 0:1a07906111ec 739
dflet 0:1a07906111ec 740 /* -- 2 bytes */
dflet 0:1a07906111ec 741 uint8_t Padding[2];
dflet 0:1a07906111ec 742 } _WlanRxFilterUpdateArgsCommandBuff_t;
dflet 0:1a07906111ec 743
dflet 0:1a07906111ec 744
dflet 0:1a07906111ec 745 /*! \typedef _WlanRxFilterRetrieveEnableStatusCommandResponseBuff_t
dflet 0:1a07906111ec 746 * The structure is used for the interface HOST NWP.\n
dflet 0:1a07906111ec 747 *
dflet 0:1a07906111ec 748 */
dflet 0:1a07906111ec 749 /* -- 16 bytes */
dflet 0:1a07906111ec 750 typedef struct _WlanRxFilterRetrieveEnableStatusCommandResponseBuff_t {
dflet 0:1a07906111ec 751
dflet 0:1a07906111ec 752 /* ! the filter set bit map */
dflet 0:1a07906111ec 753 /* -- 16 bytes */
dflet 0:1a07906111ec 754 SlrxFilterIdMask_t FilterIdMask;
dflet 0:1a07906111ec 755
dflet 0:1a07906111ec 756 } _WlanRxFilterRetrieveEnableStatusCommandResponseBuff_t;
dflet 0:1a07906111ec 757
dflet 0:1a07906111ec 758
dflet 0:1a07906111ec 759 /*! \struct _WlanRxFilterPrePreparedFiltersCommandBuff_t
dflet 0:1a07906111ec 760 * The function enables to perform operations on pre-prepared filters
dflet 0:1a07906111ec 761 *
dflet 0:1a07906111ec 762 */
dflet 0:1a07906111ec 763 typedef struct _WlanRxFilterPrePreparedFiltersCommandBuff_t {
dflet 0:1a07906111ec 764 /* ! the filter set bit map */
dflet 0:1a07906111ec 765 /* -- 4 bytes */
dflet 0:1a07906111ec 766 SlrxFilterPrePreparedFiltersMask_t FilterPrePreparedFiltersMask;
dflet 0:1a07906111ec 767
dflet 0:1a07906111ec 768 } _WlanRxFilterPrePreparedFiltersCommandBuff_t;
dflet 0:1a07906111ec 769
dflet 0:1a07906111ec 770
dflet 0:1a07906111ec 771 /*! \typedef sl_protocol_WlanRxFilterPrePreparedFiltersCommandResponseBuff_t
dflet 0:1a07906111ec 772 *
dflet 0:1a07906111ec 773 */
dflet 0:1a07906111ec 774 /*-- 4 bytes */
dflet 0:1a07906111ec 775 typedef struct _WlanRxFilterPrePreparedFiltersCommandResponseBuff_t {
dflet 0:1a07906111ec 776 /* -- 4 bytes */
dflet 0:1a07906111ec 777 /* ! the filter set bit map */
dflet 0:1a07906111ec 778 SlrxFilterPrePreparedFiltersMask_t FilterPrePreparedFiltersMask;
dflet 0:1a07906111ec 779
dflet 0:1a07906111ec 780 } _WlanRxFilterPrePreparedFiltersCommandResponseBuff_t;
dflet 0:1a07906111ec 781
dflet 0:1a07906111ec 782
dflet 0:1a07906111ec 783
dflet 0:1a07906111ec 784 typedef uint8_t SLrxFilterOperation_t;
dflet 0:1a07906111ec 785 #define SL_ENABLE_DISABLE_RX_FILTER (0)
dflet 0:1a07906111ec 786 #define SL_REMOVE_RX_FILTER (1)
dflet 0:1a07906111ec 787 #define SL_STORE_RX_FILTERS (2)
dflet 0:1a07906111ec 788 #define SL_UPDATE_RX_FILTER_ARGS (3)
dflet 0:1a07906111ec 789 #define SL_FILTER_RETRIEVE_ENABLE_STATE (4)
dflet 0:1a07906111ec 790 #define SL_FILTER_PRE_PREPARED_RETRIEVE_CREATE_REMOVE_STATE (5)
dflet 0:1a07906111ec 791 #define SL_FILTER_PRE_PREPARED_SET_CREATE_REMOVE_STATE (6)
dflet 0:1a07906111ec 792
dflet 0:1a07906111ec 793
dflet 0:1a07906111ec 794 /* Bit manipulation for 8 bit */
dflet 0:1a07906111ec 795 #define ISBITSET8(x,i) ((x[i>>3] & (0x80>>(i&7)))!=0) /* < Is bit set, 8 bit unsigned numbers = x , location = i */
dflet 0:1a07906111ec 796 #define SETBIT8(x,i) x[i>>3]|=(0x80>>(i&7)); /* < Set bit,8 bit unsigned numbers = x , location = i */
dflet 0:1a07906111ec 797 #define CLEARBIT8(x,i) x[i>>3]&=(0x80>>(i&7))^0xFF; /* < Clear bit,8 bit unsigned numbers = x , location = i */
dflet 0:1a07906111ec 798
dflet 0:1a07906111ec 799 namespace mbed_cc3100 {
dflet 0:1a07906111ec 800
dflet 0:1a07906111ec 801 /* ******************************************************************************/
dflet 0:1a07906111ec 802 /* RX filters - Start */
dflet 0:1a07906111ec 803 /* ******************************************************************************/
dflet 0:1a07906111ec 804 /* -- 80 bytes */
dflet 0:1a07906111ec 805 typedef struct _WlanRxFilterAddCommand_t {
dflet 0:1a07906111ec 806 /* -- 1 byte */
dflet 0:1a07906111ec 807 SlrxFilterRuleType_t RuleType;
dflet 0:1a07906111ec 808 /* -- 1 byte */
dflet 0:1a07906111ec 809 SlrxFilterFlags_t FilterFlags;
dflet 0:1a07906111ec 810 /* -- 1 byte */
dflet 0:1a07906111ec 811 SlrxFilterID_t FilterId;
dflet 0:1a07906111ec 812 /* -- 1 byte */
dflet 0:1a07906111ec 813 uint8_t Padding;
dflet 0:1a07906111ec 814 /* -- 56 byte */
dflet 0:1a07906111ec 815 SlrxFilterRule_t Rule;
dflet 0:1a07906111ec 816 /* -- 12 byte ( 3 padding ) */
dflet 0:1a07906111ec 817 SlrxFilterTrigger_t Trigger;
dflet 0:1a07906111ec 818 /* -- 8 byte */
dflet 0:1a07906111ec 819 SlrxFilterAction_t Action;
dflet 0:1a07906111ec 820 } _WlanRxFilterAddCommand_t;
dflet 0:1a07906111ec 821
dflet 0:1a07906111ec 822
dflet 0:1a07906111ec 823
dflet 0:1a07906111ec 824 /* -- 4 bytes */
dflet 0:1a07906111ec 825 typedef struct l_WlanRxFilterAddCommandReponse_t {
dflet 0:1a07906111ec 826 /* -- 1 byte */
dflet 0:1a07906111ec 827 SlrxFilterID_t FilterId;
dflet 0:1a07906111ec 828 /* -- 1 Byte */
dflet 0:1a07906111ec 829 uint8_t Status;
dflet 0:1a07906111ec 830 /* -- 2 byte */
dflet 0:1a07906111ec 831 uint8_t Padding[2];
dflet 0:1a07906111ec 832
dflet 0:1a07906111ec 833 } _WlanRxFilterAddCommandReponse_t;
dflet 0:1a07906111ec 834
dflet 0:1a07906111ec 835
dflet 0:1a07906111ec 836
dflet 0:1a07906111ec 837 /*
dflet 0:1a07906111ec 838 * \struct _WlanRxFilterSetCommand_t
dflet 0:1a07906111ec 839 */
dflet 0:1a07906111ec 840 typedef struct _WlanRxFilterSetCommand_t {
dflet 0:1a07906111ec 841 uint16_t InputBufferLength;
dflet 0:1a07906111ec 842 /* 1 byte */
dflet 0:1a07906111ec 843 SLrxFilterOperation_t RxFilterOperation;
dflet 0:1a07906111ec 844 uint8_t Padding[1];
dflet 0:1a07906111ec 845 } _WlanRxFilterSetCommand_t;
dflet 0:1a07906111ec 846
dflet 0:1a07906111ec 847 /**
dflet 0:1a07906111ec 848 * \struct _WlanRxFilterSetCommandReponse_t
dflet 0:1a07906111ec 849 */
dflet 0:1a07906111ec 850 typedef struct _WlanRxFilterSetCommandReponse_t {
dflet 0:1a07906111ec 851 /* 1 byte */
dflet 0:1a07906111ec 852 uint8_t Status;
dflet 0:1a07906111ec 853 /* 3 bytes */
dflet 0:1a07906111ec 854 uint8_t Padding[3];
dflet 0:1a07906111ec 855
dflet 0:1a07906111ec 856 } _WlanRxFilterSetCommandReponse_t;
dflet 0:1a07906111ec 857
dflet 0:1a07906111ec 858 /**
dflet 0:1a07906111ec 859 * \struct _WlanRxFilterGetCommand_t
dflet 0:1a07906111ec 860 */
dflet 0:1a07906111ec 861 typedef struct _WlanRxFilterGetCommand_t {
dflet 0:1a07906111ec 862 uint16_t OutputBufferLength;
dflet 0:1a07906111ec 863 /* 1 byte */
dflet 0:1a07906111ec 864 SLrxFilterOperation_t RxFilterOperation;
dflet 0:1a07906111ec 865 uint8_t Padding[1];
dflet 0:1a07906111ec 866 } _WlanRxFilterGetCommand_t;
dflet 0:1a07906111ec 867
dflet 0:1a07906111ec 868 /**
dflet 0:1a07906111ec 869 * \struct _WlanRxFilterGetCommandReponse_t
dflet 0:1a07906111ec 870 */
dflet 0:1a07906111ec 871 typedef struct _WlanRxFilterGetCommandReponse_t {
dflet 0:1a07906111ec 872 /* 1 byte */
dflet 0:1a07906111ec 873 uint8_t Status;
dflet 0:1a07906111ec 874 /* 1 bytes */
dflet 0:1a07906111ec 875 uint8_t Padding;
dflet 0:1a07906111ec 876 /* 2 byte */
dflet 0:1a07906111ec 877 uint16_t OutputBufferLength;
dflet 0:1a07906111ec 878
dflet 0:1a07906111ec 879 } _WlanRxFilterGetCommandReponse_t;
dflet 0:1a07906111ec 880
dflet 0:1a07906111ec 881
dflet 0:1a07906111ec 882
dflet 0:1a07906111ec 883 /* ******************************************************************************/
dflet 0:1a07906111ec 884 /* RX filters -- End */
dflet 0:1a07906111ec 885 /* ******************************************************************************/
dflet 0:1a07906111ec 886
dflet 0:1a07906111ec 887 class cc3100_driver;
dflet 0:1a07906111ec 888
dflet 0:1a07906111ec 889 class cc3100_wlan_rx_filters
dflet 0:1a07906111ec 890 {
dflet 0:1a07906111ec 891
dflet 0:1a07906111ec 892 public:
dflet 0:1a07906111ec 893
dflet 0:1a07906111ec 894 cc3100_wlan_rx_filters(cc3100_driver &driver);
dflet 0:1a07906111ec 895
dflet 0:1a07906111ec 896 ~cc3100_wlan_rx_filters();
dflet 0:1a07906111ec 897
dflet 0:1a07906111ec 898
dflet 0:1a07906111ec 899 /*********************************************************************************************/
dflet 0:1a07906111ec 900 /* Function prototypes */
dflet 0:1a07906111ec 901 /*********************************************************************************************/
dflet 0:1a07906111ec 902
dflet 0:1a07906111ec 903 /*!
dflet 0:1a07906111ec 904
dflet 0:1a07906111ec 905 \addtogroup wlan
dflet 0:1a07906111ec 906 @{
dflet 0:1a07906111ec 907
dflet 0:1a07906111ec 908 */
dflet 0:1a07906111ec 909
dflet 0:1a07906111ec 910
dflet 0:1a07906111ec 911 /*!
dflet 0:1a07906111ec 912 \brief Adds new filter rule to the system
dflet 0:1a07906111ec 913
dflet 0:1a07906111ec 914 \param[in] RuleType The rule type
dflet 0:1a07906111ec 915 \param[in] FilterFlags Flags which set the type of header rule Args and sets the persistent flag
dflet 0:1a07906111ec 916 \param[in] pRule Determine the filter rule logic
dflet 0:1a07906111ec 917 \param[in] pTrigger Determine when the rule is triggered also sets rule parent.
dflet 0:1a07906111ec 918 \param[in] pAction Sets the action to be executed in case the match functions pass
dflet 0:1a07906111ec 919 \param[out] pFilterId The filterId which was created
dflet 0:1a07906111ec 920
dflet 0:1a07906111ec 921 \return On success, zero is returned. Otherwise error code is returned
dflet 0:1a07906111ec 922 */
dflet 0:1a07906111ec 923 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterAdd)
dflet 0:1a07906111ec 924 SlrxFilterID_t sl_WlanRxFilterAdd( SlrxFilterRuleType_t RuleType,
dflet 0:1a07906111ec 925 SlrxFilterFlags_t FilterFlags,
dflet 0:1a07906111ec 926 const SlrxFilterRule_t* const Rule,
dflet 0:1a07906111ec 927 const SlrxFilterTrigger_t* const Trigger,
dflet 0:1a07906111ec 928 const SlrxFilterAction_t* const Action,
dflet 0:1a07906111ec 929 SlrxFilterID_t* pFilterId);
dflet 0:1a07906111ec 930
dflet 0:1a07906111ec 931 #endif
dflet 0:1a07906111ec 932
dflet 0:1a07906111ec 933
dflet 0:1a07906111ec 934
dflet 0:1a07906111ec 935
dflet 0:1a07906111ec 936
dflet 0:1a07906111ec 937 /*!
dflet 0:1a07906111ec 938 \brief Sets parameters to Rx filters
dflet 0:1a07906111ec 939
dflet 0:1a07906111ec 940 \param[in] RxFilterOperation
dflet 0:1a07906111ec 941 possible operations :
dflet 0:1a07906111ec 942 - SL_ENABLE_DISABLE_RX_FILTER - Enables\disables filter in a filter list
dflet 0:1a07906111ec 943 - SL_REMOVE_RX_FILTER - Removes filter from memory ( to remove from flash call SL_STORE_RX_FILTERS after this command)
dflet 0:1a07906111ec 944 - SL_STORE_RX_FILTERS - Save the filters for persistent
dflet 0:1a07906111ec 945 - SL_UPDATE_RX_FILTER_ARGS - Update the arguments of existing filter
dflet 0:1a07906111ec 946 - SL_FILTER_PRE_PREPARED_SET_CREATE_REMOVE_STATE - Change the default creation of the pre-prepared filters
dflet 0:1a07906111ec 947
dflet 0:1a07906111ec 948 \param[in] pInputBuffer options:
dflet 0:1a07906111ec 949 The buffer input is _WlanRxFilterOperationCommandBuff_t:
dflet 0:1a07906111ec 950 - SL_ENABLE_DISABLE_RX_FILTER
dflet 0:1a07906111ec 951 - SL_REMOVE_RX_FILTER
dflet 0:1a07906111ec 952 - SL_STORE_RX_FILTERS
dflet 0:1a07906111ec 953 The buffer input is _WlanRxFilterUpdateArgsCommandBuff_t:
dflet 0:1a07906111ec 954 - SL_UPDATE_RX_FILTER_ARGS
dflet 0:1a07906111ec 955 The buffer input is _WlanRxFilterPrePreparedFiltersCommandBuff_t:
dflet 0:1a07906111ec 956 - SL_FILTER_PRE_PREPARED_SET_CREATE_REMOVE_STATE
dflet 0:1a07906111ec 957
dflet 0:1a07906111ec 958 \param[in] InputbufferLength The length in byte of the input buffer
dflet 0:1a07906111ec 959
dflet 0:1a07906111ec 960 \return On success, zero is returned. Otherwise error code is returned
dflet 0:1a07906111ec 961 */
dflet 0:1a07906111ec 962
dflet 0:1a07906111ec 963 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterSet)
dflet 0:1a07906111ec 964 int16_t sl_WlanRxFilterSet( const SLrxFilterOperation_t RxFilterOperation,
dflet 0:1a07906111ec 965 const uint8_t* const pInputBuffer,
dflet 0:1a07906111ec 966 uint16_t InputbufferLength);
dflet 0:1a07906111ec 967 #endif
dflet 0:1a07906111ec 968
dflet 0:1a07906111ec 969 /*!
dflet 0:1a07906111ec 970 \brief Gets parameters of Rx filters
dflet 0:1a07906111ec 971
dflet 0:1a07906111ec 972 \param[in] RxFilterOperation
dflet 0:1a07906111ec 973 possible operations :
dflet 0:1a07906111ec 974 - SL_FILTER_RETRIEVE_ENABLE_STATE - Retrieves the enable disable status
dflet 0:1a07906111ec 975 - SL_FILTER_PRE_PREPARED_RETRIEVE_CREATE_REMOVE_STATE - Retrieves the pre-prepared filters creation status
dflet 0:1a07906111ec 976
dflet 0:1a07906111ec 977 \param[in] pOutputBuffer
dflet 0:1a07906111ec 978 The buffer input is _WlanRxFilterRetrieveEnableStatusCommandResponseBuff_t:
dflet 0:1a07906111ec 979 - SL_FILTER_RETRIEVE_ENABLE_STATE
dflet 0:1a07906111ec 980 The buffer input is _WlanRxFilterPrePreparedFiltersCommandResponseBuff_t:
dflet 0:1a07906111ec 981 - SL_FILTER_PRE_PREPARED_RETRIEVE_CREATE_REMOVE_STATE
dflet 0:1a07906111ec 982
dflet 0:1a07906111ec 983 \param[in] OutputbufferLength The length in byte of the output buffer
dflet 0:1a07906111ec 984
dflet 0:1a07906111ec 985 \return On success, zero is returned. Otherwise error code is returned
dflet 0:1a07906111ec 986 */
dflet 0:1a07906111ec 987
dflet 0:1a07906111ec 988 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterGet)
dflet 0:1a07906111ec 989 int16_t sl_WlanRxFilterGet(const SLrxFilterOperation_t RxFilterOperation,
dflet 0:1a07906111ec 990 uint8_t* pOutputBuffer,
dflet 0:1a07906111ec 991 uint16_t OutputbufferLength);
dflet 0:1a07906111ec 992 #endif
dflet 0:1a07906111ec 993
dflet 0:1a07906111ec 994 private:
dflet 0:1a07906111ec 995
dflet 0:1a07906111ec 996 cc3100_driver &_driver;
dflet 0:1a07906111ec 997
dflet 0:1a07906111ec 998
dflet 0:1a07906111ec 999 /*!
dflet 0:1a07906111ec 1000
dflet 0:1a07906111ec 1001 Close the Doxygen group.
dflet 0:1a07906111ec 1002 @}
dflet 0:1a07906111ec 1003
dflet 0:1a07906111ec 1004 */
dflet 0:1a07906111ec 1005 };//class
dflet 0:1a07906111ec 1006
dflet 0:1a07906111ec 1007 }//namespace mbed_cc3100
dflet 0:1a07906111ec 1008
dflet 0:1a07906111ec 1009 #endif /* RX_FILTERS_PREPROCESSOR_CLI_IF_H_ */
dflet 0:1a07906111ec 1010
dflet 0:1a07906111ec 1011
dflet 0:1a07906111ec 1012