ZerethShell
File Manager
SQL Manager
/
lib
/
python3.6
/
site-packages
/
dns
/
rdtypes
/
IN
/
__pycache__
APL.cpython-36.pyc
3 �b�Wt � @ sd d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ G dd� de �Z G dd� dejj�Z dS )� N)�xrangec @ s4 e Zd ZdZddddgZdd� Zdd � Zd d� ZdS ) �APLItema' An APL list item. @ivar family: the address family (IANA address family registry) @type family: int @ivar negation: is this item negated? @type negation: bool @ivar address: the address @type address: string @ivar prefix: the prefix length @type prefix: int �family�negation�address�prefixc C s || _ || _|| _|| _d S )N)r r r r )�selfr r r r � r �/usr/lib/python3.6/APL.py�__init__* s zAPLItem.__init__c C s2 | j rd| j| j| jf S d| j| j| jf S d S )Nz !%d:%s/%sz%d:%s/%s)r r r r )r r r r �__str__0 s zAPLItem.__str__c C s� | j dkr tjjtjj| j�}n,| j dkr@tjjtjj| j�}ntj| j�}d}x6t t |�d dd�D ]}|| td�krf|d }P qfW |d|� }t |�}|dk s�t�| j r�|dO }tjd| j | j|�}|j|� |j|� d S )N� � r � z!HBB���r )r �dns�inetZ inet_pton�AF_INETr �AF_INET6�binasciiZ unhexlifyr �len�chr�AssertionErrorr �struct�packr �write)r �filer Zlast�i�l�headerr r r �to_wire6 s$ zAPLItem.to_wireN)�__name__� __module__�__qualname__�__doc__� __slots__r r r r r r r r s r c sV e Zd ZdZdgZ� fdd�Zddd�Zedd d ��Zddd�Z edd d��Z � ZS )�APLzfAPL record. @ivar items: a list of APL items @type items: list of APL_Item @see: RFC 3123�itemsc s t t| �j||� || _d S )N)�superr&