Current File : //proc/self/root/lib/python3/dist-packages/twisted/pair/__pycache__/testing.cpython-312.pyc
�

Ϫ�fhC��0�dZddlZddlZddlmZddlmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZmZmZmZddlm Z d
Z!d�Z"dZ#d�Z$d�Z%d�Z&Gd�d�Z'd�Z(ee�Gd�d��Z)Gd�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�.�tjd|�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�_Hrs���;�;�t�Q����c�*�||zt|�z|zS)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'.s��&��9�r�(�|�#�g�-�-rc��dtdt|�z�zdztd�ztjtjt|��ztjtjt|��z}t
tjd|��}|dz	}|dz|z}|dz}|dd	tjd
|�z|ddz}||zS)a�
    Construct an IP datagram with the given source, destination, and
    application payload.

    @param src: The source IPv4 address as a dotted-quad string.
    @type src: L{bytes}

    @param dst: The destination IPv4 address as a dotted-quad string.
    @type dst: L{bytes}

    @param payload: The content of the IP datagram (such as a UDP datagram).
    @type payload: L{bytes}

    @return: An IP datagram header and payload.
    @rtype: L{bytes}
    sE�s@rz!10H�i��N�
z!H�)
r�len�socket�	inet_pton�AF_INETr�sumr�unpackr)r#r$r&�ipHeader�
checksumStep1�carry�
checksumStep2�
checksumStep3s        r�_ipr8Ds���&	�
�R�#�g�,�
�
�		 �
&�	&�
�Q�%�	��
�
�6�>�>�<��+<�
=�		>��
�
�6�>�>�<��+<�
=�	>�
�"��
�
�f�h�7�8�M��R��E�"�V�+�u�4�M�!�F�*�M�
���}�v�{�{�4��?�?�(�2�3�-�O�H��g��rc��t|�t|�ztt|�dz�ztd�z}||zS)a~
    Construct a UDP datagram with the given source, destination, and
    application payload.

    @param src: The source port number.
    @type src: L{int}

    @param dst: The destination port number.
    @type dst: L{int}

    @param payload: The content of the UDP datagram.
    @type payload: L{bytes}

    @return: A UDP datagram header and payload.
    @rtype: L{bytes}
    �r)rr-)r#r$r&�	udpHeaders    r�_udpr<vsO��&	�3��
�S�'�	�
�S��\�A�
�
�		�
�Q�%�
	���w��rc��eZdZdZdZeed�Zee	d�Z
eed�ZeZ
dZd�Zed��Zed	��Zd
�Zd�Zd�Zy
)�Tunnelz�
    An in-memory implementation of a tun or tap device.

    @cvar _DEVICE_NAME: A string representing the conventional filesystem entry
        for the tunnel factory character special device.
    @type _DEVICE_NAME: C{bytes}
    s/dev/net/tunz Resource temporarily unavailablezOperation would blockzInterrupted function callic��||_||_d|_d|_d|_t�|_t�|_t�|_y)a
        @param system: An L{_IInputOutputSystem} provider to use to perform I/O.

        @param openFlags: Any flags to apply when opening the tunnel device.
            See C{os.O_*}.

        @type openFlags: L{int}

        @param fileMode: ignored
        N)	�system�	openFlags�
tunnelMode�
requestedName�namer�
readBuffer�writeBuffer�pendingSignals)�selfr@rA�fileModes    r�__init__zTunnel.__init__�sG�����#������!�����	��'��� �7���#�g��rc�J�|j|jjzS)zx
        If the file descriptor for this tunnel is open in blocking mode,
        C{True}.  C{False} otherwise.
        )rAr@�
O_NONBLOCK�rHs r�blockingzTunnel.blocking�s ���N�N�T�[�[�%;�%;�;�<�<rc�Z�t|j|jjz�S)zz
        If the file descriptor for this tunnel is marked as close-on-exec,
        C{True}.  C{False} otherwise.
        )�boolrAr@�	O_CLOEXECrMs r�closeOnExeczTunnel.closeOnExec�s"���D�N�N�T�[�[�%:�%:�:�;�;rc��|jtjjzrt	ddt
