| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/pysnmp/entity/__pycache__/ |
Upload File : |
o
B�] � @ s� d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm Z m
Z
d dlmZ d dl
mZmZ d dlmZ d dlmZmZ d d lmZ d d
lmZ d dlmZ dgZG d
d� de�ZdS )� N)�str2octs)�MsgAndPduDispatcher)�SnmpV1MessageProcessingModel�SnmpV2cMessageProcessingModel)�SnmpV3MessageProcessingModel)�SnmpV1SecurityModel�SnmpV2cSecurityModel)�SnmpUSMSecurityModel)�rfc3415�void)�observer)�debug)�error�
SnmpEnginec @ sj e Zd ZdZ ddd�Zdd� Zdd � Zd
d� Zddd
�Zddd�Z dd� Z
dd� Zdd� Zdd� Z
dS )r ar Creates SNMP engine object.
SNMP engine object is central in SNMP v3 architecture. It is an umbrella
object that coordinates interactions between all parts of SNMP v3 system.
See :RFC:`3412#section-2.1` (where it is termed *The Dispatcher*).
With PySNMP design, `SnmpEngine` is the only stateful object, all SNMP
v3 operations require an instance of SNMP engine. Users do not normally
request services directly from `SnmpEngine`, but pass it around to
other PySNMP interfaces.
It is possible to run multiple instances of `SnmpEngine` in the
application. In a multithreaded environment, each thread that
works with SNMP must have its own `SnmpEngine` instance.
Parameters
----------
snmpEngineID : :py:class:`~pysnmp.proto.rfc1902.OctetString`
Unique and unambiguous identifier of an SNMP engine.
If not given, `snmpEngineID` is autogenerated and stored on
the filesystem. See :RFC:`3411#section-3.1.1` for details.
Examples
--------
>>> SnmpEngine()
SnmpEngine(snmpEngineID=OctetString(hexValue='0x80004fb80567726f6d6d69742'))
>>>
N�� c C s� i | _ t�� | _|d u rt� | _n|| _tjt� tjt� tjt� i| _ t
jt
� tjt� t
jt
� i| _tjjt�� tjjt�� i| _d | _| jjd u rOt�d��| jjj�dd�\}|j�|�|_| jjj�dd�\}| jd7 _| jjj�dd�\}|d u r�|j| _d S |j�|�|_|j| _tjtj@ o�t�d| j� � � t!j"�#t$�%� d| j� � �}tjtj@ o�t�d | � t!j"�&|�s�zt!�'|� W n
t(y� Y d S w t!j"�#|d
�}z
|j�t)|��*� �|_W n t+y� Y nw z | jd7 _W n t+�y
|j�d�|_Y nw z t$j,|d�\} }
t!�-| t.|j� � �� t!�/| � t0�1|
|� W n! t+�yL tjtj@ �oHt�dt2�3� d � Y d S Y d S w tjtj@ �o]t�d
|j� � � d S )Nz&MIB instrumentation does not yet existz__SNMP-FRAMEWORK-MIB�snmpEngineMaxMessageSize�snmpEngineBoots� �snmpEngineIDz+SnmpEngine: using custom SNMP Engine ID: %s�__pysnmpz*SnmpEngine: using persistent directory: %s�boots)�dirz2SnmpEngine: could not stored SNMP Engine Boots: %sz(SnmpEngine: stored SNMP Engine Boots: %s)4�cacher �MetaObserverr �msgAndPduDspr �messageProcessingModelIDr r �messageProcessingSubsystemsr �securityModelIDr r �securityModelsr �Vacm�
accessModelIDr
�accessControlModel�transportDispatcher�mibInstrumControllerr �PySnmpError�
mibBuilder�
importSymbols�syntax�cloner r
�logger�flagApp�prettyPrint�os�path�join�tempfile�
gettempdir�exists�makedirs�OSError�open�read� Exception�mkstemp�writer �close�shutil�move�sys�exc_info)�selfr �maxMessageSizer r r �origSnmpEngineID�persistentPath�f�fd�fn� rE �6/usr/lib/python3/dist-packages/pysnmp/entity/engine.py�__init__8 s�
� ���
���������
���� zSnmpEngine.__init__c C s d| j j| jf S )Nz%s(snmpEngineID=%r))� __class__�__name__r �r>