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

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

12.48 rfc.ip - IP packets

Module: rfc.ip

This module provides some basic utilities to parse raw IP packets.

The packet argument in the following functions must be any type of uniform vector (see Uniform vectors), containing a raw IP packet including its IP header. Those functions work for both IPv4 and IPv6 packets; however, reading from a raw IPv6 socket returns a packet without IPv6 header, so you usually don’t need to use these functions.

The offset argument specifies the beginning of the IP packet in packet. If packet contains only one IP packet you can pass 0. It is not an optional argument, since these routines may be used in speed-sensitive inner loop.

Function: ip-version packet offset

{rfc.ip} Returns the IP version number (either 4 or 6) of the given IP packet.

Function: ip-header-length packet offset

{rfc.ip} Returns the size of IP header of the given packet in octets, including any IP header options.

Function: ip-protocol packet offset

{rfc.ip} Returns the IP protocol number of the given packet.

Function: ip-source-address packet offset
Function: ip-destination-address packet offset

{rfc.ip} Returns the source and destination address in the given packet in an integer, respectively.


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


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