module documentation
Test cases for twisted.protocols.haproxy.V2Parser
.
Class |
|
Test twisted.protocols.haproxy.V2Parser behaviour. |
Constant | V2 |
Undocumented |
Function | _make |
Construct a version 2 IPv4 header with custom bytes. |
Function | _make |
Construct a version 2 IPv6 header with custom bytes. |
Function | _make |
Construct a version 2 IPv4 header with custom bytes. |
def _makeHeaderIPv4(sig=V2_SIGNATURE, verCom=b'!', famProto=b'\x11', addrLength=b'\x00\x0c', addrs=b'\x7f\x00\x00\x01\x7f\x00\x00\x01', ports=b'\x1f\x90"\xb8'):
(source)
¶
Construct a version 2 IPv4 header with custom bytes.
Parameters | |
sig:bytes | The protocol signature; defaults to valid V2_SIGNATURE . |
verbytes | Protocol version and command. Defaults to V2 PROXY. |
fambytes | Address family and protocol. Defaults to AF_INET/STREAM. |
addrbytes | Network-endian byte length of payload. Defaults to description of default addrs/ports. |
addrs:bytes | Address payload. Defaults to 127.0.0.1 for source and destination. |
ports:bytes | Source and destination ports. Defaults to 8080 for source 8888 for destination. |
Returns | |
bytes | A packet with header, addresses, and ports. |
def _makeHeaderIPv6(sig=V2_SIGNATURE, verCom=b'!', famProto=b'!', addrLength=b'\x00$', addrs=(b'\x00'*15+b'\x01')*2, ports=b'\x1f\x90"\xb8'):
(source)
¶
Construct a version 2 IPv6 header with custom bytes.
Parameters | |
sig:bytes | The protocol signature; defaults to valid V2_SIGNATURE . |
verbytes | Protocol version and command. Defaults to V2 PROXY. |
fambytes | Address family and protocol. Defaults to AF_INET6/STREAM. |
addrbytes | Network-endian byte length of payload. Defaults to description of default addrs/ports. |
addrs:bytes | Address payload. Defaults to ::1 for source and destination. |
ports:bytes | Source and destination ports. Defaults to 8080 for source 8888 for destination. |
Returns | |
bytes | A packet with header, addresses, and ports. |
def _makeHeaderUnix(sig=V2_SIGNATURE, verCom=b'!', famProto=b'1', addrLength=b'\x00\xd8', addrs=(b'/home/tests/mysockets/sock'+b'\x00'*82)*2):
(source)
¶
Construct a version 2 IPv4 header with custom bytes.
Parameters | |
sig:bytes | The protocol signature; defaults to valid V2_SIGNATURE . |
verbytes | Protocol version and command. Defaults to V2 PROXY. |
fambytes | Address family and protocol. Defaults to AF_UNIX/STREAM. |
addrbytes | Network-endian byte length of payload. Defaults to 108 bytes for 2 null terminated paths. |
addrs:bytes | Address payload. Defaults to /home/tests/mysockets/sock for source and destination paths. |
Returns | |
bytes | A packet with header, addresses, and8 ports. |