HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/pair/__pycache__/ethernet.cpython-38.pyc
U


W[��@spdZddlZddlmZddlmZddlmZmZGdd�de�Z	Gdd	�d	�Z
ee	�Gd
d�dej��ZdS)z1Support for working directly with ethernet frames�N)�protocol)�raw)�implementer�	Interfacec@s eZdZdZdd�Zdd�ZdS)�IEthernetProtocolz6An interface for protocols that handle Ethernet framescCsdS)z"Add an IRawPacketProtocol protocolN�rrr�7/usr/lib/python3/dist-packages/twisted/pair/ethernet.py�addProtoszIEthernetProtocol.addProtocCsdS)z#An Ethernet frame has been receivedNrrrrr�datagramReceivedsz"IEthernetProtocol.datagramReceivedN)�__name__�
__module__�__qualname__�__doc__r	r
rrrrrsrc@seZdZdd�ZdS)�EthernetHeadercCs$t�d|dd��\|_|_|_dS)Nz!6s6sH�)�structZunpack�dest�source�proto)�self�datarrr�__init__s�zEthernetHeader.__init__N)rrr
rrrrrrsrc@s&eZdZdd�Zdd�Zd	dd�ZdS)
�EthernetProtocolcCs
i|_dS)N)�etherProtos)rrrrr$szEthernetProtocol.__init__cCsRt�|�}|dkrtd��|dkr*td��||jkr>g|j|<|j|�|�dS)Nrz'Added protocol must be positive or zeroiz"Added protocol must fit in 16 bits)rZIRawPacketProtocol�	TypeErrorr�append)rZnumrrrrr	's


zEthernetProtocol.addProtorcCsLt|dd��}|j�|jd�D]&}|j|dd�||j|j|jd�q dS)Nrr)r�partialrrr)rr�getrr
rr)rrr�headerrrrrr
1s�z!EthernetProtocol.datagramReceivedN)r)rrr
rr	r
rrrrr"s
r)
rrZtwisted.internetrZtwisted.pairrZzope.interfacerrrrZAbstractDatagramProtocolrrrrr�<module>s