|
|
1.1 root 1: /*
2: * Copyright (C) 2007 Michael Brown <[email protected]>.
3: *
4: * This program is free software; you can redistribute it and/or
5: * modify it under the terms of the GNU General Public License as
6: * published by the Free Software Foundation; either version 2 of the
7: * License, or any later version.
8: *
9: * This program is distributed in the hope that it will be useful, but
10: * WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17: */
18:
19: FILE_LICENCE ( GPL2_OR_LATER );
20:
21: #include <stdint.h>
22: #include <byteswap.h>
23: #include <ipxe/netdevice.h>
24: #include <ipxe/iobuf.h>
25: #include <ipxe/if_ether.h>
26: #include <ipxe/rarp.h>
27:
28: /** @file
29: *
30: * Reverse Address Resolution Protocol
31: *
32: */
33:
34: /**
35: * Process incoming ARP packets
36: *
37: * @v iobuf I/O buffer
38: * @v netdev Network device
39: * @v ll_dest Link-layer destination address
40: * @v ll_source Link-layer source address
41: * @ret rc Return status code
42: *
43: * This is a dummy method which simply discards RARP packets.
44: */
45: static int rarp_rx ( struct io_buffer *iobuf,
46: struct net_device *netdev __unused,
47: const void *ll_dest __unused,
48: const void *ll_source __unused ) {
49: free_iob ( iobuf );
50: return 0;
51: }
52:
53:
54: /**
55: * Transcribe RARP address
56: *
57: * @v net_addr RARP address
58: * @ret string "<RARP>"
59: *
60: * This operation is meaningless for the RARP protocol.
61: */
62: static const char * rarp_ntoa ( const void *net_addr __unused ) {
63: return "<RARP>";
64: }
65:
66: /** RARP protocol */
67: struct net_protocol rarp_protocol __net_protocol = {
68: .name = "RARP",
69: .net_proto = htons ( ETH_P_RARP ),
70: .rx = rarp_rx,
71: .ntoa = rarp_ntoa,
72: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.