2 #include "NyLPC_cNet.h"
3 #include "./mimicip/NyLPC_cMiMicIpNetIf_protected.h"
4 #include "dhcp/NyLPC_cDhcpClient.h"
5 #include "apipa/NyLPC_cApipa.h"
11 const static struct NyLPC_TiNetInterface_Interface* netif;
17 void NyLPC_cNet_initialize(const struct NyLPC_TiNetInterface_Interface* i_netif)
19 NyLPC_Assert(netif==NULL);
23 void NyLPC_cNet_start(const NyLPC_TcIPv4Config_t* i_ref_config)
25 netif->start(i_ref_config);
29 void NyLPC_cNet_stop(void)
38 * 指定したIPアドレスを要求するARPリクエストを発行します。
40 void NyLPC_cNet_sendArpRequest(const struct NyLPC_TIPv4Addr* i_addr)
42 netif->sendarprequest(i_addr);
45 * ARPテーブルに指定したIPがあるかを返します。
47 NyLPC_TBool NyLPC_cNet_hasArpInfo(const struct NyLPC_TIPv4Addr* i_addr)
49 return netif->hasarpinfo(i_addr);
52 NyLPC_TBool NyLPC_cNet_isInitService(void)
54 return netif->isinitservice();
57 NyLPC_TiTcpSocket_t* NyLPC_cNet_createTcpSocketEx(NyLPC_TSocketType i_socktype)
59 return netif->createTcpSocketEx(i_socktype);
61 NyLPC_TiUdpSocket_t* NyLPC_cNet_createUdpSocketEx(NyLPC_TUInt16 i_port,NyLPC_TSocketType i_socktype)
63 return netif->createUdpSocetEx(i_port,i_socktype);
65 NyLPC_TiTcpListener_t* NyLPC_cNet_createTcpListenerEx(NyLPC_TUInt16 i_port)
67 return netif->createTcpListener(i_port);
70 const struct NyLPC_TNetInterfaceInfo* NyLPC_cNet_getInterfaceInfo(void)
72 return netif->getinterfaceinfo();
77 NyLPC_TBool NyLPC_cNet_requestAddrDhcp(NyLPC_TcIPv4Config_t* i_cfg,NyLPC_TInt16 i_repeat)
80 NyLPC_TcDhcpClient_t sock;
82 NyLPC_cDhcpClient_initialize(&sock);
83 ret=NyLPC_cDhcpClient_requestAddr(&sock,i_cfg,i_repeat);
84 NyLPC_cDhcpClient_finalize(&sock);
88 NyLPC_TBool NyLPC_cNet_requestAddrApipa(NyLPC_TcIPv4Config_t* i_cfg,NyLPC_TInt16 i_repeat)
93 NyLPC_cApipa_initialize(&sock);
94 ret=NyLPC_cApipa_requestAddr(&sock,i_cfg,i_repeat);
95 NyLPC_cApipa_finalize(&sock);