5.13.0.0R1
Software Development Kit
Packet Filter functions

Functions

wiced_result_t wiced_wifi_add_packet_filter (const wiced_packet_filter_t *settings)
 
wiced_result_t wiced_wifi_clear_packet_filter_stats (uint32_t filter_id)
 
wiced_result_t wiced_wifi_disable_packet_filter (uint8_t filter_id)
 
wiced_result_t wiced_wifi_enable_packet_filter (uint8_t filter_id)
 
wiced_result_t wiced_wifi_get_packet_filter_mask_and_pattern (uint32_t filter_id, uint32_t max_size, uint8_t *mask, uint8_t *pattern, uint32_t *size_out)
 
wiced_result_t wiced_wifi_get_packet_filter_stats (uint8_t filter_id, wiced_packet_filter_stats_t *stats)
 
wiced_result_t wiced_wifi_get_packet_filters (uint32_t max_count, uint32_t offset, wiced_packet_filter_t *list, uint32_t *count_out)
 
wiced_result_t wiced_wifi_remove_packet_filter (uint8_t filter_id)
 
wiced_result_t wiced_wifi_set_packet_filter_mode (wiced_packet_filter_mode_t mode)
 

Detailed Description

WICED Wi-Fi functions for manipulating packet filters.

Function Documentation

wiced_result_t wiced_wifi_add_packet_filter ( const wiced_packet_filter_t settings)

Adds an ethernet packet filter which causes the WLAN chip to drop all packets that do NOT match the filter

When a packet filter(s) is installed, incoming packets received by the WLAN chip are run through the pre-installed filter(s). Filter criteria are added using this API function. If the WLAN chip receives a packet that matches one of the currently installed filters, the host MCU is notified, and the packet is forwarded to the MCU. Packets that do not match any of the installed filters are dropped by the WLAN chip. If there are no packet filters installed, all received packets are passed from the WLAN chip to the host MCU

Parameters
[in]wiced_packet_filter_t: Packet filter settings
Returns
wiced_result_t
wiced_result_t wiced_wifi_clear_packet_filter_stats ( uint32_t  filter_id)

Clear all packet filter statistics

Parameters
[in]filter_id: The unique user assigned ID for the filter
Returns
wiced_result_t
wiced_result_t wiced_wifi_disable_packet_filter ( uint8_t  filter_id)

Disables a previously installed packet filter

Parameters
[in]filter_id: The unique user assigned ID for the filter
Returns
wiced_result_t
wiced_result_t wiced_wifi_enable_packet_filter ( uint8_t  filter_id)

Enables a previously installed packet filter

Parameters
[in]filter_id: The unique user assigned ID for the filter
Returns
wiced_result_t
wiced_result_t wiced_wifi_get_packet_filter_mask_and_pattern ( uint32_t  filter_id,
uint32_t  max_size,
uint8_t *  mask,
uint8_t *  pattern,
uint32_t *  size_out 
)

Get the filter pattern and mask for a packet filters

Parameters
[in]filter_id: The id used to create the packet filter
[in]max_size: Size of the supplied pattern and mask buffers in bytes
[out]mask: Byte array that will receive the packet filter mask
[out]pattern: Byte array that will receive the packet filter pattern
[out]size_out: The number bytes returned in each of pattern and filter buffers
Returns
wiced_result_t
wiced_result_t wiced_wifi_get_packet_filter_stats ( uint8_t  filter_id,
wiced_packet_filter_stats_t *  stats 
)

Gets packet filter statistics including packets matched, packets forwarded and packets discarded.

Parameters
[in]filter_id: The unique user assigned ID for the filter
[out]wiced_packet_filter_stats_t: A pointer to a structure that will be populated with filter statistics
Returns
wiced_result_t
wiced_result_t wiced_wifi_get_packet_filters ( uint32_t  max_count,
uint32_t  offset,
wiced_packet_filter_t list,
uint32_t *  count_out 
)

Get details of packet filters

Note: does not retrieve the Filter mask and pattern. use wiced_wifi_get_packet_filter_mask_and_pattern to retreive those.

Parameters
[in]max_count: The maximum number of filters to return details for.
[in]offset: The location (count) of the first filter to retrieve (0=beginning)
[out]list: An array which will receive the filter descriptors - must be able to fit max_count items
[out]count_outThe number of filter descriptors retrieved
Returns
wiced_result_t
wiced_result_t wiced_wifi_remove_packet_filter ( uint8_t  filter_id)

Removes (un-install's) a previously installed packet filter

Parameters
[in]filter_id: The unique user assigned ID for the filter
Returns
wiced_result_t
wiced_result_t wiced_wifi_set_packet_filter_mode ( wiced_packet_filter_mode_t  mode)

Sets the packet filter mode (or rule) to either forward or discard packets on a match

Parameters
[in]wiced_packet_filter_mode_t: Packet filter mode
Returns
wiced_result_t