On Fri, 9 Sep 2016, Adria Ban wrote:

I've created new functions for output like: vprintf_filter, vfprintf_filter, etc which are passing the arguments to a filter function.

Examples:
quagga-router# show running-config | section router
hostname quagga-router
!
router bgp 65535
 bgp router-id 10.100.101.2
 network 10.20.30.0/24
 network 172.16.0.0/24
 redistribute connected
 neighbor 10.0.0.1 remote-as 11111
 maximum-paths 3
!
 address-family vpnv4
 neighbor 10.0.0.1 activate
 exit-address-family
!
 address-family encap
 neighbor 10.0.0.1 activate
 exit-address-family
 exit
!
quagga-router# show running-config | include bond
!
interface bond0
interface bond0.100
ip route 1.1.1.1/32 bond0.100
ip route 1.1.1.1/32 bond0
quagga-router# show running-config | exclude link-detect

Neat.

Now I need some help if is possible to tell me where should I add those function. In this moment I've used command.c and command.h files to add the new functions because command.h is command for most of the files. Is better to move out to a new files like vty_output_filters.c and vty_output_filter.h ?

You'd have to post the code for people to be able to give opinions.

The next stage is to change other show commands in daemons to use new output filters functions.

Note that for vtysh there already is the possibility to just do:

$ vtysh -c 'show running-config' | <grep,sed,cut,awk,whatever you want>

It's neat though that you were able to take advantage of internal knowledge to implement 'section' filtering.

regards,
--
Paul Jakma | p...@jakma.org | @pjakma | Key ID: 0xD86BF79464A2FF6A
Fortune:
One good suit is worth a thousand resumes.

_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to