[quagga-dev 3611] bgp assegment cleanup

Paul Jakma paul at clubi.ie
Thu Aug 25 12:33:21 BST 2005


Hi,

It's a WIP still (compiles, runs, but aspaths are all lost ;) ), but 
would appreciate some early review of a bgpd as-segment cleanup 
patch, if anyone cares to go through it and provide feedback. See:

http://hibernia.jakma.org/~paul/patches/quagga-bgpd-segment-cleanup.diff

It cleans up aspath segment handling by:

- excising the practice of storing raw protocol segment data in
   struct aspath
- excising the delicate and replicated parsing of this raw data
- replacing it with an abstracted singly-linked list of as-segments
- introducing helper functions for common segment operations
- using stream functions to read/write to/from abstracted as-segments
   and protocol streams.

Reasoning:

- will make it easy to change as_t to u_int32_t internally
- converting more stuff to struct stream
- fairly well impossible to do 4byte protocol AS_PATH's otherwise,
   without resorting to gcc'isms (zero-length arrays + packed struct)
   and replicated/awkward parsing (all over the place)

$ scvsd|diffstat
  bgp_aspath.c |  924 
++++++++++++++++++++++++++++++++---------------------------
  bgp_aspath.h |   31 +
  bgp_attr.c   |   29 +
  bgp_route.c  |   38 +-
  bgp_snmp.c   |    3
  5 files changed, 567 insertions(+), 458 deletions(-)

regards,
-- 
Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
Fortune:
Forty two.



More information about the Quagga-dev mailing list