MAC Address Filtering#

API and Callbacks for the MAC Address Filtering Component.

This plugin artificially limits what the stack hears by filtering the packets just above the lower MAC. The plugin can be configured on the fly via CLI with the short or long address of devices whose packets will be dropped or allowed. There are two lists, a short address list (2-byte node ID) and a long address list (8-byte IEEE address). Each list may be configured as either an allow list or block list. The default is a block list with no addresses configured (accept all packets normally). A separate option allows or drops packets with no address information (e.g., Beacon Requests). NOTE: The radio will still generate and process MAC ACKs for packets. This plugin cannot be used to effect the behavior of MAC ACKs, which are handled by the RAIL library and radio hardware.

Modules#

sli_802154_mac_address_filter_option_description_t

sli_zigbee_long_addres_filter_match_struct_t

sli_zigbee_short_addres_filter_match_struct_t

sli_802154_pan_id_filter_match_struct_t

sli_802154_mac_address_filter_globals_t

MAC Address Filtering

API#

void

Clear all lists for MAC address filtering.

void

Clears all packet counts for all modes.

sl_zigbee_af_mac_address_filtering_get_stats_for_short_address(uint8_t index, uint32_t *matchCountForIndexPtr)

Get stats for a short address.

void
sl_zigbee_af_mac_address_filtering_get_stats(bool shortMode, uint32_t *allowedPacketCountPtr, uint32_t *droppedPacketCountPtr, uint32_t *totalPacketCountPtr)

Get MAC address filtering stats. Get the allowed, dropped and total packet counts.

void

Set the decision to manupulate the MAC address filtering tables.

void

Add the short address.

void

Add the long address.

void

Add the panID.

void

Set the short address list type.

void

Set the long address list type.

void

Set the list type of panId list.

Enumerations#

enum
MAC_ADDRESS_MODE_NONE = 0
MAC_ADDRESS_MODE_SHORT = 1
MAC_ADDRESS_MODE_LONG = 2
}
enum
MAC_FILTER_TYPE_NO_ADDRESS = 0
MAC_FILTER_TYPE_SHORT_ADDRESS = 1
MAC_FILTER_TYPE_LONG_ADDRESS = 2
MAC_FILTER_TYPE_PAN_ID = 3
}
enum
ALLOW_PACKET = 0
DROP_PACKET = 1
}

Typedefs#

Macros#

#define
expectCheckpoint (...)
#define
debug (...)
#define
SL_ZIGBEE_TEST_ASSERT (...)
#define
MAC_FILTER_OPTIONS_NO_ADDRESS_MASK (1 << MAC_FILTER_TYPE_NO_ADDRESS)
#define
MAC_FILTER_OPTIONS_SHORT_ADDRESS_LIST_MASK (1 << MAC_FILTER_TYPE_SHORT_ADDRESS)
#define
MAC_FILTER_OPTIONS_LONG_ADDRESS_LIST_MASK (1 << MAC_FILTER_TYPE_LONG_ADDRESS)
#define
MAC_FILTER_OPTIONS_DEST_PAN_ID_LIST_MASK (1 << MAC_FILTER_TYPE_PAN_ID)
#define
MAC_FILTER_OPTIONS_COUNT 4
#define
MAC_FILTER_OPTIONS_DROP_NO_ADDRESS 0x00
#define
MAC_FILTER_OPTIONS_SHORT_ADDRESS_BLACKLIST 0x00
#define
MAC_FILTER_OPTIONS_LONG_ADDRESS_BLACKLIST 0x00
#define
MAC_FILTER_OPTIONS_ALLOW_NO_ADDRESS 0x01
#define
MAC_FILTER_OPTIONS_SHORT_ADDRESS_WHITELIST 0x02
#define
MAC_FILTER_OPTIONS_LONG_ADDRESS_WHITELIST 0x04
#define
MAC_FILTER_OPTIONS_DEST_PAN_ID_WHITELIST 0x08
#define
MAC_FILTER_OPTIONS_DEST_PAN_ID_BLACKLIST 0x00
#define
BROADCAST_PAN_ID 0xFFFF
#define
MAC_FILTER_OPTIONS_DEFAULTS undefined
#define
MAC_FRAME_CONTROL_FRAME_TYPE_MASK 0x0007
#define
MAC_FRAME_CONTROL_FRAME_TYPE_BEACON 0x0000
#define
MAC_FRAME_CONTROL_FRAME_TYPE_DATA 0x0001
#define
MAC_FRAME_CONTROL_FRAME_TYPE_ACK 0x0002
#define
MAC_FRAME_CONTROL_FRAME_TYPE_COMMAND 0x0003
#define
MAC_FRAME_CONTROL_VERSION_MASK 0x3000
#define
MAC_FRAME_CONTROL_VERSION_SHIFT 12
#define
MAC_FRAME_CONTROL_VERSION_2003 0x0000
#define
MAC_FRAME_CONTROL_VERSION_2012 0x0002
#define
MAC_FRAME_CONTROL_SOURCE_ADDRESS_MODE_SHIFT 14
#define
MAC_FRAME_CONTROL_ADDRESS_MODE_MASK 0x0003
#define
MAC_FRAME_CONTROL_ADDRESS_MODE_NONE 0x0000
#define
MAC_FRAME_CONTROL_ADDRESS_MODE_RESERVED 0x0001
#define
MAC_FRAME_CONTROL_ADDRESS_MODE_SHORT 0x0002
#define
MAC_FRAME_CONTROL_ADDRESS_MODE_LONG 0x0003
#define
MAC_FRAME_CONTROL_DEST_ADDRESS_MODE_SHIFT 10
#define
MAC_FRAME_CONTROL_DEST_ADDRESS_MODE_NONE 0x0000
#define
MAC_FRAME_CONTROL_PANID_COMPRESSION 0x0040
#define
WHITELIST_CHARACTER_INDEX 4

