Completion for the rtable command now lists routing table numbers as stored in the nsh database, i.e. as preserved in nsh configuration. Aside from default routing table 0 users will have to visit a given routing table with nsh at least once before the table will show up in the completion list of the rtable command.
This behaviour seems like a fair trade-off given that there is no way to query the kernel for existing routing tables without looping over all possible routing table numbers and doing a syscall for each of them.
While here, fix an error in the rtable command help completion table, and fix problems with no-command completion exposed by "no rtable".
double tab rtable witin an rdomain suggests the current rdomain... and not 0.
I would suggest rdomain 0 (and every other active rdomain ) be presented as an option when in another rdomain...
when in rdomain 0 every other rdomain should be presented...
perhaps a comment / description for rdomain feature is needed and this is displayed also with 0 having main by default (unless rtable0 description is reconfigured by the user ... ? )
it is a new feature to have a description / name for the rdomain (similar to the interface description command) ill add it to the todolist
double tab rtable witin an rdomain suggests the current rdomain... and not 0.
I would suggest rdomain 0 (and every other active rdomain ) be presented as an option when in another rdomain...
when in rdomain 0 every other rdomain should be presented...
perhaps a comment / description for rdomain feature is needed and this is displayed also with 0 having main by default (unless rtable0 description is reconfigured by the user ... ? )
it is a new feature to have a description / name for the rdomain (similar to the interface description command) ill add it to the todolist
This seems to work ok from my perspective ... nsh(config-p)/rtable 0
tested trying to create an rdomain greater than what is allowed ... iit worked ok
completion worked as expected ...
works with adding new rtables and removing ones
rtable
rtable
[name]
nsh(config-p)/rtable 0
rtable
rtable
[name]
nsh(config-p)/rtable 0
nsh(config-p)/exit
nsh(p)/rtable 1
nsh(p-rtable 1)/enable
nsh(p-rtable 1)/show run
!
hostname nsh
!
interface lo0
group lo
inet ::1/128
inet 127.0.0.1/8
!
interface em0
group egress
autoconf4
!
interface em1
description test show active
inet 10.10.10.1/30
!
interface enc0
group enc
shutdown
!
interface pflog0
group pflog
no shutdown
!
interface vlan100
group vlan
shutdown
!
interface vlan200
group vlan
shutdown
!
!
no ip forwarding
!
route 224.0.0.0/4 127.0.0.1 iface nompath reject
route 127.0.0.0/8 127.0.0.1 nompath reject
route ::/96 ::1 nompath reject
route ::ffff:0.0.0.0/96 ::1 nompath reject
route 2002::/24 ::1 nompath reject
route 2002:7f00::/24 ::1 nompath reject
route 2002:e000::/20 ::1 nompath reject
route 2002:ff00::/24 ::1 nompath reject
route fe80::/10 ::1 nompath reject
route fec0::/10 ::1 nompath reject
route ff01::/16 ::1 nompath reject
route ff02::/16 ::1 nompath reject
!
!
resolv enable
!
rtable 1
!
!
nsh(p-rtable 1)/
! exit ipsec pf show
? flush ldap ping smtp
arp ftp-proxy ldp ping6 snmp
bgp group manual pipex ssh
bridge halt motd quit sshd
configure help mpls rad telnet
ddb hostname nameserver reboot tftp
dhcp ifstate ndp relay tftp-proxy
disable ike no resolv traceroute
dvmrp inet nppp rip traceroute6
editing interface ntp route verbose
eigrp ip ospf rtable who
enable ip6 ospf6 sasync write-config
nsh(p-rtable 1)/
! exit ipsec pf show
? flush ldap ping smtp
arp ftp-proxy ldp ping6 snmp
bgp group manual pipex ssh
bridge halt motd quit sshd
configure help mpls rad telnet
ddb hostname nameserver reboot tftp
dhcp ifstate ndp relay tftp-proxy
disable ike no resolv traceroute
dvmrp inet nppp rip traceroute6
editing interface ntp route verbose
eigrp ip ospf rtable who
enable ip6 ospf6 sasync write-config
nsh(p-rtable 1)/rtable
0 1
nsh(p-rtable 1)/rtable
0 1
nsh(p-rtable 1)/rtable 0
nsh(p)/rtable
0 1
nsh(p)/rtable
0 1
nsh(p)/rtable 1
nsh(p-rtable 1)/rtable 10240
% invalid table id: too large
nsh(p-rtable 1)/rtable 256
% invalid table id: too large
nsh(p-rtable 1)/rtable 255
nsh(config-p-rtable 255)/rtable
0 1 255
nsh(config-p-rtable 255)/rtable
0 1 255
nsh(config-p-rtable 255)/rtable
Completion for the rtable command now lists routing table numbers as stored in the nsh database, i.e. as preserved in nsh configuration. Aside from default routing table 0 users will have to visit a given routing table with nsh at least once before the table will show up in the completion list of the rtable command. This behaviour seems like a fair trade-off given that there is no way to query the kernel for existing routing tables without looping over all possible routing table numbers and doing a syscall for each of them.
While here, fix an error in the rtable command help completion table, and fix problems with no-command completion exposed by "no rtable".