This document provides a brief description of the Port Mirroring OpEN APIs. It provides the following services:
- Get the list of source ports for session.
- Get the direction to be mirrored for a source port.
- Add/Remove interface to the mirrored ports of session.
- Get/Set Destination Port for session.
- Remove Destination Port of session.
- Get/Set the Port Monitoring Mode for session.
- Get count of the sessions of Port Monitoring sessions.
- Remove port monitoring configuration for all sessions.
- Remove port monitoring configuration for specified session.
- Determine status of internal interface number which is configured as destination port.
- Determine status of internal interface number which is configured as source port.
- Get the session in which internal interface number is configured as a source port.
- Check validity of interface for a source port.
- Check validity of interface for a destination port.
- Get first valid interface that can be configured as source port.
- Get next valid interface that can be configured as source port.
- Get list of valid interfaces that can be configured as source port.
- Get first valid interface that can be configured as destination port.
- Get next valid interface that can be configured as destination port.
- Get list of valid interfaces that can be configured as destination port.
- Get/Set the VLAN IDs for session.
- Get the source mirror type(Port based or VLAN based) for session.
- Get the destination mirror type (Port based or VLAN based) for session.
- Get/Set the remote source VLAN for session.
- Get/Set the remote destination VLAN for session.
- Get/Set Monitoring Reflector Port for session.
- Get/Set the IP ACL attached to the mirroring session.
- Get/Set the MAC ACL attached to the mirroring session.
- Get the RSPAN VLAN.
- Get next configured RSPAN VLAN.
- Get/Set list of RSPAN VLAN.
- Check if the VLAN is a RSPAN VLAN.
- Check if the VLAN is source to any of the mirroring sessions.
- Get/Set the Port Monitoring session reserved state.
All 'Set', 'Add' and 'Remove' operations would affect the Switch behavior and configuration.
Example C Application mirror_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.
mirror_example
mirror_example.c is a sample application that demonstrates the use of the Port Mirroring OpEN API. mirror_example is started from the command line and exercises all the Port Mirroring OpEN APIs one by one.
Port Mirroring CLI/API Cross Reference