Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.4.4.5
Enumerations | Functions
SNTP Configuration And Status [OPENAPI_SNTP]
API Definitions

Enumerations

enum  OPEN_SNTP_ADDRESS_TYPE_t { OPEN_SNTP_ADDRESS_UNKNOWN = 0, OPEN_SNTP_ADDRESS_IPV4 = 1, OPEN_SNTP_ADDRESS_IPV6 = 2, OPEN_SNTP_ADDRESS_DNS = 3 }
 OpEN uses this enumeration to define SNTP address types. More...
 
enum  OPEN_SNTP_CLIENT_MODE_t { OPEN_SNTP_CLIENT_DISABLED = 0, OPEN_SNTP_CLIENT_UNICAST = 1, OPEN_SNTP_CLIENT_BROADCAST = 2 }
 OpEN uses this enumeration to define SNTP client modes. More...
 
enum  OPEN_SNTP_SERVER_MODE_t {
  OPEN_SNTP_SERVER_MODE_RESERVED = 0, OPEN_SNTP_SERVER_MODE_SYMMETRIC_ACTIVE = 1, OPEN_SNTP_SERVER_MODE_SYMMETRIC_PASSIVE = 2, OPEN_SNTP_SERVER_MODE_CLIENT = 3,
  OPEN_SNTP_SERVER_MODE_SERVER = 4, OPEN_SNTP_SERVER_MODE_BROADCAST = 5, OPEN_SNTP_SERVER_MODE_RESERVED_CONTROL = 6, OPEN_SNTP_SERVER_MODE_RESERVED_PRIVATE = 7
}
 OpEN uses this enumeration to define SNTP server modes. More...
 
enum  OPEN_SNTP_SUPPORTED_MODE_t { OPEN_SNTP_SUPPORTED_DISABLED = 0, OPEN_SNTP_SUPPORTED_UNICAST = 1, OPEN_SNTP_SUPPORTED_BROADCAST = 2, OPEN_SNTP_SUPPORTED_UNICAST_AND_BROADCAST = 3 }
 OpEN uses this enumeration to define SNTP supported client modes. More...
 

Functions

open_error_t openapiActiveSntpServerAddressTypeGet (openapiClientHandle_t *client_handle, OPEN_SNTP_ADDRESS_TYPE_t *type)
 Get the active SNTP server address type from which last packet is received.
 
open_error_t openapiActiveSntpServerIpAddressGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer)
 Get the active SNTP server from which last packet is received.
 
open_error_t openapiActiveSntpServerModeGet (openapiClientHandle_t *client_handle, OPEN_SNTP_SERVER_MODE_t *serverMode)
 Get the mode of the SNTP server from which last packet is received.
 
open_error_t openapiActiveSntpServerReferenceIdGet (openapiClientHandle_t *client_handle, open_buffdesc *reference)
 Get the SNTP server reference identifier from which last packet is received.
 
open_error_t openapiActiveSntpServerStratumGet (openapiClientHandle_t *client_handle, uint32_t *stratum)
 Get the stratum of the SNTP server from which last packet is received.
 
open_error_t openapiSntpClientModeGet (openapiClientHandle_t *client_handle, OPEN_SNTP_CLIENT_MODE_t *sntpClientMode)
 Get the SNTP client mode.
 
open_error_t openapiSntpClientModeSet (openapiClientHandle_t *client_handle, OPEN_SNTP_CLIENT_MODE_t mode)
 Set the SNTP client mode.
 
open_error_t openapiSntpClientSupportedModeGet (openapiClientHandle_t *client_handle, OPEN_SNTP_SUPPORTED_MODE_t *sntpClientSupportedMode)
 Get the SNTP client supported mode.
 
open_error_t openapiSntpServerAdd (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr)
 Add an SNTP server.
 
open_error_t openapiSntpServerAddressTypeGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, OPEN_SNTP_ADDRESS_TYPE_t *sntpServerAddrType)
 Get the SNTP server address type.
 