API Documentation#

sl_zigbee_af_mac_address_filtering_clear_all#

void sl_zigbee_af_mac_address_filtering_clear_all (void )

Clear all lists for MAC address filtering.

Parameters
N/A

Definition at line 220 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_clear_stats#

void sl_zigbee_af_mac_address_filtering_clear_stats (void )

Clears all packet counts for all modes.

Parameters
N/A

Definition at line 223 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_get_stats_for_short_address#

sl_status_t sl_zigbee_af_mac_address_filtering_get_stats_for_short_address (uint8_t index, uint32_t * matchCountForIndexPtr)

Get stats for a short address.

Parameters
N/Aindex

Ver.: always

N/AmatchCountForIndexPtr

Ver.: always

Returns

  • sl_status_t status code


Definition at line 233 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_get_stats#

void sl_zigbee_af_mac_address_filtering_get_stats (bool shortMode, uint32_t * allowedPacketCountPtr, uint32_t * droppedPacketCountPtr, uint32_t * totalPacketCountPtr)

Get MAC address filtering stats. Get the allowed, dropped and total packet counts.

Parameters
N/AshortMode

Ver.: always

N/AallowedPacketCountPtr

Ver.: always

N/AdroppedPacketCountPtr

Ver.: always

N/AtotalPacketCountPtr

Ver.: always


Definition at line 243 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_filter_no_address#

void sl_zigbee_af_mac_address_filtering_filter_no_address (bool filterNoAddress)

Set the decision to manupulate the MAC address filtering tables.

Parameters
N/AfilterNoAddress

Ver.:always


Definition at line 252 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_add_short_address#

void sl_zigbee_af_mac_address_filtering_add_short_address (sl_802154_short_addr_t nodeId)

Add the short address.

Parameters
N/AnodeId

Ver.:always


Definition at line 258 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_add_long_address#

void sl_zigbee_af_mac_address_filtering_add_long_address (sl_802154_long_addr_t eui64)

Add the long address.

Parameters
N/Aeui64

Ver.:always


Definition at line 264 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_add_pan_id#

void sl_zigbee_af_mac_address_filtering_add_pan_id (sl_802154_pan_id_t panId)

Add the panID.

Parameters
N/ApanId

Ver.:always


Definition at line 270 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_set_short_address_list_type#

void sl_zigbee_af_mac_address_filtering_set_short_address_list_type (uint8_t * listType)

Set the short address list type.

Parameters
N/AlistType

Ver.:always, listType can be "set-whitelist" or "set-blacklist".


Definition at line 276 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_set_long_address_list_type#

void sl_zigbee_af_mac_address_filtering_set_long_address_list_type (uint8_t * listType)

Set the long address list type.

Parameters
N/AlistType

Ver.:always, listType can be "set-whitelist" or "set-blacklist".


Definition at line 282 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sl_zigbee_af_mac_address_filtering_set_pan_id_list_type#

void sl_zigbee_af_mac_address_filtering_set_pan_id_list_type (uint8_t * listType)

Set the list type of panId list.

Parameters
N/AlistType

Ver.:always, listType can be "set-whitelist" or "set-blacklist".


Definition at line 288 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

Enumeration Documentation#

sli_802154_mac_address_mode_t#

sli_802154_mac_address_mode_t
Enumerator
MAC_ADDRESS_MODE_NONE
MAC_ADDRESS_MODE_SHORT
MAC_ADDRESS_MODE_LONG

Definition at line 132 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sli_802154_mac_filter_type_t#

sli_802154_mac_filter_type_t
Enumerator
MAC_FILTER_TYPE_NO_ADDRESS
MAC_FILTER_TYPE_SHORT_ADDRESS
MAC_FILTER_TYPE_LONG_ADDRESS
MAC_FILTER_TYPE_PAN_ID

Definition at line 144 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

sli_zigbee_filter_result_t#

sli_zigbee_filter_result_t
Enumerator
ALLOW_PACKET
DROP_PACKET

Definition at line 203 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

Typedef Documentation#

MacAddressFilterOptions#

typedef uint8_t MacAddressFilterOptions

Definition at line 150 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

Variable Documentation#

macAddressFilterData#

sli_802154_mac_address_filter_globals_t macAddressFilterData

Definition at line 210 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h

zeroEui64#

const sl_802154_long_addr_t zeroEui64

Definition at line 212 of file app/framework/plugin-soc/mac-address-filtering/mac-address-filtering.h