RDK-B
dhcpv4c_api.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's LICENSE file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**********************************************************************
21  Copyright [2014] [Cisco Systems, Inc.]
22 
23  Licensed under the Apache License, Version 2.0 (the "License");
24  you may not use this file except in compliance with the License.
25  You may obtain a copy of the License at
26 
27  http://www.apache.org/licenses/LICENSE-2.0
28 
29  Unless required by applicable law or agreed to in writing, software
30  distributed under the License is distributed on an "AS IS" BASIS,
31  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32  See the License for the specific language governing permissions and
33  limitations under the License.
34 **********************************************************************/
35 
36 /**********************************************************************
37 
38  module: dhcpv4c_api.h
39 
40  For CCSP Component: DHCPV4-Client Status
41 
42  ---------------------------------------------------------------
43 
44  description:
45 
46  This header file gives the function call prototypes and
47  structure definitions used for the RDK-Broadband
48  DHCPv4Client Status abstraction layer
49 
50  ---------------------------------------------------------------
51 
52  environment:
53 
54  ---------------------------------------------------------------
55 
56  author:
57 
58  Cisco
59 
60 **********************************************************************/
61 
62 /**
63 * @file dhcpv4c_api.h
64 * @author Cisco
65 * @brief For CCSP Component: DHCPV4-Client Status
66 *
67 * @description This header file gives the function call prototypes and structure definitions used for the RDK-Broadband DHCPv4Client Status abstraction layer.
68 */
69 
70 #ifndef __DHCPV4_CLIENT_API_H__
71 #define __DHCPV4_CLIENT_API_H__
72 
73 
74 #ifndef ULONG
75 #define ULONG unsigned long
76 #endif
77 
78 #ifndef BOOL
79 #define BOOL unsigned char
80 #endif
81 
82 #ifndef CHAR
83 #define CHAR char
84 #endif
85 
86 #ifndef UCHAR
87 #define UCHAR unsigned char
88 #endif
89 
90 #ifndef INT
91 #define INT int
92 #endif
93 
94 #ifndef UINT
95 #define UINT unsigned int
96 #endif
97 
98 #ifndef TRUE
99 #define TRUE 1
100 #endif
101 
102 #ifndef FALSE
103 #define FALSE 0
104 #endif
105 
106 #ifndef ENABLE
107 #define ENABLE 1
108 #endif
109 
110 #ifndef STATUS_SUCCESS
111 #define STATUS_SUCCESS 0
112 #endif
113 
114 #ifndef STATUS_FAILURE
115 #define STATUS_FAILURE -1
116 #endif
117 
118 /**
119  * @addtogroup DHCPV4C_HAL_TYPES
120  * @{
121  */
122 #define DHCPV4_MAX_IPV4_ADDRS 4
123 
124 /**********************************************************************
125  STRUCTURE DEFINITIONS
126 **********************************************************************/
127 typedef struct {
128  /* Number of IP Addresses */
129  INT number;
130  /* Each IPv4 Address */
133 /** @} */ //END OF GROUP DHCPV4C_HAL_TYPES
134 
135 /**
136  * @addtogroup DHCPV4C_HAL_APIS
137  * @{
138  */
139 
140 /**********************************************************************************
141  *
142  * DHCPV4-Client Subsystem level function prototypes
143  *
144 **********************************************************************************/
145 /* dhcpv4c_get_ert_lease_time() function */
146 /**
147 * @description Gets the E-Router Offered Lease Time
148 * @param
149 * pValue - Value in Seconds.
150 * @return The status of the operation.
151 * @retval STATUS_SUCCESS if successful.
152 * @retval STATUS_FAILURE if any error is detected
153 *
154 * @execution Synchronous.
155 * @sideeffect None.
156 *
157 * @note This function must not suspend and must not invoke any blocking system
158 * calls. It should probably just send a message to a driver event handler task.
159 *
160 */
162 
163 /* dhcpv4c_get_ert_remain_lease_time() function */
164 /**
165 * @description Gets the E-Router Remaining Lease Time
166 * @param
167 * pValue - Value in Seconds.
168 * @return The status of the operation.
169 * @retval STATUS_SUCCESS if successful.
170 * @retval STATUS_FAILURE if any error is detected
171 *
172 * @execution Synchronous.
173 * @sideeffect None.
174 *
175 * @note This function must not suspend and must not invoke any blocking system
176 * calls. It should probably just send a message to a driver event handler task.
177 *
178 */
180 
181 /* dhcpv4c_get_ert_remain_renew_time() function */
182 /**
183 * @description Gets the E-Router Interface Remaining Time to Renew
184 * @param
185 * pValue - Value in Seconds.
186 * @return The status of the operation.
187 * @retval STATUS_SUCCESS if successful.
188 * @retval STATUS_FAILURE if any error is detected
189 *
190 * @execution Synchronous.
191 * @sideeffect None.
192 *
193 * @note This function must not suspend and must not invoke any blocking system
194 * calls. It should probably just send a message to a driver event handler task.
195 *
196 */
198 
199 /* dhcpv4c_get_ert_remain_rebind_time() function */
200 /**
201 * @description Gets the E-Router Interface Remaining Time to Rebind
202 * @param
203 * pValue - Value in Seconds.
204 * @return The status of the operation.
205 * @retval STATUS_SUCCESS if successful.
206 * @retval STATUS_FAILURE if any error is detected
207 *
208 * @execution Synchronous.
209 * @sideeffect None.
210 *
211 * @note This function must not suspend and must not invoke any blocking system
212 * calls. It should probably just send a message to a driver event handler task.
213 *
214 */
216 
217 /* dhcpv4c_get_ert_config_attempts() function */
218 /**
219 * @description Gets the E-Router Number of Attemts to Configure.
220 * @param
221 * pValue - Count.
222 * @return The status of the operation.
223 * @retval STATUS_SUCCESS if successful.
224 * @retval STATUS_FAILURE if any error is detected
225 *
226 * @execution Synchronous.
227 * @sideeffect None.
228 *
229 * @note This function must not suspend and must not invoke any blocking system
230 * calls. It should probably just send a message to a driver event handler task.
231 *
232 */
234 
235 /* dhcpv4c_get_ert_ifname() function */
236 /**
237 * @description Gets the E-Router Interface Name.
238 * @param
239 * pName - Interface Name (e.g. ert0)
240 * @return The status of the operation.
241 * @retval STATUS_SUCCESS if successful.
242 * @retval STATUS_FAILURE if any error is detected
243 *
244 * @execution Synchronous.
245 * @sideeffect None.
246 *
247 * @note This function must not suspend and must not invoke any blocking system
248 * calls. It should probably just send a message to a driver event handler task.
249 *
250 */
252 
253 /* dhcpv4c_get_ert_fsm_state() function */
254 /**
255 * @description Gets the E-Router DHCP State
256 * @param
257 * pValue - State of the DHCP (RENEW/ACQUIRED etc.)
258 * @return The status of the operation.
259 * @retval STATUS_SUCCESS if successful.
260 * @retval STATUS_FAILURE if any error is detected
261 *
262 * @execution Synchronous.
263 * @sideeffect None.
264 *
265 * @note This function must not suspend and must not invoke any blocking system
266 * calls. It should probably just send a message to a driver event handler task.
267 *
268 */
270 
271 /* dhcpv4c_get_ert_ip_addr() function */
272 /**
273 * @description Gets the E-Router Interface IP Address
274 * @param
275 * pValue - IP Address (of the Interface)
276 * @return The status of the operation.
277 * @retval STATUS_SUCCESS if successful.
278 * @retval STATUS_FAILURE if any error is detected
279 *
280 * @execution Synchronous.
281 * @sideeffect None.
282 *
283 * @note This function must not suspend and must not invoke any blocking system
284 * calls. It should probably just send a message to a driver event handler task.
285 *
286 */
288 
289 /* dhcpv4c_get_ert_mask() function */
290 /**
291 * @description Gets the E-Router Subnet Mask.
292 * @param
293 * pValue - Subnet Mask (bitmask)
294 * @return The status of the operation.
295 * @retval STATUS_SUCCESS if successful.
296 * @retval STATUS_FAILURE if any error is detected
297 *
298 * @execution Synchronous.
299 * @sideeffect None.
300 *
301 * @note This function must not suspend and must not invoke any blocking system
302 * calls. It should probably just send a message to a driver event handler task.
303 *
304 */
305 INT dhcpv4c_get_ert_mask(UINT *pValue);
306 
307 /* dhcpv4c_get_ert_gw() function */
308 /**
309 * @description Gets the E-Router Gateway IP Address
310 * @param
311 * pValue - IP Address (of the Gateway)
312 * @return The status of the operation.
313 * @retval STATUS_SUCCESS if successful.
314 * @retval STATUS_FAILURE if any error is detected
315 *
316 * @execution Synchronous.
317 * @sideeffect None.
318 *
319 * @note This function must not suspend and must not invoke any blocking system
320 * calls. It should probably just send a message to a driver event handler task.
321 *
322 */
323 INT dhcpv4c_get_ert_gw(UINT *pValue);
324 
325 /* dhcpv4c_get_ert_dns_svrs() function */
326 /**
327 * @description Gets the E-Router List of DNS Servers
328 * @param
329 * pList - List of IP Address (of DNS Servers)
330 * @return The status of the operation.
331 * @retval STATUS_SUCCESS if successful.
332 * @retval STATUS_FAILURE if any error is detected
333 *
334 * @execution Synchronous.
335 * @sideeffect None.
336 *
337 * @note This function must not suspend and must not invoke any blocking system
338 * calls. It should probably just send a message to a driver event handler task.
339 *
340 */
342 
343 /* dhcpv4c_get_ert_dhcp_svr() function */
344 /**
345 * @description Gets the E-Router DHCP Server IP Address
346 * @param
347 * pValue - IP Address (of DHCP Server)
348 * @return The status of the operation.
349 * @retval STATUS_SUCCESS if successful.
350 * @retval STATUS_FAILURE if any error is detected
351 *
352 * @execution Synchronous.
353 * @sideeffect None.
354 *
355 * @note This function must not suspend and must not invoke any blocking system
356 * calls. It should probably just send a message to a driver event handler task.
357 *
358 */
360 
361 
362 /* dhcpv4c_get_ecm_lease_time() function */
363 /**
364 * @description Gets the ECM Offered Lease Time.
365 * @param
366 * pValue - Value in Seconds.
367 * @return The status of the operation.
368 * @retval STATUS_SUCCESS if successful.
369 * @retval STATUS_FAILURE if any error is detected
370 *
371 * @execution Synchronous.
372 * @sideeffect None.
373 *
374 * @note This function must not suspend and must not invoke any blocking system
375 * calls. It should probably just send a message to a driver event handler task.
376 *
377 */
379 
380 /* dhcpv4c_get_ecm_remain_lease_time() function */
381 /**
382 * @description Gets the ECM Remaining Lease Time
383 * @param
384 * pValue - Value in Seconds.
385 * @return The status of the operation.
386 * @retval STATUS_SUCCESS if successful.
387 * @retval STATUS_FAILURE if any error is detected
388 *
389 * @execution Synchronous.
390 * @sideeffect None.
391 *
392 * @note This function must not suspend and must not invoke any blocking system
393 * calls. It should probably just send a message to a driver event handler task.
394 *
395 */
397 
398 /* dhcpv4c_get_ecm_remain_renew_time() function */
399 /**
400 * @description Gets the ECM Interface Remaining time to Renew.
401 * @param
402 * pValue - Value in Seconds.
403 * @return The status of the operation.
404 * @retval STATUS_SUCCESS if successful.
405 * @retval STATUS_FAILURE if any error is detected
406 *
407 * @execution Synchronous.
408 * @sideeffect None.
409 *
410 * @note This function must not suspend and must not invoke any blocking system
411 * calls. It should probably just send a message to a driver event handler task.
412 *
413 */
415 
416 /* dhcpv4c_get_ecm_remain_rebind_time() function */
417 /**
418 * @description Gets the ECM Interface Remaining time to Rebind.
419 * @param
420 * pValue - Value in Seconds.
421 * @return The status of the operation.
422 * @retval STATUS_SUCCESS if successful.
423 * @retval STATUS_FAILURE if any error is detected
424 *
425 * @execution Synchronous.
426 * @sideeffect None.
427 *
428 * @note This function must not suspend and must not invoke any blocking system
429 * calls. It should probably just send a message to a driver event handler task.
430 *
431 */
433 
434 /* dhcpv4c_get_ecm_config_attempts() function */
435 /**
436 * @description Gets the ECM Configuration Number of Attemts.
437 * @param
438 * pValue - Count.
439 * @return The status of the operation.
440 * @retval STATUS_SUCCESS if successful.
441 * @retval STATUS_FAILURE if any error is detected
442 *
443 * @execution Synchronous.
444 * @sideeffect None.
445 *
446 * @note This function must not suspend and must not invoke any blocking system
447 * calls. It should probably just send a message to a driver event handler task.
448 *
449 */
451 
452 /* dhcpv4c_get_ecm_ifname() function */
453 /**
454 * @description Gets the ECM Interface Name.
455 * @param
456 * pName - Name of the Interface (e.g doc0)
457 * @return The status of the operation.
458 * @retval STATUS_SUCCESS if successful.
459 * @retval STATUS_FAILURE if any error is detected
460 *
461 * @execution Synchronous.
462 * @sideeffect None.
463 *
464 * @note This function must not suspend and must not invoke any blocking system
465 * calls. It should probably just send a message to a driver event handler task.
466 *
467 */
469 
470 /* dhcpv4c_get_ecm_fsm_state() function */
471 /**
472 * @description Gets the ECM DHCP State
473 * @param
474 * pValue - State of the DHCP (RENEW/ACQUIRED etc)
475 * @return The status of the operation.
476 * @retval STATUS_SUCCESS if successful.
477 * @retval STATUS_FAILURE if any error is detected
478 *
479 * @execution Synchronous.
480 * @sideeffect None.
481 *
482 * @note This function must not suspend and must not invoke any blocking system
483 * calls. It should probably just send a message to a driver event handler task.
484 *
485 */
487 
488 /* dhcpv4c_get_ecm_ip_addr() function */
489 /**
490 * @description Gets the ECM Interface IP Address
491 * @param
492 * pValue - IP Address of the Interface.
493 * @return The status of the operation.
494 * @retval STATUS_SUCCESS if successful.
495 * @retval STATUS_FAILURE if any error is detected
496 *
497 * @execution Synchronous.
498 * @sideeffect None.
499 *
500 * @note This function must not suspend and must not invoke any blocking system
501 * calls. It should probably just send a message to a driver event handler task.
502 *
503 */
505 
506 /* dhcpv4c_get_ecm_mask() function */
507 /**
508 * @description Gets the ECM Interface Subnet Mask.
509 * @param
510 * pValue - Subnet Mask (bitmask).
511 * @return The status of the operation.
512 * @retval STATUS_SUCCESS if successful.
513 * @retval STATUS_FAILURE if any error is detected
514 *
515 * @execution Synchronous.
516 * @sideeffect None.
517 *
518 * @note This function must not suspend and must not invoke any blocking system
519 * calls. It should probably just send a message to a driver event handler task.
520 *
521 */
522 INT dhcpv4c_get_ecm_mask(UINT *pValue);
523 
524 /* dhcpv4c_get_ecm_gw() function */
525 /**
526 * @description Gets the ECM Gateway IP Address
527 * @param
528 * pValue - IP Address of Gateway
529 * @return The status of the operation.
530 * @retval STATUS_SUCCESS if successful.
531 * @retval STATUS_FAILURE if any error is detected
532 *
533 * @execution Synchronous.
534 * @sideeffect None.
535 *
536 * @note This function must not suspend and must not invoke any blocking system
537 * calls. It should probably just send a message to a driver event handler task.
538 *
539 */
540 INT dhcpv4c_get_ecm_gw(UINT *pValue);
541 
542 /* dhcpv4c_get_ecm_dns_svrs() function */
543 /**
544 * @description Gets the ECM List of DNS Servers
545 * @param
546 * pList - List of IP Addresses (of DNS Servers)
547 * @return The status of the operation.
548 * @retval STATUS_SUCCESS if successful.
549 * @retval STATUS_FAILURE if any error is detected
550 *
551 * @execution Synchronous.
552 * @sideeffect None.
553 *
554 * @note This function must not suspend and must not invoke any blocking system
555 * calls. It should probably just send a message to a driver event handler task.
556 *
557 */
559 
560 /* dhcpv4c_get_ecm_dhcp_svr() function */
561 /**
562 * @description Gets the ECM DHCP Server IP Address
563 * @param
564 * pValue - IP Address
565 * @return The status of the operation.
566 * @retval STATUS_SUCCESS if successful.
567 * @retval STATUS_FAILURE if any error is detected
568 *
569 * @execution Synchronous.
570 * @sideeffect None.
571 *
572 * @note This function must not suspend and must not invoke any blocking system
573 * calls. It should probably just send a message to a driver event handler task.
574 *
575 */
577 
578 
579 /* dhcpv4c_get_emta_remain_lease_time() function */
580 /**
581 * @description Gets the E-MTA interface Least Time
582 * @param
583 * pValue - Value in Seconds.
584 * @return The status of the operation.
585 * @retval STATUS_SUCCESS if successful.
586 * @retval STATUS_FAILURE if any error is detected
587 *
588 * @execution Synchronous.
589 * @sideeffect None.
590 *
591 * @note This function must not suspend and must not invoke any blocking system
592 * calls. It should probably just send a message to a driver event handler task.
593 *
594 */
596 
597 /* dhcpv4c_get_emta_remain_renew_time() function */
598 /**
599 * @description Gets the E-MTA interface Remaining Time to Renew
600 * @param
601 * pValue - Value in Seconds.
602 * @return The status of the operation.
603 * @retval STATUS_SUCCESS if successful.
604 * @retval STATUS_FAILURE if any error is detected
605 *
606 * @execution Synchronous.
607 * @sideeffect None.
608 *
609 * @note This function must not suspend and must not invoke any blocking system
610 * calls. It should probably just send a message to a driver event handler task.
611 *
612 */
614 
615 /* dhcpv4c_get_emta_remain_rebind_time() function */
616 /**
617 * @description Gets the E-MTA interface Remaining Time to Rebind
618 * @param
619 * pValue - Value in Seconds.
620 * @return The status of the operation.
621 * @retval STATUS_SUCCESS if successful.
622 * @retval STATUS_FAILURE if any error is detected
623 *
624 * @execution Synchronous.
625 * @sideeffect None.
626 *
627 * @note This function must not suspend and must not invoke any blocking system
628 * calls. It should probably just send a message to a driver event handler task.
629 *
630 */
632 
633 /** @} */ //END OF GROUP DHCPV4C_HAL_APIS
634 #endif
635 
dhcpv4c_get_ert_ip_addr
int dhcpv4c_get_ert_ip_addr(unsigned int *pValue)
dhcpv4c_get_ert_lease_time
int dhcpv4c_get_ert_lease_time(unsigned int *pValue)
dhcpv4c_get_ert_config_attempts
int dhcpv4c_get_ert_config_attempts(int *pValue)
dhcpv4c_get_ert_remain_lease_time
int dhcpv4c_get_ert_remain_lease_time(unsigned int *pValue)
dhcpv4c_get_ert_ifname
int dhcpv4c_get_ert_ifname(char *pName)
CHAR
#define CHAR
Definition: dhcpv4c_api.h:83
dhcpv4c_get_ecm_remain_rebind_time
int dhcpv4c_get_ecm_remain_rebind_time(unsigned int *pValue)
dhcpv4c_get_ecm_remain_lease_time
int dhcpv4c_get_ecm_remain_lease_time(unsigned int *pValue)
dhcpv4c_get_ert_remain_renew_time
int dhcpv4c_get_ert_remain_renew_time(unsigned int *pValue)
dhcpv4c_get_ert_fsm_state
int dhcpv4c_get_ert_fsm_state(int *pValue)
UINT
#define UINT
Definition: dhcpv4c_api.h:95
DHCPV4_MAX_IPV4_ADDRS
#define DHCPV4_MAX_IPV4_ADDRS
Definition: dhcpv4c_api.h:122
dhcpv4c_get_ecm_ifname
int dhcpv4c_get_ecm_ifname(char *pName)
dhcpv4c_get_ecm_gw
int dhcpv4c_get_ecm_gw(unsigned int *pValue)
dhcpv4c_get_ert_mask
int dhcpv4c_get_ert_mask(unsigned int *pValue)
dhcpv4c_get_ecm_ip_addr
int dhcpv4c_get_ecm_ip_addr(unsigned int *pValue)
dhcpv4c_get_ecm_dhcp_svr
int dhcpv4c_get_ecm_dhcp_svr(unsigned int *pValue)
dhcpv4c_get_ecm_fsm_state
int dhcpv4c_get_ecm_fsm_state(int *pValue)
dhcpv4c_get_ecm_config_attempts
int dhcpv4c_get_ecm_config_attempts(int *pValue)
dhcpv4c_get_emta_remain_rebind_time
int dhcpv4c_get_emta_remain_rebind_time(unsigned int *pValue)
dhcpv4c_get_ecm_lease_time
int dhcpv4c_get_ecm_lease_time(unsigned int *pValue)
dhcpv4c_get_emta_remain_renew_time
int dhcpv4c_get_emta_remain_renew_time(unsigned int *pValue)
dhcpv4c_get_ert_dhcp_svr
int dhcpv4c_get_ert_dhcp_svr(unsigned int *pValue)
dhcpv4c_get_ecm_remain_renew_time
int dhcpv4c_get_ecm_remain_renew_time(unsigned int *pValue)
INT
#define INT
Definition: dhcpv4c_api.h:91
dhcpv4c_ip_list_t
Definition: dhcpv4c_api.h:127
dhcpv4c_get_ecm_mask
int dhcpv4c_get_ecm_mask(unsigned int *pValue)
dhcpv4c_get_ecm_dns_svrs
int dhcpv4c_get_ecm_dns_svrs(dhcpv4c_ip_list_t *pList)
dhcpv4c_get_ert_remain_rebind_time
int dhcpv4c_get_ert_remain_rebind_time(unsigned int *pValue)
dhcpv4c_get_emta_remain_lease_time
int dhcpv4c_get_emta_remain_lease_time(unsigned int *pValue)
dhcpv4c_get_ert_gw
int dhcpv4c_get_ert_gw(unsigned int *pValue)
dhcpv4c_get_ert_dns_svrs
int dhcpv4c_get_ert_dns_svrs(dhcpv4c_ip_list_t *pList)