PoE OpEN API
Power over Ethernet feature requires that the switch is equipped with special PoE controller hardware for it to function as a power sourcing equipment. Network switches and routers with the combination of FastPath software and any PoE controller provide an industry standard robust PoE solution for high power applications.
This document provides a brief description of the Power over Ethernet (PoE) OpEN APIs. It provides the following services:
- Get PoE first interface.
- Check PoE support on platform.
- Determine if the interface is capable of PoE.
- Get interface port terminal classification.
- Get interface port sensors.
- Get operational status of the port detection.
- Get interface port error code.
- Get all counters of PSE state machine.
- Find max power limit.
- Get/Set detection mode of a unit.
- Get/Set the current watt limit the PSE can deliver to a port.
- Get/Set port priority value used in management algorithm.
- Get/Set port detection mode of a given interface.
- Get/Set port ability to provide PoE high power.
- Get/Set port ability of power up.
- Get/Set violation type of a given interface.
- Get/Set usage threshold in percent.
- Get/Set the power management mode of the unit.
- Get the total power consumed for a unit.
- Get the PoE firmware version.
- Get the PSE main operational status.
- Get the threshold power.
- Get the total available power.
- Determine whether PoE trap mode is enabled or not.
- Get/Set port timer schedule name for a given interface.
- Reset PoE on a given interface.
- Reset PoE globally.
- Set PoE administrative mode globally.
- Set PoE trap mode.
- Sets port priority value used in management algorithm on all interfaces.
- Sets the current watt limit the PSE can deliver on all interfaces.
- Clear timer schedule to a given interface.
All 'Set' operations may affect the Switch behavior and configuration.
Example C Application poe_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.
poe_example
poe_example.c is a sample application that demonstrates the use of the PoE OpEN APIs. poe_example is started from the command line and has the following usage syntax:
- Usage: poe_example <test#> <arg1> <arg2> ...
- Test 1: Get the PoE first interface: poe_example 1 <poe-type>
- Test 2: Check PoE support on this platform: poe_example 2
- Test 3: Determine if the interface is capable of supporting PoE: poe_example 3 <poe-type> <interface>
- Test 4: Get interface port terminal classification: poe_example 4 <interface>
- Test 5: Get interface port sensors: poe_example 5 <interface>
- Test 6: Get operational status of the port detection: poe_example 6 <interface>
- Test 7: Get interface port error code: poe_example 7 <interface>
- Test 8: Get all counters of PSE state machine: poe_example 8 <interface>
- Test 9: Find max power limit: poe_example 9 <interface>
- Test 10: Get detection mode of a unit: poe_example 10
- Test 11: Set detection mode of a unit: poe_example 11 <detection-mode>
- Test 12: Get the current watt limit the PSE can deliver to a port: poe_example 12 <interface>
- Test 13: Set the current watt limit the PSE can deliver to a port: poe_example 13 <interface> <power-limit>
- Test 14: Get port priority value used in management algorithm: poe_example 14 <interface>
- Test 15: Set port priority value used in management algorithm: poe_example 15 <interface> <power-priority>
- Test 16: Get port detection mode of a given interface: poe_example 16 <interface>
- Test 17: Set port detection mode of a given interface: poe_example 17 <interface> <detection-mode>
- Test 18: Get port ability to provide POE high power: poe_example 18 <interface>
- Test 19: Set port ability to provide POE high power: poe_example 19 <interface> <enable|disable>
- Test 20: Get port ability of power up: poe_example 20 <interface>
- Test 21: Set port ability of power up: poe_example 21 <interface> <af|high-inrush|pre-at|at|upoe>
- Test 22: Get violation type of a given interface: poe_example 22 <interface>
- Test 23: Set violation type of a given interface: poe_example 23 <interface> <violation-type>
- Test 24: Get usage threshold in percent: poe_example 24
- Test 25: Set usage threshold in percent: poe_example 25 <threshold>
- Test 26: Get port administrative mode: poe_example 26 <interface>
- Test 27: Set port administrative mode: poe_example 27 <interface> <adminMode>
- Test 28: Get unit PoE Management mode: poe_example 28 <unit>
- Test 29: Set unit PoE Management mode: poe_example 29 <unit> <static|static-pri|dynamic|dynamic-pri|class>
- Test 30: Get unit total power consumed: poe_example 30 <unit>
- Test 31: Get firmware version: poe_example 31 <unit>
- Test 32: Get main operational status: poe_example 32 <unit>
- Test 33: Get unit threshold power: poe_example 33 <unit>
- Test 34: Get unit total available power: poe_example 34 <unit>
- Test 35: Display whether POE trap mode is enabled or not : poe_example 35 <unit>
- Test 36: Get interface timer schedule name: poe_example 36 <interface>
- Test 37: Reset PoE on a interface: poe_example 37 <interface>
- Test 38: Reset PoE globally: poe_example 38
- Test 39: Set PoE administrative mode globally: poe_example 39 <enabled|disabled>
- Test 40: Set PoE trap mode: poe_example 40 <unit> <enabled|disabled>
- Test 41: Set global priority value used in management algorithm: poe_example 41 <critical|high|medium|low>
- Test 42: Set global current watt limit the PSE can deliver: poe_example 42 <power-limit>
- Test 43: Clear timer schedule ID associated with the given interface: poe_example 43 <interface>
- Test 44: Set interface timer schedule name: poe_example 44 <interface> <timerschedulename>
- Test 45: Test PoE OpEN API Sanity: poe_example 45
It exercises all the PoE OpEN APIs with appropriate arguments to manage the PoE component in the ICOS main process (switchdrvr).
PoE CLI/API Cross Reference