1 /*********************************************************************************
3 * --------------------------------------------------------------------------------
5 * This file is part of MiMic
6 * Copyright (C)2011-2013 Ryo Iizuka
8 * MiMic is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published
10 * by the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * For further information please contact.
23 * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
25 *********************************************************************************/
26 #ifndef NYLPC_CDHCPCLIENT_H_
27 #define NYLPC_CDHCPCLIENT_H_
31 #endif /* __cplusplus */
32 #include "NyLPC_stdlib.h"
33 #include "../NyLPC_iUdpSocket.h"
34 #include "../NyLPC_cIPv4Config.h"
36 typedef struct NyLPC_TcDhcpClient NyLPC_TcDhcpClient_t;
38 struct NyLPC_TcDhcpClient{
39 NyLPC_TiUdpSocket_t* _socket;
40 NyLPC_TcIPv4Config_t* _result;
42 volatile NyLPC_TUInt16 _status;
44 struct NyLPC_TIPv4Addr _offerserver;
51 NyLPC_TBool NyLPC_cDhcpClient_initialize(NyLPC_TcDhcpClient_t* i_inst);
53 void NyLPC_cDhcpClient_finalize(NyLPC_TcDhcpClient_t* i_inst);
56 * NyLPC_TcIPv4Config_tをDHCPで更新します。
57 * この関数をコールする時は、サービスは停止中でなければなりません。
60 * emac,default_mssは設定済である必要があります。他のフィールド値は不定で構いません。
61 * 更新されるフィールドは、ip,netmast,default_rootの3つです。
65 NyLPC_TBool NyLPC_cDhcpClient_requestAddr(NyLPC_TcDhcpClient_t* i_inst,NyLPC_TcIPv4Config_t* i_cfg,NyLPC_TInt16 i_repeat);
72 #endif /* __cplusplus */