0x1949 Team - FAZEMRX - MANAGER
Edit File: network.cpython-310.pyc
o ���c� � @ sT d dl mZ d dlmZ d dlmZmZ d dlmZ d dl m Z G dd� de�ZdS ) � )�partial)� itemgetter)�AF_INET�AF_INET6)�succeed)�get_active_device_infoc @ s* e Zd ZdZd dd�Zdd� Zdd� ZdS ) �Networkz�Show information about active network interfaces. @param get_device_info: Optionally, a function that returns information about network interfaces. Defaults to L{get_active_device_info}. Nc C s |d u rt tddd�}|| _d S )NT)�extended�default_only)r r �_get_device_info)�self�get_device_info� r �;/usr/lib/python3/dist-packages/landscape/sysinfo/network.py�__init__ s � zNetwork.__init__c C s || _ dS )zeRegister this plugin with the sysinfo system. @param sysinfo: The sysinfo registry. N)�_sysinfo)r �sysinfor r r �register s zNetwork.registerc C s� | � � }t|td�d�D ]6}|d }|d �tg �}|d �tg �}|D ] }| j�d| |d � q$|D ] }| j�d| |d � q4qtd�S )z� Gather information about network interfaces and write it to the sysinfo output. @return: A succeeded C{Deferred}. � interface)�key�ip_addresseszIPv4 address for %s�addrzIPv6 address for %sN) r �sortedr �getr r r � add_headerr )r �device_info�infor �ipv4_addresses�ipv6_addressesr r r r �run s ���zNetwork.run)N)�__name__� __module__�__qualname__�__doc__r r r r r r r r s r N) � functoolsr �operatorr � netifacesr r �twisted.internet.deferr �landscape.lib.networkr �objectr r r r r �<module> s