-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/ntop/ntopng into dev
- Loading branch information
Showing
13 changed files
with
493 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* | ||
* (C) 2013-24 - ntop.org | ||
* | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
*/ | ||
|
||
#ifndef _SNMP_SESSION_H_ | ||
#define _SNMP_SESSION_H_ | ||
|
||
#include "ntop_includes.h" | ||
|
||
#ifdef HAVE_LIBSNMP | ||
|
||
#include <net-snmp/net-snmp-config.h> | ||
#include <net-snmp/net-snmp-includes.h> | ||
|
||
class SNMPSession { | ||
public: | ||
struct snmp_session session; | ||
void *session_ptr; | ||
|
||
SNMPSession(); | ||
~SNMPSession(); | ||
}; | ||
|
||
#endif | ||
|
||
#endif /* _SNMP_SESSION_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* | ||
* (C) 2013-24 - ntop.org | ||
* | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
*/ | ||
|
||
#ifndef _SNMP_TRAP_H_ | ||
#define _SNMP_TRAP_H_ | ||
|
||
#include "ntop_includes.h" | ||
|
||
#ifdef HAVE_LIBSNMP | ||
|
||
/* ******************************* */ | ||
|
||
class SNMPTrap { | ||
private: | ||
netsnmp_transport *trap_transport; | ||
SNMPSession *trap_session; | ||
netsnmp_session *trap_session_internal; | ||
pthread_t trap_loop; | ||
bool trap_collection_running; | ||
|
||
public: | ||
SNMPTrap(); | ||
~SNMPTrap(); | ||
|
||
// Call to commence trap collection | ||
void startTrapCollection(); | ||
|
||
// Call to cease trap collection | ||
void stopTrapCollection(); | ||
|
||
// Call to check if trap collection is active | ||
bool isTrapCollectionRunning(); | ||
|
||
// Trap collection loop | ||
void trapCollection(); | ||
|
||
// Handle traps | ||
void handleTrap(struct snmp_pdu *pdu); | ||
|
||
// Init trap session | ||
bool initSession(); | ||
|
||
// Release trap session data structures | ||
void releaseSession(); | ||
}; | ||
|
||
#endif | ||
|
||
#endif /* _SNMP_TRAP_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* | ||
* (C) 2013-24 - ntop.org | ||
* | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
*/ | ||
|
||
#include "ntop_includes.h" | ||
|
||
#ifdef HAVE_LIBSNMP | ||
|
||
/* ******************************* */ | ||
|
||
SNMPSession::SNMPSession() { session_ptr = NULL; } | ||
|
||
/* ******************************* */ | ||
|
||
SNMPSession::~SNMPSession() { | ||
if(session_ptr) snmp_sess_close(session_ptr); | ||
} | ||
|
||
/* ******************************* */ | ||
|
||
#endif |
Oops, something went wrong.