twisted.pair.test.test_tuntap.TapHelper(object) class documentationtwisted.pair.test.test_tuntap
(View In Hierarchy)
A helper for tests of tap-related functionality (ethernet-level tunnels).
| Method | TUNNEL_TYPE | Undocumented |
| Method | __init__ | |
| 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. |
| Parameters | tunnelRemote | The source address for UDP datagrams originated from this helper. This is
an IPv4 dotted-quad string. (type: bytes) |
| tunnelLocal | The destination address for UDP datagrams originated from this helper.
This is an IPv4 dotted-quad string. (type: bytes) | |
| pi | A flag indicating whether this helper will generate and consume a protocol
information (PI) header. (type: bool) |
Construct an ethernet frame containing an ip datagram containing a udp datagram containing the given application-level payload.
| Parameters | source | The source port for the UDP datagram being encapsulated. (type: int) |
| destination | The destination port for the UDP datagram being encapsulated. (type: int) | |
| payload | The application data to include in the udp datagram. (type: bytes) | |
| Returns | An ethernet frame. (type: bytes) | |
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 tuples.
Each tuple has the UDP application data as the first element and the sender
address as the second element. | |