Commit graph

2048 commits

Author SHA1 Message Date
Olof hagsand
62a32faf9c SNMP frontend. New snmp_lib.[ch] and rearranged code into lib
Test: renamed WITH_SNMP -> ENABLE_SNMP
2022-06-26 11:28:42 +02:00
Olof hagsand
1f8b82e8e1 SNMP frontend, add int32 + string type for scalars
Added get string test
Added set value for netconf test
2022-06-26 11:28:42 +02:00
Olof hagsand
72534e864d SNNP frontend. Added SMI default value support and deviation for set 2022-06-26 11:28:42 +02:00
Kristofer Hallin
9b0cf2f7c4 For tables use a callback to create indexes, rows etc. 2022-06-26 11:28:42 +02:00
Olof hagsand
4ff2ea099c SNMP frontend table fix: handler called with heartrate, return 0 2022-06-26 11:28:42 +02:00
Kristofer Hallin
bbcea8b780 Don't rely on the pid-file to see if snmpd is running or not. 2022-06-26 11:28:42 +02:00
Olof hagsand
3bb681ffe2 SNMP frontend, main test for config false only, write test move to test_snmp_set.sh 2022-06-26 11:28:42 +02:00
Olof hagsand
182b72a4cc SNMP frontend, RPC of single variable through clixon 2022-06-26 11:28:42 +02:00
Olof hagsand
4e0d9dd987 SNMP frontend
Fixed table/scalar collision issue
Made the CS variable change said to be in previous commit
2022-06-26 11:28:42 +02:00
Olof hagsand
214b7cc0c7 SNMP frontend test changes
Added a CS variable, set to 0 if you started clixon_snmp yourself (eg in gdb)
Also added BE (backend) with the same purpose for backend
2022-06-26 11:28:42 +02:00
Kristofer Hallin
f9d2acf025 Minimal snmpd configuration for the Docker containers. Also change the pid-dir to /var/run/ since
that is what all the tests are expecting. Can we pass the tests now?
2022-06-26 11:28:42 +02:00
Kristofer Hallin
4182ee3540 Removed problematic MIB for now. 2022-06-26 11:28:42 +02:00
Kristofer Hallin
5a09dcbf13 Change dockerfiles and start scripts to install Net-SNMP, configure snmpd properly
and make sure it is started. This is needed for the SNMP tests (test_snm*) to run properly.
Since we can't rely on systemd in Alpine we start snmpd from the startsystem-scripts.
2022-06-26 11:28:42 +02:00
Kristofer Hallin
7bdc5045b2 In come cases we need YANG files which are converted from SNMP MIBs using smidump. For the Docker images we'll clone the from an external repository. 2022-06-26 11:28:42 +02:00
Olof hagsand
df687f7180 Clixon SNMP frontend
Added two new config options to clixon-config.yang: `CLICON_HTTP_DATA_ROOT`
Added new files: apps/snmp/snmp_mib_yang.[ch] for generic MIB/YANG handling
Test: killall quiet
Test: added specific MIB for generic code: <CLICON_SNMP_MIB>NET-SNMP-EXAMPLES-MIB</CLICON_SNMP_MIB>
2022-06-26 11:28:42 +02:00
Kristofer Hallin
ee06652e86 SNMP tests: Don't start snmpd, check if the system have snmpd started otherwise present instructions for how to configure and start it. 2022-06-26 11:28:42 +02:00
Kristofer Hallin
c9eae77d61 SNMP MIB to YANG conversion. Script to traverse a MIB directory and convert the MIBs to YANG files using smidump. 2022-06-26 11:28:42 +02:00
Olof hagsand
f112580546 SNMP MIB->YANG translation file handling.
Added configure option  --with-mib-generated-yang-dir=DIR with
default value /usr/share/mibyang where generated YANGs from MIBs
should be placed so that SNMP tests know where to find the YANGs.
2022-06-26 11:28:42 +02:00
Olof hagsand
2699393c4a SNMP: replaced testhandler code to use only NET-SNMP-EXAMPLES-MIB for scalar and table 2022-06-26 11:27:54 +02:00
Kristofer Hallin
4c3bbcc0ed Fix for snmpd in Alpine, snmpd crashes with the default configuration. 2022-06-26 11:27:54 +02:00
Kristofer Hallin
0ec26df953 Fixed minor typo in comment. 2022-06-26 11:27:54 +02:00
Kristofer Hallin
b7c8a27f67 Tests for SNMP tables. 2022-06-26 11:27:54 +02:00
Kristofer Hallin
f443f4f9b3 Added example for tables. 2022-06-26 11:27:54 +02:00
Kristofer Hallin
0fc5bd3bfb Workaround for crashing snmpd in Alpine. 2022-06-26 11:27:54 +02:00
Kristofer Hallin
366b1cb42f Valgrind tests for clixon_snmp. 2022-06-26 11:27:54 +02:00
Olof hagsand
28514c6750 Clixon SNMP frontend update
* Integration of testhandler.c gives proper callback handling
* YANG `clixon-config@2022-03-21.yang` changes:
    * Added option:
      * `CLICON_SNMP_AGENT_SOCK`
