Age | Commit message (Collapse) | Author |
|
syntax
2006-10-04 Oliver Hookins <ohookins@gmail.com>
* bgpd/bgp_main.c: Add configuration check option, with
'-C' rather than '-c' for consistency between daemons.
* isisd/isis_main.c: ditto
* ospf6d/ospf6_main.c: ditto
* ospfd/ospf_main.c: ditto
* ripngd/ripng_main.c: ditto
* vtysh/vtysh_main.c: ditto
* ripd/rip_main.c: Change the config check option to
'-C' and tidy up the code.
* zebra/main.c: ditto
2006-10-04 Stergiakis Alexandros <astergiakis@antcor.com>
* ripd/rip_main.c: This trivial patch introduces a new
command-line option '-c', which instructs zebra/ripd
to check its configuration file for validity, print
any error message, and then exit. This is useful when
the configuration file is edited by hand or otherwise,
and you simply want to validate it without any other
effect.
* zebra/main.c: ditto
|
|
2006-09-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* bgpd.c: (peer_uptime) Fix printf format/arg mismatch in
zlog_warn message (%ld/size_t -> %lu/u_long).
|
|
2006-09-14 Paul Jakma <paul.jakma@sun.com>
* bgp_route.c: (bgp_process_queue_init) process queue hold time
too high, adds extra memory load. Change to be much lower,
until such time as it's made configurable.
|
|
2006-09-14 Paul Jakma <paul.jakma@sun.com>
* bgp_route.c: (bgp_table_stats_walker) Address space announced
should only count top-level unaggregateable prefixes, to
avoid falling afoul of anti-dodgy-accounting regulations
in various jurisdictions.. ;)
|
|
2006-09-14 Paul Jakma <paul.jakma@sun.com>
* (general) fix the peer refcount issue exposed by previous, by
just removing refcounting of peer threads, which is mostly
senseless as they're references leading from struct peer,
which peer_free cancels anyway. No need to muck around..
* bgp_fsm.h: Just remove the refcounting from the various
TIMER/READ/WRITE/EVENT ON/OFF/ADD macros.
* bgp_fsm.c: (bgp_stop) use BGP_EVENT_FLUSH, no refcounts attached
to events anymore.
(bgp_event) remove peer_unlock, events not refcounted.
* bgpd.c: (peer_free) flush events before free.
|
|
2006-09-14 Paul Jakma <paul.jakma@sun.com>
* (general) Fix some niggly issues around 'shutdown' and clearing
by adding a Clearing FSM wait-state and a hidden 'Deleted'
FSM state, to allow deleted peers to 'cool off' and hit 0
references. This introduces a slow memory leak of struct peer,
however that's more a testament to the fragility of the
reference counting than a bug in this patch, cleanup of
reference counting to fix this is to follow.
* bgpd.h: Add Clearing, Deleted states and Clearing_Completed
and event.
* bgp_debug.c: (bgp_status_msg[]) Add strings for Clearing and
Deleted.
* bgp_fsm.h: Don't allow timer/event threads to set anything
for Deleted peers.
* bgp_fsm.c: (bgp_timer_set) Add Clearing and Deleted. Deleted
needs to stop everything.
(bgp_stop) Remove explicit fsm_change_status call, the
general framework handles the transition.
(bgp_start) Log a warning if a start is attempted on a peer
that should stay down, trying to start a peer.
(struct .. FSM) Add Clearing_Completed
events, has little influence except when in state
Clearing to signal wait-state can end.
Add Clearing and Deleted states, former is a wait-state,
latter is a placeholder state to allow peers to disappear
quietly once refcounts settle.
(bgp_event) Try reduce verbosity of FSM state-change debug,
changes to same state are not interesting (Established->Established)
Allow NULL action functions in FSM.
* bgp_packet.c: (bgp_write) Use FSM events, rather than trying
to twiddle directly with FSM state behind the back of FSM.
(bgp_write_notify) ditto.
(bgp_read) Remove the vague ACCEPT_PEER peer_unlock, or else
this patch crashes, now it leaks instead.
* bgp_route.c: (bgp_clear_node_complete) Clearing_Completed
event, to end clearing.
(bgp_clear_route) See extensive comments.
* bgpd.c: (peer_free) should only be called while in Deleted,
peer refcounting controls when peer_free is called.
bgp_sync_delete should be here, not in peer_delete.
(peer_delete) Initiate delete.
Transition to Deleted state manually.
When removing peer from indices that provide visibility of it,
take great care to be idempotent wrt the reference counting
of struct peer through those indices.
Use bgp_timer_set, rather than replicating.
Call to bgp_sync_delete isn't appropriate here, sync can be
referenced while shutting down and finishing deletion.
(peer_group_bind) Take care to be idempotent wrt list references
indexing peers.
|
|
2006-09-13 Paul Jakma <paul.jakma@sun.com>
* bgp_aspath.c: (aspath_highest) new, return highest ASN in an
aspath.
* bgp_route.c: (bgp_peer_count_walker) new, do the walk done
in bgp_peer_counts as a thread.
(bgp_peer_counts) move walk to previous and call it via
thread_execute so this RIB walk shows up in thread stats.
(bgp_table_stats) New, gather some statistics for a given
RIB.
(bgp_table_stats_walker) New, RIB walker thread for former.
(bgp_table_stats_vty) Parsing front-end for 'show bgp ...',
useful model for future rationalisation of 'show ... bgp'.
(bgp_route_init) Add new RIB stats commands.
|
|
2006-09-06 Paul Jakma <paul.jakma@sun.com>
* (general) Squash any and all prefix-count issues by
abstracting route flag changes, and maintaining count as and
when flags are modified (rather than relying on explicit
modifications of count being sprinkled in just the right
places throughout the code).
* bgp_route.c: (bgp_pcount_{dec,inc}rement) removed.
(bgp_pcount_adjust) new, update prefix count as
needed for a given route.
(bgp_info_{uns,s}et_flag) set/unset a BGP_INFO route status
flag, calling previous function when appropriate.
(general) Update all set/unsets of flags to use previous.
Remove pcount_{dec,inc}rement calls.
No need to unset BGP_INFO_VALID in places where
bgp_info_delete is called, it does that anyway.
* bgp_{damp,nexthop}.c: Update to use bgp_info_{un,}set_flag.
* bgp_route.h: Export bgp_info_{un,}set_flag.
Add a 'meta' BGP_INFO flag, BGP_INFO_UNUSEABLE.
Move BGP_INFO_HOLDDOWN macro to here from bgpd.h
|
|
2006-09-03 Paul Jakma <paul.jakma@sun.com>
* bgp_route.c: Add 'show ... bgp ... <neighbour> prefix-count'
commands, to provide detailed counts of prefixes for a peer.
Informative, and should help pin down to pfxcnt drift
problems.
|
|
2006-08-27 Paul Jakma <paul.jakma@sun.com>
* bgp_advertise.c: (bgp_sync_delete) fix mtype in XFREE.
NULL out peer->hash after free, to be sure.
|
|
2006-08-06 Paul Jakma <paul.jakma@sun.com>
* bgp_aspath.c: (aspath_loop_check) Fix the typo-bug which
essentially had disabled this check. Problem reported by
Bartek Kania <mrbk@gnarf.org> in [quagga-users 7388].
* aspath_test.c: (validate) Fix the sense of the aspath_loop_check,
which was the wrong way around and had actually been testing for
aspath_loop_check to be buggy.
|
|
2006-07-27 Paul Jakma <paul.jakma@sun.com>
* bgpd.c: (peer_delete) Ensure freed buffers can not be
accidently reused. A potential fix for bug #287.
|
|
2006-07-02 Paul Jakma <paul.jakma@sun.com>
* bgp_fsm.c: (bgp_{stop,start}) Move clear/free of certain
bits of state from stop to start, as they may be used via
peer references on clearing queues..
|
|
2006-05-23 Paul Jakma <paul.jakma@sun.com>
* bgp_vty.c: (neighbor_update_source_cmd) Expand tab completion
to make it clear it takes both address and ifname.
|
|
2006-05-12 Paul Jakma <paul.jakma@sun.com>
* bgp_aspath.{c,h}: (aspath_print_vty) take a format string,
so as to reduce burden on callers, all in bgp_route.c
* bgp_route.c: (route_vty_out{,tmp}) Update to match
aspath_print_vty, simplifying checks needed to get spacing
right. CID #4,#5.
({damp,flap}_route_vty_out) Ditto, CID #9, #10
|
|
2006-05-12 Paul Jakma <paul.jakma@sun.com>
* bgp_route.c: (bgp_static_update_rsclient) Remove useless NULL
check, code already assumes bgp_static can not be NULL,
fixes CID #6.
|
|
2006-05-12 Paul Jakma <paul.jakma@sun.com>
* bgp_route.c: (bgp_static_update_main) Remove useless NULL
check, code already assumes bgp_static can not be NULL,
fixes CID #7.
|
|
2006-05-12 Paul Jakma <paul.jakma@sun.com>
* bgp_attr.c: (bgp_packet_attribute) Remove dead code, Coverity
CID #1
|
|
2006-05-08 Paul Jakma <paul.jakma@sun.com>
* bgp_route.c: (bgp_afi_node_get) given table should never be
NULL, check/assert this.
(bgp_static_update) Bug #240. Rsclients should only be passed
the static update if they are configured for the afi,safi.
|
|
2006-05-08 Paul Jakma <paul.jakma@sun.com>
* bgp_community.c: (community_str2com) Coverity CID#62, fix
double-free, use-after-free.
|
|
2006-05-04 Paul Jakma <paul.jakma@sun.com>
* bgp_route.c: (general) Fix logical bug in clearing, noted
by Chris Caputo in [quagga-users 6728] - clearing depended on
at least one route being added to workqueue, in order for
workqueue completion function to restart FSM. However, if no
routes are cleared, then the completion function never is
called, it needs to be called manually if the workqueue
didn't get scheduled.
Finally, clearing is per-peer-session, not per AFI/SAFI, so
the FSM synchronisation should be in bgp_clear_route_table.
(bgp_clear_route_table) Wrong place for FSM/clearing
synchronisation, move to..
(bgp_clear_route) FSM/clearing synchronisation should be
here.
If no routes were cleared, no workqueue scheduled, call
the completion func to ensure FSM kicks off again.
|
|
2006-05-04 Paul Jakma <paul.jakma@sun.com>
* (general) VPNv4 fixes. Certain VPNv4 code was not enabled.
See bug #210.
* bgp_attr.{c,h}: (bgp_packet_{withdraw,attribute}) Tag should be
u_char really.
* bgp_packet.c: (bgp_{update,withdraw}_packet) Enable some
VPNv4 code which inexplicably was ifdef'd out. comments from
a tester on IRC suggest this fixes bug #210.
|
|
2006-03-30 Paul Jakma <paul.jakma@sun.com>
* bgp_community.c: (community_gettoken) Unknown token should
return NULL, to give a strong indication to callers that
the token no longer can be parsed, otherwise callers looping
on this function may have a hard time ending their loop.
(community_str2com) While loop around community_gettoken appears
to have been coded thinking that break statement would break
from the while{}, hence it could never exit for unknown token
case. Fix it to do..while, so it can use the NULL result from
community_gettoken easily.
|
|
2006-03-22 Paul Jakma <paul.jakma@sun.com>
* bgpd.c: (peer_free) release the per-peer workqueue when
freeing the peer.
|
|
2006-03-19 Paul Jakma <paul.jakma@sun.com>
* memtypes.c: Add MTYPE_BGP_SYNCHRONISE.
* bgp_advertise.c: Use a distinct memory type for struct
bgp_synchronize.
|
|
2006-03-19 Paul Jakma <paul.jakma@sun.com>
* bgpd/bgp_vty.c: Add includes to get several structs we want
to provide usage statistics on.
(show_bgp_memory_cmd) Show memory usage stats for various
notable fixed size objects. Using mtype_stats_alloc and
mtype_memstr recently added to memory.c.
(bgp_show_summary) Report some additional stats specific to
the given BGP instance and/or AFI/SAFI such as table counts,
peers, rsclients and peer-groups.
(bgp_vty_init) Install show_bgp_memory_cmd.
|
|
2006-03-19 Paul Jakma <paul.jakma@sun.com>
* bgp_nexthop.h: Include if.h as a dependent header, for struct
connected.
|
|
2006-03-12 Paul Jakma <paul.jakma@sun.com>
* bgp_attr.h: (struct attr) rearrange fields to avoid
wasted padding between them as much as possible.
(attr_count,attr_unknown_count) export new functions to
return number of counts of cached attributes.
* bgp_attr.c: (attr_count,attr_unknown_count) new functions to
return number of counts of cached attributes.
* bgp_route.h: (struct bgp_info) rearrange fields to avoid
wasted padding.
* bgp_table.h: (struct bgp_table) Add a count field, of number
of nodes in the table.
(struct bgp_node) rearrange fields to avoid
wasted padding between them, though I don't think there
was any in this case.
* bgp_table.c: (bgp_node_{delete,get}) Maintain the table node count.
(bgp_table_count) new function to access the table count.
|
|
2006-03-03 Paul Jakma <paul.jakma@sun.com>
* bgp_route.c: (bgp_clear_node_complete) Doh. When clearing
is complete we need to kick off FSM again.
|
|
2006-02-21 Paul Jakma <paul.jakma@sun.com>
* bgp_vty.c: (bgp_show_summary) Add a 'Clrng' sub-description
to state of peer while it's suppressed due to clearing.
|
|
2006-02-21 Paul Jakma <paul.jakma@sun.com>
* bgpd.h: move the clear_node_queue to be peer specific.
Add a new peer status flag, PEER_STATUS_CLEARING.
* bgp_table.h: (struct bgp_table) Add fields to record afi,
safi of the table.
(bgp_table_init) Take afi and safi to create table for.
* bgp_table.c: (bgp_table_init) record the afi and safi.
* bgp_nexthop.c: Update all calls to bgp_table_init.
* bgp_vty.c: ditto.
* bgpd.c: ditto.
* bgp_fsm.c: (bgp_timer_set) dont bring up a session which is
clearing.
* bgp_route.c: (general) Update all bgp_table_init calls.
(bgp_process_{rsclient,main}) clear_node is serialised
via PEER_STATUS_CLEARING and fsm now.
(struct bgp_clear_node_queue) can be removed. struct bgp_node
can be the queue item data directly, as struct peer can be
kept in the new wq global user data and afi/safi can be
retrieved via bgp_node -> bgp_table.
(bgp_clear_route_node) fix to get peer via wq->spec.data,
afi/safi via bgp_node->bgp_table.
(bgp_clear_node_queue_del) no more item data to delete, only
unlock the bgp_node.
(bgp_clear_node_complete) only need to unset CLEARING flag
and unlock struct peer.
(bgp_clear_node_queue_init) queue attaches to struct peer
now. record peer name as queue name.
(bgp_clear_route_table) If queue transitions to active,
serialise clearing by setting PEER_STATUS_CLEARING rather
than plugging process queue, and lock peer while queue
active.
Update to pass only bgp_node as per-queue-item specific data.
|
|
2006-02-18 Paul Jakma <paul.jakma@sun.com>
* bgp_route.c: (bgp_announce_check) trivial, move declaration
of two local variables into the only block where they are
used, to aid the reader.
|
|
2006-02-18 Paul Jakma <paul.jakma@sun.com>
* bgp_routemap.c: (route_set_community) Quick, very hacky, fix
for the set-community leak, bug #89. True fix will be to
detangle the web of *_intern caching and provide saner object
caching for Quagga, future work.
|
|
2006-02-05 Paul Jakma <paul.jakma@sun.com>
* bgp_aspath.c: (aspath_gettoken) fix gcc warning about
possible uninitialised usage.
|
|
2006-02-05 Paul Jakma <paul.jakma@sun.com>
* bgp_route.h: Add BGP_INFO_COUNTED to track whether
prefix has been counted or not.
* bgp_route.c: (bgp_pcount_{inc,dec}rement) new helpers, to
centralise inc/dec of prefix-count,
(bgp_rib_remove) Remove pcount decrement, use helper.
(bgp_rib_withdraw) ditto, additionally use previous function
too.
(bgp_update_main) Use pcount helpers.
(bgp_clear_route_node) ditto, aslo REMOVED routes don't need
clearing.
|
|
2006-02-02 Paul Jakma <paul.jakma@sun.com>
* workqueue.h: (struct work_queue) Remove the delay field.
It served no purpose and just introduced bad behaviour.
Should be excised before its allowed to escape into 1.0.
This removes need for the 'flood' and runs_since_clear
fields.
* workqueue.c: (general) excise delay factor between queue
runs, hence the 'flood' crap too.. See above.
* bgp_route.c: (bgp_{clear_node,process}_queue_init) delay
field is removed from workqueue spec.
|
|
2006-01-19 Paul Jakma <paul.jakma@sun.com>
* (general) various miscellaneous compiler warning fixes.
Remove redundant break statements from switch clauses
which return.
return from main, not exit, cause it annoys SOS.
Remove stray semi-colons which cause empty-statement
warnings.
* zebra/main.c: (sighup) remove private declaration of external
function.
|
|
2006-01-17 Paul Jakma <paul.jakma@sun.com>
* bgp_nexthop.c: (zlookup_read*) convert to new Zserv format.
(zlookup_query_ipv6) ditto.
(bgp_import_check) ditto.
* isis_zebra.c: (isis_zebra_route_add_ipv4) fix for new
zserv format.
|
|
2006-01-16 Paul Jakma <paul.jakma@sun.com>
* bgp_aspath.c:
(aspath_snmp_pathseg) move the static stream pointer out to
file scope, so it can be freed.
(aspath_finish) new function, free aspath resources.
* bgp_aspath.h: (aspath_finish) export.
|
|
2006-01-16 Paul Jakma <paul.jakma@sun.com>
* bgp_aspath.c: (assegment_append_asns) XREALLOC can return
NULL theoretically, take care not to lose the allocated data.
(aspath_hash_alloc) aspath_dup already set the aspath
string - fix leak.
(aspath_parse) aspath_hash_alloc dupes the entire aspath,
including segments, but we forgot to free the temporary
assegment.
|
|
2006-01-10 Juris Kalnins <juris@mt.lv>
* bgpd.h: (bgp_router_id_unset) ex-function, remove.
|
|
2005-11-23 Paul Jakma <paul.jakma@sun.com>
* bgp_aspath.c: (assegments_parse) should be static
2005-11-23 Juergen Kammer <j.kammer@eurodata.de>
* bgp_aspath.c: (aspath_cmp_left_confed) fix SEGV for case
where one or both paths are empty.
|
|
* zebra_rib.c: (rib_process) convert to new workqueue specs and
shut up gcc, which complains about cast from void via
function parameters, for some dumb reason. Do the cast
inside the function instead.
(rib_queue_qnode_del) ditto.
(rib_queue_init) no need for the casts anymore.
|
|
* bgp_damp.c: (bgp_reuse_timer) struct bgp can be retrieved via
the struct bgp_damp_info, no need to guess by using
bgp_get_default().
|
|
* zebra.h: Declare new functions zebra_route_string() and
zebra_route_char().
* log.c: (zroute_lookup,zebra_route_string,zebra_route_char) New
functions to map zebra route numbers to strings.
* zebra_vty.c: (route_type_str) Remove obsolete function: use new
library function zebra_route_string() instead. Note that there
are a few differences: for IPv6 routes, we now get "ripng" and
"ospf6" instead of the old behavior ("rip" and "ospf").
(route_type_char) Remove obsolete function: ues new library function
zebra_route_char() instead. Note that there is one difference:
the old function returned 'S' for a ZEBRA_ROUTE_SYSTEM route,
whereas the new one returns 'X'.
(vty_show_ip_route_detail,vty_show_ipv6_route_detail) Replace
route_type_str() with zebra_route_string().
(vty_show_ip_route,vty_show_ipv6_route) Replace route_type_char()
with zebra_route_char().
* bgp_vty.c: (bgp_config_write_redistribute) Use new library function
zebra_route_string instead of a local hard-coded table.
* ospf6_asbr.c: Remove local hard-coded tables zroute_name and
zroute_abname. Change the ZROUTE_NAME macro to use new library
function zebra_route_string(). Remove the ZROUTE_ABNAME macro.
(ospf6_asbr_external_route_show): Replace ZROUTE_ABNAME() with
a call to zebra_route_char(), and be sure to fix the format string,
since we now have a char instead of a char *.
* ospf6_zebra.c: Remove local hard-coded tables zebra_route_name and
zebra_route_abname. Note that the zebra_route_name[] table
contained mixed-case strings, whereas the zebra_route_string()
function returns lower-case strings.
(ospf6_zebra_read_ipv6): Change debug message to use new library
function zebra_route_string() instead of zebra_route_name[].
(show_zebra): Use new library function zebra_route_string() instead
of zebra_route_name[].
* ospf_dump.c: Remove local hard-coded table ospf_redistributed_proto.
(ospf_redist_string) New function implemented using new library
function zebra_route_string(). Note that there are a few differences
in the output that will result: the new function returns strings
that are lower-case, whereas the old table was mixed case. Also,
the old table mapped ZEBRA_ROUTE_OSPF6 to "OSPFv3", whereas the
new function returns "ospf6".
* ospfd.h: Remove extern struct message ospf_redistributed_proto[],
and add extern const char *ospf_redist_string(u_int route_type)
instead.
* ospf_asbr.c: (ospf_external_info_add) In two messages, use
ospf_redist_string instead of LOOKUP(ospf_redistributed_proto).
* ospf_vty.c: Remove local hard-coded table distribute_str.
(config_write_ospf_redistribute,config_write_ospf_distribute): Use
new library function zebra_route_string() instead of distribute_str[].
* ospf_zebra.c: (ospf_redistribute_set,ospf_redistribute_unset,
ospf_redistribute_default_set,ospf_redistribute_check)
In debug messages, use ospf_redist_string() instead of
LOOKUP(ospf_redistributed_proto).
* rip_zebra.c: (config_write_rip_redistribute): Remove local hard-coded
table str[]. Replace str[] with calls to new library function
zebra_route_string().
* ripd.c: Remove local hard-coded table route_info[].
(show_ip_rip) Replace uses of str[] with calls to new library
functions zebra_route_char and zebra_route_string.
* ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded
table str[]. Replace str[i] with new library function
zebra_route_string(i).
* ripngd.c: Remove local hard-coded table route_info[].
(show_ipv6_ripng) Use new library function zebra_route_char() instead
of table route_info[].
|
|
* bgp_packet.c: fix compilation when DEBUG is used.
|
|
* configure.ac: Add the test for Solaris least-privileges. Set
defines for whether capabilities are supported and whether of
the linux or solaris variety.
Add missing-prototypes, missing-declarations, char-subscripts
and cast-qual warnings to default cflags, cause Hasso enjoys warnings,
and we really should clean the remaining ones up. (ie isisd..).
* (*/*main.c) Update the zebra_capabilities_t arrays in the various
daemons to match the changes made in lib/privs.h.
* zebra.h: Solaris capabilities requires priv.h to be included.
* privs.{c,h}: Add support for Solaris Least-Privileges.
privs.h: Reduce some of the abstract capabilities, which do
not have rough equivalents on both systems. Rename the net
related caps to _NET, as they should have been in first
place.
(zprivs_terminate) should take the zebra_privs_t as argument so
that it can update change pointer.
Add an additional privilege state, ZPRIVS_UNKNOWN.
* privs.c: (various capability functions) Add
Solaris privileges variants.
(zprivs_state) Use privs.c specific generic types to
represent various capability/privilege related types, so that
each can be typedef'd as appropriate on each platform.
(zprivs_null_state) static added, to hold the state the null
method should report (should be raised by default, and
LOWERED if zprivs_terminate has been called)
(zprivs_state_null) Report back the zprivs_null_state.
(cap_map) Make it able to map abstract capability to multiple
system capabilities.
(zcaps2sys) Map to abstract capabilities to multiple system
privileges/capabilities.
(zprivs_init) move capability related init to seperate
function, zprivs_caps_init.
(zprivs_terminate) ditto, moved to zprivs_caps_terminate.
Set the change_state callback to the NULL state, so the
user can continue to run and use the callbacks.
|
|
* Makefile.am: bgpd shouldn't list libgp's sources as its own.
Use LDADD.
* bgp_aspath.h:
(struct assegment) New struct, abstract representation of a
list of AS_PATH segments and the contained ASNs.
(struct aspath) Remove the raw-data related
fields, reference the abstract struct assegment instead.
Remove several other computed fields, it's just a
headache to maintain them and they're cheap to compute from
struct assegment.
(aspath_parse) parse a stream, not a pointer to raw data.
(aspath_count_{hops,confeds,size}) helpers to access
information formerly directly contained in struct aspath.
(aspath_snmp_pathseg) Helper for SNMP, BGP MIB wants
to be able to output hex representation of raw data.
* bgp_aspath.c: (general) partial-rewrite. Store aspath data
as an abstract singly-linked list of abstract segments,
rather than storing the raw data, and parsing it each and
every time. Remove several count/size fields which are cheap
to compute from the abstract segment structure.
(global) Include stream.h, needed for aspath_parse, and
others. Couple of helper macros added.
(struct assegment_header) Just the header, and only the
header.
(assegment_data_{new,free}) convenience functions for
AS_SEG_DATA allocation, the dynamic, per-segment array of
ASNs.
(assegment_{new,free,free_all,dup,dup_all}) convenience
functions for creating struct assegments. The _all forms will
follow the entire chain of segments from the given segment.
(assegment_prepend_asns) new function, prepend an ASN N times
to segment.
(assegment_append_asns) Append a list (array) of ASNs to
segment.
(int_cmp) convenience function for the aspath hash.
(assegment_normalise) new function. Normalise the given
segment chain to meet expectations of Quagga, and to
eliminate differing raw representations of the same paths.
Merge 'runs' of SEQUENCEs into one segment as our internal
segment is not limited by the protocol AS_PATH segment
length. Sort ASNs in SETs.
(aspath_new) Take void argument to quell warnings. Use the
assegment convenience functions.
(assegment_count_{asns,confeds,hops}) new functions to
compute at runtime values previously held in struct aspath.
(aspath_size) ditto.
(aspath_make_str_count) rewritten to stringify new
representation, and to be slightly easier to understand
hopefully.
(aspath_str_update) convenience function, update the aspath
str. Should investigate removing maintained string from
struct aspath, just run-time compute it, as per other fields.
It's just a maintenance headache, would save noticeable
amount of RAM with possibly not much extra run-time cost.
(aspath_dup) use the assegment dup functions.
(aspath_hash_alloc) Take void * argument to satisfy gcc. Use
the proper helper functions to dup data.
(assegments_parse) new function. parse raw AS_PATH data into
struct assegments. Normalise and return the head of the list.
(aspath_parse) Parse a stream, not pointer to raw data and
use assegments_parse to do it.
(assegment_data_put) Write out a single segment data in protocol
form to stream.
(assegment_header_put) ditto but for segment header.
(aspath_put) new function. As per previous but for an entire
struct aspath.
(aspath_snmp_pathseg) wrapper around aspath_put for
bgp_snmp.c. Uses a static buffer sadly.
(aspath_aggregate_as_set_add) rewritten to use assegments.
(aspath_aggregate) ditto
(aspath_{firstas,loop,private_as}_check) ditto
(aspath_{merge,prepend,add_one_as}) ditto
(aspath_cmp_left{_confed}) ditto
(aspath_delete_confed_seq) ditto, plus fixed to properly
delete all leading confed segments.
(aspath_as_add) Just use assegment_append_asns.
(aspath_segment_add) updated to use assegments.
(enum as_token) Add values for confeds
(aspath_gettoken) Add support for confeds
(aspath_str2aspath) ditto
(aspath_key_make) updated to use as_segments. Also, add
segment type into the hash value as appropriate.
(aspath_cmp) updated to use as_segments.
(aspath_print) don't segfault on NULL argument.
* bgp_attr.c: (bgp_attr_aspath) aspath_parse wants the stream
now. No need for manual forwarding of stream.
(bgp_packet_attribute) empty aspath is now denoted by NULL
segment field, length is gone.
Use aspath_size() to determine size.
(bgp_attr_init) Fix declaration, explicitely specify void
arg.
(bgp_dump_routes_attr) Use aspath_size() to determine size.
* bgp_route.c: (bgp_info_cmp) use the aspath_count_* functions.
(bgp_rib_withdraw) remove unused variable. Use
aspath_count_hops.
* bgp_snmp.c: (bgp4PathAttrTable) raw data is gone, use
aspath_snmp_pathseg to get the representation.
|
|
* bgp_vty.c: (bgp_vty_init) gcc 4 compile fix. static
function declarations shouldn't be inside functions.
* bgp_dump.c: (bgp_dump_interval_add) ditto.
|
|
introduced long time ago with route server patch. Hopefully
it's last case to fix - route-server client not in peer group.
[backport candidate]
|