Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

arp.h File Reference

ARP (Address Resolution Protocol) layer header. More...

#include <net/ip.h>

Go to the source code of this file.

Data Structures

struct  arp

Defines

#define ARPHRD_ETHER   1
 Ethernet hardware addresses.

#define ARP_OP_REQUEST   1
 ARP request operation.

#define ARP_OP_REPLY   2
 ARP reply operation.

#define RARP_OP_REQUEST   3
 RARP request operation.

#define RARP_OP_REPLY   4
 RARP reply operation.


Typedefs

typedef arp arp_t

Functions

void to_arp_layer (arp_t *packet)
 Get an ARP packet from the ethernet layer.
Parameters:
packet  The ARP packet.


void arp_reset_cache ()
 Reset the ARP resolution cache.

void arp_add_cache (in_addr_t ip, uint8_t *mac)
 Insert an address resolution into the ARP cache.
Parameters:
ip  The IP address (in network format).
mac  The ethernet address.


bool arp_remove_cache (in_addr_t ip)
 Remove an entry from the ARP cache.
Parameters:
ip  The IP address to remove (in network format).
Returns:
TRUE if the entry has been found, FALSE otherwise.


bool arp_ip_to_eth (uint8_t *eth_addr, in_addr_t ip_addr)
 Translate from IP address to ethernet address.
Parameters:
eth_addr  A pointer to the ethernet address.
ip_addr  The IP address to translate (in network format).
Returns:
TRUE if the translation can be performed, FALSE otherwise.


int arp_ip_to_eth (uint8_t *eth_addr, uint32_t ip_addr)
int send_arp_packet (in_addr_t ip_to, const uint8_t *eth_to, uint16_t arp_op)
 Send an ARP packet to the ethernet layer.
Parameters:
ip_to  The wanted IP destination address in network format.
eth_to  The ethernet destination address.
arp_op  The ARP operation.
Returns:
  • The number of bytes sent in case of success;
  • a negative value if an error occurs.


void arp_request (char *ip_dot)
 Send an ARP request.
Parameters:
ip_dot  The wanted IP address in numbers-and-dot notation. If ip_dot is not a valid ip address print the arp table to stdout.



Detailed Description

ARP (Address Resolution Protocol) layer header.

Author:
Andrea Righi <drizzt@inwind.it>
Date:
Last update: 2003-11-09
Note:
Copyright (©) 2003 Andrea Righi

Definition in file arp.h.


Define Documentation

#define ARPHRD_ETHER   1
 

Ethernet hardware addresses.

Definition at line 14 of file arp.h.


Generated on Fri Feb 20 15:32:17 2004 for Minirighi by doxygen1.2.18