Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.9.0.2
Welcome
ADK Documentation
API Reference
Files
File List
Globals
api
include
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
{
51
OPEN_SNTP_CLIENT_DISABLED
= 0,
52
OPEN_SNTP_CLIENT_UNICAST
= 1,
53
OPEN_SNTP_CLIENT_BROADCAST
= 2
54
}
OPEN_SNTP_CLIENT_MODE_t
;
55
56
58
typedef
enum
59
{
60
OPEN_SNTP_SUPPORTED_DISABLED
= 0,
61
OPEN_SNTP_SUPPORTED_UNICAST
= 1,
62
OPEN_SNTP_SUPPORTED_BROADCAST
= 2,
63
OPEN_SNTP_SUPPORTED_UNICAST_AND_BROADCAST
= 3
64
}
OPEN_SNTP_SUPPORTED_MODE_t
;
65
67
typedef
enum
68
{
69
OPEN_SNTP_ADDRESS_UNKNOWN
= 0,
70
OPEN_SNTP_ADDRESS_IPV4
= 1,
71
OPEN_SNTP_ADDRESS_IPV6
= 2,
72
OPEN_SNTP_ADDRESS_DNS
= 3
73
}
OPEN_SNTP_ADDRESS_TYPE_t
;
74
76
typedef
enum
77
{
78
OPEN_SNTP_SERVER_MODE_RESERVED
= 0,
79
OPEN_SNTP_SERVER_MODE_SYMMETRIC_ACTIVE
= 1,
80
OPEN_SNTP_SERVER_MODE_SYMMETRIC_PASSIVE
= 2,
81
OPEN_SNTP_SERVER_MODE_CLIENT
= 3,
82
OPEN_SNTP_SERVER_MODE_SERVER
= 4,
83
OPEN_SNTP_SERVER_MODE_BROADCAST
= 5,
84
OPEN_SNTP_SERVER_MODE_RESERVED_CONTROL
= 6,
85
OPEN_SNTP_SERVER_MODE_RESERVED_PRIVATE
= 7
86
}
OPEN_SNTP_SERVER_MODE_t
;
87
88
typedef
enum
89
{
90
OPEN_SNTP_STATUS_OTHER
= 1,
91
OPEN_SNTP_STATUS_SUCCESS
= 2,
92
OPEN_SNTP_STATUS_REQUEST_TIMED_OUT
= 3,
93
OPEN_SNTP_STATUS_BAD_DATE_ENCODED
= 4,
94
OPEN_SNTP_STATUS_VERSION_NOT_SUPPORTED
= 5,
95
OPEN_SNTP_STATUS_SERVER_UNSYNCHRONIZED
= 6,
96
OPEN_SNTP_STATUS_KISS_OF_DEATH
= 7,
97
OPEN_SNTP_STATUS_KOD_RATE_EXCEEDED
= 8
98
}
OPEN_SNTP_PACKET_STATUS_t
;
99
100
/*****************************************************************/
123
open_error_t
openapiSntpServerAdd
(
openapiClientHandle_t
*client_handle,
124
open_buffdesc
*ipAddr);
125
126
/*****************************************************************/
150
open_error_t
openapiSntpServerPrioritySet
(
openapiClientHandle_t
*client_handle,
151
open_buffdesc
*ipAddr,
152
uint16_t priority);
153
154
/*****************************************************************/
168
open_error_t
openapiSntpServerPriorityMaxGet
(
openapiClientHandle_t
*client_handle,
169
uint32_t *priorityMax);
170
171
/*****************************************************************/
195
open_error_t
openapiSntpServerPortSet
(
openapiClientHandle_t
*client_handle,
196
open_buffdesc
*ipAddr, uint16_t port);
197
198
/*****************************************************************/
222
open_error_t
openapiSntpServerVersionSet
(
openapiClientHandle_t
*client_handle,
223
open_buffdesc
*ipAddr, uint16_t version);
224
225
/*****************************************************************/
241
open_error_t
openapiSntpServersMaxSupportedGet
(
openapiClientHandle_t
*client_handle,
242
uint32_t *maxSntpServers);
243
244
/*****************************************************************/
265
open_error_t
openapiSntpServerDelete
(
openapiClientHandle_t
*client_handle,
266
open_buffdesc
*ipAddr);
267
268
/*****************************************************************/
282
open_error_t
openapiSntpServerMaxAddrLenGet
(
openapiClientHandle_t
*client_handle,
283
uint32_t *sntpServerAddrLen);
284
285
/*****************************************************************/
302
open_error_t
openapiSntpServerFirstGet
(
openapiClientHandle_t
*client_handle,
303
open_buffdesc
*sntpServer);
304
305
/*****************************************************************/
324
open_error_t
openapiSntpServerNextGet
(
openapiClientHandle_t
*client_handle,
325
open_buffdesc
*sntpServer,
326
open_buffdesc
*nextSntpServer);
327
328
/*****************************************************************/
344
open_error_t
openapiSntpServerAddressTypeGet
(
openapiClientHandle_t
*client_handle,
345
open_buffdesc
*sntpServer,
346
OPEN_SNTP_ADDRESS_TYPE_t
*sntpServerAddrType);
347
348
/*****************************************************************/
364
open_error_t
openapiSntpServerPriorityGet
(
openapiClientHandle_t
*client_handle,
365
open_buffdesc
*sntpServer,
366
uint16_t *serverPriority);
367
368
/*****************************************************************/
384
open_error_t
openapiSntpServerVersionGet
(
openapiClientHandle_t
*client_handle,
385
open_buffdesc
*sntpServer,
386
uint16_t *serverVersion);
387
388
/*****************************************************************/
404
open_error_t
openapiSntpServerPortGet
(
openapiClientHandle_t
*client_handle,
405
open_buffdesc
*sntpServer,
406
uint16_t *serverPort);
407
408
/*****************************************************************/
427
open_error_t
openapiSntpClientModeSet
(
openapiClientHandle_t
*client_handle,
428
OPEN_SNTP_CLIENT_MODE_t
mode);
429
430
/*****************************************************************/
444
open_error_t
openapiSntpClientModeGet
(
openapiClientHandle_t
*client_handle,
445
OPEN_SNTP_CLIENT_MODE_t
*sntpClientMode);
446
447
/*****************************************************************/
461
open_error_t
openapiSntpClientSupportedModeGet
(
openapiClientHandle_t
*client_handle,
462
OPEN_SNTP_SUPPORTED_MODE_t
*sntpClientSupportedMode);
463
464
465
/*****************************************************************/
480
open_error_t
openapiActiveSntpServerAddressTypeGet
(
openapiClientHandle_t
*client_handle,
481
OPEN_SNTP_ADDRESS_TYPE_t
*type);
482
483
/*****************************************************************/
502
open_error_t
openapiActiveSntpServerIpAddressGet
(
openapiClientHandle_t
*client_handle,
503
open_buffdesc
*sntpServer);
504
505
/*****************************************************************/
520
open_error_t
openapiActiveSntpServerStratumGet
(
openapiClientHandle_t
*client_handle,
521
uint32_t *stratum);
522
523
/*****************************************************************/
538
open_error_t
openapiActiveSntpServerReferenceIdGet
(
openapiClientHandle_t
*client_handle,
539
open_buffdesc
*reference);
540
541
/*****************************************************************/
554
open_error_t
openapiSntpServerReferenceStringLengthGet
(
openapiClientHandle_t
*client_handle,
555
uint32_t *refStrLen);
556
557
/*****************************************************************/
571
open_error_t
openapiActiveSntpServerModeGet
(
openapiClientHandle_t
*client_handle,
572
OPEN_SNTP_SERVER_MODE_t
*serverMode);
573
574
/*****************************************************************/
588
open_error_t
openapiSntpServerCurrentEntriesGet
(
openapiClientHandle_t
*client_handle,
589
uint32_t *currEntries);
590
591
/*****************************************************************/
611
open_error_t
openapiSntpServerLastAttemptStatus
(
openapiClientHandle_t
*client_handle,
612
open_buffdesc
*sntpServer,
613
OPEN_SNTP_PACKET_STATUS_t
*sntpLastAttemptStatus);
614
615
/*****************************************************************/
635
open_error_t
openapiSntpServerLastUpdatedTime
(
openapiClientHandle_t
*client_handle,
636
open_buffdesc
*sntpServer,
637
open_buffdesc
*sntpLastUpdatedTime);
638
639
/*****************************************************************/
659
open_error_t
openapiSntpServerLastAttemptTime
(
openapiClientHandle_t
*client_handle,
660
open_buffdesc
*sntpServer,
661
open_buffdesc
*sntpLastAttemptTime);
662
663
/*****************************************************************/
683
open_error_t
openapiSntpServerNumRequests
(
openapiClientHandle_t
*client_handle,
684
open_buffdesc
*sntpServer,
685
uint32_t *numRequests);
686
687
/*****************************************************************/
707
open_error_t
openapiSntpServerNumFailedRequests
(
openapiClientHandle_t
*client_handle,
708
open_buffdesc
*sntpServer,
709
uint32_t *numFailedRequests);
710
#endif
711
© 2022 by Broadcom. All rights reserved.