Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
openapi_sntp.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2016-2018 Broadcom.
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 **********************************************************************
26 *
27 * @filename openapi_sntp.h
28 *
29 * @purpose SNTP Configuration and Status
30 *
31 * @component OpEN
32 *
33 * @create 28/01/2013
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef OPENAPI_SNTP_H_INCLUDED
39 #define OPENAPI_SNTP_H_INCLUDED
40 
41 #include "openapi_common.h"
42 
43 #define OPEN_SNTP_BUFFER_SIZE 256
44 #define OPEN_SECS_PER_MIN 60
45 #define OPEN_SNTP_DATE_STRING_SIZE 21
46 
47 
49 typedef enum
50 {
55 
56 
58 typedef enum
59 {
65 
67 typedef enum
68 {
74 
76 typedef enum
77 {
87 
88 typedef enum
89 {
99 
100 /*****************************************************************/
124  open_buffdesc *ipAddr);
125 
126 /*****************************************************************/
151  open_buffdesc *ipAddr,
152  uint16_t priority);
153 
154 /*****************************************************************/
169  uint32_t *priorityMax);
170 
171 /*****************************************************************/
196  open_buffdesc *ipAddr, uint16_t port);
197 
198 /*****************************************************************/
223  open_buffdesc *ipAddr, uint16_t version);
224 
225 /*****************************************************************/
242  uint32_t *maxSntpServers);
243 
244 /*****************************************************************/
266  open_buffdesc *ipAddr);
267 
268 /*****************************************************************/
283  uint32_t *sntpServerAddrLen);
284 
285 /*****************************************************************/
303  open_buffdesc *sntpServer);
304 
305 /*****************************************************************/
325  open_buffdesc *sntpServer,
326  open_buffdesc *nextSntpServer);
327 
328 /*****************************************************************/
345  open_buffdesc *sntpServer,
346  OPEN_SNTP_ADDRESS_TYPE_t *sntpServerAddrType);
347 
348 /*****************************************************************/
365  open_buffdesc *sntpServer,
366  uint16_t *serverPriority);
367 
368 /*****************************************************************/
385  open_buffdesc *sntpServer,
386  uint16_t *serverVersion);
387 
388 /*****************************************************************/
405  open_buffdesc *sntpServer,
406  uint16_t *serverPort);
407 
408 /*****************************************************************/
429 
430 /*****************************************************************/
445  OPEN_SNTP_CLIENT_MODE_t *sntpClientMode);
446 
447 /*****************************************************************/
462  OPEN_SNTP_SUPPORTED_MODE_t *sntpClientSupportedMode);
463 
464 
465 /*****************************************************************/
482 
483 /*****************************************************************/
503  open_buffdesc *sntpServer);
504 
505 /*****************************************************************/
521  uint32_t *stratum);
522 
523 /*****************************************************************/
539  open_buffdesc *reference);
540 
541 /*****************************************************************/
555  uint32_t *refStrLen);
556 
557 /*****************************************************************/
572  OPEN_SNTP_SERVER_MODE_t *serverMode);
573 
574 /*****************************************************************/
589  uint32_t *currEntries);
590 
591 /*****************************************************************/
612  open_buffdesc *sntpServer,
613  OPEN_SNTP_PACKET_STATUS_t *sntpLastAttemptStatus);
614 
615 /*****************************************************************/
636  open_buffdesc *sntpServer,
637  open_buffdesc *sntpLastUpdatedTime);
638 
639 /*****************************************************************/
660  open_buffdesc *sntpServer,
661  open_buffdesc *sntpLastAttemptTime);
662 
663 /*****************************************************************/
684  open_buffdesc *sntpServer,
685  uint32_t *numRequests);
686 
687 /*****************************************************************/
708  open_buffdesc *sntpServer,
709  uint32_t *numFailedRequests);
710 #endif
711 
Address type IPv4.
Definition: openapi_sntp.h:70
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_SNTP_SUPPORTED_MODE_t
OpEN uses this enumeration to define SNTP supported client modes.
Definition: openapi_sntp.h:58
SNTP client broadcast mode.
Definition: openapi_sntp.h:53
Kiss of Death as Rate Exceeded.
Definition: openapi_sntp.h:97
SNTP client unicast mode.
Definition: openapi_sntp.h:52
SNTP client unicast mode.
Definition: openapi_sntp.h:61
open_error_t openapiSntpClientSupportedModeGet(openapiClientHandle_t *client_handle, OPEN_SNTP_SUPPORTED_MODE_t *sntpClientSupportedMode)
Get the SNTP client supported mode.
OPEN_SNTP_SERVER_MODE_t
OpEN uses this enumeration to define SNTP server modes.
Definition: openapi_sntp.h:76
open_error_t openapiSntpServerReferenceStringLengthGet(openapiClientHandle_t *client_handle, uint32_t *refStrLen)
Get the maximum length of the SNTP reference ID string.
open_error_t openapiSntpServerPortGet(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint16_t *serverPort)
Get the SNTP server port.
open_error_t openapiSntpServerVersionGet(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint16_t *serverVersion)
Get the SNTP server version.
open_error_t openapiSntpServersMaxSupportedGet(openapiClientHandle_t *client_handle, uint32_t *maxSntpServers)
Get the maximum number of SNTP servers supported.
Address type IPv6.
Definition: openapi_sntp.h:71
open_error_t openapiSntpServerDelete(openapiClientHandle_t *client_handle, open_buffdesc *ipAddr)
Delete an SNTP server.
open_error_t
OPEN uses these enumerators to indicate the error codes.
OPEN_SNTP_CLIENT_MODE_t
OpEN uses this enumeration to define SNTP client modes.
Definition: openapi_sntp.h:49
open_error_t openapiSntpServerVersionSet(openapiClientHandle_t *client_handle, open_buffdesc *ipAddr, uint16_t version)
Set SNTP server version.
open_error_t openapiSntpServerAddressTypeGet(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, OPEN_SNTP_ADDRESS_TYPE_t *sntpServerAddrType)
Get the SNTP server address type.
SNTP client mode disabled.
Definition: openapi_sntp.h:51
open_error_t openapiSntpClientModeSet(openapiClientHandle_t *client_handle, OPEN_SNTP_CLIENT_MODE_t mode)
Set the SNTP client mode.
open_error_t openapiSntpServerAdd(openapiClientHandle_t *client_handle, open_buffdesc *ipAddr)
Add an SNTP server.
SNTP client unicast and broadcast modes.
Definition: openapi_sntp.h:63
open_error_t openapiSntpServerNextGet(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, open_buffdesc *nextSntpServer)
Get the next SNTP server.
open_error_t openapiSntpServerMaxAddrLenGet(openapiClientHandle_t *client_handle, uint32_t *sntpServerAddrLen)
Get the maximum length of SNTP server address.
Address type DNS.
Definition: openapi_sntp.h:72
OPEN_SNTP_PACKET_STATUS_t
Definition: openapi_sntp.h:88
open_error_t openapiSntpServerPrioritySet(openapiClientHandle_t *client_handle, open_buffdesc *ipAddr, uint16_t priority)
Set priority to the SNTP server.
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 openapiActiveSntpServerStratumGet(openapiClientHandle_t *client_handle, uint32_t *stratum)
Get the stratum of the SNTP server from which last packet is received.
open_error_t openapiSntpServerPortSet(openapiClientHandle_t *client_handle, open_buffdesc *ipAddr, uint16_t port)
Set SNTP server port.
open_error_t openapiSntpServerNumRequests(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint32_t *numRequests)
Get the SNTP server number of requests.
Server Kiss Of Death.
Definition: openapi_sntp.h:96
SNTP client broadcast mode.
Definition: openapi_sntp.h:62
open_error_t openapiSntpServerLastAttemptTime(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, open_buffdesc *sntpLastAttemptTime)
Get the SNTP server last attempt time.
open_error_t openapiSntpServerPriorityMaxGet(openapiClientHandle_t *client_handle, uint32_t *priorityMax)
Get the maximum SNTP priority.
open_error_t openapiSntpServerFirstGet(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer)
Get the first SNTP server.
open_error_t openapiSntpServerLastUpdatedTime(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, open_buffdesc *sntpLastUpdatedTime)
Get the SNTP server last updated time.
OPEN_SNTP_ADDRESS_TYPE_t
OpEN uses this enumeration to define SNTP address types.
Definition: openapi_sntp.h:67
Address type unknown.
Definition: openapi_sntp.h:69
open_error_t openapiSntpServerLastAttemptStatus(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, OPEN_SNTP_PACKET_STATUS_t *sntpLastAttemptStatus)
Get the SNTP server last attempt status.
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 openapiActiveSntpServerReferenceIdGet(openapiClientHandle_t *client_handle, open_buffdesc *reference)
Get the SNTP server reference identifier from which last packet is received.
open_error_t openapiSntpServerNumFailedRequests(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint32_t *numFailedRequests)
Get the SNTP server number of failed requests.
open_error_t openapiSntpServerCurrentEntriesGet(openapiClientHandle_t *client_handle, uint32_t *currEntries)
Get number of SNTP servers configured.
SNTP client mode disabled.
Definition: openapi_sntp.h:60
open_error_t openapiSntpServerPriorityGet(openapiClientHandle_t *client_handle, open_buffdesc *sntpServer, uint16_t *serverPriority)
Get the SNTP server priority.
open_error_t openapiSntpClientModeGet(openapiClientHandle_t *client_handle, OPEN_SNTP_CLIENT_MODE_t *sntpClientMode)
Get the SNTP client mode.