summaryrefslogtreecommitdiff
path: root/accel-pppd/extra
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/extra')
-rw-r--r--accel-pppd/extra/net-snmp/ACCEL-PPP-MIB.txt28
-rw-r--r--accel-pppd/extra/net-snmp/CMakeLists.txt1
-rw-r--r--accel-pppd/extra/net-snmp/agent.c2
-rw-r--r--accel-pppd/extra/net-snmp/sessionTable_enums.h1
-rw-r--r--accel-pppd/extra/net-snmp/statSSTP.c93
-rw-r--r--accel-pppd/extra/net-snmp/statSSTP.h11
6 files changed, 133 insertions, 3 deletions
diff --git a/accel-pppd/extra/net-snmp/ACCEL-PPP-MIB.txt b/accel-pppd/extra/net-snmp/ACCEL-PPP-MIB.txt
index b536a9b..e175771 100644
--- a/accel-pppd/extra/net-snmp/ACCEL-PPP-MIB.txt
+++ b/accel-pppd/extra/net-snmp/ACCEL-PPP-MIB.txt
@@ -34,7 +34,8 @@ statPPTP OBJECT IDENTIFIER ::= { accelPPPStat 3 }
statL2TP OBJECT IDENTIFIER ::= { accelPPPStat 4 }
statPPPOE OBJECT IDENTIFIER ::= { accelPPPStat 5 }
statIPOE OBJECT IDENTIFIER ::= { accelPPPStat 6 }
---statRadius OBJECT IDENTIFIER ::= { accelPPPStat 6 }
+statSSTP OBJECT IDENTIFIER ::= { accelPPPStat 7 }
+--statRadius OBJECT IDENTIFIER ::= { accelPPPStat 8 }
statCoreUpTime OBJECT-TYPE
@@ -177,6 +178,26 @@ statIPOEActive OBJECT-TYPE
"count of active connections"
::= { statIPOE 2 }
+--
+-- SSTP stats
+--
+
+statSSTPStarting OBJECT-TYPE
+ SYNTAX INTEGER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "count of connections which are
+ in starting phase"
+ ::= { statSSTP 1 }
+
+statSSTPActive OBJECT-TYPE
+ SYNTAX INTEGER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "count of active connections"
+ ::= { statSSTP 2 }
--
-- PPP session table
@@ -252,8 +273,9 @@ sesType OBJECT-TYPE
SYNTAX INTEGER {
pptp(1),
l2tp(2),
- pppoe(3)
- ipoe(4)
+ pppoe(3),
+ ipoe(4),
+ sstp(6)
}
MAX-ACCESS read-only
STATUS current
diff --git a/accel-pppd/extra/net-snmp/CMakeLists.txt b/accel-pppd/extra/net-snmp/CMakeLists.txt
index 5feaec6..737f0b2 100644
--- a/accel-pppd/extra/net-snmp/CMakeLists.txt
+++ b/accel-pppd/extra/net-snmp/CMakeLists.txt
@@ -11,6 +11,7 @@ SET(sources
statPPPOE.c
statPPTP.c
statIPOE.c
+ statSSTP.c
terminate.c
shutdown.c
exec_cli.c
diff --git a/accel-pppd/extra/net-snmp/agent.c b/accel-pppd/extra/net-snmp/agent.c
index 162cdbc..4cc04c1 100644
--- a/accel-pppd/extra/net-snmp/agent.c
+++ b/accel-pppd/extra/net-snmp/agent.c
@@ -17,6 +17,7 @@
#include "statL2TP.h"
#include "statPPPOE.h"
#include "statIPOE.h"
+#include "statSSTP.h"
#include "terminate.h"
#include "shutdown.h"
#include "sessionTable.h"
@@ -108,6 +109,7 @@ static void *snmp_thread(void *a)
init_statL2TP();
init_statPPPOE();
init_statIPOE();
+ init_statSSTP();
init_terminate();
init_shutdown();
init_sessionTable();
diff --git a/accel-pppd/extra/net-snmp/sessionTable_enums.h b/accel-pppd/extra/net-snmp/sessionTable_enums.h
index 74268ee..fff47fe 100644
--- a/accel-pppd/extra/net-snmp/sessionTable_enums.h
+++ b/accel-pppd/extra/net-snmp/sessionTable_enums.h
@@ -45,6 +45,7 @@ extern "C" {
#define SESTYPE_L2TP 2
#define SESTYPE_PPPOE 3
#define SESTYPE_IPOE 4
+#define SESTYPE_SSTP 6
#endif /* SESTYPE_ENUMS */
diff --git a/accel-pppd/extra/net-snmp/statSSTP.c b/accel-pppd/extra/net-snmp/statSSTP.c
new file mode 100644
index 0000000..06ba6aa
--- /dev/null
+++ b/accel-pppd/extra/net-snmp/statSSTP.c
@@ -0,0 +1,93 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.int_watch.conf 13957 2005-12-20 15:33:08Z tanders $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "triton.h"
+#include "statSSTP.h"
+
+/*
+ * The variables we want to tie the relevant OIDs to.
+ * The agent will handle all GET and (if applicable) SET requests
+ * to these variables automatically, changing the values as needed.
+ */
+
+void sstp_get_stat(unsigned int **, unsigned int **);
+
+static unsigned int *stat_starting;
+static unsigned int *stat_active;
+
+/*
+ * Our initialization routine, called automatically by the agent
+ * (Note that the function name must match init_FILENAME())
+ */
+void
+init_statSSTP(void)
+{
+ netsnmp_handler_registration *reg;
+ netsnmp_watcher_info *winfo;
+
+ static oid statSSTPStarting_oid[] = { 1,3,6,1,4,1,8072,100,1,7,1 };
+ static oid statSSTPActive_oid[] = { 1,3,6,1,4,1,8072,100,1,7,2 };
+
+ /*
+ * a debugging statement. Run the agent with -DstatSSTP to see
+ * the output of this debugging statement.
+ */
+ DEBUGMSGTL(("statSSTP", "Initializing the statSSTP module\n"));
+
+ if (!triton_module_loaded("sstp"))
+ return;
+
+ sstp_get_stat(&stat_starting, &stat_active);
+
+ /*
+ * Register scalar watchers for each of the MIB objects.
+ * The ASN type and RO/RW status are taken from the MIB definition,
+ * but can be adjusted if needed.
+ *
+ * In most circumstances, the scalar watcher will handle all
+ * of the necessary processing. But the NULL parameter in the
+ * netsnmp_create_handler_registration() call can be used to
+ * supply a user-provided handler if necessary.
+ *
+ * This approach can also be used to handle Counter64, string-
+ * and OID-based watched scalars (although variable-sized writeable
+ * objects will need some more specialised initialisation).
+ */
+ DEBUGMSGTL(("statSSTP",
+ "Initializing statSSTPStarting scalar integer. Default value = %d\n",
+ 0));
+ reg = netsnmp_create_handler_registration(
+ "statSSTPStarting", NULL,
+ statSSTPStarting_oid, OID_LENGTH(statSSTPStarting_oid),
+ HANDLER_CAN_RONLY);
+ winfo = netsnmp_create_watcher_info(
+ stat_starting, sizeof(*stat_starting),
+ ASN_INTEGER, WATCHER_FIXED_SIZE);
+ if (netsnmp_register_watched_scalar( reg, winfo ) < 0 ) {
+ snmp_log( LOG_ERR, "Failed to register watched statSSTPStarting" );
+ }
+
+ DEBUGMSGTL(("statSSTP",
+ "Initializing statSSTPActive scalar integer. Default value = %d\n",
+ 0));
+ reg = netsnmp_create_handler_registration(
+ "statSSTPActive", NULL,
+ statSSTPActive_oid, OID_LENGTH(statSSTPActive_oid),
+ HANDLER_CAN_RONLY);
+ winfo = netsnmp_create_watcher_info(
+ stat_active, sizeof(*stat_active),
+ ASN_INTEGER, WATCHER_FIXED_SIZE);
+ if (netsnmp_register_watched_scalar( reg, winfo ) < 0 ) {
+ snmp_log( LOG_ERR, "Failed to register watched statSSTPActive" );
+ }
+
+
+ DEBUGMSGTL(("statSSTP",
+ "Done initalizing statSSTP module\n"));
+}
diff --git a/accel-pppd/extra/net-snmp/statSSTP.h b/accel-pppd/extra/net-snmp/statSSTP.h
new file mode 100644
index 0000000..900f89e
--- /dev/null
+++ b/accel-pppd/extra/net-snmp/statSSTP.h
@@ -0,0 +1,11 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.int_watch.conf 13957 2005-12-20 15:33:08Z tanders $
+ */
+#ifndef STATSSTP_H
+#define STATSSTP_H
+
+/* function declarations */
+void init_statSSTP(void);
+
+#endif /* STATSSTP_H */