Cleanup in elf.c with .bss section clean; adm command mounts cdrom instead of floppy...
[ZeXOS.git] / kernel / include / net / arp.h
blob6f6ba24732481263e083b57818173f151ef7300d
1 /*
2 * ZeX/OS
3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef _ARP_H
20 #define _ARP_H
22 #define MIN_ARP_SIZE 28
24 #define __PACKED__ __attribute__ ((__packed__))
26 typedef struct arp_cache_context {
27 struct arp_cache_context *next, *prev;
29 net_ipv4 ip;
30 mac_addr_t mac;
31 } arp_cache_t;
33 typedef struct proto_arp_t {
34 unsigned short hard_type;
35 unsigned short prot_type;
36 unsigned char hard_size;
37 unsigned char prot_size;
38 unsigned short op;
39 mac_addr_t sender_ethernet;
40 net_ipv4 sender_ipv4;
41 mac_addr_t target_ethernet;
42 net_ipv4 target_ipv4;
43 } __PACKED__ proto_arp_t;
45 enum {
46 ARP_OP_REQUEST = 0x100,
47 ARP_OP_REPLY = 0x200,
48 ARP_OP_RARP_REQUEST,
49 ARP_OP_RARP_REPLY
52 enum {
53 ARP_HARD_TYPE_ETHERNET = 0x100
56 extern unsigned arp_cache_add (mac_addr_t mac, net_ipv4 ip);
57 extern unsigned arp_cache_get (net_ipv4 ip, mac_addr_t *mac);
58 extern unsigned init_proto_arp ();
60 #endif