__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

x[h�.���SSKrSSKrSSKrSSKrSSKrSSKJr SSKJr \R"\
5rSrSr
SrSrSrS	rSrS
rSrSr\R,"\5r\R,"\5r\\-rS
rS
rSrSrSrSrSr Sr!S
r"Sr#Sr$\"S/SQ5r%\"SSS/5r&\"S/SQ5r'"SS\(5r)Sr*Sr+S$Sjr,Sr-Sr.S r/S!r0S"r1S#r2g)%�N)�
namedtuple)�util�����i���<�IHHII�BHiII������RTAAttr)�length�rta_type�data�InterfaceOperstate�ifname�	operstate�
NetlinkHeader)r�type�flags�seq�pidc��\rSrSrSrSrg)�NetlinkCreateSocketError�5z5Raised if netlink socket fails during create or bind.�N)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r!��C/usr/lib/python3/dist-packages/cloudinit/sources/helpers/netlink.pyrr5s��?r(rc��[R"[R[R[R5nUR	[
R"5[45 URS5 [RS5 U$![RanSU-n[U5UeSnAff=f)a]Creates netlink socket and bind on netlink group to catch interface
down/up events. The socket will bound only on RTMGRP_LINK (which only
includes RTM_NEWLINK/RTM_DELLINK/RTM_GETLINK events). The socket is set to
non-blocking mode since we're only receiving messages.

:returns: netlink socket in non-blocking mode
:raises: NetlinkCreateSocketError
rz*Exception during netlink socket create: %sNzCreated netlink socket)
�socket�
AF_NETLINK�SOCK_RAW�
NETLINK_ROUTE�bind�os�getpid�RTMGRP_LINK�setblocking�errorr�LOG�debug)�netlink_socket�e�msgs   r)�create_bound_netlink_socketr:9s���3�������v����0D�0D�
��	���R�Y�Y�[�+�6�7��"�"�1�%��I�I�&�'����	�<�<�3�:�Q�>��&�s�+��2��3�s�A=B�C�*B;�;Cc���UcS5e[U5[:�dS5e[R"[US[
5upp4n[RSU5 [XX4U5$)a�Gets netlink message type and length

:param: data read from netlink socket
:returns: netlink message type
:raises: AssertionError if data is None or data is not >= NLMSGHDR_SIZE
struct nlmsghdr {
           __u32 nlmsg_len;    /* Length of message including header */
           __u16 nlmsg_type;   /* Type of message content */
           __u16 nlmsg_flags;  /* Additional flags */
           __u32 nlmsg_seq;    /* Sequence number */
           __u32 nlmsg_pid;    /* Sender port ID */
};
N�data is nonez+data is smaller than netlink message headerzGot netlink msg of type %d)	�len�
NLMSGHDR_SIZE�struct�unpack�NLMSGHDR_FMT�MSG_TYPE_OFFSETr5r6r)r�msg_len�msg_typerrrs      r)�get_netlink_msg_headerrEOss����+�^�+���D�	�]�"�5�4�5�"�)/����d�+�O�,�*�&�G�u�3��I�I�*�H�5���E��<�<r(c���UcS5e[R"U///U5un nX;ag[RS5 UR[5nUc[RS5 U$)a�Select and read from the netlink socket if ready.

:param: netlink_socket: specify which socket object to read from
:param: timeout: specify a timeout value (integer) to wait while reading,
        if none, it will block indefinitely until socket ready for read
:returns: string of data read (max length = <MAX_SIZE>) from socket,
          if no data read, returns None
:raises: AssertionError if netlink_socket is None
N�netlink socket is noneznetlink socket ready for readz,Reading from Netlink socket returned no data)�selectr5r6�recv�MAX_SIZEr4)r7�timeout�read_set�_rs     r)�read_netlink_socketrNhsr���%�?�'?�?�%��]�]�N�#3�R��W�E�N�H�a���%���I�I�-�.����x�(�D��|��	�	�@�A��Kr(c�H�UcS5e[U[5(dS5eU[:�dS5eS=p#Sn[R"SXS9Sn[R"SXS-S9SnX[-X-n[X#U5$![R
a gf=f)	aUnpack a single rta attribute.