open_error_t openapiSntpServerCurrentEntriesGet (openapiClientHandle_t *client_handle, uint32_t *currEntries)
 Get number of SNTP servers configured.
 
open_error_t openapiSntpServerDelete (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr)
 Delete an SNTP server.
 
open_error_t openapiSntpServerFirstGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer)
 Get the first SNTP server.
 
open_error_t openapiSntpServerMaxAddrLenGet (openapiClientHandle_t *client_handle, uint32_t *sntpServerAddrLen)
 Get the maximum length of SNTP server address.
 
open_error_t openapiSntpServerNextGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, open_buffdesc *nextSntpServer)
 Get the next SNTP server.
 
open_error_t openapiSntpServerPortGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint16_t *serverPort)
 Get the SNTP server port.
 
open_error_t openapiSntpServerPortSet (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr, uint16_t port)
 Set SNTP server port.
 
open_error_t openapiSntpServerPriorityGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint16_t *serverPriority)
 Get the SNTP server priority.
 
open_error_t openapiSntpServerPriorityMaxGet (openapiClientHandle_t *client_handle, uint32_t *priorityMax)
 Get the maximum SNTP priority.
 
open_error_t openapiSntpServerPrioritySet (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr, uint16_t priority)
 Set priority to the SNTP server.
 
open_error_t openapiSntpServerReferenceStringLengthGet (openapiClientHandle_t *client_handle, uint32_t *refStrLen)
 Get the maximum length of the SNTP reference ID string.
 
open_error_t openapiSntpServersMaxSupportedGet (openapiClientHandle_t *client_handle, uint32_t *maxSntpServers)
 Get the maximum number of SNTP servers supported.
 
open_error_t openapiSntpServerVersionGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint16_t *serverVersion)
 Get the SNTP server version.
 
open_error_t openapiSntpServerVersionSet (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr, uint16_t version)
 Set SNTP server version.
 

Detailed Description

Enumeration Type Documentation

OpEN uses this enumeration to define SNTP address types.

Enumerator:
OPEN_SNTP_ADDRESS_UNKNOWN 

Address type unknown.

OPEN_SNTP_ADDRESS_IPV4 

Address type IPv4.

OPEN_SNTP_ADDRESS_IPV6 

Address type IPv6.

OPEN_SNTP_ADDRESS_DNS 

Address type DNS.

Definition at line 62 of file openapi_sntp.h.

OpEN uses this enumeration to define SNTP client modes.

Enumerator:
OPEN_SNTP_CLIENT_DISABLED 

SNTP client mode disabled.

OPEN_SNTP_CLIENT_UNICAST 

SNTP client unicast mode.

OPEN_SNTP_CLIENT_BROADCAST 

SNTP client broadcast mode.

Definition at line 44 of file openapi_sntp.h.

OpEN uses this enumeration to define SNTP server modes.

Enumerator:
OPEN_SNTP_SERVER_MODE_RESERVED 

Reserved Mode.

OPEN_SNTP_SERVER_MODE_SYMMETRIC_ACTIVE 

Symmetric Active Mode.

OPEN_SNTP_SERVER_MODE_SYMMETRIC_PASSIVE 

Symmetric Passive Mode.

OPEN_SNTP_SERVER_MODE_CLIENT 

Client Mode.

OPEN_SNTP_SERVER_MODE_SERVER 

Server Mode.

OPEN_SNTP_SERVER_MODE_BROADCAST 

Broadcast Mode.

OPEN_SNTP_SERVER_MODE_RESERVED_CONTROL 

Reserved Control Mode.

OPEN_SNTP_SERVER_MODE_RESERVED_PRIVATE 

Reserved Private Mode.

Definition at line 71 of file openapi_sntp.h.

OpEN uses this enumeration to define SNTP supported client modes.

