Rename e1000_main.c to e1000.c to so we can type 'make bin/e1000.dsk' instead of...
[gpxe.git] / src / net / rarp.c
blobbb5e6ad7676f6d374db38f603bbe6fd63408eb89
1 /*
2 * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
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.
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.
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.
19 #include <stdint.h>
20 #include <byteswap.h>
21 #include <gpxe/netdevice.h>
22 #include <gpxe/iobuf.h>
23 #include <gpxe/if_ether.h>
24 #include <gpxe/rarp.h>
26 /** @file
28 * Reverse Address Resolution Protocol
32 /**
33 * Process incoming ARP packets
35 * @v iobuf I/O buffer
36 * @v netdev Network device
37 * @v ll_source Link-layer source address
38 * @ret rc Return status code
40 * This is a dummy method which simply discards RARP packets.
42 static int rarp_rx ( struct io_buffer *iobuf,
43 struct net_device *netdev __unused,
44 const void *ll_source __unused ) {
45 free_iob ( iobuf );
46 return 0;
50 /**
51 * Transcribe RARP address
53 * @v net_addr RARP address
54 * @ret string "<RARP>"
56 * This operation is meaningless for the RARP protocol.
58 static const char * rarp_ntoa ( const void *net_addr __unused ) {
59 return "<RARP>";
62 /** RARP protocol */
63 struct net_protocol rarp_protocol __net_protocol = {
64 .name = "RARP",
65 .net_proto = htons ( ETH_P_RARP ),
66 .rx = rarp_rx,
67 .ntoa = rarp_ntoa,