Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions

Address Resolution Protocol. More...

Functions

struct arpEntry * arpAlloc (void)
 
thread arpDaemon (void)
 
syscall arpFree (struct arpEntry *entry)
 
struct arpEntry * arpGetEntry (const struct netaddr *praddr)
 
syscall arpInit (void)
 
syscall arpLookup (struct netif *netptr, const struct netaddr *praddr, struct netaddr *hwaddr)
 
syscall arpNotify (struct arpEntry *entry, message msg)
 
syscall arpRecv (struct packet *pkt)
 
syscall arpSendReply (struct packet *pkt)
 
syscall arpSendRqst (struct arpEntry *entry)
 

Detailed Description

Address Resolution Protocol.

Function Documentation

struct arpEntry* arpAlloc ( void  )

Allocates an entry from the ARP table.

Returns
entry in ARP table, SYSERR if error occurs
Precondition
-condition interrupts are disabled
Postcondition
-condition interrupts are still disabled
thread arpDaemon ( void  )

ARP daemon to manage the ARP table.

syscall arpFree ( struct arpEntry *  entry)

Frees an entry from the ARP table.

Returns
SYSERR if error occurs, otherwise OK
struct arpEntry* arpGetEntry ( const struct netaddr *  praddr)

Obtains an entry from the ARP table given a protocol address.

Parameters
praddrprotocol address
Returns
entry for correspoding praddr in ARP table, NULL if none exists

< pointer to ARP table entry

< interrupt state

syscall arpInit ( void  )

Initializes ARP table and ARP daemon.

Returns
OK if initialization is successful, otherwise SYSERR
syscall arpLookup ( struct netif *  netptr,
const struct netaddr *  praddr,
struct netaddr *  hwaddr 
)

Obtains a hardware address from the ARP table given a protocol address.

Parameters
netptrnetwork interface
praddrprotocol address
hwaddrbuffer into which hardware address should be placed
Returns
OK if hardware address was obtained, otherwise TIMEOUT or SYSERR

< pointer to ARP table entry

< num of ARP lookups performed

< TTL for ARP table entry

< interrupt state

syscall arpNotify ( struct arpEntry *  entry,
message  msg 
)

Send a message to threads waiting on resolution of an ARP table entry.

Parameters
entryARP table entry
msgmessage to send to waiting threads
Returns
OK if successful, SYSERR if error occurs

< index into ARP table

< interrupt state

syscall arpRecv ( struct packet *  pkt)

Processes an incoming ARP packet.

Parameters
pktpointer to the incoming packet return OK if packet was processed succesfully, otherwise SYSERR

< pointer to ARP table entry

< source hardware address

< source protocol address

< destination protocol address

< interrupt state

syscall arpSendReply ( struct packet *  pkt)

Sends an ARP reply for an ARP request over a network interface.

Parameters
pktARP packet to reply to
Returns
OK if packet was sent, otherwise SYSERR
syscall arpSendRqst ( struct arpEntry *  entry)

Sends an ARP request for an ARP table entry over a network interface.

Parameters
entryARP table entry
Returns
OK if packet was sent, otherwise SYSERR