:param: data: string of data read from netlink socket
:param: offset: starting offset of RTA Attribute
:return: RTAAttr object with length, type and data. On error, return None.
:raises: AssertionError if data is None or offset is not integer.
Nr<zoffset is not integerz'rta offset is less than expected lengthr�H)�offsetr)�
isinstance�int�RTATTR_START_OFFSETr?�unpack_fromr4�RTA_DATA_START_OFFSETr)rrQrr�	attr_datas     r)�unpack_rta_attrrXs�����+�^�+���f�c�"�"�;�$;�;�"��%�%�1�0�1�%���F��I���#�#�C��=�a�@���%�%�c�4��
�C�A�F��
�3�3�f�o�F�I��6�Y�/�/���<�<����s�3B
�
B!� B!c�~�UcS5e[U5[:�dS5eS=p[nU[U5::a�[X5nU(aURS:XaO�[UR[--
[-nX4RU--
nUR
[:Xa[UR5nOFUR
[:Xa2[R"URS5nURS5nU[U5::aM�U(aUcg[RSX5 [X5$)a�Reads Interface name and operational state from RTA Data.

:param: data: string of data read from netlink socket
:returns: InterfaceOperstate object containing if_name and oper_state.
          None if data does not contain valid IFLA_OPERSTATE and
          IFLA_IFNAME messages.
:raises: AssertionError if data is None or length of data is
         smaller than RTATTR_START_OFFSET.
Nr<z2length of data is smaller than RTATTR_START_OFFSETrzutf-8�z!rta attrs: ifname %s operstate %d)r=rTrXr�
PAD_ALIGNMENTr�IFLA_OPERSTATE�ordr�IFLA_IFNAMEr�
decode_binary�stripr5r6r)rrrrQ�attr�padlen�interface_names       r)�read_rta_oper_staterd�s����+�^�+���D�	�'�'�<�;�<�'���F�
 �F�
�C��I�
��t�,���t�{�{�a�'��
�T�[�[�=�8�9����	�+�+��&�&���=�=�N�*��D�I�I��I�
�]�]�k�
)�!�/�/��	�	�7�C�N�#�)�)�$�/�F��C��I�
��Y�&���I�I�1�6�E��f�0�0r(c�^^�[RS5 SmUU4Sjn[US[/[[
/U5 T$)z�Block until a single nic is attached.

:param: netlink_socket: netlink_socket to receive events
:param: existing_nics: List of existing nics so that we can skip them.
:raises: AssertionError if netlink_socket is none.
z!Preparing to wait for nic attach.Nc�>�UT;agUmg)NTFr!)�iname�carrier�prevCarrier�
existing_nicsrs   ��r)�should_continue_cb�5wait_for_nic_attach_event.<locals>.should_continue_cb�s����M�!����r()r5r6�read_netlink_messages�RTM_NEWLINK�OPER_UP�	OPER_DOWN)r7rjrkrs ` @r)�wait_for_nic_attach_eventrq�sC����I�I�1�2�
�F�����	�
�	�)�����Mr(c�t^�[RS5 SmU4Sjn[US[/[/U5 T$)z�Block until a single nic is detached and its operational state is down.

:param: netlink_socket: netlink_socket to receive events.
z!Preparing to wait for nic detach.Nc�
>�Umg)NFr!)rgrhrirs   �r)rk�5wait_for_nic_detach_event.<locals>.should_continue_cb�s�����r()r5r6rm�RTM_DELLINKrp)r7rkrs  @r)�wait_for_nic_detach_eventrv�s=���
�I�I�1�2�
�F��
���{�m�i�[�:L���Mr(c��^�UcS5eTcS5e[T5S:�dS5eU4Sjn[RS5 [UT[[
/[[/U5 g)a�Block until media disconnect and connect has happened on an interface.
Listens on netlink socket to receive netlink events and when the carrier
changes from 0 to 1, it considers event has happened and
return from this function

:param: netlink_socket: netlink_socket to receive events
:param: ifname: Interface name to lookout for netlink events
:raises: AssertionError if netlink_socket is None or ifname is None.
NrGzinterface name is nonerzinterface name cannot be emptyc�t>�U[:H=(a	 U[:HnU(a[RST5 gg)NzMedia switch happened on %s.FT)rpror5r6)rgrhri�isVnetSwitchrs    �r)rk�=wait_for_media_disconnect_connect.<locals>.should_continue_cb�s/���#�y�0�J�w�'�7I����I�I�4�f�=��r(z1Wait for media disconnect and reconnect to happen)r=r5r6rmrnrurorp)r7rrks ` r)�!wait_for_media_disconnect_connectr{�st����%�?�'?�?�%���7�7�7���v�;��?�<�<�<�?���I�I�A�B����	�k�"�	�)���r(c���Uc[S5e[5n[n[n[U[5nUcM[
R
S[U55 XX-
n[
R
S[U55 Sn	[U5n
X�:GaTXYSn[U5[:a[
R
S5 GO&[U5n[U5UR:a[
R
S5 O�UR[-S-
[S-
)-n
X�-n	[
R
S	U	5 URU;aM�[U5nUc[
R
S
U5 M�Ub4URU:wa$[
R
SURU5 GMURU;aGM+UnURnU"URXg5(dgX�:aGMTXYSnGM�)a�Reads from the netlink socket until the condition specified by
the continuation callback is met.

:param: netlink_socket: netlink_socket to receive events.
:param: ifname_filter: if not None, will only listen for this interface.
:param: rtm_types: Type of netlink events to listen for.
:param: operstates: Operational states to listen.
:param: should_continue_callback: Specifies when to stop listening.
NzNetlink socket is nonezread %d bytes from socketzLength of data after concat %drz#Data is smaller than netlink headerz*Partial data. Smaller than netlink messagerz"offset to next netlink message: %dz!Failed to read rta attributes: %sz6Ignored netlink event on interface %s. Waiting for %s.)�RuntimeError�bytesrorN�SELECT_TIMEOUTr5r6r=r>rErr[rrdrr)r7�
ifname_filter�	rtm_types�
operstates�should_continue_callbackrrhri�	recv_datarQ�datalen�nl_msg�nlheaderrb�interface_states               r)rmrms��� ���3�4�4��7�D��G��K�
�'���G�	�����	�	�-�s�9�~�>�����	�	�2�C��I�>����d�)�����'�]�F��6�{�]�*��	�	�?�@��-�f�5�H��6�{�X�_�_�,��	�	�F�G���o�o�
�5��9���!�>��F��_�F��I�I�:�F�C��}�}�I�-��1�&�9�O��&��	�	�=��O���)�#�*�*�m�;��	�	�L�#�*�*�!��
��(�(�
�:��!�K�%�/�/�G�+��&�&�����M��N�G�}��ar()N)3�loggingr0rHr+r?�collectionsr�	cloudinitr�	getLoggerr"r5r2rnru�RTM_GETLINK�RTM_SETLINKrJrBrrA�
IFINFOMSG_FMT�calcsizer>�IFINFOMSG_SIZErTrVr[r^r\�OPER_UNKNOWN�OPER_NOTPRESENTrp�OPER_LOWERLAYERDOWN�OPER_TESTING�OPER_DORMANTrorrrr}rr:rErNrXrdrqrvr{rmr!r(r)�<module>r�s0��
�	�
�
�
�"��
����!���������������������
�����-�
�����/��#�n�4�����
���������
�	�������
��
�Y� >�
?��� 4�x��6M�N����>��
�
@�|�@��,=�2�.0�4"1�J�:�&�@Er(

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 165 B 0644
akamai.cpython-313.pyc File 1.93 KB 0644
aliyun.cpython-313.pyc File 5.91 KB 0644
azure.cpython-313.pyc File 46.53 KB 0644
cloudsigma.cpython-313.pyc File 4.71 KB 0644
digitalocean.cpython-313.pyc File 8.25 KB 0644
ec2.cpython-313.pyc File 9.33 KB 0644
hetzner.cpython-313.pyc File 1.14 KB 0644
netlink.cpython-313.pyc File 13.02 KB 0644
openstack.cpython-313.pyc File 28.2 KB 0644
upcloud.cpython-313.pyc File 6.95 KB 0644
vultr.cpython-313.pyc File 8.2 KB 0644
Filemanager