Enumerator:
OPEN_SNTP_SUPPORTED_DISABLED 

SNTP client mode disabled.

OPEN_SNTP_SUPPORTED_UNICAST 

SNTP client unicast mode.

OPEN_SNTP_SUPPORTED_BROADCAST 

SNTP client broadcast mode.

OPEN_SNTP_SUPPORTED_UNICAST_AND_BROADCAST 

SNTP client unicast and broadcast modes.

Definition at line 53 of file openapi_sntp.h.

Function Documentation

open_error_t openapiActiveSntpServerAddressTypeGet ( openapiClientHandle_t client_handle,
OPEN_SNTP_ADDRESS_TYPE_t type 
)

Get the active SNTP server address type from which last packet is received.

Parameters
[in]client_handleClient handle from registration API
[out]typeSNTP server address type
Return values
OPEN_E_NONEif active SNTP server address type is returned.
OPEN_E_FAILif failed to get active SNTP server type.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiActiveSntpServerIpAddressGet ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer 
)

Get the active SNTP server from which last packet is received.

Parameters
[in]client_handleClient handle from registration API
[out]sntpServerActive SNTP server
Return values
OPEN_E_NONEif active SNTP server address is returned.
OPEN_E_FAILif there are no active SNTP servers .
OPEN_E_PARAMif invalid parameter is passed.
OPEN_E_INTERNALif internal error.
Note
Maximum size for ipAddr is determined by calling openapiSntpServerMaxAddrLenGet().

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiActiveSntpServerModeGet ( openapiClientHandle_t client_handle,
OPEN_SNTP_SERVER_MODE_t serverMode 
)

Get the mode of the SNTP server from which last packet is received.

Parameters
[in]client_handleClient handle from registration API
[out]serverModeSNTP server mode
Return values
OPEN_E_NONEif SNTP server mode is returned.
OPEN_E_FAILif failed to get SNTP server mode.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiActiveSntpServerReferenceIdGet ( openapiClientHandle_t client_handle,
open_buffdesc reference 
)

Get the SNTP server reference identifier from which last packet is received.

Parameters
[in]client_handleClient handle from registration API
[out]referenceReference Identifier of SNTP server
Return values
OPEN_E_NONEif reference of the SNTP server is returned.
OPEN_E_FAILif failed to get reference of SNTP server.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiActiveSntpServerStratumGet ( openapiClientHandle_t client_handle,
uint32_t *  stratum 
)

Get the stratum of the SNTP server from which last packet is received.

Parameters
[in]client_handleClient handle from registration API
[out]stratumStratum of the SNTP server
Return values
OPEN_E_NONEif stratum of the SNTP server is returned.
OPEN_E_FAILif failed to get stratum of SNTP server.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpClientModeGet ( openapiClientHandle_t client_handle,
OPEN_SNTP_CLIENT_MODE_t sntpClientMode 
)

Get the SNTP client mode.

Parameters
[in]client_handleClient handle from registration API
[out]sntpClientModeSNTP client mode
Return values
OPEN_E_NONEif SNTP client mode is returned.
OPEN_E_FAILif failed to get SNTP client mode.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpClientModeSet ( openapiClientHandle_t client_handle,
OPEN_SNTP_CLIENT_MODE_t  mode 
)

Set the SNTP client mode.

Parameters
[in]client_handleClient handle from registration API
[in]modeSNTP client mode
Return values
OPEN_E_NONEif SNTP client mode is set successfully.
OPEN_E_FAILif failed to set SNTP client mode.
OPEN_E_ERRORif invalid SNTP client mode
OPEN_E_INTERNALif internal error.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.
To unconfigure SNTP client mode, pass the mode as OPEN_SNTP_CLIENT_DISABLED.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpClientSupportedModeGet ( openapiClientHandle_t client_handle,
OPEN_SNTP_SUPPORTED_MODE_t sntpClientSupportedMode 
)

