Concept |  Packet |  Mapper |  Network |  Procotol language |  Utilities |  Launching |  FAQ 

The packet manage the memory containing the data.

packet packetName ?size?

  Creates the packet named 'packetName' with the given size (default is MTU).

packetName (re)size ?size?
size of the packet
  Without arguments, returns the current size.
With one argument, set the size of the packet. If you reduce the size, the bytes are lost ; if you raise the size, the new bytes are initialize to 0.

packetName fill value
value used
  Fill the packet memory with value (value in a byte).

packetName getchar ?-offset n?
packetName getshort ?-offset n?
packetName getint ?-offset n?
packetName getdata ?-offset n -size n?
packetName gettext ?-offset n -size n?
value
value
value
string
string
  Extract the data from the packet either as one char (8 bits), one short (16 bits) or one int (32 bits) or as one string (in Tcl meaning with possible embedded null char) or one text with non printable characters espaced with \x??.

The position of the data to read can be specified with -offset, and when working with a string the size with -size. By default, offset is set to zero and size to the whole packet.

packetName setfrom string
packetName setchar ?-offset n? numericalValue
packetName setshort ?-offset n? numericalValue
packetName setint ?-offset n? numericalValue
packetName setdata ?-offset n -size n? string
new size of packet
1
2
4
transfered bytes
  Commands similar to the "get" serie.

 

After the management of the packet's memory, let's see how to deal with mappers.

mappers
list of all known mappers
  List all the mappers currently registred within GAPS.

packetName newmapper mapperName ?-offset n? ?-setdefaults?
packetName deletemappers ?mapperName ...?
packetName mappers
list of packet mappers
list of packet mappers
list of packet mappers
  To create a new mapper, use the newmapper command. the mapperName must be the name of a mapper (as returned by the mappers command). You can create only one instance of a type of mapper per packet (i.e. with the same name). By default, the new mapper is automatically appended to the last mapper (offset computed by GASP), but you can force the offset by using the -offset option. When creating a mapper, you can write the memory to default values (as specified in the protocol definition) using the -setdefaults option.

To delete a mapper, use the deletemapper command. If no name is given, all the mappers are deleted (the deletion of a mapper does not affect the packet memory).

To list the mappers currently applied to a packet, use the mappers command.

packetName decodefrom mapperName
list of packet mappers
  Use this command to automate the decoding of a set of nested protocols. For example, in networks protocols the type of the next layer is indicated. The command construct a list (stack) of mappers using the known protocols : the process stops as soon as the "next layer" protocol is unknown.

packetName data string ?offset?
nb bytes set in data
  This provide a way to access the packet memory located just after the last mapper. This correspond to the user data in a network packet.

You can set this memory, the string given in argument is written byte per byte in the packet memory. If the string is longer than the size of the packet memory, the remaining chars are discarded.


Copyright © 2000 Laurent Riesterer.
Last modified on Mar 2, 2000.