Repository URL to install this package:
|
Version:
1.0.10 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
scapy
/
__pycache__
/
utils6.cpython-37.pyc
|
|---|
B
áÓ%Âñވªã U @ s" d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z ddl
mZmZm
Z
mZmZmZmZmZ ddlmZ ddlmZmZ dd lmZmZ dd
lmZmZ ddlmZm Z ddl!m"Z"m#Z# dd
lm$Z$m%Z%m&Z&m'Z'm(Z(m)Z) dd Z*dd Z+dd Z,dÂddZ-dd Z.dd Z/dd Z0dÃddZ1dd Z2d!d" Z3d#d$ Z4dÄd%d&Z5d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{gUZ6d|d} Z7d~d Z8dd Z9de_:de_;dd
Z<dd Z=dd Z>dd Z?dÅddZ@dd ZAdd ZBdd ZCdd ZDdd ZEdd ZFdd ZGdd ZHdd ZId d¡ ZJd¢d£ ZKd¤d¥ ZLd¦d§ ZMd¨d© ZNdªd« ZOd¬d ZPd®d¯ ZQd°d± ZRd²d³ ZSd´dµ ZTd¶d· ZUd¸d¹ ZVdºd» ZWd¼d½ ZXd¾d¿ ZYG dÀdD dÁe ZZdS )Æz
Utility functions for IPv6.
é )Úabsolute_importN)Úconf)ÚNet)ÚIPV6_ADDR_GLOBALÚIPV6_ADDR_LINKLOCALÚIPV6_ADDR_SITELOCALÚIPV6_ADDR_LOOPBACKÚIPV6_ADDR_UNICASTÚIPV6_ADDR_MULTICASTÚIPV6_ADDR_6TO4ÚIPV6_ADDR_UNSPECIFIED)Ústrxor)ÚorbÚchb)Ú inet_ptonÚ inet_ntop)ÚRandMACÚRandBin)ÚwarningÚScapy_Exception)ÚreduceÚ
cmp_to_key)ÚIteratorÚListÚOptionalÚTupleÚUnionÚcastc C s dd }t g }t| s t| r0dd |D }nÀt| rHdd |D }n¨t| r`dd |D }nt| rÒt| rdd dd tjfgD }qðt | r¢d
d |D }qðt
| rºdd |D }qðt| rðdd |D }n| d
krð|dkrðdd |D }dd |D }|jt
|d |S )aì
Given all addresses assigned to a specific interface ('laddr' parameter),
this function returns the "candidate set" associated with 'addr/plen'.
Basically, the function filters all interface addresses to keep only those
that have the same scope as provided prefix.
This is on this list of addresses that the source selection mechanism
will then be performed to select the best source address associated
with some specific destination that uses this prefix.
c S sN d}t | rd}d}t |r d}|| }|dks8|dkr<|S t| sHdS | S )Nr é éÿÿÿÿ)Úin6_isgladdrÚin6_isaddr6to4)ÚxÚyZx_globalZy_globalÚres© r% ú/build/wlanpi-profiler-7At3M6/wlanpi-profiler-1.0.10/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/scapy/utils6.pyÚ cset_sort8 s z1construct_source_candidate_set.<locals>.cset_sortc s s | ]}|d t kr|V qdS )r N)r )Ú.0r" r% r% r&