Get the SNTP client supported mode.

Parameters
[in]client_handleClient handle from registration API
[out]sntpClientSupportedModeSNTP client supported mode
Return values
OPEN_E_NONEif SNTP client supported mode is returned.
OPEN_E_FAILif failed to get SNTP client mode.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerAdd ( openapiClientHandle_t client_handle,
open_buffdesc ipAddr 
)

Add an SNTP server.

Parameters
[in]client_handleClient handle from registration API
[in]ipAddrBuff descriptor for IP address of SNTP server - DNS, IPV4 and IPv6 addresses
Return values
OPEN_E_NONEif SNTP server is added successfully.
OPEN_E_FAILif failed to add SNTP server.
OPEN_E_EXISTSif the server is already configured.
OPEN_E_FULLif no more space is available to add the server.
OPEN_E_INTERNALif internal error.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.
Maximum size for ipAddr is determined by calling openapiSntpServerMaxAddrLenGet().

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerAddressTypeGet ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer,
OPEN_SNTP_ADDRESS_TYPE_t sntpServerAddrType 
)

Get the SNTP server address type.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerSNTP server
[out]sntpServerAddrTypeSNTP server address type
Return values
OPEN_E_NONEif SNTP server address type is returned.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_FAILif failed to get SNTP server address type.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerCurrentEntriesGet ( openapiClientHandle_t client_handle,
uint32_t *  currEntries 
)

Get number of SNTP servers configured.

Parameters
[in]client_handleClient handle from registration API
[out]currEntriesNumber of SNTP servers configured.
Return values
OPEN_E_NONEif current number of SNTP servers is returned.
OPEN_E_FAILif failed to get current number of SNTP servers.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerDelete ( openapiClientHandle_t client_handle,
open_buffdesc ipAddr 
)

Delete an SNTP server.

Parameters
[in]client_handleClient handle from registration API
[in]ipAddrBuff Descriptor for IP address of SNTP server - DNS, IPV4 and IPv6 addresses
Return values
OPEN_E_NONEif SNTP server is deleted successfully.
OPEN_E_FAILif failed to delete SNTP server.
OPEN_E_NOT_FOUNDif SNTP server is not found.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.
Maximum size for ipAddr is determined by calling openapiSntpServerMaxAddrLenGet().

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerFirstGet ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer 
)

Get the first SNTP server.

Parameters
[in]client_handleClient handle from registration API
[out]sntpServerSNTP server
Return values
OPEN_E_NONEif first SNTP server is returned.
OPEN_E_FAILif SNTP server does not exist.
OPEN_E_PARAMif invalid parameter is passed.
Note
Maximum size for ipAddr is determined by calling openapiSntpServerMaxAddrLenGet().

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerMaxAddrLenGet ( openapiClientHandle_t client_handle,
uint32_t *  sntpServerAddrLen 
)

Get the maximum length of SNTP server address.

Parameters
[in]client_handleClient handle from registration API
[out]sntpServerAddrLenMaximum length of SNTP server address
Return values
OPEN_E_NONEif SNTP server address length is returned successfully.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerNextGet ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer,
open_buffdesc nextSntpServer 
)

Get the next SNTP server.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerPrevious SNTP server
[out]nextSntpServerNext SNTP server
Return values
OPEN_E_NONEif next SNTP server is returned.
OPEN_E_NOT_FOUNDif next SNTP server does not exist.
OPEN_E_FAILif previous SNTP server is invalid.
OPEN_E_PARAMif invalid parameter is passed.
Note
Maximum size for ipAddr is determined by calling openapiSntpServerMaxAddrLenGet().

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerPortGet ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer,
uint16_t *  serverPort 
)

Get the SNTP server port.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerSNTP server
[out]serverPortSNTP server port
Return values
OPEN_E_NONEif SNTP server port is returned.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_FAILif failed to get SNTP server port.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerPortSet ( openapiClientHandle_t client_handle,
open_buffdesc ipAddr,
uint16_t  port 
)

