Commit graph

48 commits

Author SHA1 Message Date
Alfredo Cardigliano
5d27dde70d Add SNMP polling in nEdge (implement #3872) 2021-03-25 14:36:56 +00:00
Luca Deri
a1178a0791 Updated (C) 2021-01-02 12:08:23 +01:00
Alfredo Cardigliano
91e431efae Fix 32 in 64 wrap (SNMP::handle_async_response) 2020-12-02 17:00:57 +00:00
Luca Deri
f1b76b3b42 Fixes #4669 2020-11-11 00:27:11 +01:00
Alfredo Cardigliano
0fb6f9472f Direct flow dump improbements and debug counters 2020-09-15 18:13:24 +02:00
Luca Deri
ce5f149297 Warnign fix 2020-09-01 23:02:14 +02:00
Luca Deri
dc194b1cee Added workaround for for HEX-encoded OCTET-STRING 2020-07-03 17:17:43 +02:00
Luca Deri
b2e255f744 Improved SNMP response handling 2020-06-25 14:47:59 +02:00
Luca Deri
335f17c093 Implemented SNMPv3 authentication with privacy 2020-06-25 12:55:31 +02:00
Alfredo Cardigliano
309e92ebad Fix compile warnings 2020-06-24 17:06:48 +02:00
Luca Deri
43d066ae90 SNMPv3 fixes 2020-06-24 14:46:32 +02:00
Luca Deri
1e319f49d5 Updated logi 2020-06-24 09:45:35 +02:00
Luca Deri
0181e2a2e5 SNMP v3 changes 2020-06-23 17:33:33 +02:00
Luca Deri
f6f166039f Merge branch 'dev' of https://github.com/ntop/ntopng into dev 2020-06-22 23:52:21 +02:00
Luca Deri
afff093728 Added type information 2020-06-22 23:52:03 +02:00
Luca Deri
004e21486c Improved tracing 2020-06-22 11:01:14 +02:00
Luca Deri
67c5cbdfd0 Fiz for db4772e69c 2020-06-19 11:04:26 +02:00
Simone Mainardi
db4772e69c Compilation fix for send_snmp_set_request without libsnmp 2020-06-19 10:03:57 +02:00
Luca Deri
1eaceeb888 SNMP improvements 2020-06-18 23:18:12 +02:00
Luca Deri
6a16cccd18 Added SNMP set support 2020-06-18 19:32:16 +02:00
Luca Deri
94076c9976 SNMP improvements 2020-06-16 20:05:08 +02:00
Luca Deri
8c6b2247ac Implemented Get-Bulk (NET-SNMP only)
Disabled NET-SNMP until is work in progress
2020-06-15 23:49:10 +02:00
Luca Deri
3400455c9a Added NET-SNMP error handling 2020-06-15 22:55:51 +02:00
Luca Deri
984c24cd92 Changes for supporting NET-SNMP where available 2020-06-15 01:11:14 +02:00
Luca Deri
bef5cb30ba Fixed race condition that caused a variable to be incremented twice on
some platforms
2020-06-09 22:12:07 +02:00
Luca Deri
89500955a0 Reworked SNMP get/getnext options 2020-06-08 19:49:45 +02:00
Luca Deri
bfff94b387 Fix for properly handlign SNMP oid's in requests 2020-06-08 17:03:27 +02:00
Luca Deri
6e2a12a05e Fix for SNMP empty responses 2020-06-04 18:33:51 +02:00
Luca Deri
4c3be85ba3 Fixed in SNMP read async responses 2020-06-02 17:00:44 +02:00
Luca Deri
31d3135eb8 SNMP API enhancements 2020-05-31 23:21:33 +02:00
Luca Deri
e29bebe967 Various SNMP fixes
Fixes in async get/gext SNMP calls
2020-05-28 00:15:13 +02:00
Luca Deri
8c948de437 SNMP code reorganization 2020-05-25 23:50:36 +02:00
emanuele-f
3f5bd04e7a Fix possible lua stack corruptions
Basic rules to avoid corruptions:
  - CONST_LUA_OK must be followed by a lua_push* / lua_newtable
  - CONST_LUA_ERROR must *not* be followed by a lua_push* / lua_newtable

Detailed information can be found at https://www.lua.org/manual/5.2/manual.html#lua_CFunction
2020-04-09 11:26:06 +02:00
Luca Deri
57e6a93065 Improved scheduling algorithm to guarantee minimum service time when number of entries allow
Updated (C)
2020-01-06 23:36:36 +01:00
Luca Deri
bedff2c8e2 Updated (C) 2019-01-07 19:28:49 +01:00
Simone Mainardi
61d90f8d3e Disables SNMP build in nEdge 2018-12-17 12:05:24 +01:00
Simone Mainardi
5bbaf9311a Prevents SNMP walks from being performed during shutdown
Attempts to fix #1992
2018-09-13 11:16:07 +02:00
Simone Mainardi
e14003f464 Fixes several SNMP library memory leaks 2018-05-18 15:36:59 +02:00
Luca Deri
c7ef8d0c46 Various SNMP improvemenets
Moved to LuaJIT 2.1.0 updated to the latest git
2018-04-25 14:20:23 +02:00
Simone Mainardi
9f00dc8cd9 Fixes SNMP memory leaks
Fixes:

==21577==
==21577== 1,080 bytes in 27 blocks are definitely lost in loss record 310 of 320
==21577==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==21577==    by 0x4B9AB5: snmp_create_message (snmp.c:37)
==21577==    by 0x4BC10F: SNMP::send_snmp_request(char*, char*, bool, char**, unsigned int) (SNMP.cpp:62)
==21577==    by 0x4932C6: ntop_snmp_batch_get(lua_State*) (Lua.cpp:2598)
==21577==    by 0x556046: lj_BC_FUNCC (in /home/simone/ntopng/ntopng)
==21577==    by 0x5454FC: lua_pcall (in /home/simone/ntopng/ntopng)
==21577==    by 0x4E4EA4: LuaHandler::luaL_dofileM(bool) (LuaHandler.cpp:34)
==21577==    by 0x4A01D5: __ntop_lua_handlefile(lua_State*, char*, bool) (Lua.cpp:6959)
==21577==    by 0x4A105B: Lua::run_script(char*, NetworkInterface*) (Lua.cpp:7638)
==21577==    by 0x4A7F30: ThreadedActivity::runScript(char*, NetworkInterface*) (ThreadedActivity.cpp:162)
==21577==    by 0x4A7E3B: ThreadedActivity::runScript() (ThreadedActivity.cpp:130)
==21577==    by 0x4A809D: ThreadedActivity::uSecDiffPeriodicActivityBody() (ThreadedActivity.cpp:190)

==25013==
==25013== 672 (168 direct, 504 indirect) bytes in 7 blocks are definitely lost in loss record 305 of 320
==25013==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==25013==    by 0x4BB3E9: push_state (asn1.c:417)
==25013==    by 0x4BB6CC: asn1_parse_structure (asn1.c:494)
==25013==    by 0x4BB613: asn1_parse_sequence (asn1.c:477)
==25013==    by 0x4BA3BD: snmp_parse_message (snmp.c:229)
==25013==    by 0x4BC6B0: SNMP::snmp_fetch_responses(lua_State*) (SNMP.cpp:176)
==25013==    by 0x493353: ntop_snmp_read_responses(lua_State*) (Lua.cpp:2614)
==25013==    by 0x556006: lj_BC_FUNCC (in /home/simone/ntopng/ntopng)
==25013==    by 0x5454BC: lua_pcall (in /home/simone/ntopng/ntopng)
==25013==    by 0x4E4E6A: LuaHandler::luaL_dofileM(bool) (LuaHandler.cpp:34)
==25013==    by 0x4A019B: __ntop_lua_handlefile(lua_State*, char*, bool) (Lua.cpp:6959)
==25013==    by 0x4A1021: Lua::run_script(char*, NetworkInterface*) (Lua.cpp:7638)

==25013== 316 bytes in 6 blocks are definitely lost in loss record 299 of 320
==25013==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==25013==    by 0x812A949: strdup (in /usr/lib64/libc-2.17.so)
==25013==    by 0x4BA8B2: snmp_get_varbind_as_string (snmp.c:421)
==25013==    by 0x4BC70E: SNMP::snmp_fetch_responses(lua_State*) (SNMP.cpp:179)
==25013==    by 0x493353: ntop_snmp_read_responses(lua_State*) (Lua.cpp:2614)
==25013==    by 0x556006: lj_BC_FUNCC (in /home/simone/ntopng/ntopng)
==25013==    by 0x5454BC: lua_pcall (in /home/simone/ntopng/ntopng)
==25013==    by 0x4E4E6A: LuaHandler::luaL_dofileM(bool) (LuaHandler.cpp:34)
==25013==    by 0x4A019B: __ntop_lua_handlefile(lua_State*, char*, bool) (Lua.cpp:6959)
==25013==    by 0x4A1021: Lua::run_script(char*, NetworkInterface*) (Lua.cpp:7638)
==25013==    by 0x4A7EF6: ThreadedActivity::runScript(char*, NetworkInterface*) (ThreadedActivity.cpp:162)
==25013==    by 0x4A7E01: ThreadedActivity::runScript() (ThreadedActivity.cpp:130)
2018-04-16 16:48:57 +02:00
Luca Deri
f0c936c368 Updated (C) to 2018 2018-03-22 21:59:42 +01:00
Luca Deri
0ab74db446 Fixed invalid SNMP return code handler 2018-03-22 20:54:54 +01:00
Luca Deri
d7c8fbeff1 SNMP protocol version is now set in preferences 2018-01-21 08:14:28 +01:00
Luca Deri
94df4af211 SNMP-discovered devices are not automatically added to SNMP 2018-01-20 21:22:41 +01:00
Luca Deri
32e8fe2a21 Maximized SNMP socket buffer to accept more SNMP responses
Improved discovery with VM detection, name-to-OS, SNMP sysName.o
2017-09-18 10:23:29 +02:00
Luca Deri
11f99a9a18 Fixed warning 2017-08-10 07:51:39 +02:00
Luca Deri
af74f3b041 Added Lua batch SNMP API 2017-08-09 10:26:25 +02:00
Luca Deri
7b15221414 Cleaned up SNMP code and moved onto a new class 2017-08-09 09:23:08 +02:00