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
26 * Parts of this file were leveraged from uIP:
\r
28 * Copyright (c) 2001-2003, Adam Dunkels.
\r
29 * All rights reserved.
\r
31 * Redistribution and use in source and binary forms, with or without
\r
32 * modification, are permitted provided that the following conditions
\r
34 * 1. Redistributions of source code must retain the above copyright
\r
35 * notice, this list of conditions and the following disclaimer.
\r
36 * 2. Redistributions in binary form must reproduce the above copyright
\r
37 * notice, this list of conditions and the following disclaimer in the
\r
38 * documentation and/or other materials provided with the distribution.
\r
39 * 3. The name of the author may not be used to endorse or promote
\r
40 * products derived from this software without specific prior
\r
41 * written permission.
\r
43 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
\r
44 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
\r
45 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
\r
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
\r
47 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
\r
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
\r
49 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
\r
50 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
\r
51 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
52 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
\r
53 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
55 #ifndef NYLPC_CIPV4ARP_H_
\r
56 #define NYLPC_CIPV4ARP_H_
\r
57 #include "NyLPC_cIPv4Config.h"
\r
61 #endif /* __cplusplus */
\r
64 struct NyLPC_TArpTableItem
\r
66 struct NyLPC_TIPv4Addr ipaddr;
\r
67 struct NyLPC_TEthAddr ethaddr;
\r
71 /**********************************************************************
\r
73 * class NyLPC_TcIPv4Config
\r
75 **********************************************************************/
\r
78 #define NyLPC_TcIPv4Arp_ARPTAB_SIZE 8
\r
81 typedef struct NyLPC_TcIPv4Arp NyLPC_TcIPv4Arp_t;
\r
84 * NyLPC_TcIPv4クラスの構造体です。
\r
86 struct NyLPC_TcIPv4Arp
\r
88 const NyLPC_TcIPv4Config_t* _cfg;
\r
89 NyLPC_TUInt8 arptime;
\r
90 NyLPC_TUInt8 tmpage;
\r
91 struct NyLPC_TArpTableItem arp_table[NyLPC_TcIPv4Arp_ARPTAB_SIZE];
\r
94 void NyLPC_cIPv4Arp_initialize(NyLPC_TcIPv4Arp_t* i_inst,const NyLPC_TcIPv4Config_t* i_ref_config);
\r
95 #define NyLPC_cIPv4Arp_finalize(i_inst)
\r
96 void NyLPC_cIPv4Arp_periodic(NyLPC_TcIPv4Arp_t* i_inst);
\r
97 void NyLPC_cIPv4Arp_incomingIp(NyLPC_TcIPv4Arp_t* i_inst,const struct NyLPC_TEthernetIIHeader* i_eth,struct NyLPC_TIPv4Addr i_ip_src);
\r
103 * 応答パケットを格納したcUipService_allocBufで確保したメモリ
\r
105 void* NyLPC_cIPv4Arp_rx(NyLPC_TcIPv4Arp_t* i_inst,const struct NyLPC_TArpHeader* i_arp, NyLPC_TUInt16 i_len, NyLPC_TUInt16* o_tx_len);
\r
106 const struct NyLPC_TEthAddr* NyLPC_cIPv4Arp_IPv4toEthAddr(NyLPC_TcIPv4Arp_t* i_inst,const struct NyLPC_TIPv4Addr i_ip_addr);
\r
111 #endif /* __cplusplus */
\r
115 #endif /* NYLPC_CIPV4ARP_H_ */
\r