rarp.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00018 
00019 FILE_LICENCE ( GPL2_OR_LATER );
00020 
00021 #include <stdint.h>
00022 #include <byteswap.h>
00023 #include <gpxe/netdevice.h>
00024 #include <gpxe/iobuf.h>
00025 #include <gpxe/if_ether.h>
00026 #include <gpxe/rarp.h>
00027 
00028 /** @file
00029  *
00030  * Reverse Address Resolution Protocol
00031  *
00032  */
00033 
00034 /**
00035  * Process incoming ARP packets
00036  *
00037  * @v iobuf             I/O buffer
00038  * @v netdev            Network device
00039  * @v ll_source         Link-layer source address
00040  * @ret rc              Return status code
00041  *
00042  * This is a dummy method which simply discards RARP packets.
00043  */
00044 static int rarp_rx ( struct io_buffer *iobuf,
00045                      struct net_device *netdev __unused,
00046                      const void *ll_source __unused ) {
00047         free_iob ( iobuf );
00048         return 0;
00049 }
00050 
00051 
00052 /**
00053  * Transcribe RARP address
00054  *
00055  * @v net_addr  RARP address
00056  * @ret string  "<RARP>"
00057  *
00058  * This operation is meaningless for the RARP protocol.
00059  */
00060 static const char * rarp_ntoa ( const void *net_addr __unused ) {
00061         return "<RARP>";
00062 }
00063 
00064 /** RARP protocol */
00065 struct net_protocol rarp_protocol __net_protocol = {
00066         .name = "RARP",
00067         .net_proto = htons ( ETH_P_RARP ),
00068         .rx = rarp_rx,
00069         .ntoa = rarp_ntoa,
00070 };

Generated on Tue Apr 6 20:01:10 2010 for gPXE by  doxygen 1.5.7.1