[OpenVMPS-devel] Patch to get vlan DB from TDB file
Brought to you by:
dori_seliskar
From: Phil M. <p.m...@im...> - 2006-03-14 00:58:15
|
All, Please find attached a patch that adds an "--enable-tdb" feature. This wholly replaces the vlan.db file with a vlan.tdb file (path currently hardcoded - bad I know). The patch is more than a little rough around the edges. (TDB is a DBM-like multiple-reader/single-writer binary DB, used by projects such as Samba, pppd, etc. You can update the TDB whilst the vmpsd is running. We were concerned about possible performance issues with running external plugins, but still wanted fast updates, so we are planning to use an SQL watcher + incremental updates to the TDB) Entries are looked for in the TDB in the following formats: IN:switchip:portname:mac IN:switchip:*:mac IN:*:*:mac IN:switchip:portname:* IN:switchip:*:* (including a terminating NULL on the string). So, you could do this: ./configure --enable-tdb make ./vmpsd -p 3000 -d -f /etc/vmps/db & tdbtool tdb> create vlan.tdb tdb> insert IN:*:*:112233445566 FOOBAR tdb> insert IN:127.0.0.1:*:112233445577 BAZBAN tdb> q Then run: $ tools/vqpcli.pl -s localhost -p 3000 -m 1122.3344.5566 Vlan: FOOBAR MAC Address: 112233445566 Status: ALLOW looking for[32]: IN:127.0.0.1:Fa0/1:112233445566 looking for[28]: IN:127.0.0.1:*:112233445566 looking for[20]: IN:*:*:112233445566 found[7]: FOOBAR ALLOW: 112233445566 -> FOOBAR, switch 127.0.0.1 port Fa0/1 As far as I can tell it ought to be possible to implement most of the same policies as the file-backed store, though you have to flatten them out somewhat. The patch also adds an argument to vqpcli.pl for port number, fixes the SNMP linking and contains a patch to accept VMPS from any domain for multi-domain operation (we have a need for such). Hope someone finds this useful, thanks for the excellent software Phil |