Internet Middleware API Reference  Rev 1.0
dhcpd.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 #ifndef __DHCPD_H__
36 #define __DHCPD_H__
37 #include "ip4_addr.h"
38 #include "syslog.h"
39 
40 
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91 
92 
101 #define DHCPD_SAVE_CLIENT_CONFIG_ON_LINE
102 
103 
106 #define DHCPD_DEFAULT_LEASE_TIME (64800)
107 
108 
111 #define DHPCD_DEFAULT_SERVER_IP ("10.10.10.1")
112 
113 
116 #define DHPCD_DEFAULT_GATEWAY ("10.10.10.1")
117 
118 
121 #define DHPCD_DEFAULT_NETMASK ("255.255.255.0")
122 
123 
126 #define DHPCD_DEFAULT_PRIMARY_DNS ("8.8.8.8")
127 
128 
131 #define DHPCD_DEFAULT_SECONDARY_DNS ("8.8.4.4")
132 
133 
136 #define DHPCD_DEFAULT_IP_POOL_START ("10.10.10.2")
137 
138 
141 #define DHPCD_DEFAULT_IP_POOL_END ("10.10.10.10")
142 
153 typedef struct
154 {
155  char dhcpd_server_address[IP4ADDR_STRLEN_MAX];
156  char dhcpd_gateway[IP4ADDR_STRLEN_MAX];
157  char dhcpd_netmask[IP4ADDR_STRLEN_MAX];
158  char dhcpd_primary_dns[IP4ADDR_STRLEN_MAX];
159  char dhcpd_secondary_dns[IP4ADDR_STRLEN_MAX];
160  char dhcpd_ip_pool_start[IP4ADDR_STRLEN_MAX];
161  char dhcpd_ip_pool_end[IP4ADDR_STRLEN_MAX];
163 
177 int dhcpd_start(dhcpd_settings_t *dhcpd_settings);
178 
179 
185 void dhcpd_stop(void);
186 
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #endif /* __DHCPD_H__ */
This structure defines the DHCPD configuration structure.
Definition: dhcpd.h:153
int dhcpd_start(dhcpd_settings_t *dhcpd_settings)
This function is used to start the DHCPD service.
void dhcpd_stop(void)
This function is used to stop the DHCPD service.