I have to design (College work) a project for an web application which must be capable of acting as a GUI for a open-source project (Quagga Routing Daemon). This application must provide a way of managing many instances of the software installed in different remote routers. For those who don't know what Quagga is, it's a routing daemon which supports BGP, OSPF and many other dynamic routing protocols, its default management interface is the CLI, the idea of building the web application is to ease the configuration and maintaining of networks which have a considerable amount of routers running quagga. The first problem I'm facing is to figure out a eficient way of translating quagga's default config file to some structure that is ease for the web application to handle and the opposite, also I have to do the opposite, translating changes made by the user in the web interface to quagga's default config style. Here is a example of quagga bgpd.conf, which is the config file for the BGP Daemon:
! ! Zebra configuration saved from vty ! 2014/02/28 08:12:51 ! hostname mikronoc.domain.net password 0df0bd859b enable password 0df0bd859b log file /var/log/quagga/bgpd.log ! router bgp 65535 bgp router-id 10.20.6.82 neighbor 10.28.33.1 remote-as 28198 neighbor 10.28.33.1 ebgp-multihop 255 neighbor 10.28.33.1 next-hop-self neighbor 10.28.33.1 soft-reconfiguration inbound ! ip prefix-list PL-ANY seq 5 permit 0.0.0.0/0 ge 32 ip prefix-list PL-DEFAULT-ROUTE seq 5 permit 0.0.0.0/0 ! line vty !
The file has some hierarchy, the commands that are leftmost are in the enable mode, it's like a global configuration mode for the bgp daemon, the ones that are indented belongs to the first leftmost command before them, like 'bgp router-id 10.20.6.82' is only available when you enter the bgp configuration mode 'router bgp <as number>'. Usually administrators don't create this files by hand, firstly they connect to the daemon port with telnet:
root# telnet localhost bgpd
And then they can insert the commands in the CLI and write them to the configuration file with:
quagga-cli # write memory
Then quagga modifies the file on its own, I was thinking about using this feature to avoid handling config files manually, my software would just need to establish a connection to the daemon interface and run the commands, quagga would handle the file modification.
Thanks in advance.