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

Macros

#define OPEN_SECS_PER_MIN   60
 
#define OPEN_SNTP_BUFFER_SIZE   256
 
#define OPEN_SNTP_DATE_STRING_SIZE   21
 

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_PACKET_STATUS_t {
  OPEN_SNTP_STATUS_OTHER = 1, OPEN_SNTP_STATUS_SUCCESS = 2, OPEN_SNTP_STATUS_REQUEST_TIMED_OUT = 3, OPEN_SNTP_STATUS_BAD_DATE_ENCODED = 4,
  OPEN_SNTP_STATUS_VERSION_NOT_SUPPORTED = 5, OPEN_SNTP_STATUS_SERVER_UNSYNCHRONIZED = 6, OPEN_SNTP_STATUS_KISS_OF_DEATH = 7, OPEN_SNTP_STATUS_KOD_RATE_EXCEEDED = 8
}
 
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. More...
 
open_error_t openapiActiveSntpServerIpAddressGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer)
 Get the active SNTP server from which last packet is received. More...
 
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. More...
 
open_error_t openapiActiveSntpServerReferenceIdGet (openapiClientHandle_t *client_handle, open_buffdesc *reference)
 Get the SNTP server reference identifier from which last packet is received. More...
 
open_error_t openapiActiveSntpServerStratumGet (openapiClientHandle_t *client_handle, uint32_t *stratum)
 Get the stratum of the SNTP server from which last packet is received. More...
 
open_error_t openapiSntpClientModeGet (openapiClientHandle_t *client_handle, OPEN_SNTP_CLIENT_MODE_t *sntpClientMode)
 Get the SNTP client mode. More...
 
open_error_t openapiSntpClientModeSet (openapiClientHandle_t *client_handle, OPEN_SNTP_CLIENT_MODE_t mode)
 Set the SNTP client mode. More...
 
open_error_t openapiSntpClientSupportedModeGet (openapiClientHandle_t *client_handle, OPEN_SNTP_SUPPORTED_MODE_t *sntpClientSupportedMode)
 Get the SNTP client supported mode. More...
 
open_error_t openapiSntpServerAdd (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr)
 Add an SNTP server. More...
 
open_error_t openapiSntpServerAddressTypeGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, OPEN_SNTP_ADDRESS_TYPE_t *sntpServerAddrType)
 Get the SNTP server address type. More...
 
open_error_t openapiSntpServerCurrentEntriesGet (openapiClientHandle_t *client_handle, uint32_t *currEntries)
 Get number of SNTP servers configured. More...
 
open_error_t openapiSntpServerDelete (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr)
 Delete an SNTP server. More...
 
open_error_t openapiSntpServerFirstGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer)
 Get the first SNTP server. More...
 
open_error_t openapiSntpServerLastAttemptStatus (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, OPEN_SNTP_PACKET_STATUS_t *sntpLastAttemptStatus)
 Get the SNTP server last attempt status. More...
 
open_error_t openapiSntpServerLastAttemptTime (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, open_buffdesc *sntpLastAttemptTime)
 Get the SNTP server last attempt time. More...
 
open_error_t openapiSntpServerLastUpdatedTime (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, open_buffdesc *sntpLastUpdatedTime)
 Get the SNTP server last updated time. More...
 
open_error_t openapiSntpServerMaxAddrLenGet (openapiClientHandle_t *client_handle, uint32_t *sntpServerAddrLen)
 Get the maximum length of SNTP server address. More...
 
open_error_t openapiSntpServerNextGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, open_buffdesc *nextSntpServer)
 Get the next SNTP server. More...
 
open_error_t openapiSntpServerNumFailedRequests (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint32_t *numFailedRequests)
 Get the SNTP server number of failed requests. More...
 
open_error_t openapiSntpServerNumRequests (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint32_t *numRequests)
 Get the SNTP server number of requests. More...
 
open_error_t openapiSntpServerPortGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint16_t *serverPort)
 Get the SNTP server port. More...
 
open_error_t openapiSntpServerPortSet (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr, uint16_t port)
 Set SNTP server port. More...
 
open_error_t openapiSntpServerPriorityGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint16_t *serverPriority)
 Get the SNTP server priority. More...
 
open_error_t openapiSntpServerPriorityMaxGet (openapiClientHandle_t *client_handle, uint32_t *priorityMax)
 Get the maximum SNTP priority. More...
 
