PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
import logging from collections import namedtuple from ctypes import c_uint16, c_uint32 from pyroute2.ethtool.common import ( LINK_DUPLEX_NAMES, LINK_PORT_NAMES, LINK_TP_MDI_NAMES, LINK_TRANSCEIVER_NAMES, LinkModeBits_by_index, LMBTypeMode, LMBTypePort, ) from pyroute2.ethtool.ioctl import WAKE_NAMES, IoctlEthtool from pyroute2.netlink.exceptions import NetlinkError from pyroute2.netlink.generic.ethtool import NlEthtool, ethtool_rings_msg INT32MINUS_UINT32 = c_uint32(-1).value INT16MINUS_UINT16 = c_uint16(-1).value log = logging.getLogger(__name__) EthtoolBitsetBit = namedtuple( 'EthtoolBitsetBit', ('index', 'name', 'enable', 'set') ) class UseIoctl(Exception): pass class EthtoolCoalesce(object): @staticmethod def from_ioctl(ioctl_coalesce): return {name: int(value) for name, value in ioctl_coalesce.items()} @staticmethod def to_ioctl(ioctl_coalesce, coalesce): for name, value in coalesce.items(): if ioctl_coalesce[name] != value: ioctl_coalesce[name] = value class EthtoolFeature(object): __slots__ = ('set', 'index', 'name', 'enable', 'available') def __init__(self, set, index, name, enable, available): self.set = set self.index = index self.name = name self.enable = enable self.available = available class EthtoolFeatures(namedtuple('EthtoolFeatures', ('features',))): @classmethod def from_ioctl(cls, features): return cls( { name: EthtoolFeature(set, index, name, enable, available) for name, enable, available, set, index in features } ) @staticmethod def to_ioctl(ioctl_features, eth_features): for feature in eth_features.features.values(): enable = ioctl_features[feature.name] if feature.enable == enable: continue ioctl_features[feature.name] = feature.enable class EthtoolWakeOnLan(namedtuple('EthtoolWolMode', ('modes', 'sopass'))): @classmethod def from_netlink(cls, nl_wol): nl_wol = nl_wol[0].get_attr('ETHTOOL_A_WOL_MODES') wol_modes = {} for mode in nl_wol.get_attr('ETHTOOL_A_BITSET_BITS')['attrs']: mode = mode[1] index = mode.get_attr('ETHTOOL_A_BITSET_BIT_INDEX') name = mode.get_attr('ETHTOOL_A_BITSET_BIT_NAME') enable = mode.get_attr('ETHTOOL_A_BITSET_BIT_VALUE') wol_modes[name] = EthtoolBitsetBit( index, name, True if enable is True else False, set=None ) return EthtoolWakeOnLan(modes=wol_modes, sopass=None) @classmethod def from_ioctl(cls, wol_mode): dict_wol_modes = {} for bit_index, name in WAKE_NAMES.items(): if wol_mode.supported & bit_index: dict_wol_modes[name] = EthtoolBitsetBit( bit_index, name, wol_mode.wolopts & bit_index != 0, set=None, ) return EthtoolWakeOnLan(modes=dict_wol_modes, sopass=None) class EthtoolStringBit( namedtuple('EthtoolStringBit', ('set', 'index', 'name')) ): @classmethod def from_netlink(cls, nl_string_sets): nl_string_sets = nl_string_sets[0] ethtool_strings_set = set() for i in nl_string_sets.get_attr('ETHTOOL_A_STRSET_STRINGSETS')[ 'attrs' ]: i = i[1] set_id = i.get_attr('ETHTOOL_A_STRINGSET_ID') i = i.get_attr('ETHTOOL_A_STRINGSET_STRINGS') for i in i['attrs']: i = i[1] ethtool_strings_set.add( cls( set=set_id, index=i.get_attr('ETHTOOL_A_STRING_INDEX'), name=i.get_attr('ETHTOOL_A_STRING_VALUE'), ) ) return ethtool_strings_set @classmethod def from_ioctl(cls, string_sets): return { cls(i // 32, i % 32, string) for i, string in enumerate(string_sets) } class EthtoolLinkInfo( namedtuple( 'EthtoolLinkInfo', ('port', 'phyaddr', 'tp_mdix', 'tp_mdix_ctrl', 'transceiver'), ) ): def __new__(cls, port, phyaddr, tp_mdix, tp_mdix_ctrl, transceiver): port = LINK_PORT_NAMES.get(port, None) transceiver = LINK_TRANSCEIVER_NAMES.get(transceiver, None) tp_mdix = LINK_TP_MDI_NAMES.get(tp_mdix, None) tp_mdix_ctrl = LINK_TP_MDI_NAMES.get(tp_mdix_ctrl, None) return super(EthtoolLinkInfo, cls).__new__( cls, port, phyaddr, tp_mdix, tp_mdix_ctrl, transceiver ) @classmethod def from_ioctl(cls, link_settings): return cls( port=link_settings.port, phyaddr=link_settings.phy_address, tp_mdix=link_settings.eth_tp_mdix, tp_mdix_ctrl=link_settings.eth_tp_mdix_ctrl, transceiver=link_settings.transceiver, ) @classmethod def from_netlink(cls, nl_link_mode): nl_link_mode = nl_link_mode[0] return cls( port=nl_link_mode.get_attr('ETHTOOL_A_LINKINFO_PORT'), phyaddr=nl_link_mode.get_attr('ETHTOOL_A_LINKINFO_PHYADDR'), tp_mdix=nl_link_mode.get_attr('ETHTOOL_A_LINKINFO_TP_MDIX'), tp_mdix_ctrl=( nl_link_mode.get_attr('ETHTOOL_A_LINKINFO_TP_MDIX_CTR') ), transceiver=( nl_link_mode.get_attr('ETHTOOL_A_LINKINFO_TRANSCEIVER') ), ) class EthtoolLinkMode( namedtuple( 'EthtoolLinkMode', ('speed', 'duplex', 'autoneg', 'supported_ports', 'supported_modes'), ) ): def __new__(cls, speed, duplex, autoneg, supported_ports, supported_modes): if ( speed == 0 or speed == INT32MINUS_UINT32 or speed == INT16MINUS_UINT16 ): speed = None duplex = LINK_DUPLEX_NAMES.get(duplex, None) return super(EthtoolLinkMode, cls).__new__( cls, speed, duplex, bool(autoneg), supported_ports, supported_modes ) @classmethod def from_ioctl(cls, link_settings): (map_supported, map_advertising, map_lp_advertising) = ( IoctlEthtool.get_link_mode_masks(link_settings) ) bits_supported = IoctlEthtool.get_link_mode_bits(map_supported) supported_ports = [] supported_modes = [] for bit in bits_supported: if bit.type == LMBTypePort: supported_ports.append(bit.name) elif bit.type == LMBTypeMode: supported_modes.append(bit.name) return cls( speed=link_settings.speed, duplex=link_settings.duplex, autoneg=link_settings.autoneg, supported_ports=supported_ports, supported_modes=supported_modes, ) @classmethod def from_netlink(cls, nl_link_mode): nl_link_mode = nl_link_mode[0] supported_ports = [] supported_modes = [] for bitset_bit in nl_link_mode.get_attr( 'ETHTOOL_A_LINKMODES_OURS' ).get_attr('ETHTOOL_A_BITSET_BITS')['attrs']: bitset_bit = bitset_bit[1] bit_index = bitset_bit.get_attr('ETHTOOL_A_BITSET_BIT_INDEX') bit_name = bitset_bit.get_attr('ETHTOOL_A_BITSET_BIT_NAME') bit_value = bitset_bit.get_attr('ETHTOOL_A_BITSET_BIT_VALUE') if bit_value is not True: continue bit = LinkModeBits_by_index[bit_index] if bit.name != bit_name: log.error( "Bit name is not the same as the target: %s <> %s", bit.name, bit_name, ) continue if bit.type == LMBTypePort: supported_ports.append(bit.name) elif bit.type == LMBTypeMode: supported_modes.append(bit.name) return cls( speed=nl_link_mode.get_attr("ETHTOOL_A_LINKMODES_SPEED"), duplex=nl_link_mode.get_attr("ETHTOOL_A_LINKMODES_DUPLEX"), autoneg=nl_link_mode.get_attr("ETHTOOL_A_LINKMODES_AUTONEG"), supported_ports=supported_ports, supported_modes=supported_modes, ) class EthtoolRings( namedtuple( 'EthtoolRings', ( "rx_max", "rx_mini_max", "rx_jumbo_max", "tx_max", "rx", "rx_mini", "rx_jumbo", "tx", "rx_buf_len", "tcp_data_split", "cqe_size", "tx_push", "rx_push", "tx_push_buf_len", "tx_push_buf_len_max", ), ) ): nl_attributs_dict = { "rx_max": 'ETHTOOL_A_RINGS_RX_MAX', "rx_mini_max": 'ETHTOOL_A_RINGS_RX_MINI_MAX', "rx_jumbo_max": 'ETHTOOL_A_RINGS_RX_JUMBO_MAX', "tx_max": 'ETHTOOL_A_RINGS_TX_MAX', "rx": 'ETHTOOL_A_RINGS_RX', "rx_mini": 'ETHTOOL_A_RINGS_RX_MINI', "rx_jumbo": 'ETHTOOL_A_RINGS_RX_JUMBO', "tx": 'ETHTOOL_A_RINGS_TX', "rx_buf_len": 'ETHTOOL_A_RINGS_RX_BUF_LEN', "tcp_data_split": 'ETHTOOL_A_RINGS_TCP_DATA_SPLIT', "cqe_size": 'ETHTOOL_A_RINGS_CQE_SIZE', "tx_push": 'ETHTOOL_A_RINGS_TX_PUSH', "rx_push": 'ETHTOOL_A_RINGS_RX_PUSH', "tx_push_buf_len": 'ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN', "tx_push_buf_len_max": 'ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX', } def __new__( cls, rx_max=None, rx_mini_max=None, rx_jumbo_max=None, tx_max=None, rx=None, rx_mini=None, rx_jumbo=None, tx=None, rx_buf_len=None, tcp_data_split=None, cqe_size=None, tx_push=None, rx_push=None, tx_push_buf_len=None, tx_push_buf_len_max=None, ): return super(EthtoolRings, cls).__new__( cls, rx_max, rx_mini_max, rx_jumbo_max, tx_max, rx, rx_mini, rx_jumbo, tx, rx_buf_len, tcp_data_split, cqe_size, tx_push, rx_push, tx_push_buf_len, tx_push_buf_len_max, ) @classmethod def from_netlink(cls, nl_rings): nl_rings = nl_rings[0] return cls( **{ cls_attr: nl_rings.get_attr(netlink_attr) for cls_attr, netlink_attr in cls.nl_attributs_dict.items() } ) def to_netlink(self): nl_rings_attrs = ethtool_rings_msg() for cls_attr, netlink_attr in self.nl_attributs_dict.items(): attr = getattr(self, cls_attr) if attr is not None: nl_rings_attrs["attrs"].append((netlink_attr, attr)) return nl_rings_attrs @classmethod def from_ioctl(cls, ioctl_rings): ioctl_rings = dict(ioctl_rings) ioctl_rings.pop("cmd") return cls(**ioctl_rings) class Ethtool: def __init__(self): self._with_ioctl = IoctlEthtool() self._with_nl = NlEthtool() self._with_nl.module_err_level = 'debug' self._is_nl_working = self._with_nl.is_nlethtool_in_kernel() def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): self.close() def _nl_exec(self, f, with_netlink, *args, **kwargs): if with_netlink is None: with_netlink = self._is_nl_working if with_netlink is False: raise UseIoctl() try: return f(*args, **kwargs) except NetlinkError: raise UseIoctl() def get_link_mode(self, ifname, with_netlink=None): try: link_mode = self._nl_exec( self._with_nl.get_linkmode, with_netlink, ifname ) link_mode = EthtoolLinkMode.from_netlink(link_mode) except UseIoctl: self._with_ioctl.change_ifname(ifname) link_settings = self._with_ioctl.get_link_settings() link_mode = EthtoolLinkMode.from_ioctl(link_settings) return link_mode def get_link_info(self, ifname, with_netlink=None): try: link_info = self._nl_exec( self._with_nl.get_linkinfo, with_netlink, ifname ) link_info = EthtoolLinkInfo.from_netlink(link_info) except UseIoctl: self._with_ioctl.change_ifname(ifname) link_settings = self._with_ioctl.get_link_settings() link_info = EthtoolLinkInfo.from_ioctl(link_settings) return link_info def get_strings_set(self, ifname, with_netlink=None): try: stringsets = self._nl_exec( self._with_nl.get_stringset, with_netlink, ifname ) return EthtoolStringBit.from_netlink(stringsets) except UseIoctl: self._with_ioctl.change_ifname(ifname) stringsets = self._with_ioctl.get_stringset() return EthtoolStringBit.from_ioctl(stringsets) def get_wol(self, ifname): nl_working = self._is_nl_working if nl_working is True: try: wol = self._with_nl.get_wol(ifname) return EthtoolWakeOnLan.from_netlink(wol) except NetlinkError: nl_working = False if nl_working is False: self._with_ioctl.change_ifname(ifname) wol_mode = self._with_ioctl.get_wol() return EthtoolWakeOnLan.from_ioctl(wol_mode) def get_rings(self, ifname, with_netlink=None): try: rings = self._nl_exec( self._with_nl.get_rings, with_netlink, ifname ) rings = EthtoolRings.from_netlink(rings) except UseIoctl: self._with_ioctl.change_ifname(ifname) rings_info = self._with_ioctl.get_rings() rings = EthtoolRings.from_ioctl(rings_info) return rings def set_rings(self, ifname, with_netlink=None, **kwargs): try: rings = EthtoolRings(**kwargs).to_netlink() self._nl_exec(self._with_nl.set_rings, with_netlink, rings, ifname) except UseIoctl: self._with_ioctl.change_ifname(ifname) ioctl_rings = self._with_ioctl.get_rings() for name, value in kwargs.items(): if name in ioctl_rings.keys() and ioctl_rings[name] != value: ioctl_rings[name] = value self._with_ioctl.set_rings(ioctl_rings) def get_features(self, ifname): self._with_ioctl.change_ifname(ifname) return EthtoolFeatures.from_ioctl(self._with_ioctl.get_features()) def set_features(self, ifname, features): self._with_ioctl.change_ifname(ifname) ioctl_features = self._with_ioctl.get_features() EthtoolFeatures.to_ioctl(ioctl_features, features) self._with_ioctl.set_features(ioctl_features) def get_coalesce(self, ifname): self._with_ioctl.change_ifname(ifname) return EthtoolCoalesce.from_ioctl(self._with_ioctl.get_coalesce()) def set_coalesce(self, ifname, coalesce): self._with_ioctl.change_ifname(ifname) ioctl_coalesce = self._with_ioctl.get_coalesce() EthtoolCoalesce.to_ioctl(ioctl_coalesce, coalesce) self._with_ioctl.set_coalesce(ioctl_coalesce) def close(self): self._with_ioctl.close() self._with_nl.close()