Class TCP

The TCP Layer, inherits from Base_Object

Tables

TCP.new_args Constructor arguments

Fields

TCP.FIN The TCP FIN flag value
TCP.SYN The TCP SYN flag value
TCP.RST The TCP RST flag value
TCP.PSH The TCP PSH flag value
TCP.ACK The TCP ACK flag value
TCP.URG The TCP URG flag value
TCP.ECE The TCP ECE flag value
TCP.CWR The TCP CWR flag value

Methods

TCP:new ([args]) Constructor for a TCP Layer
TCP:hasflags (flags) Check if the TCP Layer has the given flag combination
TCP:offset () Get the TCP data offset value
TCP:setsource (source) Set the TCP source port
TCP:getsource () Get the TCP source port
TCP:sedest (dest) Set the TCP destination port
TCP:gedest () Get the TCP destination port
TCP:setseq (seq) Set the TCP sequence number
TCP:getseq () Get the TCP sequence number
TCP:setack (ack) Set the TCP acknowledgment number
TCP:getack () Get the TCP acknowledgment number
TCP:setwin (win) Set the TCP window size
TCP:getwin () Get the TCP window size
TCP:setflags (flags) Set the TCP flags
TCP:getflags () Get the TCP flags


Tables

TCP.new_args
Constructor arguments

Fields:

  • src num the source port
  • dst num the destination port
  • seq num the sequence number
  • ack num the acknowledgment number
  • win num the window size
  • flags num the flags (all at once)

Fields

TCP.FIN
The TCP FIN flag value
  • FIN num
TCP.SYN
The TCP SYN flag value
  • SYN num
TCP.RST
The TCP RST flag value
  • RST num
TCP.PSH
The TCP PSH flag value
  • PSH num
TCP.ACK
The TCP ACK flag value
  • ACK num
TCP.URG
The TCP URG flag value
  • URG num
TCP.ECE
The TCP ECE flag value
  • ECE num
TCP.CWR
The TCP CWR flag value
  • CWR num

Methods

TCP:new ([args])
Constructor for a TCP Layer

Parameters:

  • args table arguments, all grouped inside a table, see new_args (optional)

Returns:

    TCP a new TCP object

Usage:

    TCP.new{
    	 dst=80,
    	 flags=18
    }
TCP:hasflags (flags)
Check if the TCP Layer has the given flag combination

Parameters:

  • flags num a flag mask

Returns:

    num r 0 if the layer doesn't have the flags

Usage:

    tcp:hasflags(TCP.SYN + TCP.ACK)
TCP:offset ()
Get the TCP data offset value

Returns:

    num offset
TCP:setsource (source)
Set the TCP source port

Parameters:

  • source num the TCP source port
TCP:getsource ()
Get the TCP source port

Returns:

    num source the TCP source port
TCP:sedest (dest)
Set the TCP destination port

Parameters:

  • dest num the TCP destination port
TCP:gedest ()
Get the TCP destination port

Returns:

    num dest the TCP destination port
TCP:setseq (seq)
Set the TCP sequence number

Parameters:

  • seq num the TCP sequence number
TCP:getseq ()
Get the TCP sequence number

Returns:

    num seq the TCP sequence number
TCP:setack (ack)
Set the TCP acknowledgment number

Parameters:

  • ack num the TCP acknowledgment number
TCP:getack ()
Get the TCP acknowledgment number

Returns:

    num ack the TCP acknowledgment number
TCP:setwin (win)
Set the TCP window size

Parameters:

  • win num the TCP window size
TCP:getwin ()
Get the TCP window size

Returns:

    num win the TCP window size
TCP:setflags (flags)
Set the TCP flags

Parameters:

  • flags num the TCP flags

Usage:

    tcp:setflags(TCP.SYN + TCP.ACK)
TCP:getflags ()
Get the TCP flags

Returns:

    num flags the TCP flags
generated by LDoc 1.4.6 Last updated 2017-10-04 11:48:45