Age | Commit message (Collapse) | Author |
|
* lib/filer.c: show protocol name in filter_show()
* lib/plist.c: show protocol name in vty_show_prefix_entry()
* routemap.c: show protocol name in vty_show_route_map_entry()
* lib/vty.c: in vty_command(), show protocol name if command unknown
* zebra/zserv.c: Always provide distance fo route add
* ripd/rip_snmp.c: rip2IfConfReceive() sends values in conformance
with RFC. Also PeerDomain is now set to a STRING type.
* ripd/ripd.h: rip_redistribute_add() API includes metric and distance
* ripd/ripd.c: rip_redistribute_add() API i.e. stores metric and distance
Now allows a RIP-route to overcome a redistributed route coming
from a protocol with worse (higher) administrative distance
Metrics from redistribution are shown in show ip rip
* ripd/rip_zebra.c: adapt to the rip_redistribute_add() API, i.e.
provide distance and metric
* ripd/rip_interface.c: adapt to the rip_redistribute_add() API
* ripd/rip_routemap.c: no RMAP_COMPILE_ERROR on (metric > 16) usage
rather a CMD_WARNING, because set metric ius shared with other
protocols using larger values (such as OSPF)
The match metric action takes first external metric if present
(from redistribution) then RIP metric.
|
|
* lib/md5-gnu.h: removed
* lib/md5.h: replaces md5-gnu.h
* lib/Makefile.am: use correct md5.h
* lib/md5.c: import from WIDE
* ospfd/ospf_packet.c: use new md5 API
* ripd/ripd.c: use new md5 API
|
|
* memtypes.{c,h}: Add MTYPE_AS_SEG_DATA.
|
|
* lib/str.[ch]: Add strndup() from glibc.
|
|
* command.c: (install_element) be more robust. Eg, cmd_init
need not have been called, some applications may use other
library subsystems, which call install_element, without the
application wanting commands and hence not calling cmd_init.
|
|
* command.h: (enum node_type) Add BGP_IPV6M_NODE
* command.c: (node_parent) Handle BGP_IPV6M_NODE node
(config_exit, config_end) ditto
* vty.c: (vty_end_config) Handle BGP_IPV6M_NODE node
|
|
* getopt.h: Don't declare getopt (rather than getopt_long), since
quagga doesn't need it.
* getopt.c (getopt): Don't define getopt.
Fixes build breakage on NetBSD, and seems likely to work on most
platforms since it avoids the entire issue of system getopt
declarations and whether they conform to POSIX.2. Note that this
change doesn't address system getopt_long declarations, but also
doesn't change anything about getopt_long.
|
|
* prefix.c: (prefix_ipv4_new, prefix_ipv6_new): Call prefix_new
to allocate the memory to make sure that all struct prefix pointers
point to objects of the same length (avoids memory overruns
on struct prefix assignments).
(prefix_ipv4_free, prefix_ipv6_free): Simply call prefix_free.
It is interesting to note that these functions are never actually
called anywhere in the code. Instead prefix_free was already
being called directly, despite the previous MTYPE incompatibility.
[backport candidate]
|
|
* prefix.c: (ip_masklen) While loop should test that 'pnt' pointer is
in range before dereferencing it.
[backport candidate]
|
|
* getopt.h: add further tests for full getopt declaration on
various systems.
|
|
* memtypes.h: update autobuilt file to match memtypes.c changes
|
|
* bgpd/(general) refcount struct peer and bgp_info, hence allowing us
add work_queues for bgp_process.
* bgpd/bgp_route.h: (struct bgp_info) Add 'lock' field for refcount.
Add bgp_info_{lock,unlock} helper functions.
Add bgp_info_{add,delete} helpers, to remove need for
users managing locking/freeing of bgp_info and bgp_node's.
* bgpd/bgp_table.h: (struct bgp_node) Add a flags field, and
BGP_NODE_PROCESS_SCHEDULED to merge redundant processing of
nodes.
* bgpd/bgp_fsm.h: Make the ON/OFF/ADD/REMOVE macros lock and unlock
peer reference as appropriate.
* bgpd/bgp_damp.c: Remove its internal prototypes for
bgp_info_delete/free. Just use bgp_info_delete.
* bgpd/bgpd.h: (struct bgp_master) Add work_queue pointers.
(struct peer) Add reference count 'lock'
(peer_lock,peer_unlock) New helpers to take/release reference
on struct peer.
* bgpd/bgp_advertise.c: (general) Add peer and bgp_info refcounting
and balance how references are taken and released.
(bgp_advertise_free) release bgp_info reference, if appropriate
(bgp_adj_out_free) unlock peer
(bgp_advertise_clean) leave the adv references alone, or else
call bgp_advertise_free cant unlock them.
(bgp_adj_out_set) lock the peer on new adj's, leave the reference
alone otherwise. lock the new bgp_info reference.
(bgp_adj_in_set) lock the peer reference
(bgp_adj_in_remove) and unlock it here
(bgp_sync_delete) make hash_free on peer conditional, just in
case.
* bgpd/bgp_fsm.c: (general) document that the timers depend on
bgp_event to release a peer reference.
(bgp_fsm_change_status) moved up the file, unchanged.
(bgp_stop) Decrement peer lock as many times as cancel_event
canceled - shouldnt be needed but just in case.
stream_fifo_clean of obuf made conditional, just in case.
(bgp_event) always unlock the peer, regardless of return value
of bgp_fsm_change_status.
* bgpd/bgp_packet.c: (general) change several bgp_stop's to BGP_EVENT's.
(bgp_read) Add a mysterious extra peer_unlock for ACCEPT_PEERs
along with a comment on it.
* bgpd/bgp_route.c: (general) Add refcounting of bgp_info, cleanup
some of the resource management around bgp_info. Refcount peer.
Add workqueues for bgp_process and clear_table.
(bgp_info_new) make static
(bgp_info_free) Ditto, and unlock the peer reference.
(bgp_info_lock,bgp_info_unlock) new exported functions
(bgp_info_add) Add a bgp_info to a bgp_node in correct fashion,
taking care of reference counts.
(bgp_info_delete) do the opposite of bgp_info_add.
(bgp_process_rsclient) Converted into a work_queue work function.
(bgp_process_main) ditto.
(bgp_processq_del) process work queue item deconstructor
(bgp_process_queue_init) process work queue init
(bgp_process) call init function if required, set up queue item
and add to queue, rather than calling process functions directly.
(bgp_rib_remove) let bgp_info_delete manage bgp_info refcounts
(bgp_rib_withdraw) ditto
(bgp_update_rsclient) let bgp_info_add manage refcounts
(bgp_update_main) ditto
(bgp_clear_route_node) clear_node_queue work function, does
per-node aspects of what bgp_clear_route_table did previously
(bgp_clear_node_queue_del) clear_node_queue item delete function
(bgp_clear_node_complete) clear_node_queue completion function,
it unplugs the process queues, which have to be blocked while
clear_node_queue is being processed to prevent a race.
(bgp_clear_node_queue_init) init function for clear_node_queue
work queues
(bgp_clear_route_table) Sets up items onto a workqueue now, rather
than clearing each node directly. Plugs both process queues to
avoid potential race.
(bgp_static_withdraw_rsclient) let bgp_info_{add,delete} manage
bgp_info refcounts.
(bgp_static_update_rsclient) ditto
(bgp_static_update_main) ditto
(bgp_static_update_vpnv4) ditto, remove unneeded cast.
(bgp_static_withdraw) see bgp_static_withdraw_rsclient
(bgp_static_withdraw_vpnv4) ditto
(bgp_aggregate_{route,add,delete}) ditto
(bgp_redistribute_{add,delete,withdraw}) ditto
* bgpd/bgp_vty.c: (peer_rsclient_set_vty) lock rsclient list peer
reference
(peer_rsclient_unset_vty) ditto, but unlock same reference
* bgpd/bgpd.c: (peer_free) handle frees of info to be kept for lifetime
of struct peer.
(peer_lock,peer_unlock) peer refcount helpers
(peer_new) add initial refcounts
(peer_create,peer_create_accept) lock peer as appropriate
(peer_delete) unlock as appropriate, move out some free's to
peer_free.
(peer_group_bind,peer_group_unbind) peer refcounting as
appropriate.
(bgp_create) check CALLOC return value.
(bgp_terminate) free workqueues too.
* lib/memtypes.c: Add MTYPE_BGP_PROCESS_QUEUE and
MTYPE_BGP_CLEAR_NODE_QUEUE
|
|
* memtypes.h: update this auto-built file. (maybe we should just
remove it, is GNU awk a terrible dependency to have?)
|
|
* workqueue.h: Add a WQ_QUEUE_BLOCKED item_status return code,
to allow a queue function to indicate the queue is not
ready/blocked - rather than any problem with the item at hand.
Add a notion of being able to 'plug' and 'unplug' a queue.
Add helpers to plug/unplug a queue.
Add a completion callback, to be called when a queue is emptied.
* workqueue.c: (work_queue_new) remove useless list_free.
(work_queue_schedule) new internal helper function to schedule
queue, if appropriate.
(work_queue_add) use work_queue_schedule
(show_work_queues) Print 'P' if queue is plugged.
(work_queue_plug) new API function, plug a queue - ie prevent it
from 'drained' / processed / scheduled.
(work_queue_unplug) unplug a queue, allowing it to be drained
/ scheduled / processed again.
(work_queue_run) Add support for WQ_QUEUE_BLOCKED.
Add comment for RETRY_NOW case.
Make hysteris more aggresive in ramping up granularity, improves
performance significantly.
Add support for calling completion callback when queue is emptied,
possibly useful for knowing when to unplug a queue.
|
|
* routemap.c: (rmap_onmatch_goto) fix crash if 'continue' command
is used, which does not supply an argv[0].
this is a backport candidate /iff/ the trailing ; is removed
from VTY_GET_INTEGER_RANGE
* vty.h: fix the VTY_GET macros, do {..} while(0) so they have
correct function like syntax in usage.
|
|
* memtypes.awk: use character classes, which work correctly in
all LC_COLLATE environments, unlike A-Z, which doesnt work in
eg estonian collate order. Reported by Hasso.
|
|
* memtypes.c: (memory_list_bgp) add MTYPE_BGP_PEER_HOST
|
|
* sockunion.c: (sockunion_getsockname) use MTYPE_SOCKUNION, not TMP
(sockunion_getpeername) ditto
|
|
* thread.c: (thread_cancel_event) the number of pending events
cancelled is potentially useful information, dont throw it away,
pass it back to the caller.
|
|
* getopt.h: It's not just __GNU_LIBRARY__ which defines
getopt, eg __EXTENSIONS__ does too on SunOS. It still seems
awfully fragile though.
* getopt.c: include zebra.h after config.h, before including
getopt.h so that things at least are consistent..
* getopt1.c: ditto
|
|
* configure.ac: Check for OSes which support passing ifindex in
struct ip_mreq.
* lib/sockopt.c: Add support for BSD style ifindex in ip_mreq.
* ospfd/ospf_network.c: Log ifindex on multicast membership leave/join
events.
|
|
* (general) extern and static'ification of functions in code and
header.
Cleanup any definitions with unspecified arguments.
Add casts for callback assignments where the callback is defined,
typically, as passing void *, but the function being assigned has
some other pointer type defined as its argument, as gcc complains
about casts from void * to X* via function arguments.
Fix some old K&R style function argument definitions.
Add noreturn gcc attribute to some functions, as appropriate.
Add unused gcc attribute to some functions (eg ones meant to help
while debugging)
Add guard defines to headers which were missing them.
* command.c: (install_node) add const qualifier, still doesnt shut
up the warning though, because of the double pointer.
(cmp_node) ditto
* keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived
fromn vty.h ones to fix some of the (long) < 0 warnings.
* thread.c: (various) use thread_empty
(cpu_record_hash_key) should cast to uintptr_t, a stdint.h type
* vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they
removed from ospfd/ospf_vty.h
* zebra.h: Move definition of ZEBRA_PORT to here, to remove
dependence of lib on zebra/zserv.h
|
|
|
|
* stream.h: Add comment about the special zero-ing ability of
stream_put.
(stream_recvmsg, stream_write) should return ssize_t and size_t
respectively. Should both be extern linkage.
(stream_recvfrom) Stream aware wrapper around recvfrom, in style
of stream_read_try.
* stream.c: (stream_recvfrom) new function, wrapper around recvfrom.
(stream_recvmsg, stream_write) ssize_t and size_t return values
|
|
Add wall-clock timing statistics to 'show thread cpu' output.
* thread.h: Define struct rusage_t to contain wall-clock time
and cpu time. Change GETRUSAGE macro to collect both pieces
of data. Make appropriate changes to struct cpu_thread_history
to track CPU time and real time. Change proto for
thread_consumed_time to return real and cpu time elapsed.
And declare a new global variable 'struct timeval recent_time'.
* thread.c (struct timeval recent_time): New global timestamp variable.
(timeval_adjust): If timeout is negative, set to 0 (not 10
microseconds). And remove upper bound of 1,000,000 seconds, since
this does not seem to make any sense (and it breaks
funcname_thread_add_timer_timeval).
(timeval_cmp): Should return long, not int.
(vty_out_cpu_thread_history): Show CPU time and real time.
(cpu_record_hash_print): Calculate totals for CPU and real time.
(cpu_record_print): Change 'show thread cpu' title to show CPU and
real time.
(thread_timer_remain_second): Put current time in global recent_time.
(funcname_thread_add_timer_timeval): Fix assert. Replace 2-case
switch assignment with a ternary expression. Use global recent_time
variable. Fix use of timeval_adjust (previously, the value was not
actually being adjusted).
(thread_cancel): Add missing "break" statement in case
THREAD_BACKGROUND.
(thread_timer_wait): Use global recent_time value instead of calling
gettimeofday. And there's no need to check for negative timeouts,
since timeval_subtract already sets these to zero.
(thread_timer_process): Timers are sorted, so bail out once we
encounter a timer that has not yet popped. And remove some
extraneous asserts.
(thread_fetch): Do not process foreground timers before calling
select. Instead, add them to the ready list just after the select.
Also, no need to maintain a count of the number of ready threads,
since we don't care how many there are, just whether there's
one at the head of the ready list (which is easily checked).
Stick current time in global variable recent_time to reduce
the number of calls to gettimeofday. Tighten logic for
calculating the select timeout.
(thread_consumed_time): Now returns real time and puts the elapsed
cpu time in an additional argument.
(thread_should_yield): Use real (wall-clock) time to decide whether
to yield.
(thread_call): Maintain CPU and real time statistics.
* vty.c (vty_command): For slow commands, show real and cpu time.
|
|
* workqueue.c (show_work_queues): Remove unused gettimeofday call.
|
|
* memory.h: memtypes is built source, default includes points to
top_builddir, so we should refer to lib/memtypes.h
|
|
* workqueue.h: (struct work_queue_item) change retry_count to ran,
its a count of number item has been run.
* workqueue.c: (show_work_queues) Fix formating of slightly
bugfix: fix SIGFPE if wq->runs is 0.
(work_queue_run) retry logic was slightly wrong.
cycles.best is 0 initialy, granularity is 1, so update best
if cycles >= granularity, not just >.
|
|
* buffer.c (buffer_write): Comment out call to buffer_flush_available.
This should speed up buffering at the expense of a possible increase
in latency in flushing the data if inside a long-running thread.
|
|
|
|
* workqueue.{c,h}: Helper API for setting up and running queues via
background threads.
* command.c: install the 'show workqueues' command
* memtypes.c: Add work queue mtypes, and a rib-queue type for
a zebra rib work queue.
* memtypes.h: Updated to match memtypes.c
* Makefile.am: Add new workqueue files to build.
|
|
* thread.c: Kill unused TIMER_NO_SORT bits
|
|
to HACKING (which I added..)
|
|
* memory.c: Make the string field much wider
* memtypes.c: Correct the prefix list str/entry strings
|
|
* Makefile.am: Refer to source files via srcdir variable, fix
out-of-tree build breakage.
|
|
* thread.h: Fix type for struct thread_master add_type: should be
unsigned char. Also, add some documentation of thread_add_background
args. And remove extraneous declaration of
show_thread_work_queues_cmd.
|
|
* memory.h: Move include of memtypes.h to after the definition of
struct memory_list, gcc 4.0 doesn't like arrays of incomplete
types.
|
|
|
|
* thread.h: Add background thread type and thread_add_background
macro and accompanying funcname_... function.
export thread_should_yield, background threads can use it.
Lower thread yield time to 10ms, 100ms is noticeable lag and
a thread would only be /starting/ to finish sometime afterward.
* thread.c: (general) Add background thread type and schedule
nearly all thread types through the ready list for fairness.
(timeval_adjust) static qualifier missing
(vty_out_cpu_thread_history) add support for printout of
background threads
(show_thread_cpu) ditto.
(thread_master_debug) add debug of background list
(thread_master_create) fixup long line
(thread_add_unuse) add asserts for required state.
(thread_master_free) free background thread list
(funcname_thread_add_timer_timeval) make generic, able to
support arbitrary timer-like thread types.
(funcname_thread_add_timer) pass thread type to .._add_timer_timeval
(funcname_thread_add_timer_msec) ditto
(funcname_thread_add_background) Add a background thread, with an
optional millisecond delay factor, using .._add_timer_timeval.
(thread_cancel) Add background thread type.
Move the thread_list_delete common to all cases to bottom of
function, after the switch statement..
(thread_cancel_event) indent
(thread_timer_wait) Static qualifier, and make it able to cope
with arbitrary timer-like thread lists, so its of use to
background threads too.
(thread_process_fd) static qualifier. Again, make it take a list
reference rather than thread_master. Fix indentation.
(thread_timer_process) Check for ready timer-like threads in the
given list and move them on to the ready list - code originally
embedded in thread_fetch.
(thread_fetch) Schedule all threads, other than events, through
the ready list, to ensure fairness. Timer readying code moved to
thread_timer_process so it can be reused for background threads.
Remove the unneeded quagga_sigevent_process, as pointed out by
John Lin <john.ch.lin@gmail.com>.
(thread_should_yield) make this available.
|
|
* configure.ac: Added AC_ARG_ENABLE(time-check). By default,
warning messages will now be printed for threads or commands that take
longer than 5 seconds, but this configure argument can be used
to disable the checks or change the threshold.
* thread.h (thread_consumed_time): Declare new function to calculate
elapsed microseconds.
* thread.c (thread_consumed_time): Must be global not static so we
can call it from lib/vty.c:vty_command.
(thread_should_yield): Surround with `#if 0' to make clear that this
function is not currently being used anywhere.
(thread_call): If CONSUMED_TIME_CHECK is defined, print a CPU HOG
warning message if the thread takes more than CONSUMED_TIME_CHECK
microseconds.
* vty.c (vty_command): If CONSUMED_TIME_CHECK is defined, print a CPU
HOG warning message if the command takes more than CONSUMED_TIME_CHECK
microseconds.
|
|
* memtypes.c: the comment about use of comments in the comments
headers was causing comment within comment warnings from compiler
* memtypes.awk: Add extensive comments on the file format for
memtypes.c.
tighten the pattern for the MTYPE matching action (suggestion from
Andrew) and tighten which field we try the match on.
|
|
* Makefile.am: memtypes.awk is gawk dependent, use the GAWK automake
var.
* memtypes.h: New file, auto-generated, checked in for convenience.
|
|
* memtypes.c: The new, unified location for memory type definitions.
The memtype enum and declarations for memory_lists are built from
this automatically and put into memtypes.h.
* memtypes.awk: New script to generate memtypes.h from memtypes.c
* memory.h: Finally, the enum can banished!
* memory.c: Finally, the seperate mtype memory_list definitions can
be banished!
(log_memstats) Increase width of fields
(show_memory_zebra_cmd) display zebra specific memory types.
Increase width of fields.
* Makefile.am: Add memtypes.{c,h}, add BUILT_SOURCES for memtypes.h
Add a rule to build memtypes.h using memtypes.awk.
Add memtypes.awk to EXTRA_DIST.
|
|
Implement non-blocking zclient I/O with buffering.
* zclient.h (struct zclient): Add two fields to support non-blocking
I/O: struct buffer *wb, and struct thread *t_write.
(zclient_free): Remove function.
(zebra_redistribute_send): Change 2nd arg from socket fd to
struct zclient * (needed to support non-blocking I/O and buffering).
(zclient_send_message): New function to send an arbitrary
message with non-blocking I/O.
* zclient.c (zclient_new): Create write buffer.
(zclient_free): Remove unused function.
(zclient_stop): Must cancel new t_write thread. Also, reset
all buffers: ibuf, obuf, and wb.
(zclient_failed): New helper function for typical error handling.
(zclient_flush_data): New thread to flush queued data.
(zclient_send_message): New function to send the message in
zclient->obuf to zebra using non-blocking I/O and buffering.
(zebra_message_send, zapi_ipv4_route, zapi_ipv6_route): Use
new zclient_send_message function instead of calling writen.
(zclient_start): Set socket non-blocking. Also, change 2nd arg
to zebra_redistribute_send from zclient->sock to zclient.
(zebra_redistribute_send): Change 2nd arg to struct zclient *.
Can now use zclient->obuf to assemble the message instead of
allocating a temporary stream. And call zclient_send_message to
send the message instead of writen.
(zclient_read): Convert to support non-blocking I/O by using
stream_read_try instead of deprecated stream_read.
(zclient_redistribute): Change 2nd arg to zebra_redistribute_send
from zclient->sock to zclient.
* ospf6_zebra.c (ospf6_zebra_redistribute, ospf6_zebra_no_redistribute):
Change 2nd arg to zebra_redistribute_send from zclient->sock
to zclient.
* ospf_zebra.c (ospf_zebra_add): Call zclient_send_message instead
of writen.
* rip_zebra.c (rip_redistribute_set, rip_redistribute_unset,
rip_redistribute_clean): Change 2nd arg to zebra_redistribute_send
from zclient->sock to zclient.
* ripng_zebra.c (ripng_redistribute_unset, ripng_redistribute_clean):
Change 2nd arg to zebra_redistribute_send from zclient->sock
to zclient.
* bgp_zebra.c (bgp_redistribute_set, bgp_redistribute_unset):
The 2nd arg to zebra_redistribute_send is now zclient instead of
zclient->sock.
* isis_zebra.h (isis_zebra_finish): Remove declaration of unused
function.
* isis_zebra.c (isis_zebra_route_add_ipv4): Call zclient_send_message
to send the message to zebra instead of calling writen directly, since
zclient_send_message understands non-blocking I/O and will manage
the buffer queue appropriately.
(isis_zebra_finish): Remove unused function, particularly since
the zclient_free function has been removed.
|
|
|
|
* sigevent.c: On GNU_LINUX, check whether __USE_GNU is already defined.
|
|
* vty.c: (vty_log_fixed) Use casts to (void *) to try to eliminate
compiler warnings when assigning a (const char *) value to
struct iovec iov_base.
|
|
* zebra.h: If GNU_LINUX is defined, then define _GNU_SOURCE. This
fixes a problem where we were not getting the declaration of strnlen
in <string.h>.
|
|
Closes Bugzilla #167.
|
|
inet_ntoa alike.
* ripngd.[hc], ripng_interface.c, ripng_peer.c: inet6_ntoa() takes
argument now by value.
|