Class IP
The IP Layer, inherits from Base_Object
Tables
-
IP.new_args
-
Constructor arguments
Fields:
- dst
string
the IP dst
- id
num
the IP identifier, randomized if unset
- flags
num
the IP flags
- ttl
num
the IP TTL
- offset
num
the IP fragment offset
- ecn
num
the IP ecn flag
- dscp
num
the IP dscp byte
- proto
num
the IP protocol number
Methods
-
IP:new ([args])
-
Constructor for an IP Layer
Parameters:
- args
table
arguments, all grouped inside a table, see new_args
(optional)
Returns:
IP
a new IP object
Usage:
IP.new{
dst="8.8.8.8,
proto=17,
tll=64
}
-
IP:payloadlen ()
-
Return the number of bytes after the IP header
Returns:
num
bytes
-
IP:source ([source])
-
Get/Set the IP source address
Parameters:
- source
string
set the IP source address to source
(optional)
Returns:
string
source
-
IP:dest ([dest])
-
Get/Set the IP destination address
Parameters:
- dest
string
set the IP destination address to dest
(optional)
Returns:
string
dest
-
IP:flags (flags)
-
Set the IP flags
Parameters:
-
IP:fragoffset (offset)
-
Set the IP fragment offset
Parameters:
-
IP:ttl (tll)
-
Set the IP TTL
Parameters:
-
IP:id ([id])
-
Get/Set the IP Identification
Parameters:
Returns:
num
the IP ID
-
IP:dscp (dscp)
-
Set the IP DSCP
Parameters:
-
IP:ecn (ecn)
-
Set the IP ECN
Parameters: