%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/ethtool.pyc

�
���^c@@s�dZddlmZmZmZddlZyddlZeZWne	k
r]e
ZnXeje�Z
idd6dd6dd6dd	6d
d6dd
6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6ZiZx$ej�D]\ZZeee<q Wid.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6ZiZx$ej�D]\ZZeee<q�Wd>Zd?�Zd@�ZdA�ZdB�ZdC�ZdD�ZdE�ZdF�ZdS(Gu�
Module for running ethtool command

.. versionadded:: 2016.3.0

:codeauthor:    Krzysztof Pawlowski <msciciel@msciciel.eu>
:maturity:      new
:depends:       python-ethtool
:platform:      linux
i(tabsolute_importtprint_functiontunicode_literalsNu
pkt_rate_highupkt_rate_lowurate_sample_intervalusample_intervalurx_coalesce_usecsurx_usecsurx_coalesce_usecs_highu
rx_usecs_highurx_coalesce_usecs_irqurx_usecs_irqurx_coalesce_usecs_lowurx_usecs_lowurx_max_coalesced_framesu	rx_framesurx_max_coalesced_frames_highurx_frames_highurx_max_coalesced_frames_irqu
rx_frames_irgurx_max_coalesced_frames_lowu
rx_frames_lowustats_block_coalesce_usecsustats_block_usecsutx_coalesce_usecsutx_usecsutx_coalesce_usecs_highu
tx_usecs_highutx_coalesce_usecs_irqutx_usecs_irqutx_coalesce_usecs_lowutx_usecs_lowutx_max_coalesced_framesu	tx_framesutx_max_coalesced_frames_highutx_frames_highutx_max_coalesced_frames_irqu
tx_frames_irqutx_max_coalesced_frames_lowu
tx_frames_lowuuse_adaptive_rx_coalesceuadaptive_rxuuse_adaptive_tx_coalesceuadaptive_txu
rx_pendingurxurx_max_pendingurx_maxurx_mini_pendingurx_miniurx_mini_max_pendingurx_mini_maxurx_jumbo_pendingurx_jumbourx_jumbo_max_pendingurx_jumbo_maxu
tx_pendingutxutx_max_pendingutx_maxuethtoolcC@str
tStdfSdS(u>
    Only load this module if python-ethtool is installed
    uKThe ethtool module could not be loaded: ethtool python libraries not found.N(tHAS_ETHTOOLt__virtualname__tFalse(((s8/usr/lib/python2.7/site-packages/salt/modules/ethtool.pyt__virtual__JscC@sqytj|�}Wn"tk
r7tjd|�dSXi}x,|j�D]\}}|||t|<qKW|S(u�
    Queries the specified network device for rx/tx ring parameter information

    CLI Example:

    .. code-block:: bash

        salt '*' ethtool.show_ring <devname>
    u#Ring parameters not supported on %su
Not supported(tethtoolt
get_ringparamtIOErrortlogterrortitemstethtool_ring_remap(tdevnametringtrettkeytvalue((s8/usr/lib/python2.7/site-packages/salt/modules/ethtool.pyt	show_ringUs
cC@sqytj|�}Wn"tk
r7tjd|�dSXi}x,|j�D]\}}|||t|<qKW|S(u�
    Queries the specified network device for coalescing information

    CLI Example:

    .. code-block:: bash

        salt '*' ethtool.show_coalesce <devname>
    u(Interrupt coalescing not supported on %su
Not supported(Rtget_coalesceR	R
RRtethtool_coalesce_remap(RtcoalesceRRR((s8/usr/lib/python2.7/site-packages/salt/modules/ethtool.pyt
show_coalescems
cC@s�ytj|�}Wn"tk
r7tjd|�dSXytj|�}Wn"tk
rotjd|�dSXi|d6|d6}|S(u�
    Queries the specified network device for associated driver information

    CLI Example:

    .. code-block:: bash

        salt '*' ethtool.show_driver <devname>
    u(Driver information not implemented on %suNot implementedu"Bus information no available on %su
Not availableudriverubus_info(Rt
get_moduleR	R
Rtget_businfo(RtmoduletbusinfoR((s8/usr/lib/python2.7/site-packages/salt/modules/ethtool.pytshow_driver�s


cK@s�ytj|�}Wn"tk
r7tjd|�dSXt}xe|j�D]W\}}|tkrKt|}||kr�|||kr�|||<t}q�q�qKqKWy'|r�tj	||�nt
|�SWn%tk
r�tjd||�dSXdS(u�
    Changes the rx/tx ring parameters of the specified network device

    CLI Example:

    .. code-block:: bash

        salt '*' ethtool.set_ring <devname> [rx=N] [rx_mini=N] [rx_jumbo=N] [tx=N]
    u#Ring parameters not supported on %su
Not supportedu Invalid ring arguments on %s: %suInvalid argumentsN(RRR	R
RRRtethtool_ring_maptTruet
set_ringparamR(RtkwargsRtchangedtparamR((s8/usr/lib/python2.7/site-packages/salt/modules/ethtool.pytset_ring�s(



cK@s�ytj|�}Wn"tk
r7tjd|�dSXt}xe|j�D]W\}}|tkrKt|}||kr�|||kr�|||<t}q�q�qKqKWy'|r�tj	||�nt
|�SWn%tk
r�tjd||�dSXdS(uY
    Changes the coalescing settings of the specified network device

    CLI Example:

    .. code-block:: bash

        salt '*' ethtool.set_coalesce <devname> [adaptive_rx=on|off] [adaptive_tx=on|off] [rx_usecs=N] [rx_frames=N]
            [rx_usecs_irq=N] [rx_frames_irq=N] [tx_usecs=N] [tx_frames=N] [tx_usecs_irq=N] [tx_frames_irq=N]
            [stats_block_usecs=N] [pkt_rate_low=N] [rx_usecs_low=N] [rx_frames_low=N] [tx_usecs_low=N] [tx_frames_low=N]
            [pkt_rate_high=N] [rx_usecs_high=N] [rx_frames_high=N] [tx_usecs_high=N] [tx_frames_high=N]
            [sample_interval=N]
    u(Interrupt coalescing not supported on %su
Not supportedu$Invalid coalesce arguments on %s: %suInvalid argumentsN(RRR	R
RRRtethtool_coalesce_mapRtset_coalesceR(RR RR!R"R((s8/usr/lib/python2.7/site-packages/salt/modules/ethtool.pyR%�s(



cC@s
ytj|�rdpd}Wntk
r8d}nXytj|�rQdpTd}Wntk
rqd}nXytj|�r�dp�d}Wntk
r�d}nXytj|�r�dp�d}Wntk
r�d}nXi|d6|d6|d6|d6}|S(u�
    Queries the specified network device for the state of protocol offload and other features

    CLI Example:

    .. code-block:: bash

        salt '*' ethtool.show_offload <devname>
    uonuoffu
not supporteduscatter_gatherutcp_segmentation_offloaduudp_fragmentation_offloadugeneric_segmentation_offload(Rtget_sgR	tget_tsotget_ufotget_gso(Rtsgttsotufotgsotoffload((s8/usr/lib/python2.7/site-packages/salt/modules/ethtool.pytshow_offload�s,








cK@swxj|j�D]\\}}|dkr
|dkr7dp:d}ytj||�Wqitk
redSXq
q
Wt|�S(u�
    Changes the offload parameters and other features of the specified network device

    CLI Example:

    .. code-block:: bash

        salt '*' ethtool.set_offload <devname> tcp_segmentation_offload=on
    utcp_segmentation_offloaduoniiu
Not supported(RRtset_tsoR	R/(RR R"R((s8/usr/lib/python2.7/site-packages/salt/modules/ethtool.pytset_offloads
(t__doc__t
__future__RRRtloggingRRRtImportErrorRt	getLoggert__name__R
R$RRtktvRR
RRRRRR#R%R/R1(((s8/usr/lib/python2.7/site-packages/salt/modules/ethtool.pyt<module>sn




					#	'	)

Zerion Mini Shell 1.0