This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NyLPC_cDhcpClient.h Source File

NyLPC_cDhcpClient.h

00001 /*********************************************************************************
00002  * PROJECT: MiMic
00003  * --------------------------------------------------------------------------------
00004  *
00005  * This file is part of MiMic
00006  * Copyright (C)2011-2013 Ryo Iizuka
00007  *
00008  * MiMic is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License as published
00010  * by the Free Software Foundation, either version 3 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public License
00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  *
00021  * For further information please contact.
00022  *  http://nyatla.jp/
00023  *  <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
00024  *
00025  *********************************************************************************/
00026 #ifndef NYLPC_CDHCPCLIENT_H_
00027 #define NYLPC_CDHCPCLIENT_H_
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif /* __cplusplus */
00032 #include "NyLPC_stdlib.h"
00033 #include "../NyLPC_iUdpSocket.h"
00034 #include "../NyLPC_cIPv4Config.h"
00035 
00036 typedef struct NyLPC_TcDhcpClient NyLPC_TcDhcpClient_t;
00037 
00038 struct NyLPC_TcDhcpClient{
00039     NyLPC_TiUdpSocket_t* _socket;
00040     NyLPC_TcIPv4Config_t* _result;
00041     NyLPC_TUInt32 txid;
00042     volatile NyLPC_TUInt16 _status;
00043     //offer情報
00044     struct NyLPC_TIPv4Addr _offerserver;
00045 };
00046 
00047 
00048 /**
00049  * DHCPソケットを作成します。
00050  */
00051 NyLPC_TBool NyLPC_cDhcpClient_initialize(NyLPC_TcDhcpClient_t* i_inst);
00052 
00053 void NyLPC_cDhcpClient_finalize(NyLPC_TcDhcpClient_t* i_inst);
00054 
00055 /**
00056  * NyLPC_TcIPv4Config_tをDHCPで更新します。
00057  * この関数をコールする時は、サービスは停止中でなければなりません。
00058  * @param i_cfg
00059  * 更新するi_cfg構造体。
00060  * emac,default_mssは設定済である必要があります。他のフィールド値は不定で構いません。
00061  * 更新されるフィールドは、ip,netmast,default_rootの3つです。
00062  * @return
00063  * 更新に成功した場合TRUE
00064  */
00065 NyLPC_TBool NyLPC_cDhcpClient_requestAddr(NyLPC_TcDhcpClient_t* i_inst,NyLPC_TcIPv4Config_t* i_cfg,NyLPC_TInt16 i_repeat);
00066 
00067 
00068 
00069 
00070 #ifdef __cplusplus
00071 }
00072 #endif /* __cplusplus */
00073 
00074 #endif