MoonGen
|
Precision time protocol (PTP) utility. More...
Go to the source code of this file.
Functions | |
function ptpHeader | setMessageType (mt) |
Set the message type. More... | |
function ptpHeader | getMessageType () |
Retrieve the message type. More... | |
function ptpHeader | getMessageTypeString () |
Retrieve the message type. More... | |
function ptpHeader | setVersion (v) |
Set the version. More... | |
function ptpHeader | getVersion () |
Retrieve the version. More... | |
function ptpHeader | getVersionString () |
Retrieve the version. More... | |
function ptpHeader | setLength (l) |
Set the length. More... | |
function ptpHeader | getLength () |
Retrieve the length. More... | |
function ptpHeader | getLengthString () |
Retrieve the length. More... | |
function ptpHeader | setDomain (d) |
Set the domain. More... | |
function ptpHeader | getDomain () |
Retrieve the domain. More... | |
function ptpHeader | getDomainString () |
Retrieve the domain. More... | |
function ptpHeader | setReserved (uint8) |
Set the reserved field. More... | |
function ptpHeader | getReserved () |
Retrieve the reserved field. More... | |
function ptpHeader | getReservedString () |
Retrieve the reserved field. More... | |
function ptpHeader | setFlags (f) |
Set the flags. More... | |
function ptpHeader | getFlags () |
Retrieve the flags. More... | |
function ptpHeader | getFlagsString () |
Retrieve the flags. More... | |
function ptpHeader | setCorrection (c) |
Set the correction field. More... | |
function ptpHeader | getCorrection () |
Retrieve the correction field. More... | |
function ptpHeader | getCorrectionString () |
Retrieve the correction field. More... | |
function ptpHeader | setReserved2 (uint32) |
Set the reserved2 field. More... | |
function ptpHeader | getReserved2 () |
Retrieve the reserved2 field. More... | |
function ptpHeader | getReserved2String () |
Retrieve the reserved2 field. More... | |
function ptpHeader | setOui (int) |
Set the oui. More... | |
function ptpHeader | getOui () |
Retrieve the oui. More... | |
function ptpHeader | getOuiString () |
Retrieve the oui. More... | |
function ptpHeader | setUuid (int) |
Set the uuid. More... | |
function ptpHeader | getUuid () |
Retrieve the Uuid. More... | |
function ptpHeader | getUuidString () |
Retrieve the Uuid. More... | |
function ptpHeader | setNodePort (p) |
Set the node port. More... | |
function ptpHeader | getNodePort () |
Retrieve the node port. More... | |
function ptpHeader | getNodePortString () |
Retrieve the node port. More... | |
function ptpHeader | setSequenceID (s) |
Set the sequence ID. More... | |
function ptpHeader | getSequenceID () |
Retrieve the sequence ID. More... | |
function ptpHeader | getSequenceIDString () |
Retrieve the sequence ID. More... | |
function ptpHeader | setControl (c) |
Set the control field. More... | |
function ptpHeader | getControl () |
Retrieve the control field. More... | |
function ptpHeader | getControlString () |
Retrieve the control field. More... | |
function ptpHeader | setLogMessageInterval (l) |
Set the log message interval. More... | |
function ptpHeader | getLogMessageInterval () |
Retrieve the log message interval. More... | |
function ptpHeader | getLogMessageIntervalString () |
Retrieve the log message interval. More... | |
function ptpHeader | fill (args, pre) |
Set all members of the ip header. More... | |
function ptpHeader | get (pre) |
Retrieve the values of all members. More... | |
function ptpHeader | getString () |
Retrieve the values of all members. More... | |
function ptpHeader | resolveNextHeader () |
Resolve which header comes after this one (in a packet). More... | |
function ptpHeader | setDefaultNamedArgs (pre, namedArgs, nextHeader, accumulatedLength) |
Change the default values for namedArguments (for fill/get). More... | |
Variables | |
local | ptp = {} |
Ptp protocol constants. | |
local | ptpHeader = {} |
Module for ptp_header struct (see headers.lua). | |
pkt | getPtpPacket = packetCreate("eth", "ptp") |
Cast the packet to a layer 2 Ptp packet. | |
pkt | getUdpPtpPacket = packetCreate("eth", "ip4", "udp", "ptp") |
Cast the packet to a Ptp over Udp (IP4) packet. | |
Precision time protocol (PTP) utility.
Utility functions for the ptp_header struct defined in headers.lua .
Includes:
Definition in file ptp.lua.
function ptpHeader fill | ( | args | , |
pre | |||
) |
Set all members of the ip 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.
args | Table of named arguments. Available arguments: MessageType, Version, Length, Domain, Reserved, Flags, Correction, Reserved2, Oui, Uuid, NodePort, SequenceID, Control, LogMessageInterval |
pre | prefix for namedArgs. Default 'ptp'. |
function ptpHeader get | ( | pre | ) |
function ptpHeader getControl | ( | ) |
Retrieve the control field.
function ptpHeader getControlString | ( | ) |
Retrieve the control field.
function ptpHeader getCorrection | ( | ) |
Retrieve the correction field.
function ptpHeader getCorrectionString | ( | ) |
Retrieve the correction field.
function ptpHeader getDomain | ( | ) |
Retrieve the domain.
function ptpHeader getDomainString | ( | ) |
Retrieve the domain.
function ptpHeader getFlags | ( | ) |
Retrieve the flags.
function ptpHeader getFlagsString | ( | ) |
Retrieve the flags.
function ptpHeader getLength | ( | ) |
Retrieve the length.
function ptpHeader getLengthString | ( | ) |
Retrieve the length.
function ptpHeader getLogMessageInterval | ( | ) |
Retrieve the log message interval.
function ptpHeader getLogMessageIntervalString | ( | ) |
Retrieve the log message interval.
function ptpHeader getMessageType | ( | ) |
Retrieve the message type.
function ptpHeader getMessageTypeString | ( | ) |
Retrieve the message type.
function ptpHeader getNodePort | ( | ) |
Retrieve the node port.
function ptpHeader getNodePortString | ( | ) |
Retrieve the node port.
function ptpHeader getOui | ( | ) |
Retrieve the oui.
function ptpHeader getOuiString | ( | ) |
Retrieve the oui.
function ptpHeader getReserved | ( | ) |
Retrieve the reserved field.
function ptpHeader getReserved2 | ( | ) |
Retrieve the reserved2 field.
function ptpHeader getReserved2String | ( | ) |
Retrieve the reserved2 field.
function ptpHeader getReservedString | ( | ) |
Retrieve the reserved field.
function ptpHeader getSequenceID | ( | ) |
Retrieve the sequence ID.
function ptpHeader getSequenceIDString | ( | ) |
Retrieve the sequence ID.
function ptpHeader getString | ( | ) |
Retrieve the values of all members.
function ptpHeader getUuid | ( | ) |
Retrieve the Uuid.
function ptpHeader getUuidString | ( | ) |
Retrieve the Uuid.
function ptpHeader getVersion | ( | ) |
Retrieve the version.
function ptpHeader getVersionString | ( | ) |
Retrieve the version.
function ptpHeader 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)
function ptpHeader setControl | ( | c | ) |
Set the control field.
c | Control field as 8 bit integer. |
function ptpHeader setCorrection | ( | c | ) |
Set the correction field.
c | Correction field as table of two 32 bit integers { high, low }. |
function ptpHeader 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.
pre | The prefix used for the namedArgs, e.g. 'ptp' |
namedArgs | Table of named arguments (see See Also) |
nextHeader | The header following after this header in a packet |
accumulatedLength | The so far accumulated length for previous headers in a packet |
function ptpHeader setDomain | ( | d | ) |
Set the domain.
d | Domain as 8 bit integer. |
function ptpHeader setFlags | ( | f | ) |
Set the flags.
f | Flags as 16 bit integer. |
function ptpHeader setLength | ( | l | ) |
Set the length.
l | Length as 16 bit integer. |
function ptpHeader setLogMessageInterval | ( | l | ) |
Set the log message interval.
l | Log message interval as 8 bit integer. |
function ptpHeader setMessageType | ( | mt | ) |
Set the message type.
mt | Message type as 8 bit integer. |
function ptpHeader setNodePort | ( | p | ) |
Set the node port.
p | Node port as 16 bit integer. |
function ptpHeader setOui | ( | int | ) |
Set the oui.
int | Oui as 24 bit integer. |
function ptpHeader setReserved | ( | uint8 | ) |
Set the reserved field.
uint8 | Reserved as 8 bit integer. |
function ptpHeader setReserved2 | ( | uint32 | ) |
Set the reserved2 field.
uint32 | Reserved2 as 32 bit integer. |
function ptpHeader setSequenceID | ( | s | ) |
Set the sequence ID.
s | Sequence ID as 16 bit integer. |
function ptpHeader setUuid | ( | int | ) |
Set the uuid.
int | Uuis as table of two integers { high, low }, high as 8 bit integer and low as 32 bit integer. |
function ptpHeader setVersion | ( | v | ) |
Set the version.
v | Version as 8 bit integer. |