this is working but reads signal from PROC which will be replaced later
author"Darron Broad" <darron@kewl.org>
Tue, 11 Dec 2018 16:56:50 +0000
changeset 11 e2182306ab0d
parent 10 ce8ed0a6978b
child 12 3ce76810dfae
this is working but reads signal from PROC which will be replaced later

EG.

./mini_snmpd -c kewl -L London -C root@kewl.org -t 1 -d /overlay,/tmp -i br-lan,eth1,wlan0,wlan0-1 -v -n -w wlan0
Listening on port 161/udp and 161/tcp
updating the MIB (full)
updating the MIB (full)
...

$ snmpwalk -v1 -c kewl 192.168.0.181 1.3.6.1.4.1.762
SNMPv2-SMI::enterprises.762.2.5.2.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.762.2.5.2.1.3.1 = STRING: "wlan0"
SNMPv2-SMI::enterprises.762.2.5.2.1.7.1 = INTEGER: -256
SNMPv2-SMI::enterprises.762.2.5.2.1.8.1 = INTEGER: -67
mib.c
mini_snmpd.c
--- a/mib.c	Tue Dec 11 16:49:09 2018 +0000
+++ b/mib.c	Tue Dec 11 16:56:50 2018 +0000
@@ -635,7 +635,6 @@
 
 #ifdef __linux
 	if (g_wireless_list_length > 0) {
-		printf("mib build entry\n");
 		for (i = 0; i < g_wireless_list_length; i++) {
 			if (mib_build_entry(&m_wireless_oid, 1, i + 1, BER_TYPE_INTEGER, (const void *)(i + 1)) == -1) {
 				return -1;
@@ -833,7 +832,6 @@
 
 #ifdef __linux
 	if (full) {
-		printf("mib update entry\n");
 		if (g_wireless_list_length > 0) {
 			get_wirelessinfo(&u.wirelessinfo);
 			for (i = 0; i < g_wireless_list_length; i++) {
--- a/mini_snmpd.c	Tue Dec 11 16:49:09 2018 +0000
+++ b/mini_snmpd.c	Tue Dec 11 16:56:50 2018 +0000
@@ -57,7 +57,7 @@
 	       "  -d, --disks PATH                Disks to monitor, default: /\n"
 	       "  -i, --interfaces IFACE          Network interfaces to monitor, default: none\n"
 #ifdef __linux
-	       "  -w, --wireless-interfaces IFACE Wirless network interfaces to monitor, default: none\n"
+	       "  -w, --wireless-interfaces IFACE Wireless network interfaces to monitor, default: none\n"
 #endif
 	       "  -I, --listen IFACE              Network interface to listen, default: all\n"
 	       "  -t, --timeout SEC               Timeout for MIB updates, default: 1 second\n"
@@ -290,7 +290,7 @@
 
 int main(int argc, char *argv[])
 {
-	static const char short_options[] = "p:P:c:D:V:L:C:d:i:t:ansvh"
+	static const char short_options[] = "p:P:c:D:V:L:C:d:i:w:t:ansvh"
 #ifndef __FreeBSD__
 		"I:"
 #endif