summaryrefslogtreecommitdiff
path: root/lib/memory.c
AgeCommit message (Collapse)Author
2008-08-23[vty] Add support for a 'restricted mode' with anonymous vty connectionsPaul Jakma
* lib/command.h: Add a RESTRICTED_NODE, intended for use with anonymous, 'no login' vtys, to provide a subset of 'view' mode commands. * lib/command.c: Add RESTRICTED_NODE bits, nothing special, just following VIEW_NODE. * lib/vty.c: (vty_auth) enable authentication should fall back to restricted/view node as appropriate. (vty_create) init vty's to restricted/view node as appropriate, for the 'no login' case. (vty_{no_,}restricted_mode_cmd) config commands to enable 'anonymous restricted' in vty configuration. (vty_config_write) 'anonymous restricted' config. (vty_init) Install some commands to restricted mode, and the 'anonymous restricted' config commands into VTY_NODE. * bgpd/*.c: Install some of the safe(r) BGP commands into 'restricted mode', i.e. lookup commands of non-sensitive data. Useful with looking-glass route-servers.
2008-08-22[lib] mes_lookup string lookup table argument should be marked constStephen Hemminger
2008-08-14 Stephen Hemminger <stephen.hemminger@vyatta.com> * lib/log.{c,h}: struct message argument should point to const * */*.c: adjust to suit, Signed-off-by: Paul Jakma <paul@quagga.net>
2008-01-08[lib] add mising UL qualifier to numerical constantPaul Jakma
2008-01-08 Pavol Rusnak <prusnak@suse.cz> * memory.c: (mtype_memstr) Fix accidental shift past width of type, constant should have been forced to UL, rather than being left to default to int.
2006-06-30[lib] Fix typo in cpp conditional for malloc.h includePaul Jakma
2006-06-28 Paul Jakma <paul.jakma@sun.com> * memory.c: Fix typo in cpp conditional around malloc.h, from comment in bug #269.
2006-05-28[lib] malloc.h is deprecated, try not to include it anymorePaul Jakma
2006-05-28 Paul Jakma <paul.jakma@sun.com> * memory.c: malloc.h is deprecated in favour of stdlib.h, however we still need it on GNU Libc for mallinfo().
2006-03-30[lib/memory] Add mallinfo supportPaul Jakma
2006-02-15 Paul Jakma <paul.jakma@sun.com> * configure.ac: Check for mallinfo, being careful to link test so we can detect things like umem being used (which doesn't provide a mallinfo). * lib/memory.c: (mtype_memstr) new helper function to return human friendly string for a byte count. (mtype_stats_alloc) new function, for users to retrieve number of objects allocated. (show_memory_mallinfo) New function, show mallinfo statistics if available. (show_memory_all_cmd) Call show_memory_mallinfo, if mallinfo is available. * lib/memory.h: Export mtype_memstr and mtype_stats_alloc. Provide a define for a reasonable buffer size for mtype_memstr.
2005-10-202005-10-20 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* memory.c: (show_memory_vty) Omit zero statistics. Print separators only if some non-zero stats have been printed in between. (show_separator) New function to print a separator. (show_memory_all) Keep track of whether a separator is needed between the different memory statistics groups.
2005-05-062005-05-06 Paul Jakma <paul@dishone.st>paul
* (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
2005-04-252005-04-25 Paul Jakma <paul.jakma@sun.com>paul
* memory.c: Make the string field much wider * memtypes.c: Correct the prefix list str/entry strings
2005-04-152005-04-15 Paul Jakma <paul@dishone.st>paul
* 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.
2004-12-082004-12-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* prefix.c: (prefix_copy) Error message before abort should have severity LOG_ERR, not LOG_INFO. * memory.c: (mtype_log) Log level should be LOG_DEBUG, not LOG_INFO.
2004-11-262004-11-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* log.c, log.h, memory.c: Change function name from zlog_backtrace_safe to the more self-explanatory zlog_backtrace_sigsafe.
2004-11-262004-11-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* log.c: (zlog_backtrace) New function to log a backtrace. (zlog_backtrace_safe) Log a backtrace in an async-signal-safe way. Unfortunately, this function does not support syslog logging yet. (zlog_signal) Move backtrace code into separate function zlog_backtrace_safe. (_zlog_assert_failed) Call zlog_backtrace before aborting. * log.h: Declare new functions zlog_backtrace and zlog_backtrace_safe. * memory.c: (zerror) Call zlog_backtrace before aborting.
2004-11-202004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* global: Replace strerror with safe_strerror. And vtysh/vtysh.c needs to include "log.h" to pick up the declaration.
2004-11-162004-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* memory.h: Fix prototype for memory_init(). * memory.c: Declare many functions and data structures static instead of global. Fix prototype for memory_init().
2004-11-152004-11-15 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* memory.c: (zerror) Use zlog_err instead of fprintf to stderr. Instead of exiting, log currenty memory usage and then abort. (log_memstats) New function to log memory statistics, called by zerror. (show_memory_all) Loop over new mlists array instead of calling show_memory_vty separately for each memory_list.
2004-10-102004-10-10 Paul Jakma <paul@dishone.st>paul
* version.h.in: (pid_output*) add const qualifier. * command.h: Change DEFUN func to take const char *[] rather than char **, to begin process of fixing compile warnings in lib/. Nearly all other changes in this commit follow from this change. * buffer.{c,h}: (buffer_write) pointer-arithmetic is gccism, take const void * and cast an automatic const char *p to it. (buffer_putstr) add const * command.c: (zencrypt) const qualifier (cmd_execute_command_real) ditto (cmd_execute_command_strict) ditto (config_log_file) ditto. Fix leak of getcwd() returned string. * memory.{c,h}: Add MTYPE_DISTRIBUTE_IFNAME for struct dist ifname. * distribute.{c,h}: Update with const qualifier. (distribute_free) use MTYPE_DISTRIBUTE_IFNAME (distribute_lookup) Cast to char *, note that it's ok. (distribute_hash_alloc) use MTYPE_DISTRIBUTE_IFNAME. (distribute_get) Cast to char *, note that it's ok. * filter.c: Update with const qualifier. * if.{c,h}: ditto. * if_rmap.{c,h}: ditto. (if_rmap_lookup) Cast to char *, note that it's ok. (if_rmap_get) ditto. * log.{c,h}: Update with const qualifier. * plist.{c,h}: ditto. * routemap.{c,h}: ditto. * smux.{c,h}: ditto. Fix some signed/unsigned comparisons. * sockopt.c: (getsockopt_cmsg_data) add return for error case. * vty.c: Update with const qualifier.
2004-10-04First small part of lib cleanup. Mainly "constification" of arguments andhasso
adding FIXME's.
2003-12-23Merge isisd into the Quagga's framework:jardin
- add privs support - use misc quagga's definitions - make it compile"able" - fix segfault cases related to hostname() - add debug isis xxx command This patch has been approved by Paul Jakma.
2003-05-25Ripngd part of 6Wind patch.hasso
2002-12-13Initial revisionpaul