/**
 * mdnsのサンプルです。
 */
#include "boot/sketch.h"

#include "NyLPC_net.h"
#include "../netif/mimicip/NyLPC_cMiMicIpNetIf.h"
#include <stdio.h>
#include <string.h>



struct NyLPC_TMDnsServiceRecord sr[1]=
{
	{"_http._tcp",80}
};
struct NyLPC_TDnsRecord a={
	name:"MiMicHttpd",
	a:"mimic01020304",
	1,
	sr
};


NyLPC_TcMDnsServer_t mdns;
const struct NyLPC_TiNetInterface_Interface* netif;
void setup(void)
{
	//uipサービス初期化。いろいろ利用可能に。
	netif=NyLPC_cMiMicIpNetIf_getNetInterface();
	NyLPC_cNet_initialize(netif);
	NyLPC_cMDnsServer_initialize(&mdns,&a);

}


void loop(void)
{
	struct NyLPC_TIPv4Addr client_addr;
	NyLPC_TcNetConfig_t c2;
	NyLPC_TIPv4Addr_set(&client_addr,192,168,128,195);

	NyLPC_cNetConfig_initialize(&c2,NyLPC_TBool_TRUE);
	NyLPC_cNetConfig_setIpAddr(&c2,192,168,128,39);
	NyLPC_cNetConfig_setGateway(&c2,192,168,128,254);
	NyLPC_cNet_start(&(c2.super));
	for(;;);
}




