summaryrefslogtreecommitdiffstats
path: root/lib/smux.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib: Remove smux option for snmpDonald Sharp2018-08-231-1416/+0
| | | | | | | | | | | | | | The smux.c code has not been able to compile for 2+ years and no-one has noticed. Additionally net-snmp has marked smux integration as deprecated for quite some time as well. Since no-one has noticed and it's been broken and smux integration is deprecated let's just remove this from the code base. From looking at the code, it sure looks like SNMP could use a decent cleanup. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-90/+104
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-44/+33
| | | | | | | | | This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindent pt. 2whitespace / reindent2017-07-171-33/+44
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-1188/+1138
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter2017-07-141-3/+3
|\ | | | | | | | | | | Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * vtysh: return non-zero for configuration failuresDaniel Walton2017-07-131-3/+3
| | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
* | *: remove VTYNL, part 2 of 6David Lamparter2017-07-141-1/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-1/+1
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: s/VTY_NEWLINE/VTYNL/gQuentin Young2017-06-291-1/+1
| | | | | | Should be able to fit more vty_out onto one line now Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use vty_outlnQuentin Young2017-06-291-1/+1
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: update thread_add_* callsQuentin Young2017-05-091-6/+8
| | | | | | | | | | | | Pass pointer to pointer instead of assigning by return value. See previous commit message. To ensure that the behavior stays functionally correct, any assignments with the result of a thread_add* function have been transformed to set the pointer to null before passing it. These can be removed wherever the pointer is known to already be null. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove THREAD_ON macros, add nullity checkQuentin Young2017-05-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way thread.c is written, a caller who wishes to be able to cancel a thread or avoid scheduling it twice must keep a reference to the thread. Typically this is done with a long lived pointer whose value is checked for null in order to know if the thread is currently scheduled. The check-and-schedule idiom is so common that several wrapper macros in thread.h existed solely to provide it. This patch removes those macros and adds a new parameter to all thread_add_* functions which is a pointer to the struct thread * to store the result of a scheduling call. If the value passed is non-null, the thread will only be scheduled if the value is null. This helps with consistency. A Coccinelle spatch has been used to transform code of the form: if (t == NULL) t = thread_add_* (...) to the form thread_add_* (..., &t) The THREAD_ON macros have also been transformed to the underlying thread.c calls. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: snmp: convert into modulesDavid Lamparter2017-03-251-2/+2
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* frr: Remove HAVE_IPV6 from code baseDonald Sharp2017-01-131-42/+0
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge remote-tracking branch 'origin/stable/2.0'Donald Sharp2017-01-061-1/+1
|\
| * build: rename (1 of ?): configure.ac + preprocDavid Lamparter2016-12-201-1/+1
| | | | | | | | | | | | | | This replaces Quagga -> FRR in most configure.ac settings as well as a handful of preprocessor macros in the source code. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | lib: add 'int idx_foo' argv index variablesDaniel Walton2016-09-231-2/+4
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | lib: distribute.c, smux.c, vty.c grammar refactorQuentin Young2016-09-221-21/+6
|/ | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: fix vty.c and smux.c static variable clashDonald Sharp2015-10-131-5/+6
| | | | | | | | | | | | Both vty.c and smux.c declare: static struct thread_master *master This is not a good thing because they are both linked into the same library. If you want to pass different struct thread_master pointers into smux.c and vty.c you will probably not get the result you were looking for Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: nuke ^L (page feed)David Lamparter2014-06-041-5/+5
| | | | | | | | | | | | | | Quagga sources have inherited a slew of Page Feed (^L, \xC) characters from ancient history. Among other things, these break patchwork's XML-RPC API because \xC is not a valid character in XML documents. Nuke them from high orbit. Patches can be adapted simply by: sed -e 's%^L%%' -i filename.patch (you can type page feeds in some environments with Ctrl-V Ctrl-L) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* agentx: handle SNMP trapsVincent Bernat2012-06-251-1/+8
| | | | | | | | | | | | | | | | smux_trap() signature has been changed to provide appropriate level information to send SNMPv2 notifications. This includes the addition of the enterprise OID to use (from which is derived the SNMP trap OID) and the MIB registry to locate the appropriate function for variable bindings provided by the trap. The SMUX implementation has been updated but ignore the provided enterprise OID. Instead, it still uses the SMUX peer OID to keep compatibility with previous versions of Quagga. The SMUX implementation also ignores the provided MIB registry since it uses smux_get() function to grab the appropriate values. This is not possible with the AgentX implementation since there is no such function provided by NetSNMP.
* smux: remove `tick` argument from smux_trap()Vincent Bernat2012-06-251-1/+1
| | | | | | | | | smux_trap() contains an argument whose use appears to be to set sysUpTime.0/timestamp field in SNMP trap. However, this value is not used in smux_trap(). Moreover, it is expected that this field is the value of sysUpTime.0 when the trap was sent and not any other time related to the trap. To avoid any confusion, we remove this field from the signature of the function.
* agentx: add AgentX support to Quagga.Vincent Bernat2012-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | --enable-snmp will enable AgentX support in Quagga. SMUX is still here and can be enabled with --enable-snmp=smux. AgentX support can be enabled with "agentx" in configuration file. As for SMUX, this command is not understood by vtysh. It can be disabled with "no agentx", though there is no real use of this since this command cannot be used with vtysh. If "agentx" and "no agentx" command were added to vtysh, it would not be possible to disable agentx support after enabling it because NetSNMP does not expose the appropriate methods for this. The internals of AgentX are hidden by NetSNMP. Therefore, we don't have a file descriptor to add to the threading system. We do not have the timers to set either. Therefore, the event loop is modified to make use of snmp_select_info() from NetSNMP. Traps are not supported yet.
* smux: isolate SMUX implementation from SNMP implementationVincent Bernat2012-06-251-83/+40
| | | | | | | | lib/snmp.c gets OID related helper functions that can be used with another SNMP interface. smux.h is cleaned of SMUX specific bits to only expose functions that may be used by an alternative implementation. We also do not redefine functions already present in NetSNMP. Just use the appropriate headers.
* build: only define HAVE_SNMPVincent Bernat2012-06-251-6/+0
| | | | | NetSNMP is the only SNMP implementation for Quagga. We don't need two different symbols.
* lib: fix SMUX compiler warningsStephen Hemminger2011-12-061-4/+3
| | | | | Make progname a string, and cast when calling asn1. Remove variable set but never used.
* [cleanup] Use const in smux interfaceStephen Hemminger2009-06-181-8/+8
| | | | smux_trap and oid_copy should allow read-only source.
* [cleanup] Make command nodes staticStephen Hemminger2009-06-121-1/+1
| | | | | The cmd_nodes used to configure vty, can mostly be static so (basic data hiding 101).
* [snmp] Compiler warning fixes for when "--enable-snmp" is configured.Chris Caputo2009-06-021-51/+44
| | | | | Compiled on 32-bit and 64-bit linux gcc 4.1.2 platforms. No run-time testing on 32-bit and limited run-time testing on 64-bit.
* Make --enable-snmp cross compile and make libcrypto optional with ↵Joakim Tjernlund2008-08-251-1/+3
| | | | | | | --without-crypto Autoconfig work by me, the rest was done by "Kirill K. Smirnov" <lich@math.spbu.ru>
* [snmp-smux] Fix problems if 'smux peer ...' is issued multiple timesPaul Jakma2007-10-221-2/+12
| | | | | | | 2007-10-22 Lorenzo Colitti <lorenzo@colitti.com> * smux.c: (smux_stop) Avoid cancelling a defunct thread pointer (smux_start) Stop smux before trying to start it, possibly again.
* [autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warningsPaul Jakma2007-05-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 2007-05-09 Paul Jakma <paul.jakma@sun.com> * configure.ac: sys/conf.h depends on sys/param.h, at least on FBSD 6.2. (bug #363) Should check for in_pktinfo for IRDP 2006-05-27 Paul Jakma <paul.jakma@sun.com> * configure.ac: General cleanup of header and type checks, introducing an internal define, QUAGGA_INCLUDES, to build up a list of stuff to include so as to avoid 'present but cant be compiled' warnings. Misc additional checks of things missing according to autoscan. Add LIBM, for bgpd's use of libm, so as to avoid burdening LIBS, and all the binaries, with libm linkage. Remove the bad practice of using m4 changequote(), just quote the []'s in the case statements properly. This should fix bugs 162, 303 and 178. * */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN, * bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
* [64-bit] Fix 4 problems with printf formats and 64-bit size_tAndrew J. Schorr2007-04-271-1/+1
| | | | | | | | 2007-04-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * lib/smux.c: (smux_trap) Fix printf format to work with 64-bit size_t. * ospf6d/ospf6_snmp.c: (ospfv3AreaEntry, ospfv3AreaLsdbEntry) Fix some zlog_debug printf formats to work with 64-bit size_t.
* [snmp] Fix asn_build calls to pass correct variable sizes (fixes 64-bit issues)Andrew J. Schorr2006-09-261-7/+7
| | | | | | | | | | | | 2006-09-26 Pierre-Yves Ritschard <pierre-yves@spootnik.org> * smux.c: (smux_open,smux_trap,smux_register) Fix various asn_build_* calls to pass the proper length in the final argument: use sizeof(<variable>) instead of sizeof(<type>), since there were several inconsistencies between the actual variable type and the size that was passed. This should fix some problems on 64-bit architectures where sizeof(int) != sizeof(long).
* 2005-09-29 Alain Ritoux <alain.ritoux@6wind.com>vincent2005-09-291-6/+27
| | | | | | | | * lib/smux.[ch]: allow to retreive global OID (identified by <0 namelen). * ospf_ism.c: generate SNMP traps on Interface state change * ospf_nsm.c: generate SNMP traps on Neighbour state change * ospf_snmp.[ch]: support for SNMP traps for interface and neighbours.
* 2005-04-07 Paul Jakma <paul.jakma@sun.com>paul2005-04-071-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (global): Fix up list loops to match changes in lib/linklist, and some basic auditing of usage. * configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES * HACKING: Add notes about deprecating interfaces and commands. * lib/linklist.h: Add usage comments. Rename getdata macro to listgetdata. Rename nextnode to listnextnode and fix its odd behaviour to be less dangerous. Make listgetdata macro assert node is not null, NULL list entries should be bug condition. ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use with for loop, Suggested by Jim Carlson of Sun. Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the "safety" of previous macro. LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to distinguish from the similarly named functions, and reflect their effect better. Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section with the old defines which were modified above, for backwards compatibility - guarded to prevent Quagga using it.. * lib/linklist.c: fix up for linklist.h changes. * ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single scan of the area list, rather than scanning all areas first for INTER_ROUTER and then again for INTER_NETWORK. According to 16.2, the scan should be area specific anyway, and further ospf6d does not seem to implement 16.3 anyway.
* 2004-12-07 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-12-071-47/+47
| | | | * {smux.c,zclient.c}: Change level of debug messages to LOG_DEBUG.
* 2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-11-201-3/+3
| | | | | * global: Replace strerror with safe_strerror. And vtysh/vtysh.c needs to include "log.h" to pick up the declaration.
* 2004-10-31 Paul Jakma <paul@dishone.st>paul2004-10-311-18/+19
| | | | * smux.c: fix int to size_t compile warnings
* Make initializing smux connection configurable - "smux peer OID" commandhasso2004-10-131-39/+47
| | | | | initializes connection, and "no smux peer" command terminates it. Fixes bugzilla #47 and #112.
* 2004-10-11 Paul Jakma <paul@dishone.st>paul2004-10-111-1/+2
| | | | | | * if.h: mtu's should be unsigned. * routemap.{c,h}: const char updates * smux.{c,h}: ditto
* 2004-10-10 Paul Jakma <paul@dishone.st>paul2004-10-101-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-03-16 David Young <dyoung@pobox.com>gdt2004-03-161-1/+1
| | | | | | | | | * (many) reference <lib/version.h> rather than "version.h", because version.h is a generated file and not present in the source tree when using objdir builds. (committed by gdt) works fine with normal builds; didn't try objdir
* 2003-08-13 Paul Jakma <paul@dishone.st>paul2003-08-131-1/+1
| | | | | | | * lib/version.h: Add QUAGGA_PROGNAME * lib/smux.c: hardcoded zebra/quagga -> QUAGGA_PROGNAME * lib/command.c: ditto * vtysh/vtysh_user.c: ditto
* 2003-08-13 Paul Jakma <paul@dishone.st>paul2003-08-131-1/+1
| | | | * lib/smux.c: change progname to quagga.
* 2003-08-12 Paul Jakma <paul@dishone.st>paul2003-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | 2003-08-12 Paul Jakma <paul@dishone.st> * Makefile.am: redhat/zebra.* -> redhat/quagga.* * configure.ac: Bump autoconf prerequisite to 2.53. dist name zebra -> quagga. general Zebra -> Quagga where appropriate (ie not zebra daemon). User and group zebra->quagga. s/ZEBRA\(_VERSION\)/QUAGGA\1/. * bgpd/bgp_main.c: s/ZEBRA\(_VERSION\)/QUAGGA\1/ * lib/command.c: Update banners and s/ZEBRA\(_VERSION\)/QUAGGA\1/ * lib/print_version.c: ditto * lib/version.h: s/ZEBRA\(_VERSION\)/QUAGGA\1/ and bump version. Change ZEBRA_URL. * lib/smux.c: s/ZEBRA\(_VERSION\)/QUAGGA\1/ * lib/vty.h: Change Zebra.conf to Quagga.conf (integrated file) * ospf6d/ospf6{,_main}.c: s/ZEBRA\(_VERSION\)/QUAGGA\1/ * ospfd/ospf_main.c: s/ZEBRA\(_VERSION\)/QUAGGA\1/
* 2003-06-19 Paul Jakma <paul@dishone.st>paul2003-06-191-3/+9
| | | | | * Fix lib/smux.c's reliance on daemons exporting struct thread_master *master.
* 2003-04-04 Paul Jakma <paul@dishone.st>paul2003-04-041-2/+2
| | | | | | | | | * Sync to Zebra CVS * Fix lib/thread.h leak * Fix small Opaque LSA leak * Do not configure OSPF interfaces for secondary addresses * vtysh fixes from Hasso * Dave Watson's missing ntohs fix