Get raw text for this example (you can click any command below to see its doc)
/*   Example of how to define an environment for given trace file   Trace file: smtp_client     Values of previously defined variables (created in file smtp_client_defines) will be inserted in packets.  */
// modification of packet with MAIL FROM command
GETPAC
PARAMETERS: <number of packet>
Copies the specified packet from trace file to the buffer of current packet.
8
// loads packet from file
CLEARHISTORY
PARAMETERS: no parameters
Clears info about the maximum size of previous packets. New packet may be smaller than previous ones. This command also makes all auto-calculated values inactive.
// if not use this command new packet cannot become smaller than original
POS
PARAMETERS: <new position> | <field's name>
Sets the <new position> of byte pointer. In the case of <field's name> new position will be equal to field's position.
= tcp.data
// the packet contains TCP options
PASS
PARAMETERS: <number of bytes>
Increases the byte pointer for the given <number of bytes>.
12
// so don't use standart
"tcp.data"
field but make this OFFSET
PARAMETERS: <number of bites>
The position of the next defined field will be shifted to the left for the given <number of bits> which must be from 1 to 7. So every written value will be shifter to the left before writing. Nevertheless, after the writing the left bits will be also changed and set to 0. To avoid this use command MASK
PARAMETERS: <field's mask>
Defines the mask for the next defined field. Mask is hexadecimal number. Value for field will be written only in bits corresponding not null bits of mask. See "headers/tcp_header.fws".
. See "headers/tcp_header.fws"
.td_command_name
"MAIL From: "
.td_email mail_from
// defined in smtp_client_defines
.td_rest
" SIZE=834\r\n"
// writes new data to packet, the size of packet will be set after the written value
ip.len = IPlen
// IP length has changed, mark it to be recalculated
tcp.crc = TCPcrc
// TCP checksum has changed, mark it to be recalculated
SETPAC
PARAMETERS: <number of packet>
Replaces the specified packet in trace file by the current packet.
8
// writes modified packet to file
// modification of packet with RCPT TO command
GETPAC
PARAMETERS: <number of packet>
Copies the specified packet from trace file to the buffer of current packet.
10
// loads packet from file
CLEARHISTORY
PARAMETERS: no parameters
Clears info about the maximum size of previous packets. New packet may be smaller than previous ones. This command also makes all auto-calculated values inactive.
// if not use this command new packet cannot become smaller than original
POS
PARAMETERS: <new position> | <field's name>
Sets the <new position> of byte pointer. In the case of <field's name> new position will be equal to field's position.
= tcp.data
// the packet contains TCP options
PASS
PARAMETERS: <number of bytes>
Increases the byte pointer for the given <number of bytes>.
12
// so don't use standart
"tcp.data"
field but make this OFFSET
PARAMETERS: <number of bites>
The position of the next defined field will be shifted to the left for the given <number of bits> which must be from 1 to 7. So every written value will be shifter to the left before writing. Nevertheless, after the writing the left bits will be also changed and set to 0. To avoid this use command MASK
PARAMETERS: <field's mask>
Defines the mask for the next defined field. Mask is hexadecimal number. Value for field will be written only in bits corresponding not null bits of mask. See "headers/tcp_header.fws".
. See "headers/tcp_header.fws"
.td_command_name
"Rcpt To: "
.td_email mail_to
// defined in smtp_client_defines
.td_newl_ine
"\r\n"
// writes new data to packet, the size of packet will be set after the written value
ip.len = IPlen
// IP length has changed, mark it to be recalculated
tcp.crc = TCPcrc
// TCP checksum has changed, mark it to be recalculated
SETPAC
PARAMETERS: <number of packet>
Replaces the specified packet in trace file by the current packet.
10
// writes modified packet to file