Tools for automated testing of
|Class||Tunnel||An in-memory implementation of a tun or tap device.|
|Class||MemoryIOSystem||An in-memory implementation of basic I/O primitives, useful in the
context of unit testing as a drop-in replacement for parts of the
|Function||_H||Pack an integer into a network-order two-byte string.|
|Function||_ethernet||Construct an ethernet frame.|
|Function||_ip||Construct an IP datagram with the given source, destination, and application payload.|
|Function||_udp||Construct a UDP datagram with the given source, destination, and application payload.|
|Class||_FakePort||A socket-like object which can be used to read UDP datagrams from
tunnel-like file descriptors managed by a
Pack an integer into a network-order two-byte string.
|Parameters||n||The integer to pack. Only values that fit into 16 bits are supported.|
|Returns||The packed representation of the integer. (type: |
Construct an ethernet frame.
|Parameters||src||The source ethernet address, encoded. (type: |
|dst||The destination ethernet address, encoded. (type: |
|protocol||The protocol number of the payload of this datagram. (type: |
|payload||The content of the ethernet frame (such as an IP datagram). (type: |
|Returns||The full ethernet frame. (type: |
Construct an IP datagram with the given source, destination, and application payload.
|Parameters||src||The source IPv4 address as a dotted-quad string. (type: |
|dst||The destination IPv4 address as a dotted-quad string. (type: |
|payload||The content of the IP datagram (such as a UDP datagram). (type: |
|Returns||An IP datagram header and payload. (type: |
method with permission-checking logic. The returned function will check
self.permissions and raise
if the function name is not listed as an available permission.
|Returns||A wrapper around |