Thanks for answering KpjComp. I realize I'm being a bit vague.
Communication with the router is another issue (I have a choice between SSH, telnet, and SNMP; perhaps I'll start with SSH as that will also be useful when doing similar things on Linux etc).
What I'm having trouble with is the representation of objects, the way to translate them, and what GUI to show to the user.
Example: user wants to forward a port to a server in the DMZ.
Suppose the program GUI shows the router, the WAN and LAN connections, and their status (green=up, red=down), as well as the servers/machines connected to the other ends.
In the program GUI, he might click on the WAN connection and drag it to a server. The program will ask him if he wants to forward a port; he says yes, selects port 80, TCP.
The program will now know it has to create a NAT rule to forwrd from e.g. WAN interface eth0 to LAN interface eth2, IP destination address=the address of the server.
At the same time, the GUI will need to create a firewall rule to allow traffic to port 80.
Then, it will need to output this in a similar format to my first post.... and e.g. send it via SSH, but that's a separate discussion.
Now imagine the user wants to modify this port forward to also allow UDP=>the program will need to read in the NAT+firewall rules and rewrite them.
So I will probably have various objects on different levels of abstraction: the high level user/GUI view (e.g. a port forward, a desktop with a DHCP assigned address and DNS name) and a representation of the commands/settings in the router (e.g. DHCP setup/assignments, DNS rules, NAT rules, firewall rules, DNS setup/assignments, static routing tables).
As far as the GUI is concerned: I might need to have a high level view as described above, but it may also make sense to allow click through to lists of the objects with rules mentioned above (e.g. from a port forward to the NAT, and firewall rules)... or perhaps not.
Oh, I'm going to release it as open source (probably dual MIT and LGPL with linking exception licensed, so you're free to do anything you like with it).
Hope this clarifies things,
thanks,
BigChimp