Test cases for twisted.protocols.haproxy.V2Parser.

Class V2ParserTests Test twisted.protocols.haproxy.V2Parser behaviour.
Function _makeHeaderIPv6 Construct a version 2 IPv6 header with custom bytes.
Function _makeHeaderIPv4 Construct a version 2 IPv4 header with custom bytes.
Function _makeHeaderUnix Construct a version 2 IPv4 header with custom bytes.
def _makeHeaderIPv6(sig=V2_SIGNATURE, verCom='!', famProto='!', addrLength='\x00$', addrs='\x00' * 15 + '\x01' * 2, ports='\x1f\x90"\xb8'):

Construct a version 2 IPv6 header with custom bytes.

ParameterssigThe protocol signature; defaults to valid V2_SIGNATURE. (type: bytes)
verComProtocol version and command. Defaults to V2 PROXY. (type: bytes)
famProtoAddress family and protocol. Defaults to AF_INET6/STREAM. (type: bytes)
addrLengthNetwork-endian byte length of payload. Defaults to description of default addrs/ports. (type: bytes)
addrsAddress payload. Defaults to ::1 for source and destination. (type: bytes)
portsSource and destination ports. Defaults to 8080 for source 8888 for destination. (type: bytes)
ReturnsA packet with header, addresses, and ports. (type: bytes)
def _makeHeaderIPv4(sig=V2_SIGNATURE, verCom='!', famProto='\x11', addrLength='\x00\x0c', addrs='\x7f\x00\x00\x01\x7f\x00\x00\x01', ports='\x1f\x90"\xb8'):

Construct a version 2 IPv4 header with custom bytes.

ParameterssigThe protocol signature; defaults to valid V2_SIGNATURE. (type: bytes)
verComProtocol version and command. Defaults to V2 PROXY. (type: bytes)
famProtoAddress family and protocol. Defaults to AF_INET/STREAM. (type: bytes)
addrLengthNetwork-endian byte length of payload. Defaults to description of default addrs/ports. (type: bytes)
addrsAddress payload. Defaults to 127.0.0.1 for source and destination. (type: bytes)
portsSource and destination ports. Defaults to 8080 for source 8888 for destination. (type: bytes)
ReturnsA packet with header, addresses, and ports. (type: bytes)
def _makeHeaderUnix(sig=V2_SIGNATURE, verCom='!', famProto='1', addrLength='\x00\xd8', addrs='/home/tests/mysockets/sock' + '\x00' * 82 * 2):

Construct a version 2 IPv4 header with custom bytes.

ParameterssigThe protocol signature; defaults to valid V2_SIGNATURE. (type: bytes)
verComProtocol version and command. Defaults to V2 PROXY. (type: bytes)
famProtoAddress family and protocol. Defaults to AF_UNIX/STREAM. (type: bytes)
addrLengthNetwork-endian byte length of payload. Defaults to 108 bytes for 2 null terminated paths. (type: bytes)
addrsAddress payload. Defaults to /home/tests/mysockets/sock for source and destination paths. (type: bytes)
ReturnsA packet with header, addresses, and8 ports. (type: bytes)
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.