Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.4.4.5
Welcome
ADK Documentation
API Reference
Files
File List
Globals
api
include
openapi_dhcp_server.h
Go to the documentation of this file.
1
9
/*********************************************************************
10
*
11
* Copyright 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_dhcp_server.h
28
*
29
* @purpose DHCP Server API
30
*
31
* @component OpEN
32
*
33
* @note This code must not include any ICOS header files.
34
*
35
* @create 7/6/2018
36
*
37
* @end
38
*
39
**********************************************************************/
40
#ifndef OPENAPI_DHCP_SERVER_H_INCLUDED
41
#define OPENAPI_DHCP_SERVER_H_INCLUDED
42
43
#include "
openapi_common.h
"
44
46
typedef
enum
47
{
48
OPEN_DHCP_SERVER_POOL_TYPE_INACTIVE
= 0,
49
OPEN_DHCP_SERVER_POOL_TYPE_DYNAMIC
= 1,
50
OPEN_DHCP_SERVER_POOL_TYPE_MANUAL
= 2
51
}
OPEN_DHCP_SERVER_POOL_TYPE_t
;
52
54
typedef
enum
55
{
56
OPEN_DHCP_SERVER_FREE_LEASE
= 0,
57
OPEN_DHCP_SERVER_ACTIVE_LEASE
= 1,
58
OPEN_DHCP_SERVER_OFFERED_LEASE
= 2,
59
OPEN_DHCP_SERVER_EXPIRED_LEASE
= 3,
60
OPEN_DHCP_SERVER_ABANDONED_LEASE
= 4,
61
}
OPEN_DHCP_SERVER_LEASE_STATE_t
;
62
63
#define OPEN_DHCP_SERVER_POOL_NAME_MAXLEN 32
64
#define OPEN_DHCP_SERVER_CLIENT_ID_MAXLEN 256
67
typedef struct
68
{
69
char
name[OPEN_DHCP_SERVER_POOL_NAME_MAXLEN];
70
}
OPEN_DHCP_SERVER_POOL_NAME_t
;
71
73
typedef
struct
74
{
75
char
clientid[OPEN_DHCP_SERVER_CLIENT_ID_MAXLEN];
76
}
OPEN_DHCP_SERVER_CLIENT_ID_t
;
77
79
typedef
enum
80
{
81
OPEN_DHCPS_STAT_ID_RESERVED
= 0,
82
OPEN_DHCPS_STAT_ID_ACTIVE_LEASES
= 1,
83
OPEN_DHCPS_STAT_ID_EXPIRED_LEASES
= 2,
84
OPEN_DHCPS_STAT_ID_MALFORMED_MSGS
= 3,
85
OPEN_DHCPS_STAT_ID_DISCOVER_DROPPED
= 4,
86
OPEN_DHCPS_STAT_ID_RX_DISCOVER
= 5,
87
OPEN_DHCPS_STAT_ID_RX_REQUEST
= 6,
88
OPEN_DHCPS_STAT_ID_RX_DECLINE
= 7,
89
OPEN_DHCPS_STAT_ID_RX_RELEASE
= 8,
90
OPEN_DHCPS_STAT_ID_RX_INFORM
= 9,
91
OPEN_DHCPS_STAT_ID_TX_OFFER
= 10,
92
OPEN_DHCPS_STAT_ID_TX_ACK
= 11,
93
OPEN_DHCPS_STAT_ID_TX_NACK
= 12,
94
OPEN_DHCPS_STAT_ID_LAST
95
}
OPEN_DHCPS_STAT_ID_t
;
96
97
/*****************************************************************/
119
open_error_t
openapiDhcpServerLeaseDataGet
(
openapiClientHandle_t
*client_handle,
120
open_inet_addr_t
*ipaddr,
121
uint32_t *mask,
122
open_buffdesc
*hwaddr,
123
OPEN_DHCP_SERVER_CLIENT_ID_t
*clientId,
124
OPEN_DHCP_SERVER_POOL_NAME_t
*poolName,
125
uint32_t *remaining);
126
127
/*****************************************************************/
142
open_error_t
openapiDhcpServerPoolEntryFirstGet
(
openapiClientHandle_t
*client_handle,
143
uint32_t *poolIndex,
144
OPEN_DHCP_SERVER_POOL_NAME_t
*poolName);
145
146
/*****************************************************************/
162
open_error_t
openapiDhcpServerPoolEntryNextGet
(
openapiClientHandle_t
*client_handle,
163
uint32_t *poolIndex,
164
OPEN_DHCP_SERVER_POOL_NAME_t
*poolName);
165
166
167
/*****************************************************************/
182
open_error_t
openapiDhcpServerPoolTypeGet
(
openapiClientHandle_t
*client_handle,
183
OPEN_DHCP_SERVER_POOL_NAME_t
*poolName,
184
OPEN_DHCP_SERVER_POOL_TYPE_t
*type);
185
186
187
/*****************************************************************/
204
open_error_t
openapiDhcpServerLeaseEntryFirstGet
(
openapiClientHandle_t
*client_handle,
205
OPEN_DHCP_SERVER_POOL_NAME_t
*poolName,
206
uint32_t *leaseIndex,
207
open_inet_addr_t
*ipaddr,
208
OPEN_DHCP_SERVER_LEASE_STATE_t
*state);
209
210
/*****************************************************************/
228
open_error_t
openapiDhcpServerLeaseEntryNextGet
(
openapiClientHandle_t
*client_handle,
229
OPEN_DHCP_SERVER_POOL_NAME_t
*poolName,
230
uint32_t *leaseIndex,
231
open_inet_addr_t
*ipaddr,
232
OPEN_DHCP_SERVER_LEASE_STATE_t
*state);
233
234
/*****************************************************************/
248
open_error_t
openapiDhcpServerStatGet
(
openapiClientHandle_t
*client_handle,
249
OPEN_DHCPS_STAT_ID_t
id
, uint32_t *val);
250
251
#endif
/* OPENAPI_DHCP_SERVER_H_INCLUDED */
252
© 2020 by Broadcom. All rights reserved.