| Server IP : 139.59.63.204 / Your IP : 216.73.217.62 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu-s-1vcpu-1gb-blr1-01 6.8.0-110-generic #110-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 19 15:09:20 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/twisted/pair/__pycache__/ |
Upload File : |
�
ojhC � �0 � d Z ddlZddlZddlmZ ddlmZmZmZm Z m
Z
mZmZm
Z
ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd
lmZ ddlmZmZmZmZ ddlm Z d
Z!d� Z"dZ#d� Z$d� Z%d� Z& G d� d� Z'd� Z( ee� G d� d� � Z) G d� d� Z*y)zD
Tools for automated testing of L{twisted.pair}-based applications.
� N)�deque)�EAGAIN�EBADF�EINTR�EINVAL�ENOBUFS�ENOSYS�EPERM�EWOULDBLOCK��wraps)�implementer)�DatagramProtocol)�EthernetProtocol)�
IPProtocol)�RawUDPProtocol)� _IFNAMSIZ�
_TUNSETIFF�TunnelFlags�_IInputOutputSystem)�nativeString� c �. � t j d| � S )z�
Pack an integer into a network-order two-byte string.
@param n: The integer to pack. Only values that fit into 16 bits are
supported.
@return: The packed representation of the integer.
@rtype: L{bytes}
z>H)�struct�pack)�ns �6/usr/lib/python3/dist-packages/twisted/pair/testing.py�_Hr s � � �;�;�t�Q��� � c �* � || z t |� z |z S )a�
Construct an ethernet frame.
@param src: The source ethernet address, encoded.
@type src: L{bytes}
@param dst: The destination ethernet address, encoded.
@type dst: L{bytes}
@param protocol: The protocol number of the payload of this datagram.
@type protocol: L{int}
@param payload: The content of the ethernet frame (such as an IP datagram).
@type payload: L{bytes}
@return: The full ethernet frame.
@rtype: L{bytes}
)r ��src�dst�protocol�payloads r � _ethernetr'