class documentation
class TapHelper: (source)
A helper for tests of tap-related functionality (ethernet-level tunnels).
Method | __init__ |
No summary |
Method | encapsulate |
Construct an ethernet frame containing an ip datagram containing a udp datagram containing the given application-level payload. |
Method | parser |
Get a function for parsing a datagram read from a tap device. |
Instance Variable | pi |
Undocumented |
Instance Variable | tunnel |
Undocumented |
Instance Variable | tunnel |
Undocumented |
Property | TUNNEL |
Undocumented |
Parameters | |
tunnelbytes | The source address for UDP datagrams originated from this helper. This is an IPv4 dotted-quad string. |
tunnelbytes | The destination address for UDP datagrams originated from this helper. This is an IPv4 dotted-quad string. |
pi:bool | A flag indicating whether this helper will generate and consume a protocol information (PI) header. |
Construct an ethernet frame containing an ip datagram containing a udp datagram containing the given application-level payload.
Parameters | |
source:int | The source port for the UDP datagram being encapsulated. |
destination:int | The destination port for the UDP datagram being encapsulated. |
payload:bytes | The application data to include in the udp datagram. |
Returns | |
bytes | An ethernet frame. |
Get a function for parsing a datagram read from a tap device.
Returns | |
A function which accepts a datagram exactly as might be read from a tap device. The datagram is expected to ultimately carry a UDP datagram. When called, it returns a list of tuple s. Each tuple has the UDP application data as the first element and the sender address as the second element. |