MoonGen
 All Files Functions Variables Pages
ah.lua File Reference

AH utility. More...

Go to the source code of this file.

Functions

function ipsecICV set (icv)
 Set the IPsec ICV. More...
 
function ipsecICV get ()
 Retrieve the IPsec ICV. More...
 
function ipsecICV getString (doByteSwap)
 Get the IPsec string. More...
 
function ahHeader setSPI (int)
 Set the SPI. More...
 
function ahHeader getSPI ()
 Retrieve the SPI. More...
 
function ahHeader getSPIString ()
 Retrieve the SPI as string. More...
 
function ahHeader setSQN (int)
 Set the SQN. More...
 
function ahHeader getSQN ()
 Retrieve the SQN. More...
 
function ahHeader getSQNString ()
 Retrieve the SQN as string. More...
 
function ahHeader setIV (iv)
 Set the IV. More...
 
function ahHeader getIV ()
 Retrieve the IV. More...
 
function ahHeader getIVString ()
 Retrieve the IV as string. More...
 
function ahHeader setICV (icv)
 Set the ICV. More...
 
function ahHeader getICV ()
 Retrieve the ICV. More...
 
function ahHeader getICVString ()
 Retrieve the ICV as string. More...
 
function ahHeader setNextHeader (int)
 Set the Next Header. More...
 
function ahHeader getNextHeader ()
 Retrieve the Next Header. More...
 
function ahHeader getNextHeaderString ()
 Retrieve the Next Header as string. More...
 
function ahHeader setLength (int)
 Set the Length. More...
 
function ahHeader getLength ()
 Retrieve the Length. More...
 
function ahHeader getLengthString ()
 Retrieve the Length as string. More...
 
function ahHeader fill (args, pre)
 Set all members of the ah header. More...
 
function ahHeader get (pre)
 Retrieve the values of all members. More...
 
function ahHeader getString ()
 Retrieve the values of all members. More...
 
function ahHeader resolveNextHeader ()
 Resolve which header comes after this one (in a packet) For instance: in tcp/udp based on the ports This function must exist and is only used when get/dump is executed on an unknown (mbuf not yet casted to e.g. More...
 
function ahHeader setDefaultNamedArgs (pre, namedArgs, nextHeader, accumulatedLength)
 Change the default values for namedArguments (for fill/get) This can be used to for instance calculate a length value based on the total packet length See proto/ip4.setDefaultNamedArgs as an example This function must exist and is only used by packet.fill. More...
 

Detailed Description

AH utility.

Utility functions for the ah_header structs defined in headers.lua .
Includes:

  • AH constants
  • IPsec ICV
  • AH header utility
  • Definition of AH packets

Definition in file ah.lua.

Function Documentation

function ahHeader fill ( args  ,
pre   
)

Set all members of the ah header.

Per default, all members are set to default values specified in the respective set function. Optional named arguments can be used to set a member to a user-provided value.

Parameters
argsTable of named arguments. Available arguments: ahSPI, ahSQN, ahIV, ahICV
preprefix for namedArgs. Default 'ah'. fill() fill{ ahXYZ=1 }
Examples:
l2-poisson-load-latency.lua, l3-tcp-syn-flood.lua, and quality-of-service-test.lua.
function ipsecICV get ( )

Retrieve the IPsec ICV.

Returns
ICV in 'union ipsec_icv' format.
function ahHeader get ( pre  )

Retrieve the values of all members.

Parameters
preprefix for namedArgs. Default 'ah'.
Returns
Table of named arguments. For a list of arguments see "See also".
See Also
ahHeader:fill
function ahHeader getICV ( )

Retrieve the ICV.

Returns
SPI as...
function ahHeader getICVString ( )

Retrieve the ICV as string.

Returns
ICV as string.
function ahHeader getIV ( )

Retrieve the IV.

Returns
SPI as 'union ipsec_iv'.
function ahHeader getIVString ( )

Retrieve the IV as string.

Returns
IV as string.
function ahHeader getLength ( )

Retrieve the Length.

Returns
Length as A bit integer.
function ahHeader getLengthString ( )

Retrieve the Length as string.

Returns
Length as string.
function ahHeader getNextHeader ( )

Retrieve the Next Header.

Returns
Next Header as A bit integer.
function ahHeader getNextHeaderString ( )

Retrieve the Next Header as string.

Returns
Next Header as string.
function ahHeader getSPI ( )

Retrieve the SPI.

Returns
SPI as A bit integer.
function ahHeader getSPIString ( )

Retrieve the SPI as string.

Returns
SPI as string.
function ahHeader getSQN ( )

Retrieve the SQN.

Returns
SQN as A bit integer.
function ahHeader getSQNString ( )

Retrieve the SQN as string.

Returns
SQN as string.
function ipsecICV getString ( doByteSwap  )

Get the IPsec string.

Parameters
icvIPsec ICV in string format.
function ip4Header getString ( )

Retrieve the values of all members.

Returns
Values in string format.
function ahHeader resolveNextHeader ( )

Resolve which header comes after this one (in a packet) For instance: in tcp/udp based on the ports This function must exist and is only used when get/dump is executed on an unknown (mbuf not yet casted to e.g.

tcpv6 packet) packet (mbuf)

Returns
String next header (e.g. 'eth', 'ip4', nil)
function ipsecICV set ( icv  )

Set the IPsec ICV.

Parameters
ivIPsec ICV in 'union ipsec_icv' format.
Examples:
l3-tcp-syn-flood.lua, and quality-of-service-test.lua.
function ahHeader setDefaultNamedArgs ( pre  ,
namedArgs  ,
nextHeader  ,
accumulatedLength   
)

Change the default values for namedArguments (for fill/get) This can be used to for instance calculate a length value based on the total packet length See proto/ip4.setDefaultNamedArgs as an example This function must exist and is only used by packet.fill.

Parameters
preThe prefix used for the namedArgs, e.g. 'ah'
namedArgsTable of named arguments (see See more)
nextHeaderThe header following after this header in a packet
accumulatedLengthThe so far accumulated length for previous headers in a packet
Returns
Table of namedArgs
See Also
ahHeader:fill
function ahHeader setICV ( icv  )

Set the ICV.

Parameters
intICV of the ah header as...
function ahHeader setIV ( iv  )

Set the IV.

Parameters
intIV of the ah header as 'union ipsec_iv'.
function ahHeader setLength ( int  )

Set the Length.

Parameters
intLength of the ah header as A bit integer.
function ahHeader setNextHeader ( int  )

Set the Next Header.

Parameters
intNext Header of the ah header as A bit integer.
function ahHeader setSPI ( int  )

Set the SPI.

Parameters
intSPI of the ah header as A bit integer.
function ahHeader setSQN ( int  )

Set the SQN.

Parameters
intSQN of the ah header as A bit integer.