1 /*********************************************************************************
\r
3 * --------------------------------------------------------------------------------
\r
5 * This file is part of MiMic
\r
6 * Copyright (C)2011 Ryo Iizuka
\r
8 * MiMic is free software: you can redistribute it and/or modify
\r
9 * it under the terms of the GNU Lesser General Public License as published
\r
10 * by the Free Software Foundation, either version 3 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU Lesser General Public License
\r
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
21 * For further information please contact.
\r
23 * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
\r
25 *********************************************************************************/
\r
26 #ifndef NYLPC_CMDNSSERVER_H_
\r
27 #define NYLPC_CMDNSSERVER_H_
\r
28 #include "NyLPC_netif.h"
\r
32 #endif /* __cplusplus */
\r
36 * NyLPC_TDnsRecordで使用するサービスレコード
\r
38 struct NyLPC_TMDnsServiceRecord
\r
40 const char* protocol;
\r
46 struct NyLPC_TDnsRecord
\r
49 const NyLPC_TChar* name;
\r
50 /** Host name recommended name[:emac:]*/
\r
51 const NyLPC_TChar* a;
\r
55 NyLPC_TUInt16 num_of_srv;
\r
56 const struct NyLPC_TMDnsServiceRecord* srv;
\r
64 typedef struct NyLPC_TcMDnsServer NyLPC_TcMDnsServer_t;
\r
68 struct NyLPC_TcMDnsServer
\r
70 /** マルチキャストのUDPソケット*/
\r
71 NyLPC_TiUdpSocket_t* _socket;
\r
73 NyLPC_TcStopwatch_t _periodic_sw;
\r
74 /** 動作モード(private)*/
\r
75 NyLPC_TUInt8 _state;
\r
76 NyLPC_TUInt8 _state_val;
\r
77 NyLPC_TUInt8 _padding[2];
\r
79 const struct NyLPC_TDnsRecord* _ref_record;
\r
83 * スケッチシステムの場合、この関数はsetup時に実行してください。
\r
84 * @param i_ref_record
\r
85 * DNSレコードの参照値。インスタンス
\r
87 NyLPC_TBool NyLPC_cMDnsServer_initialize(
\r
88 NyLPC_TcMDnsServer_t* i_inst,const struct NyLPC_TDnsRecord* i_ref_record);
\r
90 void NyLPC_cMDnsServer_finalize(
\r
91 NyLPC_TcMDnsServer_t* i_inst);
\r
93 void NyLPC_cMDnsServer_periodicRecvProc(NyLPC_TcMDnsServer_t* i_inst);
\r
96 * 関数はstop関数をコールするまでの間ブロックします。
\r
98 void NyLPC_cMDnsServer_start(NyLPC_TcMDnsServer_t* i_inst);
\r
101 * 関数はサービスが停止するまでブロックします。
\r
103 void NyLPC_cMDnsServer_stop(NyLPC_TcMDnsServer_t* i_inst);
\r
108 #endif /* __cplusplus */
\r