2022-06-26 11:27:54 +02:00
Kristofer Hallin
c584d171ee Check if we have Net-SNMP support enabled before trying to run SNMP tests. 2022-06-26 11:26:04 +02:00
Kristofer Hallin
432131c9d2 Add SNMP tools. 2022-06-26 11:26:04 +02:00
Kristofer Hallin
8bff60fb30 Set proper paths to SNMP utils. 2022-06-26 11:26:04 +02:00
Kristofer Hallin
1032e6fee6 Changed paths for SNMP tools used in test. 2022-06-26 11:26:04 +02:00
Kristofer Hallin
34df2413ea Initial SNMP tests. 2022-06-26 11:26:04 +02:00
Kristofer Hallin
40d5f99694 Tell the agent to use a Unix socket for communication. 2022-06-26 11:26:04 +02:00
Olof hagsand
e32cb81b49 Clixon SNMP frontend update
Integrated netsnmp agent and clixon event handling, made a workaround of fdset:s
used in the netsnmp API with sockets used in Clixon
Added a hardcoded MIB OID handler as subagent
Added libnetsnmpagent to autotools dependency check
New OE_SNMP error code
2022-06-26 11:26:04 +02:00
Kristofer Hallin
16d21bbe3b Move include of signal.h 2022-06-26 11:26:04 +02:00
Kristofer Hallin
376996c89e Install net-snmp-dev and build Clixon with Net-SNMP support. 2022-06-26 11:26:04 +02:00
Kristofer Hallin
01ea7594ce Include signal.h 2022-06-26 11:26:04 +02:00
Olof hagsand
d72aa58f90 Initial Net-snmp frontend commit
Added apps/snmp with makefiles, autotools, docker adjustment
Minimal snmp_main program
2022-06-26 11:26:04 +02:00
Olof hagsand
a00e36caa2 * Full RFC 7950 if-feature-expr support (Section 7.20.2)
* Previous implementation did not handle nested if-feature expressions
  * As part of fixing: [YANG if-feature does not support nested boolean expression](https://github.com/clicon/clixon/issues/341)
  * Added new yacc/lex parser for if-feature-expr string
2022-06-26 10:58:43 +02:00
Olof hagsand
5bb3767358 Workaround for [YANG if-feature does not support nested boolean expression](https://github.com/clicon/clixon/issues/341) 2022-06-24 11:29:42 +02:00
Olof hagsand
05918e3ca2 Test: change make test from all -> sum, make vagrant yang checkout more resilient
New slack invite
2022-06-23 16:37:22 +02:00
Olof hagsand
33c77c8a09 Cleanup, debug stmts, diff vars and obsolete compile options 2022-06-23 15:40:47 +02:00
Olof hagsand
bdb516fec9 YANG Action (RFC 7950 Section 7.15)
See [Support for "action" statement](https://github.com/clicon/clixon/issues/101)
2022-06-21 15:44:02 +02:00
Olof hagsand
87c65c3541 Fixed: [RPC edit-config payloads are not fully validated](https://github.com/clicon/clixon/issues/337) 2022-06-20 15:08:50 +02:00
Olof Hagsand
7c22021242
Merge pull request #336 from pheller/fix-test-readme
Update README.md
2022-06-14 09:46:43 +02:00
Phillip Heller
75abfb8204
Update README.md
https://github.com/YangModels/yang default branch appears to be named "main", not "master"
2022-06-13 11:09:58 -06:00
Olof hagsand
0b16797a45 * Added: [Feature Request: Log SSL events](https://github.com/clicon/clixon/issues/331)
* Added syslog NOTICE on failed user certs
2022-06-08 13:22:38 +02:00
Olof hagsand
609e27e0c2 Augmented XML uses default namespace
* Instead of using prefixes for augmented XML, assign the default namespace
Test: moved datastore format tests from test_cli to new test_datastore_format
2022-06-08 11:49:48 +02:00
Olof hagsand
db8cf75077 Test: Fixed: show netconf pretty 2022-06-07 14:21:40 +02:00
Olof hagsand
b1cb774c9d TEXT output/parser: fix space-separated leaf/leaf-lists 2022-06-07 13:23:05 +02:00
Olof hagsand
01b38c6645 Fix text parser leaf-list / leaf succession
See https://github.com/clicon/clixon/issues/324
2022-06-06 15:40:07 +02:00