HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/pyroute2/cli/__pycache__/__init__.cpython-37.pyc
B

tP�e��@s4dZdZdZdZdZdZdZdZdd	�Zd
d�Z	dS)
a�

CLI provides a simple syntax to manipulate NDB. The syntax is the
same for the console and the http versions.

The first level of the hierarchy represents NDB views:

* interfaces -- network interfaces
* addresses -- IP addresses
* routes -- IP and MPLS routes, one record per NH
* neighbours -- ARP cache
* rules -- RPDB rules
* netns -- network namespaces
* vlans -- bridge VLAN filters

CLI supports indentation, though it is optional. A level up in the
indentation means a level up in the object hierarchy. Same effect
with `..` command.

An example script to create a bridge and a port, no indentation::

    ; comments start with ;
    interfaces
    create ifname br0, kind bridge
    address 00:11:22:33:44:55
    state up
    add_ip 192.168.123.21/24
    add_ip 192.168.123.22/24
    commit
    .. ; level up to the interfaces view
    create ifname br0p0, kind dummy
    state up
    master br0
    commit

Same script with indentation, no `..` needed::

    interfaces
        create ifname br0, kind bridge
            address 00:11:22:33:44:55
            state up
            add_ip 192.168.123.21/24
            add_ip 192.168.123.22/24
            commit
        create ifname br0p0, kind dummy
            state up
            master br0
            commit

Select objects::

    ; by name
    interfaces br0
        ; ...

    ; by spec
    interfaces
        {target netns01, ifname eth0}
            ; ...
        {address 00:11:22:33:44:55}
            ; ...




Manage interfaces
-----------------

Create::

    interfaces
        create ifname br0.100, kind vlan, vlan_id 100, link br0
            commit
        create ifname v0, kind veth, peer v0p
            commit

Change mac address::

    interfaces br0
        address 00:11:22:33:44:55
        commit

Change netns and rename::

    sources
        add netns test01
    interfaces
        v0p
            net_ns_fd test01
            commit
        {target test01, ifname v0p}
            ifname eth0
            commit
        summary | filter kind veth | select target, ifname | format json

Manage addresses
----------------

...

Manage routes
-------------

...

Generate reports
----------------

It is possible to modify the output of the dump or summary commands::

    interfaces
        ; print index, ifname and MAC address for UP interfaces
        dump | filter state up | select index, ifname, address

    routes
        ; output in JSON format
        summary | format json

The `format` command can only be the last in the sentence. Available
output filters:

filter { } -- filter out records
select { } -- output only selected record fields
format { } -- change the output format, possible values: csv, json

Wait for events
---------------

...

�������	cCs
d|_|S)NT)Z__cli_cptr__)�f�r	�F/opt/alt/python37/lib/python3.7/site-packages/pyroute2/cli/__init__.py�change_pointer�srcCs
d|_|S)NT)Z__cli_publish__)rr	r	r
�show_result�srN)
�__doc__Zt_stmtZt_dictZt_commaZt_pipeZ
t_end_of_dictZt_end_of_sentenceZt_end_of_streamrrr	r	r	r
�<module>�s