This document provides a brief description of the Static Filter OpEN APIs. It provides the following services:
- Sets the static MAC filter admin mode.
- Gets the static MAC filter admin mode.
- Creates a static MAC filter.
- Removes a configured MAC Static Filter.
- Apply a comma separated source interface list to the static MAC filter.
- Adds a source interface to the static MAC filter.
- Deletes a source interface from the source interface list of the static MAC filter.
- Adds a destination interface to the static MAC filter.
- Deletes a destination interface from the destination interface list of the static MAC filter.
- Adds a comma separated destination interface list to the static MAC filter.
- Deletes a comma separated destination interface list from the static MAC filter.
- Gets the first configured MAC static filter.
- Gets the next configured MAC static filter.
- Gets list of source interfaces for a MAC static filter.
- Gets list of destination interfaces for a MAC static filter.
- Gets the number of MAC static filters configured.
- Gets the number of total, multicast and unicast MAC static filters configured.
- Checks to see if a MAC filter is configured or not.
- Gets the buffer size used by filtering component for the bit mask.
- Checks if a particular interface is present in any MAC filter.
- Check to see if the port is the appropriate type on which the param can be set.
- Checks to see the mac address type, unicast or multicast.
- Set multicast address filtering configuration for all vlans.
- Sets multicast address filtering configuration for the specified vlan.
- Gets multicast address filtering configuration for the specified vlan.
- Checks if the interface is valid for filtering.
- Sets the stream id of an existing macfilter with given MAC address and vlan id.
- Gets the configured stream id.
- Gets list of destination filter interfaces for a MAC static filter.
Example C Application static_filter_example
Initialization
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.
static_filter_example
static_filter_example.c is a sample application that demonstrates the use of OpEN's Static Filter APIs. static_filter_example is started from the command line and can be used to exercise the various APIs by specifying arguments on the command line.
Sample Output
- Usage: ./static_filter_example <test#> <arg1> <arg2> ...
- Test 1: Sets the static MAC filter admin mode:./static_filter_example 1 <adminMode>
- Test 2: Gets the static MAC filter admin mode: ./static_filter_example 2
- Test 3: Creates a static MAC filter: ./static_filter_example 3 <macAddr> <vlanId>
- Test 4: Deletes a static MAC filter: ./static_filter_example 4 <macAddr> <vlanId>
- Test 5: Apply a comma separated source interface list to the static MAC filter: ./static_filter_example 5 <macAddr> <vlanId> <srcIntfList>
- Test 6: Adds a source interface to the static MAC filter: ./static_filter_example 6 <macAddr> <vlanId> <ifNum>
- Test 7: Deletes a source interface from the source interface list of the static MAC filter: ./static_filter_example 7 <macAddr> <vlanId> <ifNum>
- Test 8: Adds a destination interface to the static MAC filter: ./static_filter_example 8 <macAddr> <vlanId> <ifNum>
- Test 9: Deletes a destination interface from the destination interface list of the static MAC filter: ./static_filter_example 9 <macAddr> <vlanId> <ifNum>
- Test 10: Adds a comma separated destination interface list to the static MAC filter: ./static_filter_example 10 <macAddr> <vlanId> <ifNum> <fwdIntfList> <filterList>
- Test 11: Deletes a comma separated destination interface list from the static MAC filter: ./static_filter_example 11 <macAddr> <vlanId> <ifNum> <fwdIntfList> <filterList>
- Test 12: Gets the first configured MAC static filter: ./static_filter_example 12
- Test 13: Gets the next configured MAC static filter: ./static_filter_example 13 <macAddr> <vlanId>
- Test 14: Gets list of source interfaces for a MAC static filter: ./static_filter_example 14 <macAddr> <vlanId>
- Test 15: Gets list of destination interfaces for a MAC static filter: ./static_filter_example 15 <macAddr> <vlanId>
- Test 16: Gets the number of MAC static filters configured: ./static_filter_example 16
- Test 17: Gets the number of total, multicast and unicast MAC static filters configured: ./static_filter_example 17
- Test 18: Checks to see if a MAC filter is configured or not: ./static_filter_example 18 <macAddr> <vlanId>
- Test 19: Gets the buffer size used by filtering component for the bit mask: ./static_filter_example 19
- Test 20: Checks if a particular interface is present in any MAC filter: ./static_filter_example 20 <ifNum>
- Test 21: Check to see if the port is the appropriate type on which the param can be set: ./static_filter_example 21 <ifNum>
- Test 22: Checks to see the mac address type, unicast or multicast: ./static_filter_example 22 <macAddr>
- Test 23: Set multicast address filtering configuration for all vlans: ./static_filter_example 23 <mode>
- Test 24: Sets multicast address filtering configuration for the specified vlan: ./static_filter_example 24 <vlanId> <mode>
- Test 25: Gets multicast address filtering configuration for the specified vlan: ./static_filter_example 25 <vlanId>
- Test 26: Checks if the interface is valid for filtering: ./static_filter_example 26 <ifNum>
- Test 27: Sets the stream id of an existing macfilter with given MAC address and vlan id: ./static_filter_example 27 <macAddr> <vlanId> <streamId>
- Test 28: Gets the configured stream id: ./static_filter_example 28 <macAddr> <vlanId>
- Test 29: Gets list of destination filter interfaces for a MAC static filter: ./static_filter_example 29 <macAddr> <vlanId>
Static Filter CLI/API Cross Reference