관리-도구
편집 파일: wire.cpython-38.pyc
U /?�f � @ sF d dl Z d dlZd dlmZmZmZ d dlZd dlZG dd� d�Z dS )� N)�Iterator�Optional�Tuplec @ s� e Zd Zd(eed�dd�Zed�dd�Zeed�d d �Zd)eed�d d�Zed�dd�Z ed�dd�Z ed�dd�Zed�dd�Zed�dd�Z eed�dd�Zd*ed dd�dd �Zedd!�d"d#�Zejeed�d$d%��Zejed�d&d'��ZdS )+�Parserr )�wire�currentc C s0 || _ d| _t| j �| _|r&| �|� || _d S �Nr )r r �len�end�seek�furthest)�selfr r � r �6/opt/hc_python/lib/python3.8/site-packages/dns/wire.py�__init__ s zParser.__init__)�returnc C s | j | j S �N)r r �r r r r � remaining s zParser.remaining)�sizer c C sX |dkst �|| �� kr tjj�| j| j| j| � }| j|7 _t| j| j�| _|S r ) �AssertionErrorr �dns� exception� FormErrorr r �maxr )r r �outputr r r � get_bytes s zParser.get_bytes� )�length_sizer c C s t �| �|�d�}| �|�S )N�big��int� from_bytesr )r r �lengthr r r �get_counted_bytes s zParser.get_counted_bytesc C s | � | �� �S r )r r r r r r � get_remaining$ s zParser.get_remainingc C s t �d| �d��d S )Nz!Br r ��struct�unpackr r r r r � get_uint8'