iPXE
rarp.c File Reference

Reverse Address Resolution Protocol. More...

#include <stdint.h>
#include <byteswap.h>
#include <ipxe/netdevice.h>
#include <ipxe/iobuf.h>
#include <ipxe/if_ether.h>
#include <ipxe/rarp.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static int rarp_rx (struct io_buffer *iobuf, struct net_device *netdev __unused, const void *ll_dest __unused, const void *ll_source __unused, unsigned int flags __unused)
 Process incoming ARP packets.
static const char * rarp_ntoa (const void *net_addr __unused)
 Transcribe RARP address.

Variables

struct net_protocol rarp_protocol __net_protocol
 RARP protocol.

Detailed Description

Reverse Address Resolution Protocol.

Definition in file rarp.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ rarp_rx()

int rarp_rx ( struct io_buffer * iobuf,
struct net_device *netdev __unused,
const void *ll_dest __unused,
const void *ll_source __unused,
unsigned int flags __unused )
static

Process incoming ARP packets.

Parameters
iobufI/O buffer
netdevNetwork device
ll_destLink-layer destination address
ll_sourceLink-layer source address
flagsPacket flags
Return values
rcReturn status code

This is a dummy method which simply discards RARP packets.

Definition at line 51 of file rarp.c.

55 {
56 free_iob ( iobuf );
57 return 0;
58}
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
Definition iobuf.c:153

References __unused, flags, free_iob(), and netdev.

◆ rarp_ntoa()

const char * rarp_ntoa ( const void *net_addr __unused)
static

Transcribe RARP address.

Parameters
net_addrRARP address
Return values
string"<RARP>"

This operation is meaningless for the RARP protocol.

Definition at line 69 of file rarp.c.

69 {
70 return "<RARP>";
71}

References __unused.

Variable Documentation

◆ __net_protocol

struct net_protocol rarp_protocol __net_protocol
Initial value:
= {
.name = "RARP",
.net_proto = htons ( ETH_P_RARP ),
.rx = rarp_rx,
.ntoa = rarp_ntoa,
}
#define ETH_P_RARP
Definition if_ether.h:21
#define htons(value)
Definition byteswap.h:136
static int rarp_rx(struct io_buffer *iobuf, struct net_device *netdev __unused, const void *ll_dest __unused, const void *ll_source __unused, unsigned int flags __unused)
Process incoming ARP packets.
Definition rarp.c:51
static const char * rarp_ntoa(const void *net_addr __unused)
Transcribe RARP address.
Definition rarp.c:69

RARP protocol.

AoE protocol.

Definition at line 74 of file rarp.c.

74 {
75 .name = "RARP",
76 .net_proto = htons ( ETH_P_RARP ),
77 .rx = rarp_rx,
78 .ntoa = rarp_ntoa,
79};