summaryrefslogtreecommitdiffstats
path: root/lib/symtab.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix broken prefix-list handling in bgpdChris Hall2012-02-291-510/+397
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some changes to symtab.c had broken the symbol reference handling for prefix-lists in plist.c This commit further "improves" the symbol table functions, to support current use rather better. One key change is that the symbol table supports the notion of a symbol which is "set", so has some value other than its name. In the case of prefix-lists, a prefix-list is "set" when there is at least one (valid) entry or a description has been set. Changes include: * small changes in bgpd/bgp_clist.c where symbol table function names have changed and other small differences. * similarly in bgpd/bgp_peer_index.c, but here also clarified ownership of the peer index entries, and ensured that the symbol table stuff does *not* free same. * in bgpd/bgp_route.c fixed the handling of references to prefix-lists. Newer symbol handling more clearly identifies when a symbol has some value "set". * in bgpd/bgp_vty.c similarly, when showing state of filtering the "*" against a prefix-list means it is "set". * in lib/plist.c -- adjust to newer symbol table stuff. Fix issues will add_hook and delete_hook. Changed lookup so that if plist is not set, then lookup will return not-found -- so works as before (!). * adjusted test for symbol stuff.
* vtysh partly restored. bgpd not crashing on over-size messages.Chris Hall2012-02-191-101/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NB: this is a partial interim version -- NOT for production. Reinstate vtysh. In bgpd: cope better with generating oversize messages. The "pipework" branch is no more. There is now "euro_ix" and "euro_ix_b", where 'b' stands for 'bleedin'. The "pipework" is currently in 'bleedin'. Version updated to: 0.99.18ex20b Major changes in this commit: * modified bgpd to avoid crashing if an oversize message is created. At present, any oversize messages are simply discarded. This may be a mistake... since it is possible that some routes that should have been withdrawn are not. TBA. The stream lib facilities have been overhauled to may this easier. * restoring vtysh. At present the vtysh is thought to work, except that it does not currently create integrated configuration files. For the time being, *only* the following compile: lib, bgpd, zebra, vtysh, tests All other daemons will fail to compile, and must be disabled.
* Update the scaled number output and memory show commands.Chris Hall2011-09-061-3/+4
| | | | | | | | | | | Functions to output scaled decimal and binary numbers were implemented for memory show commands. Those have been generalised and placed in the qfstring.c. The memory show commands have been updated to use the newer functions, and a small test program for those has been implemeted. Other small updates to qfstring.c, qstring.c and qpath.c.
* Merge branch 'pipework' of /git/quagga.euro-ix into euro_ix_bChris Hall2011-09-051-1/+1
|\
* | Updated the "symbol table" and added AVL treeChris Hall2011-08-261-625/+880
|/ | | | | | | | | | | | | | | | | Modified the symbol table so that the name of the symbol is now a property of its value -- which simplifies some of the semantics, because the name no longer has a separate existence (a name which refers to an empty or undefined value is now a matter for the value, not for the symbol table). It also allows for the symbol table to be used where the value and the name are almost indistinguishable. Introduced AVL tree to support large prefix lists, routemaps, etc. etc. Updated testsymtab and added testavl. Updated exiting use of the symbol table.
* Creation of pipework branchChris Hall2010-12-211-33/+36
|
* Fix reaming of empty symbol table -- lib/symtab.cChris Hall (GMCH)2009-12-101-2/+3
|
* Allow orphan symbols to be unset -- lib/symtab.cChris Hall (GMCH)2009-12-101-6/+9
| | | | Improved version.
* Allow orphan symbols to be unset -- lib/symtab.cChris Hall (GMCH)2009-12-101-2/+3
| | | | | | | | | | May not set orphan symbol values to anything meaningful, but must be allowed to unset an orphan value (which is already unset) so that when reaming a symbol table ordinary value delete/unset functions can be called. So fixed the assert which was disallowing all value changes for orphans, in symbol_set_value().
* Upgrade Prefix-List & BGP Community-List handlingChris Hall (GMCH)2009-11-261-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Affects: lib/plist.c & .h and bgpd/bgp_clist.c & .h With very long prefix-lists the repeated scanning of the linked list of prefix_list_entry slowed things down (scaled O(n**2)). For lists of 10,000 or more entries this could consume several *minutes* while reading a configuration file. This is a substantial re-working of the code, making use of new facilities introduced in lib/symtab and lib/vector. The prefix-list names are held in a symbol table. The addition of entries to a prefix-list uses binary-chop searches rather than linear list scans. For bgpd, all references to prefix-lists are replaced by symbol table references. The peer_prefix_list_update function is called every time a prefix-list changes. This used to run through every possible reference to a prefix-list to see if its address needed updating. For other daemons, the old interfaces have been preserved. The prefix match code has been stream-lined a little. The BGP community-list and extcommunity-list handling has also been updated to use a symbol table to hold the names. This improves the processing of route-maps, which look-up the list by name each time it is used. (In the longer term, this should be replaced by the use of symbol references.) Other files affected: bgpd/bgpd.c & .h bgpd/bgp_route.c & .h bgpd/bgp_packet.c bgpd/bgp_vty.c updated to use prefix list references & community list symbols. symtab.c & .h small change to symbol_dec_ref & symbol_zero_ref to return NULL if reference count goes to zero, and the symbol otherwise.
* Introduce lib/symtab.c & .hChris Hall (GMCH)2009-11-241-0/+1178
These are two brand new files. They provide a "Symbol Table" data structure, which maps symbol "names" to symbol "values. (Inside the dta structure is a hash table.) There is also support for managing references to symbols, and the ability to visit all references to a symbol when its value is set or unset. Other files affected: lib/Makefile.am -- to add the new files. lib/memtypes.c -- additional memory types for symbol table stuff