Server IP : 209.38.156.173 / Your IP : 216.73.216.128 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/protocols/haproxy/test/__pycache__/ |
Upload File : |
o �b�. � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ dZ e ddd d dfde d e de de de de de fdd�Ze dddddfde d e de de de de de fdd�Ze ddddfde d e de de de de fdd�Z G dd � d ej�Zd!S )"z7 Test cases for L{twisted.protocols.haproxy.V2Parser}. � )�address)�unittest� )� _v2parser)�InvalidProxyHeaders QUIT � !s $s s �"��sig�verCom�famProto� addrLength�addrs�ports�returnc C � | | | | | | S )aV Construct a version 2 IPv6 header with custom bytes. @param sig: The protocol signature; defaults to valid L{V2_SIGNATURE}. @type sig: L{bytes} @param verCom: Protocol version and command. Defaults to V2 PROXY. @type verCom: L{bytes} @param famProto: Address family and protocol. Defaults to AF_INET6/STREAM. @type famProto: L{bytes} @param addrLength: Network-endian byte length of payload. Defaults to description of default addrs/ports. @type addrLength: L{bytes} @param addrs: Address payload. Defaults to C{::1} for source and destination. @type addrs: L{bytes} @param ports: Source and destination ports. Defaults to 8080 for source 8888 for destination. @type ports: L{bytes} @return: A packet with header, addresses, and ports. @rtype: L{bytes} � �r r r r r r r r �N/usr/lib/python3/dist-packages/twisted/protocols/haproxy/test/test_v2parser.py�_makeHeaderIPv6 � #r � s s c C r )aX Construct a version 2 IPv4 header with custom bytes. @param sig: The protocol signature; defaults to valid L{V2_SIGNATURE}. @type sig: L{bytes} @param verCom: Protocol version and command. Defaults to V2 PROXY. @type verCom: L{bytes} @param famProto: Address family and protocol. Defaults to AF_INET/STREAM. @type famProto: L{bytes} @param addrLength: Network-endian byte length of payload. Defaults to description of default addrs/ports. @type addrLength: L{bytes} @param addrs: Address payload. Defaults to 127.0.0.1 for source and destination. @type addrs: L{bytes} @param ports: Source and destination ports. Defaults to 8080 for source 8888 for destination. @type ports: L{bytes} @return: A packet with header, addresses, and ports. @rtype: L{bytes} r r r r r �_makeHeaderIPv46 r r � 1s �s� /home/tests/mysockets/sock /home/tests/mysockets/sock c C s | | | | | S )a� Construct a version 2 IPv4 header with custom bytes. @param sig: The protocol signature; defaults to valid L{V2_SIGNATURE}. @type sig: L{bytes} @param verCom: Protocol version and command. Defaults to V2 PROXY. @type verCom: L{bytes} @param famProto: Address family and protocol. Defaults to AF_UNIX/STREAM. @type famProto: L{bytes} @param addrLength: Network-endian byte length of payload. Defaults to 108 bytes for 2 null terminated paths. @type addrLength: L{bytes} @param addrs: Address payload. Defaults to C{/home/tests/mysockets/sock} for source and destination paths. @type addrs: L{bytes} @return: A packet with header, addresses, and8 ports. @rtype: L{bytes} r )r r r r r r r r �_makeHeaderUnix\ s #r c @ s e Zd ZdZd4dd�Zd4dd�Zd4dd �Zd4d d�Zd4dd �Zd4dd�Z d4dd�Z d4dd�Zd4dd�Zd4dd�Z d4dd�Zd4dd�Zd4dd�Zd4dd�Zd4d d!�Zd4d"d#�Zd4d$d%�Zd4d&d'�Zd4d(d)�Zd4d*d+�Zd4d,d-�Zd4d.d/�Zd4d0d1�Zd4d2d3�ZdS )5� V2ParserTestsz? Test L{twisted.protocols.haproxy.V2Parser} behaviour. r Nc C � t � }| �tj�|�� dS )zL Test if a well formed IPv4 header is parsed without error. N)r � assertTruer �V2Parser�parse��self�headerr r r �test_happyPathIPv4� � z V2ParserTests.test_happyPathIPv4c C r )zL Test if a well formed IPv6 header is parsed without error. N)r r r r r r r r r �test_happyPathIPv6� r"