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

Internet Control Message Protocol. More...

Functions

thread icmpDaemon (void)
 
syscall icmpDestUnreach (const struct packet *unreached, uchar code)
 
syscall icmpEchoRequest (struct netaddr *dst, ushort id, ushort seq)
 
syscall icmpInit (void)
 
syscall icmpRecv (struct packet *pkt)
 
syscall icmpRedirect (struct packet *redir, uchar code, struct rtEntry *route)
 
syscall icmpSend (struct packet *pkt, uchar type, uchar code, uint datalen, struct netaddr *src, struct netaddr *dst)
 
syscall icmpTimeExceeded (struct packet *unreached, uchar code)
 

Detailed Description

Internet Control Message Protocol.

Function Documentation

thread icmpDaemon ( void  )

Daemon that responds to ICMP echo requests (pings).

syscall icmpDestUnreach ( const struct packet *  unreached,
uchar  code 
)

Compose ICMP Destination Unreachable message.

Parameters
unreachedpacket that could not be sent
codeICMP destination unreachable code number
Returns
OK if packet was sent, otherwise SYSERR
syscall icmpEchoRequest ( struct netaddr *  dst,
ushort  id,
ushort  seq 
)

Send an ICMP Echo (Ping) Request.

Parameters
dstdestination address
idping stream identifier
seqsequence number
Returns
OK if packet was sent, otherwise SYSERR
syscall icmpInit ( void  )

Initializes ICMP daemon.

Returns
OK if initialization is successful, otherwise SYSERR
syscall icmpRecv ( struct packet *  pkt)

Processes an incoming ICMP packet.

Parameters
pktpointer to the incoming packet return OK if packet was processed succesfully, otherwise SYSERR
syscall icmpRedirect ( struct packet *  redir,
uchar  code,
struct rtEntry *  route 
)

Compose ICMP Redirect message.

Parameters
redirpacket that should have gone somewhere else
codeICMP redirect code number
routenew gateway for packet
Returns
OK if packet was sent, otherwise SYSERR
syscall icmpSend ( struct packet *  pkt,
uchar  type,
uchar  code,
uint  datalen,
struct netaddr *  src,
struct netaddr *  dst 
)

Send an ICMP (Internet Control Message Protocol) packet.

Parameters
pktPacket containing the ICMP data. pkt->curr must be positioned on the ICMP data, pkt->len must be the length of the ICMP data, and there must be at least enough space between pkt->data and pkt->curr for the ICMP, IPv4, and link-level headers to be attached.
typeICMP type field to use.
codeICMP code field to use.
datalenLength of the ICMP data payload.
srcSource network address. If src->type == 0, then the source is automatically set to the address of the interface on which the packet is sent. dst Destination network address.
Returns
::OK if packet was successfully sent; otherwise ::SYSERR or another error code returned by ipv4Send().
syscall icmpTimeExceeded ( struct packet *  unreached,
uchar  code 
)

Compose ICMP Time Exceeded message.

Parameters
unreachedpacket that could not be sent
codeICMP destination unreachable code number
Returns
OK if packet was sent, otherwise SYSERR