|
@@ -42,6 +42,7 @@
|
|
#include "utilities.h"
|
|
#include "utilities.h"
|
|
#include "../../lib/kcore/statistics.h"
|
|
#include "../../lib/kcore/statistics.h"
|
|
#include "../../globals.h"
|
|
#include "../../globals.h"
|
|
|
|
+#include "../../tcp_options.h"
|
|
|
|
|
|
/*
|
|
/*
|
|
* Note: this file originally auto-generated by mib2c using
|
|
* Note: this file originally auto-generated by mib2c using
|
|
@@ -61,6 +62,8 @@ init_kamailioNet(void)
|
|
const oid kamailioNetTcpConnPassiveOpen_oid[] = { 1,3,6,1,4,1,34352,3,1,3,1,4,1,2,6 };
|
|
const oid kamailioNetTcpConnPassiveOpen_oid[] = { 1,3,6,1,4,1,34352,3,1,3,1,4,1,2,6 };
|
|
const oid kamailioNetTcpConnReject_oid[] = { 1,3,6,1,4,1,34352,3,1,3,1,4,1,2,8 };
|
|
const oid kamailioNetTcpConnReject_oid[] = { 1,3,6,1,4,1,34352,3,1,3,1,4,1,2,8 };
|
|
const oid kamailioNetTcpEnabled_oid[] = { 1,3,6,1,4,1,34352,3,1,3,1,4,1,3,1 };
|
|
const oid kamailioNetTcpEnabled_oid[] = { 1,3,6,1,4,1,34352,3,1,3,1,4,1,3,1 };
|
|
|
|
+ const oid kamailioNetTcpMaxConns_oid[] = { 1,3,6,1,4,1,34352,3,1,3,1,4,1,3,2 };
|
|
|
|
+ const oid kamailioNetTcpAsync_oid[] = { 1,3,6,1,4,1,34352,3,1,3,1,4,1,3,3 };
|
|
|
|
|
|
DEBUGMSGTL(("kamailioNet", "Initializing\n"));
|
|
DEBUGMSGTL(("kamailioNet", "Initializing\n"));
|
|
|
|
|
|
@@ -104,6 +107,16 @@ init_kamailioNet(void)
|
|
kamailioNetTcpEnabled_oid, OID_LENGTH(kamailioNetTcpEnabled_oid),
|
|
kamailioNetTcpEnabled_oid, OID_LENGTH(kamailioNetTcpEnabled_oid),
|
|
HANDLER_CAN_RONLY
|
|
HANDLER_CAN_RONLY
|
|
));
|
|
));
|
|
|
|
+ netsnmp_register_scalar(
|
|
|
|
+ netsnmp_create_handler_registration("kamailioNetTcpMaxConns", handle_kamailioNetTcpMaxConns,
|
|
|
|
+ kamailioNetTcpMaxConns_oid, OID_LENGTH(kamailioNetTcpMaxConns_oid),
|
|
|
|
+ HANDLER_CAN_RONLY
|
|
|
|
+ ));
|
|
|
|
+ netsnmp_register_scalar(
|
|
|
|
+ netsnmp_create_handler_registration("kamailioNetTcpAsync", handle_kamailioNetTcpAsync,
|
|
|
|
+ kamailioNetTcpAsync_oid, OID_LENGTH(kamailioNetTcpAsync_oid),
|
|
|
|
+ HANDLER_CAN_RONLY
|
|
|
|
+ ));
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef SKREP
|
|
#ifdef SKREP
|
|
@@ -325,3 +338,65 @@ handle_kamailioNetTcpEnabled(netsnmp_mib_handler *handler,
|
|
|
|
|
|
return SNMP_ERR_NOERROR;
|
|
return SNMP_ERR_NOERROR;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+int
|
|
|
|
+handle_kamailioNetTcpMaxConns(netsnmp_mib_handler *handler,
|
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
|
+ netsnmp_request_info *requests)
|
|
|
|
+{
|
|
|
|
+ struct cfg_group_tcp t;
|
|
|
|
+ unsigned int maxconn;
|
|
|
|
+
|
|
|
|
+ tcp_options_get(&t);
|
|
|
|
+ maxconn = t.max_connections;
|
|
|
|
+
|
|
|
|
+ switch(reqinfo->mode) {
|
|
|
|
+
|
|
|
|
+ case MODE_GET:
|
|
|
|
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
|
|
|
|
+ (u_char *) &maxconn, sizeof(int));
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ default:
|
|
|
|
+ /* we should never get here, so this is a really bad error */
|
|
|
|
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_kamailioNetTcpMaxConns\n", reqinfo->mode );
|
|
|
|
+ return SNMP_ERR_GENERR;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
|
+}
|
|
|
|
+int
|
|
|
|
+handle_kamailioNetTcpAsync(netsnmp_mib_handler *handler,
|
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
|
+ netsnmp_request_info *requests)
|
|
|
|
+{
|
|
|
|
+ struct cfg_group_tcp t;
|
|
|
|
+ unsigned int value;
|
|
|
|
+
|
|
|
|
+ tcp_options_get(&t);
|
|
|
|
+ value = t.async;
|
|
|
|
+ /* We are never called for a GETNEXT if it's registered as a
|
|
|
|
+ "instance", as it's "magically" handled for us. */
|
|
|
|
+
|
|
|
|
+ /* a instance handler also only hands us one request at a time, so
|
|
|
|
+ we don't need to loop over a list of requests; we'll only get one. */
|
|
|
|
+
|
|
|
|
+ switch(reqinfo->mode) {
|
|
|
|
+
|
|
|
|
+ case MODE_GET:
|
|
|
|
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
|
|
|
|
+ (u_char *) &value, sizeof(int));
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ default:
|
|
|
|
+ /* we should never get here, so this is a really bad error */
|
|
|
|
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_kamailioNetTcpAsync\n", reqinfo->mode );
|
|
|
|
+ return SNMP_ERR_GENERR;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
|
+}
|