This document provides a brief description of the Macal OpEN APIs. It provides the following services:
- To create a new management ACAL.
- To delete an existing management ACAL.
- Sets VRF of a management ACAL.
- Gets VRF of a management ACAL.
- Activate a management ACAL.
- Deactivate a management ACAL.
- To add a management ACAL rule.
- To remove a rule from an existing ACAL.
- To add an action to management ACAL rule.
- To add the source ip address and net mask to a management ACAL rule.
- To add an interface (ethernet/LAG) to an existing management ACAL rule.
- To add a vlan to an existing management ACAL rule.
- To add a serviceport to an existing management ACAL rule.
- Check if this management ACAL rule is for the service port.
- To add a service to management ACAL rule.
- Get the name of the management ACAL already existing.
- Get the active management ACAL.
- Get the first management ACAL rule index.
- Get the next management ACAL rule index.
- Check if this management ACAL rule with given priority exists.
- Get the action for a management ACAL rule.
- Get the source ip address and net mask of a management ACAL rule.
- Get the interface (ethernet/LAG) of an existing management ACAL rule.
- Get the vlan ID of an existing management ACAL rule.
- Get the service of a management ACAL rule.
- Get the service port statistics for a management ACAL rule.
- Get the TCP/UDP port number of a management ACAL rule.
- Add the TCP/UDP port number to a management ACAL rule.
- Checks to see if a user has configured a field in a management ACAL rule.
- Check if a MACAL list is created.
- Check if a MACAL list is activated.
- Get the number of packets filtered.
- Get the macal deny counter interval.
- Set the macal deny counter interval.
- Get the first available priority (index) for the specified management ACAL.
- Checks the specified VRF name is valid or not.
- Clears macal service port statistics.
- Check if the Net Filter table support is present on this platform.
Example C Application macal_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.
macal_example
macal_example.c is a sample application that demonstrates the use of OpEN's Macal APIs. macal_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: ./macal_example <test#> <arg1> <arg2> ...
- Test 1: To create a new management ACAL: macal_example 1 <macalName>
- Test 2: To delete an existing management ACAL: macal_example 2 <macalName>
- Test 3: Sets VRF of a management ACAL: macal_example 3 <vrfName>
- Test 4: Gets VRF of a management ACAL: macal_example 4
- Test 5: Activate a management ACAL: macal_example 5 <macalName>
- Test 6: Deactivate a management ACAL: macal_example 6 <macalName>
- Test 7: To add a management ACAL rule: macal_example 7 <macalName> <macalRulePrio>
- Test 8: To remove a rule from an existing ACAL: macal_example 8 <macalName> <macalRulePrio>
- Test 9: To add an action to management ACAL rule: macal_example 9 <macalName> <macalRulePrio> <action>
- Test 10: To add the source ip address and net mask to a management ACAL rule: macal_example 10 <macalName> <macalRulePrio> <ipAddr> <mask>
- Test 11: To add an interface (ethernet/LAG) to an existing management ACAL rule: macal_example 11 <macalName> <macalRulePrio> <ifNum>
- Test 12: To add a vlan to an existing management ACAL rule: macal_example 12 <macalName> <macalRulePrio> <vlanId>
- Test 13: To add a serviceport to an existing management ACAL rule: macal_example 13 <macalName> <macalRulePrio> <isServicePort>
- Test 14: Check if this management ACAL rule is for the service port: macal_example 14 <macalName> <macalRulePrio>
- Test 15: To add a service to management ACAL rule: macal_example 15 <macalName> <macalRulePrio> <service>
- Test 16: Get the name of the management ACAL already existing: macal_example 16
- Test 17: Get the active management ACAL: macal_example 17
- Test 18: Get the first management ACAL rule index: macal_example 18 <macalName>
- Test 19: Get the next management ACAL rule index: macal_example 19 <macalName> <macalRulePrio>
- Test 20: Check if this management ACAL rule with given priority exists: macal_example 20 <macalName> <macalRulePrio>
- Test 21: Get the action for a management ACAL rule: macal_example 21 <macalName> <macalRulePrio>
- Test 22: Get the source ip address and net mask of a management ACAL rule: macal_example 22 <macalName> <macalRulePrio>
- Test 23: Get the interface (ethernet/LAG) of an existing management ACAL rule: macal_example 23 <macalName> <macalRulePrio>
- Test 24: Get the vlan ID of an existing management ACAL rule: macal_example 24 <macalName> <macalRulePrio>
- Test 25: Get the service of a management ACAL rule: macal_example 25 <macalName> <macalRulePrio>
- Test 26: Get the service port statistics for a management ACAL rule: macal_example 26 <macalName> <macalRulePrio>
- Test 27: Get the TCP/UDP port number of a management ACAL rule: macal_example 27 <macalName> <macalRulePrio>
- Test 28: Add the TCP/UDP port number to a management ACAL rule: macal_example 28 <macalName> <macalRulePrio> <portNum>
- Test 29: Checks to see if a user has configured a field in a management ACAL rule: macal_example 29 <macalName> <macalRulePrio> <ruleField>
- Test 30: Check if a MACAL list is created: macal_example 30
- Test 31: Check if a MACAL list is activated: macal_example 31
- Test 32: Get the number of packets filtered: macal_example 32
- Test 33: Get the macal deny counter interval: macal_example 33
- Test 34: Set the macal deny counter interval: macal_example 34 <interval>
- Test 35: Get the first available priority (index) for the specified management ACAL: macal_example 35 <macalName>
- Test 36: Checks the specified VRF name is valid or not: macal_example 36 <vrfName>
- Test 37: Clears macal service port statistics: macal_example 37
- Test 38: Check if the Net Filter table support is present on this platform: macal_example 38 <isSupported>
Macal CLI/API Cross Reference