open_error_t openapiSntpServerPrioritySet (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr, uint16_t priority)
 Set priority to the SNTP server. More...
 
open_error_t openapiSntpServerReferenceStringLengthGet (openapiClientHandle_t *client_handle, uint32_t *refStrLen)
 Get the maximum length of the SNTP reference ID string. More...
 
open_error_t openapiSntpServersMaxSupportedGet (openapiClientHandle_t *client_handle, uint32_t *maxSntpServers)
 Get the maximum number of SNTP servers supported. More...
 
open_error_t openapiSntpServerVersionGet (openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint16_t *serverVersion)
 Get the SNTP server version. More...
 
open_error_t openapiSntpServerVersionSet (openapiClientHandle_t *client_handle, open_buffdesc *ipAddr, uint16_t version)
 Set SNTP server version. More...
 

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 67 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 49 of file openapi_sntp.h.

Enumerator
OPEN_SNTP_STATUS_OTHER 

Other.

OPEN_SNTP_STATUS_SUCCESS 

Success.

OPEN_SNTP_STATUS_REQUEST_TIMED_OUT 

Request Timed Out.

OPEN_SNTP_STATUS_BAD_DATE_ENCODED 

Bad Date Encoded.

OPEN_SNTP_STATUS_VERSION_NOT_SUPPORTED 

Version Not Supported.

OPEN_SNTP_STATUS_SERVER_UNSYNCHRONIZED 

Server Unsynchronized.

OPEN_SNTP_STATUS_KISS_OF_DEATH 

Server Kiss Of Death.

OPEN_SNTP_STATUS_KOD_RATE_EXCEEDED 

Kiss of Death as Rate Exceeded.

Definition at line 88 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 76 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 58 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 openapiSntpServerLastAttemptStatus ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer,
OPEN_SNTP_PACKET_STATUS_t sntpLastAttemptStatus 
)

Get the SNTP server last attempt status.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerSNTP server
[out]sntpLastAttemptStatusLast attempt status
Return values
OPEN_E_NONEif SNTP server last attempt status is returned.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_FAILif failed to get SNTP server last attempt status.
OPEN_E_PARAMif invalid parameter is passed.
Note
Buffer size for sntpServer should be OPEN_SNTP_BUFFER_SIZE.

OpEN API Version: 1.19

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

Get the SNTP server last attempt time.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerSNTP server
[out]sntpLastAttemptTimeLast attempt time
Return values
OPEN_E_NONEif SNTP server last attempt time is returned.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_FAILif failed to get SNTP server last attempt time.
OPEN_E_PARAMif invalid parameter is passed.
Note
Buffer size for sntpServer and sntpLastAttemptTime should be OPEN_SNTP_BUFFER_SIZE.

OpEN API Version: 1.19

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

Get the SNTP server last updated time.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerSNTP server
[out]sntpLastUpdatedTimeLast update time
Return values
OPEN_E_NONEif SNTP server last updated time is returned.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_FAILif failed to get SNTP server last update time.
OPEN_E_PARAMif invalid parameter is passed.
Note
Buffer size for sntpServer and sntpLastUpdatedTime should be OPEN_SNTP_BUFFER_SIZE.

OpEN API Version: 1.19

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 openapiSntpServerNumFailedRequests ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer,
uint32_t *  numFailedRequests 
)

Get the SNTP server number of failed requests.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerSNTP server
[out]numFailedRequestsNumber of failed requests
Return values
OPEN_E_NONEif SNTP server last attempt time is returned.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_FAILif failed to get SNTP server number of failed requests.
OPEN_E_PARAMif invalid parameter is passed.
Note
Buffer size for sntpServer should be OPEN_SNTP_BUFFER_SIZE.

OpEN API Version: 1.19

Examples:
sntp_example.c.
open_error_t openapiSntpServerNumRequests ( openapiClientHandle_t client_handle,
open_buffdesc sntpServer,
uint32_t *  numRequests 
)

Get the SNTP server number of requests.

Parameters
[in]client_handleClient handle from registration API
[in]sntpServerSNTP server
[out]numRequestsNumber of requests
Return values
OPEN_E_NONEif SNTP server last attempt time is returned.
OPEN_E_NOT_FOUNDif SNTP server does not exist.
OPEN_E_FAILif failed to get SNTP server number of requests.
OPEN_E_PARAMif invalid parameter is passed.
Note
Buffer size for sntpServer should be OPEN_SNTP_BUFFER_SIZE.

OpEN API Version: 1.19

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.