|��}|jj|�y)aI
        Deliver a datagram to this tunnel's read buffer.  This makes it
        available to be read later using the C{read} method.

        @param datagram: The IPv4 datagram to deliver.  If the mode of this
            tunnel is TAP then ethernet framing will be added automatically.
        @type datagram: L{bytes}
        ss������r"N)rBr�IFF_TAP�valuer'�_IPv4rE�append�rH�datagrams  r�addToReadBufferzTunnel.addToReadBuffer�sC���?�?�[�0�0�6�6�6� ��[�5�(��H�	
�����x�(rc��|jrX|jtjjzrd}ndt
z}|dz}||jj
�d|zS|jr
t��|j�)a
        Read a datagram out of this tunnel.

        @param limit: The maximum number of bytes from the datagram to return.
            If the next datagram is larger than this, extra bytes are dropped
            and lost forever.
        @type limit: L{int}

        @raise OSError: Any of the usual I/O problems can result in this
            exception being raised with some particular error number set.

        @raise IOError: Any of the usual I/O problems can result in this
            exception being raised with some particular error number set.

        @return: The datagram which was read from the tunnel.  If the tunnel
            mode does not include L{TunnelFlags.IFF_NO_PI} then the datagram is
            prefixed with a 4 byte PI header.
        @rtype: L{bytes}
        r�rN)
rErBr�	IFF_NO_PIrU�_PI_SIZE�popleftrN�NotImplementedError�nonBlockingExceptionStyle)rH�limit�headers   r�readzTunnel.read�sx��(�?�?�����!6�!6�!<�!<�<���
!�8�+����
���D�O�O�3�3�5�f�u�=�=�=�
�]�]�%�'�'��0�0�0rc�
�|jr*|jj�ttd��t	|�|j
kDrttd��|jj|�t	|�S)a{
        Write a datagram into this tunnel.

        @param datagram: The datagram to write.
        @type datagram: L{bytes}

        @raise IOError: Any of the usual I/O problems can result in this
            exception being raised with some particular error number set.

        @return: The number of bytes of the datagram which were written.
        @rtype: L{int}
        zInterrupted system callzNo buffer space available)	rGr_�OSErrorrr-�SEND_BUFFER_SIZErrFrWrXs  r�writezTunnel.writesk��������'�'�)��%�!:�;�;��x�=�4�0�0�0��'�#>�?�?�������)��8�}�rN)�__name__�
