For Gauche 0.9.15Search (procedure/syntax/module):

Next: , Previous: , Up: Library modules - Utilities   [Contents][Index]

12.47 rfc.icmp - ICMP packets

Module: rfc.icmp

{rfc.icmp} This module provides some basic utilities to construct and parse ICMP packets.

For the functions below, buffer should be a writable u8vector of the enough size.

Parsing functions takes offset as well as buffer, which specifies the beginning of the ICMP packet. Using the offset you can carry the whole IP packet in buffer, without creating a new buffer to extract ICMP portion.

Function: icmp4-fill-echo! buffer ident sequence data

{rfc.icmp} Fills buffer with the ICMPv4 Echo Request packet. Data must be a u8vector. The checksum field is left to be zero, which can be filled by icmp4-fill-checksum!.

Function: icmp4-fill-checksum! buffer size

{rfc.icmp} Calculates the ICMPv4 checksum of the packet in the buffer, of size length (the size of the packet, not the buffer), and fills the checksum field of the packet.

Function: icmp6-fill-echo! buffer ident sequence data

{rfc.icmp} Fills buffer with the ICMPv6 Echo Request packet. Data must be a u8vector. The checksum field is left to be zero, which is to be filled by the kernel (so you don’t need to fill by yourself).

Function: icmp-packet-type buffer offset
Function: icmp-packet-code buffer offset
Function: icmp-packet-ident buffer offset
Function: icmp-packet-sequence buffer offset

{rfc.icmp} Extracts type, code, ident and sequence fields of ICMP packet. These functions are common to both ICMPv4/v6.

Function: icmp4-describe-packet buffer offset
Function: icmp6-describe-packet buffer offset

{rfc.icmp} Prints out a simple text description of the given ICMPv4 and v6 packet, respectively.

Function: icmp4-message-type->string type
Function: icmp4-unreach-code->string code
Function: icmp4-redirect-code->string code
Function: icmp4-router-code->string code
Function: icmp4-exceeded-code->string code
Function: icmp4-parameter-code->string code
Function: icmp4-security-code->string code
Function: icmp6-message-type->string type
Function: icmp6-unreach-code->string code
Function: icmp6-exceeded-code->string code
Function: icmp6-parameter-code->string code

{rfc.icmp} Returns a text description of ICMPv4 and ICMPv6 types and codes.


Next: , Previous: , Up: Library modules - Utilities   [Contents][Index]


For Gauche 0.9.15Search (procedure/syntax/module):