1 |
52 |
dgisselq |
////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
//
|
3 |
|
|
// Filename: arp.h
|
4 |
|
|
//
|
5 |
|
|
// Project: OpenArty, an entirely open SoC based upon the Arty platform
|
6 |
|
|
//
|
7 |
|
|
// Purpose: To encapsulate common functions associated with the ARP protocol
|
8 |
|
|
// and hardware (ethernet MAC) address resolution.
|
9 |
|
|
//
|
10 |
|
|
//
|
11 |
|
|
// Creator: Dan Gisselquist, Ph.D.
|
12 |
|
|
// Gisselquist Technology, LLC
|
13 |
|
|
//
|
14 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
15 |
|
|
//
|
16 |
|
|
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
|
17 |
|
|
//
|
18 |
|
|
// This program is free software (firmware): you can redistribute it and/or
|
19 |
|
|
// modify it under the terms of the GNU General Public License as published
|
20 |
|
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
21 |
|
|
// your option) any later version.
|
22 |
|
|
//
|
23 |
|
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
24 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
25 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
26 |
|
|
// for more details.
|
27 |
|
|
//
|
28 |
|
|
// You should have received a copy of the GNU General Public License along
|
29 |
|
|
// with this program. (It's in the $(ROOT)/doc directory, run make with no
|
30 |
|
|
// target there if the PDF file isn't present.) If not, see
|
31 |
|
|
// <http://www.gnu.org/licenses/> for a copy.
|
32 |
|
|
//
|
33 |
|
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
34 |
|
|
// http://www.gnu.org/licenses/gpl.html
|
35 |
|
|
//
|
36 |
|
|
//
|
37 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
38 |
|
|
//
|
39 |
|
|
//
|
40 |
|
|
#ifndef ARP_H
|
41 |
|
|
#define ARP_H
|
42 |
|
|
|
43 |
|
|
extern void init_arp_table(void);
|
44 |
|
|
extern int arp_lookup(unsigned ipaddr, unsigned long *mac);
|
45 |
|
|
extern void arp_table_add(unsigned ipaddr, unsigned long mac);
|
46 |
|
|
extern void send_arp_reply(unsigned machi, unsigned maclo, unsigned ipaddr);
|
47 |
|
|
|
48 |
|
|
#endif
|