__module__�__qualname__�__doc__�_DEVICE_NAME�IOErrorr�EAGAIN_STYLErfr�EWOULDBLOCK_STYLEr�EINTR_STYLErargrJ�propertyrNrRrZrdrh�rrr>r>�s����#�L��6�#E�F�L���-D�E���%�!<�=�K� ,����&�.�=��=��<��<�)�"!1�Frr>c�.��t���fd��}|S)a|
    Wrap a L{MemoryIOSystem} method with permission-checking logic.  The
    returned function will check C{self.permissions} and raise L{IOError} with
    L{errno.EPERM} if the function name is not listed as an available
    permission.

    @param original: The L{MemoryIOSystem} instance to wrap.

    @return: A wrapper around C{original} that applies permission checks.
    c�l���j|jvrttd���|g|��i|��S)NzOperation not permitted)ri�permissionsrfr
)rH�args�kwargs�originals   �r�permissionCheckerz&_privileged.<locals>.permissionChecker+s:������D�$4�$4�4��%�!:�;�;���.�t�.�v�.�.rr)ryrzs` r�_privilegedr{s#����8�_�/��/�
�rc�r�eZdZdZdZdZdZdZd�Zd�Z	d�Z
edd
��Zd�Z
d�Zd
�Zed��Zd�Zd�Zy	)�MemoryIOSystemz�
    An in-memory implementation of basic I/O primitives, useful in the context
    of unit testing as a drop-in replacement for parts of the C{os} module.

    @ivar _devices:
    @ivar _openFiles:
    @ivar permissions:

    @ivar _counter:
    i ��rc�2�i|_i|_ddh|_y)N�open�ioctl)�_devices�
_openFilesrvrMs rrJzMemoryIOSystem.__init__Gs����
����"�G�,��rc�<�|j|j�S)aX
        Get the L{Tunnel} object associated with the given L{TuntapPort}.

        @param port: A L{TuntapPort} previously initialized using this
            L{MemoryIOSystem}.

        @return: The tunnel object created by a prior use of C{open} on this
            object on the tunnel special device file.
        @rtype: L{Tunnel}
        )r��fileno)rH�ports  r�	getTunnelzMemoryIOSystem.getTunnelLs�����t�{�{�}�-�-rc�"�||j|<y)a1
        Specify a class which will be used to handle I/O to a device of a
        particular name.

        @param name: The filesystem path name of the device.
        @type name: L{bytes}

        @param cls: A class (like L{Tunnel}) to instantiated whenever this
            device is opened.
        N)r�)rHrD�clss   r�registerSpecialDevicez$MemoryIOSystem.registerSpecialDeviceYs��"��
�
�d�rNc���||jvrG|j}|xjdz
c_|j||||�|j|<|Sttd��)a�
        A replacement for C{os.open}.  This initializes state in this
        L{MemoryIOSystem} which will be reflected in the behavior of the other
        file descriptor-related methods (eg L{MemoryIOSystem.read},
        L{MemoryIOSystem.write}, etc).

        @param name: A string giving the name of the file to open.
        @type name: C{bytes}

        @param flags: The flags with which to open the file.
        @type flags: C{int}

        @param mode: The mode with which to open the file.
        @type mode: C{int}

        @raise OSError: With C{ENOSYS} if the file is not a recognized special
            device file.

        @return: A file descriptor associated with the newly opened file
            description.
        @rtype: L{int}
        r~zFunction not implemented)r��_counterr�rfr	)rHrD�flags�mode�fds     rr�zMemoryIOSystem.openfs\��0�4�=�=� ����B��M�M�Q��M�"5�$�-�-��"5�d�E�4�"H�D�O�O�B���I��f�8�9�9rc�z�	|j|j|�S#t$rttd��wxYw)z�
        Try to read some bytes out of one of the in-memory buffers which may
        previously have been populated by C{write}.

        @see: L{os.read}
        �Bad file descriptor)r�rd�KeyErrorrfr)rHr�rbs   rrdzMemoryIOSystem.read�s>��	8��?�?�2�&�+�+�E�2�2���	8��%�!6�7�7�	8��� �:c�z�	|j|j|�S#t$rttd��wxYw)z�
        Try to add some bytes to one of the in-memory buffers to be accessed by
        a later C{read} call.

        @see: L{os.write}
        r�)r�rhr�rfr)rHr��datas   rrhzMemoryIOSystem.write�s>��	8��?�?�2�&�,�,�T�2�2���	8��%�!6�7�7�	8�r�c�Z�	|j|=y#t$rttd��wxYw)z�
        Discard the in-memory buffer and other in-memory state for the given
        file descriptor.

        @see: L{os.close}
        r�N)r�r�rfr)rHr�s  r�closezMemoryIOSystem.close�s0��	8�����#���	8��%�!6�7�7�	8�s�
�*c�f�	|j|}|tk7rtt
d��t
jdtfz|�\}}||_	||_
|dtdz
dz|_t
jdtfz|j|�S#t$rttd��wxYw)z�
        Perform some configuration change to the in-memory state for the given
        file descriptor.

        @see: L{fcntl.ioctl}
        r�zRequest or args is not valid.z%dsHN�s123)
r�r�rfrrrrr2rrBrCrDr)rHr��requestrw�tunnelrDr�s       rr�zMemoryIOSystem.ioctl�s���	8��_�_�R�(�F��j� ��&�"A�B�B��]�]�6�Y�L�#8�$�?�
��d� ���#����?�Y��]�+�f�4����{�{�6�Y�L�0�&�+�+�t�D�D���	8��%�!6�7�7�	8�s�B�B0c	��d}d}t||dt||d|����}t|jj	��}|dj|�||fS)ah
        Write an ethernet frame containing an ip datagram containing a udp
        datagram containing the given payload, addressed to the given address,
        to a tunnel device previously opened on this I/O system.

        @param datagram: A UDP datagram payload to send.
        @type datagram: L{bytes}

        @param address: The destination to which to send the datagram.
        @type address: L{tuple} of (L{bytes}, L{int})

        @return: A two-tuple giving the address from which gives the address
            from which the datagram was sent.
        @rtype: L{tuple} of (L{bytes}, L{int})
        z10.1.2.3iaSrr~)r#r$r&)r8r<�listr��valuesrZ)rHrY�address�srcIP�srcPort�
serialized�	openFiless       r�sendUDPzMemoryIOSystem.sendUDP�sh��"��������
��W�'�!�*�h�G�
�
�����/�/�1�2�	��!��$�$�Z�0��w��rc��t||�S)aa
        Get a socket-like object which can be used to receive a datagram sent
        from the given address.

        @param fileno: A file descriptor representing a tunnel device which the
            datagram will be received via.
        @type fileno: L{int}

        @param host: The IPv4 address to which the datagram was sent.
        @type host: L{bytes}

        @param port: The UDP port number to which the datagram was sent.
            received.
        @type port: L{int}

        @return: A L{socket.socket}-like object which can be used to receive
            the specified datagram.
        )�	_FakePort)rHr��hostr�s    r�
receiveUDPzMemoryIOSystem.receiveUDP�s��&��v�&�&r�N)rirjrkrlr��O_RDWRrLrQrJr�r�r{r�rdrhr�r�r�r�rsrrr}r}4so��	��H�
�F��J��I�-�
.�"��:��:�<
8�
8�
8��E��E�, �>'rr}c��eZdZdZd�Zd�Zy)r�z�
    A socket-like object which can be used to read UDP datagrams from
    tunnel-like file descriptors managed by a L{MemoryIOSystem}.
    c� �||_||_yr�)�_system�_fileno)rHr@r�s   rrJz_FakePort.__init__�s�������rc�~�
��|jj|jjj	�}g�
t�}�
fd�}||_t�}|jd|�t���jd|�|jj|jj}|tjjzr)t�}|jd��|j}n�fd�}|tjjz}	|	r	|t d}||��
dd|S)a_
        Receive a datagram sent to this port using the L{MemoryIOSystem} which
        created this object.

        This behaves like L{socket.socket.recv} but the data being I{sent} and
        I{received} only passes through various memory buffers managed by this
        object and L{MemoryIOSystem}.

        @see: L{socket.socket.recv}
        c�(���j|�yr�)rW)rYr��	datagramss  �r�capturez_FakePort.recv.<locals>.captures������X�&ri90�r c�.���j|dddd�Sr�)�datagramReceived)r��ips �r�<lambda>z _FakePort.recv.<locals>.<lambda> s���B�,?�,?��d�D�$��-�rNr)r�r�r�rFr_rr�r�addProtorrBrrTrUrr]r^)rH�nbytesr��receiverr��udpr��etherr��	dataHasPIr�r�s          @@r�recvz_FakePort.recv�s����|�|�&�&�t�|�|�4�@�@�H�H�J���	�#�%��	'�%,��!�������U�H�%�
�\��
���B����|�|�&�&�t�|�|�4�?�?���+�%�%�+�+�+�$�&�E��N�N�5�"�%�$�5�5�� ���� 5� 5� ;� ;�;�<�	����	�?�D������|�G�V�$�$rN)rirjrkrlrJr�rsrrr�r��s���
�,%rr�)+rlr.r�collectionsr�errnorrrrrr	r
r�	functoolsr
�zope.interfacer�twisted.internet.protocolr�twisted.pair.ethernetr�twisted.pair.ipr�twisted.pair.rawudpr�twisted.pair.tuntaprrrr�twisted.python.compatrr^rrVr'r8r<r>r{r}r�rsrr�<module>r�s�����
��S�S�S��&�6�2�&�.�W�W�.�
��
 �	��.�,/�d�<H�H�V�*
�
 �!�}'�}'�"�}'�@6%�6%r
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!