Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
LinuxPTP API

This document provides a brief description of the LinuxPTP OpEN APIs. It provides the following services:

Example C Application linuxptp_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.

linuxptp_example

linuxptp_example.c is a sample application that demonstrates the use of OpEN's LinuxPTP APIs. linuxptp_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

LinuxPTP CLI/API Cross Reference

CLI Command OpEN API Reference
(Config)#
[no] ptp
openapiLinuxptpAdminModeSet()
(Priv-User Mode)#
show ptp summary
openapiLinuxptpAdminModeGet()
openapiLinuxptpBridgePriorityGet()
openapiLinuxptpSourceIPv4AddrGet()
openapiLinuxptpSourceIPv6AddrGet()
openapiLinuxptpProfileGet()
openapiLinuxptpTransportGet()
openapiLinuxptpAnnounceIntervalGet()
openapiLinuxptpAnnounceTimeoutGet()
openapiLinuxptpSyncIntervalGet()
openapiLinuxptpDelayRequestIntervalGet()
openapiLinuxptpLoggingGet()
openapiLinuxptpPdelayRequestIntervalGet()
openapiLinuxptpDomainGet()
openapiLinuxptpDelayMechanismGet()
(Interface-Config Mode)#
[no] ptp
openapiLinuxptpIntfAdminModeSet()
(Priv-User Mode)#
show ptp interface <slot/port>
openapiLinuxptpIntfAdminModeGet()
openapiLinuxptpIntfStateGet()
openapiLinuxptpIntfDelayGet()
openapiLinuxptpIntfOperStateGet()
(Priv-User Mode)#
show ptp boundary-clock
openapiLinuxptpClockMeanPathDelayGet()
openapiLinuxptpClockParamGet()
openapiLinuxptpClockOperModeGet()
openapiLinuxptpClockStepsRemovedGet()
openapiLinuxptpClockOffsetFromMaster()
openapiLinuxptpClockRoleGet()
(Priv-User Mode)#
show ptp statistics <slot/port>
openapiLinuxptpIntfStatsGet()
(Priv-User Mode)#
show ptp parent
openapiLinuxptpClockIdGet()
(Config)#
[no] ptp priority1 <value>
openapiLinuxptpBridgePrioritySet()
(Config)#
[no] ptp priority2 <value>
openapiLinuxptpBridgePrioritySet()
(Config)#
[no] ptp clock-operation <two-step>
openapiLinuxptpClockOperModeSet()
(Config)#
[no] ptp source ipv4-address <ip address>
openapiLinuxptpSourceIPv4AddrSet()
(Config)#
[no] ptp source ipv6-address <ipv6 address>
openapiLinuxptpSourceIPv6AddrSet()
(Config)#
[no] ptp profile <value>
openapiLinuxptpProfileSet()
(Config)#
[no] ptp profile default transport <ethernet or ipv4 or ipv6>
openapiLinuxptpTransportSet()
(Config)#
[no] ptp profile <profile-name> announce <value>
openapiLinuxptpAnnounceIntervalSet()
(Config)#
[no] ptp profile <profile-name> announce timeout-count <value>
openapiLinuxptpAnnounceTimeoutSet()
(Config)#
[no] ptp profile <profile-name> sync <value>
openapiLinuxptpSyncIntervalSet()
(Config)#
[no] ptp profile <profile-name> delay-request <value>
openapiLinuxptpDelayRequestIntervalSet()
(Config)#
[no] ptp profile <profile-name> pdelay-request <value>
openapiLinuxptpPdelayRequestIntervalSet()
(Config)#
[no] ptp profile <profile-name> domain <value>
openapiLinuxptpDomainSet()
(Config)#
[no] ptp profile <profile-name> delay-mechanism <value>
openapiLinuxptpDelayMechanismSet()
(Config)#
[no] ptp logginf <value>
openapiLinuxptpLoggingSet()
(Priv-User Mode)#
clear statistics all
openapiLinuxptpIntfStatsClear()
(Priv-User Mode)#
show ptp time-properties
openapiLinuxptpTimePropGet()
(Config)#
[no] ptp path-trace
openapiLinuxptpPathTraceTlvSet()
(Priv-User Mode)#
show ptp path-trace
openapiLinuxptpPathTraceClockIdGetNext()