Set SNTP server port.

Parameters
[in]client_handleClient handle from registration API
[in]ipAddrBuff descriptor for IP address of SNTP server - DNS, IPV4 and IPv6 addresses
[in]portSNTP server port
-Minimum value OPENAPI_SNTP_MIN_SERVER_PORT
-Maximum value OPENAPI_SNTP_MAX_SERVER_PORT
Return values
OPEN_E_NONEif SNTP server port is set successfully.
OPEN_E_FAILif failed to set SNTP server port.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.
Maximum size for ipAddr is determined by calling openapiSntpServerMaxAddrLenGet().

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerPriorityGet ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer,
uint16_t *  serverPriority 
)

Get the SNTP server priority.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerSNTP server
[out]serverPrioritySNTP server priority
Return values
OPEN_E_NONEif SNTP server priority is returned.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_FAILif failed to get SNTP server priority.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerPriorityMaxGet ( openapiClientHandle_t client_handle,
uint32_t *  priorityMax 
)

Get the maximum SNTP priority.

Parameters
[in]client_handleClient handle from registration API
[out]priorityMaxMaximum priority
Return values
OPEN_E_NONEif SNTP priority is returned successfully.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerPrioritySet ( openapiClientHandle_t client_handle,
open_buffdesc ipAddr,
uint16_t  priority 
)

Set priority to the SNTP server.

Parameters
[in]client_handleClient handle from registration API
[in]ipAddrBuff descriptor for IP address of SNTP server - DNS, IPV4 and IPv6 addresses
[in]prioritySNTP server priority
-Minimum value OPENAPI_SNTP_MIN_SERVER_PRIORITY
-Maximum value openapiSntpServerPriorityMaxGet()
Return values
OPEN_E_NONEif SNTP server priority is set successfully.
OPEN_E_FAILif failed to set SNTP server priority.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.
Maximum size for ipAddr is determined by calling openapiSntpServerMaxAddrLenGet().

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerReferenceStringLengthGet ( openapiClientHandle_t client_handle,
uint32_t *  refStrLen 
)

Get the maximum length of the SNTP reference ID string.

Parameters
[in]client_handleClient handle from registration API
[out]refStrLenReference ID string length
Return values
OPEN_E_NONEif reference ID string length id returned.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServersMaxSupportedGet ( openapiClientHandle_t client_handle,
uint32_t *  maxSntpServers 
)

Get the maximum number of SNTP servers supported.

Parameters
[in]client_handleClient handle from registration API
[out]maxSntpServersMaximum number of SNTP servers supported
Return values
OPEN_E_NONEif the maximum number of SNTP servers is returned.
OPEN_E_FAILif failed to get maximum number of SNTP servers.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerVersionGet ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer,
uint16_t *  serverVersion 
)

Get the SNTP server version.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerSNTP server
[out]serverVersionSNTP server version
Return values
OPEN_E_NONEif SNTP server version is returned.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_FAILif failed to get SNTP server version.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.1

Examples:
sntp_example.c.
open_error_t openapiSntpServerVersionSet ( openapiClientHandle_t client_handle,
open_buffdesc ipAddr,
uint16_t  version 
)

Set SNTP server version.

Parameters
[in]client_handleClient handle from registration API
[in]ipAddrBuff descriptor for IP address of SNTP server - DNS, IPV4 and IPv6 addresses
[in]versionSNTP server version
-Minimum value OPENAPI_SNTP_VERSION_MIN
-Maximum value OPENAPI_SNTP_VERSION_MAX
Return values
OPEN_E_NONEif SNTP server version is set successfully.
OPEN_E_FAILif failed to set SNTP server version.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.
Maximum size for ipAddr is determined by calling openapiSntpServerMaxAddrLenGet().

OpEN API Version: 1.1

Examples:
sntp_example.c.