summaryrefslogtreecommitdiff
path: root/usr.sbin/bsnmpd
Commit message (Collapse)AuthorAgeFilesLines
* Replace literal uses of /usr/local in C sources with _PATH_LOCALBASEStefan Eßer2020-10-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Literal references to /usr/local exist in a large number of files in the FreeBSD base system. Many are in contributed software, in configuration files, or in the documentation, but 19 uses have been identified in C source files or headers outside the contrib and sys/contrib directories. This commit makes it possible to set _PATH_LOCALBASE in paths.h to use a different prefix for locally installed software. In order to avoid changes to openssh source files, LOCALBASE is passed to the build via Makefiles under src/secure. While _PATH_LOCALBASE could have been used here, there is precedent in the construction of the path used to a xauth program which depends on the LOCALBASE value passed on the compiler command line to select a non-default directory. This could be changed in a later commit to make the openssh build consistently use _PATH_LOCALBASE. It is considered out-of-scope for this commit. Reviewed by: imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26942 Notes: svn path=/head/; revision=367075
* Fix a few mandoc issuesGordon Bergling2020-10-091-1/+2
| | | | | | | | | | - skipping paragraph macro: Pp after Sh - sections out of conventional order: Sh EXAMPLES - whitespace at end of input line - normalizing date format Notes: svn path=/head/; revision=366583
* Do a sweep and remove most WARNS=6 settingsKyle Evans2020-10-011-2/+0
| | | | | | | | | | | | | | | Repeating the default WARNS here makes it slightly more difficult to experiment with default WARNS changes, e.g. if we did something absolutely bananas and introduced a WARNS=7 and wanted to try lifting the default to that. Drop most of them; there is one in the blake2 kernel module, but I suspect it should be dropped -- the default WARNS in the rest of the build doesn't currently apply to kernel modules, and I haven't put too much thought into whether it makes sense to make it so. Notes: svn path=/head/; revision=366304
* bsnmptools: make it print protocol errors to stderr instead of stdoutEugene Grosbein2020-08-051-4/+4
| | | | | | | | | Reviewed by: syrinx, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25911 Notes: svn path=/head/; revision=363889
* Fix a comment for the SUN geom class.Warner Losh2020-02-101-1/+1
| | | | | | | | Reivewed by: cy@, bcr@ Differential Revision: https://reviews.freebsd.org/D23593 Notes: svn path=/head/; revision=357737
* Fix comment. It mentioned sparc64 specifically, but alignment issuesWarner Losh2020-02-101-2/+1
| | | | | | | | | | are present elsewhere. Reivewed by: cy@, bcr@ Differential Revision: https://reviews.freebsd.org/D23593 Notes: svn path=/head/; revision=357736
* Fix the following -Werror warning from clang 10.0.0 in bsnmpd:Dimitry Andric2020-01-311-1/+2
| | | | | | | | | | | | | | | | | usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] return (-1); ^ usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here } else ^ The intent was to group the return statement with the previous syslog() call. MFC after: 3 days Notes: svn path=/projects/clang1000-import/; revision=357339
* Fix the following -Werror warning from clang 10.0.0 in bsnmpd:Dimitry Andric2020-01-291-2/+2
| | | | | | | | | | | | | usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] begemotBridgeStpPortEnable_enabled || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Work around it by casting the enum values to the type of val->v.integer. MFC after: 3 days Notes: svn path=/projects/clang1000-import/; revision=357271
* Update Makefile.depend filesSimon J. Gerraty2019-12-114-5/+5
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-111-0/+6
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* No need for each bsnmpd(1) module to open connection to syslogShteryana Shopova2019-06-211-1/+0
| | | | | | | | | | | | bsnmpd(1) main does that early on init and the connection is available to all loaded modules Event: Vienna Hackathon 2019 PR: 233431 , 221487 MFC after: 2 weeks Notes: svn path=/head/; revision=349265
* Unbreak snmp_pf(3) after the changes introduced in r338209Shteryana Shopova2019-06-212-2/+2
| | | | | | | | | PR: 237011 Event: Vienna Hackathon 2019 MFC after: 2 weeks Notes: svn path=/head/; revision=349264
* Add IPv6 transport for bsnmp.Andrey V. Elsukov2019-04-022-3/+15
| | | | | | | | | | | | | | | | This patch adds a new table begemotSnmpdTransInetTable that uses the InetAddressType textual convention and can be used to create listening ports for IPv4, IPv6, zoned IPv6 and based on DNS names. It also supports future extension beyond UDP by adding a protocol identifier to the table index. In order to support this gensnmptree had to be modified. Submitted by: harti MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16654 Notes: svn path=/head/; revision=345797
* snmp_hostres(3): fix a typo in sanity checks in handle_chunk()Andriy Voskoboinyk2019-02-181-1/+1
| | | | | | | | | PR: 204253 Submitted by: David Binderman <dcb314@hotmail.com> MFC after: 5 days Notes: svn path=/head/; revision=344245
* Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths ofPatrick Kelsey2018-08-221-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2^32 bps or greater to be used. Prior to this, bandwidth parameters would simply wrap at the 2^32 boundary. The computations in the HFSC scheduler and token bucket regulator have been modified to operate correctly up to at least 100 Gbps. No other algorithms have been examined or modified for correct operation above 2^32 bps (some may have existing computation resolution or overflow issues at rates below that threshold). pfctl(8) will now limit non-HFSC bandwidth parameters to 2^32 - 1 before passing them to the kernel. The extensions to the pf(4) ioctl interface have been made in a backwards-compatible way by versioning affected data structures, supporting all versions in the kernel, and implementing macros that will cause existing code that consumes that interface to use version 0 without source modifications. If version 0 consumers of the interface are used against a new kernel that has had bandwidth parameters of 2^32 or greater configured by updated tools, such bandwidth parameters will be reported as 2^32 - 1 bps by those old consumers. All in-tree consumers of the pf(4) interface have been updated. To update out-of-tree consumers to the latest version of the interface, define PFIOC_USE_LATEST ahead of any includes and use the code of pfctl(8) as a guide for the ioctls of interest. PR: 211730 Reviewed by: jmallett, kp, loos MFC after: 2 weeks Relnotes: yes Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D16782 Notes: svn path=/head/; revision=338209
* Move snmpd.config to usr.sbin/bsnmpd/bsnmpd/Brad Davis2018-08-112-0/+324
| | | | | | | | | | | | This helps with pkgbase as this config file will now be tagged as a config file Approved by: allanjude (mentor) Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16674 Notes: svn path=/head/; revision=337625
* Update bsnmp to version 1.13. This does not bring user-visible changes.Hartmut Brandt2018-07-0317-13/+20
| | | | | | | | | | For developers gensnmptree can now generate functions for enums to convert between enums and strings and to check the validity of a value. The sources in FreeBSD are now in sync with the upstream which allows to bring in IPv6 modifications. Notes: svn path=/head/; revision=335885
* SPDX: use the Beerware identifier.Pedro F. Giffuni2017-11-301-0/+2
| | | | Notes: svn path=/head/; revision=326408
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2712-0/+24
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-3114-15/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* These values already set by src.libnames.mk.Bryan Drewery2017-10-311-7/+0
| | | | | | | | MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325178
* bsnmpd: Only refresh devtree if devd event is a new or removed device.Pedro F. Giffuni2017-10-281-1/+3
| | | | | | | | | | | It makes sense to refresh the tree only when a device is inserted or removed, otherwise bsnmpd wastes lot of CPU. PR: 209368 MFC after: 1 week Notes: svn path=/head/; revision=325067
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-05-091-5/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318000
* Remove the NATM framework including the en(4), fatm(4), hatm(4), andBrooks Davis2017-04-246-506/+1
| | | | | | | | | | | | | | | | | | | | | | | | patm(4) devices. Maintaining an address family and framework has real costs when we make infrastructure improvements. In the case of NATM we support no devices manufactured in the last 20 years and some will not even work in modern motherboards (some newer devices that patm(4) could be updated to support apparently exist, but we do not currently have support). With this change, support remains for some netgraph modules that don't require NATM support code. It is unclear if all these should remain, though ng_atmllc certainly stands alone. Note well: FreeBSD 11 supports NATM and will continue to do so until at least September 30, 2021. Improvements to the code in FreeBSD 11 are certainly welcome. Reviewed by: philip Approved by: harti Notes: svn path=/head/; revision=317383
* Use nitems() from sys/param.h.Marcelo Araujo2017-03-121-1/+1
| | | | | | | | Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D9943 Notes: svn path=/head/; revision=315102
* usr.sbin: normalize paths using SRCTOP-relative paths or :H when possibleEnji Cooper2017-03-043-5/+5
| | | | | | | | | | This simplifies make logic/output MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314659
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-281-4/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* Add smilint target to subdir targets so "make smilint" here will runEnji Cooper2017-01-171-1/+3
| | | | | | | | | | | | the smilint target in subdirs While here, convert a path that's .CURDIR relative to SRCTOP MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312330
* Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328Enji Cooper2017-01-172-10/+0
| | | | | | | | | MFC after: 1 week X-MFC with: r312328 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312329
* Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB fileEnji Cooper2017-01-091-0/+13
| | | | | | | | | | | This change also documents the modification harti made to a handful of objects in r122758 (the max OCTET STRING width was increased from 15 to 31 octets) MFC after: 1 week Notes: svn path=/head/; revision=311761
* Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB fileEnji Cooper2017-01-091-1/+3
| | | | | | | | | | There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after: 1 week Notes: svn path=/head/; revision=311758
* Add a REVISION section to track changes for the hostres moduleEnji Cooper2017-01-091-0/+3
| | | | | | | | | | There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after: 1 week Notes: svn path=/head/; revision=311741
* Improve the smilint target in the hostres and mibII modulesEnji Cooper2017-01-092-4/+6
| | | | | | | | | | | - Mark the smilint target .PHONY so it's always executed when requested - Leverage .PATH for BMIBS instead of spelling the path out longhand for them MFC after: 1 week Notes: svn path=/head/; revision=311740
* Use SRCTOP instead of spelling out the full path with .CURDIREnji Cooper2017-01-097-8/+8
| | | | | | | | | This helps condense the output for CFLAGS and .PATH MFC after: 3 days Notes: svn path=/head/; revision=311739
* OS_getSystemUptime: use nitems for calculating the number of elementsEnji Cooper2017-01-051-2/+2
| | | | | | | | | in a sysctl mib instead of hardcoding the number 2 MFC after: 3 days Notes: svn path=/head/; revision=311393
* style cleanupEnji Cooper2017-01-041-3/+2
| | | | | | | | | | - bridge_pf_dump: use nitems instead of spelling it out longhand - bridge_do_pfctl: sort variables by alignment for type MFC after: 1 week Notes: svn path=/head/; revision=311294
* bridge_do_pfctl: allocate mib_name dynamically using asprintfEnji Cooper2017-01-041-7/+12
| | | | | | | | | | | | | This is being done to reduce wasted space, simplify complexity in the code, and to quell a Coverity warning about buffer overruns. warning about buffer overruns. MFC after: 1 week Reported by: Coverity CID: 1006736 Notes: svn path=/head/; revision=311293
* bridge_get_pfval: use nitems instead of spelling it out longhandEnji Cooper2017-01-041-2/+2
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=311291
* Use strlcpy instead of strcpy when copying the bridge name to ifr.ifr_nameEnji Cooper2017-01-041-3/+3
| | | | | | | | | | | to avoid buffer overflows MFC after: 1 week Reported by: Coverity CID: 1006735, 1006737, 1006738 Notes: svn path=/head/; revision=311290
* Fix logical inversion when checking result from callocEnji Cooper2017-01-041-1/+1
| | | | | | | | | | | | in snmp_output_err_resp(..) X-MFC with: r310987 MFC after: 3 days Reported by: Coverity CID: 1368195 Notes: svn path=/head/; revision=311222
* Swap parameters around with parse_syntax_strval(..) for consistency withEnji Cooper2017-01-031-4/+3
| | | | | | | | | | other parse_* APIs in bsnmp* MFC after: 3 days Noted by: bz Notes: svn path=/head/; revision=311175
* Make /usr/lib/libbsnmptools.so.0 into an INTERRNALLIBEnji Cooper2017-01-033-3/+9
| | | | | | | | | | | | | | | | Although it increases the size of the bsnmp{get,set,walk} binaries by four on my [amd64] system, it removes the need for producing .debug files, profiled libraries, and for installing the library itself, reducing the overall size use on disk by the utilities noted previously. Plus, it guards against ABI/API compatibility issues with the library as it's only used internal to the tools themselves. MFC after: 3 weeks Notes: svn path=/head/; revision=311174
* Call snmp_pdu_free on req/resp with a consistent, correct patternEnji Cooper2017-01-011-11/+21
| | | | | | | | | | | | | | | | | | | | | - snmp_pdu_free should be called before snmp_pdu_create is called again - snmp_pdu_free should be called on the resp to snmp_dialog when successful Tested with the following bsnmp commands: % export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest % SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0" % bsnmpset $SNMP_ARGS sysLocation="MyAgent" % bsnmpget $SNMP_ARGS sysLocation % bsnmpwalk $SNMP_ARGS MFC after: 12 days X-MFC with: r310729, r310892, r310894 Notes: svn path=/head/; revision=310989
* snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, notEnji Cooper2016-12-311-8/+23
| | | | | | | | | | | | | | | | | | | on the stack Some of the callers try to determine whether or not `object` is valid by testing the value for NULL, which will never be true if it's a stack value, so in order to be clear and correct down the call stack, use a heap allocated object. This also addresses a Coverity issue by initializing all of `object` via calloc MFC after: 1 week Reported by: Coverity CID: 1006392 Notes: svn path=/head/; revision=310987
* snmp_output_resp: style(9): sort variables by alignmentEnji Cooper2016-12-311-2/+2
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=310986
* Set value->v.octetstring.len to a correct value on malloc success/failureEnji Cooper2016-12-311-3/+3
| | | | | | | | | | | | | The previous code always set value->v.octetstring.len to len, regardless of the result from the malloc call. This misleads the caller on malloc failure. Set .len to len on success and 0 on failure. MFC after: 1 week Reported by: Coverity CID: 1007590 Notes: svn path=/head/; revision=310954
* snmp_pdu_free the right object at the right time in snmptool_walkEnji Cooper2016-12-311-2/+7
| | | | | | | | | | | | | | | | | | r310892 was on the right track, but unfortunately it was resolving the problem incorrectly and accidentally leaking memory in the process. - Call snmp_pdu_free on req before calling snmp_pdu_create on it at the bottom of the outer while loop - Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create in the inner loop MFC after: 12 days X-MFC with: r310729, r310892 Reported by: valgrind Notes: svn path=/head/; revision=310894
* Don't call snmp_pdu_free(..) until finished with the pdu and when ready toEnji Cooper2016-12-311-3/+2
| | | | | | | | | | | | allocate a new one via snmp_pdu_create(..) This fixes bsnmpwalk, so it no longer crashes after r310729 X-MFC with: r310729 MFC after: 12 days Notes: svn path=/head/; revision=310892
* Don't explicitly build tcp wrappers support into bsnmpd; make it conditionalEnji Cooper2016-12-281-2/+6
| | | | | | | | | | | | on MK_TCP_WRAPPERS != "no" This likely fixes an issue seen where some of the USE_TCPWRAPPERS code didn't work as advertised MFC after: 1 week Notes: svn path=/head/; revision=310711
* Fix the build by moving the initializers for len/nswapdev down below theEnji Cooper2016-12-281-2/+5
| | | | | | | | | | declarations MFC after: 3 days Pointyhat to: ngie Notes: svn path=/head/; revision=310675