diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2015-06-10 10:04:00 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2015-06-10 10:04:00 +0000 |
commit | fcc399ba837bd3a5201c019f381b955380b0487d (patch) | |
tree | 819eab188807c81c73af694c1df3de9789174505 | |
parent | bb79007aa81b142e64a1f260b2e3dd610c7fcb76 (diff) |
Export new pf "no-route" error counter
OK sthen, blambert for the SNMP part
-rw-r--r-- | share/snmp/OPENBSD-PF-MIB.txt | 14 | ||||
-rw-r--r-- | usr.sbin/snmpd/mib.c | 6 | ||||
-rw-r--r-- | usr.sbin/snmpd/mib.h | 4 |
3 files changed, 19 insertions, 5 deletions
diff --git a/share/snmp/OPENBSD-PF-MIB.txt b/share/snmp/OPENBSD-PF-MIB.txt index ae96829db84..00ebef92250 100644 --- a/share/snmp/OPENBSD-PF-MIB.txt +++ b/share/snmp/OPENBSD-PF-MIB.txt @@ -1,4 +1,4 @@ --- $OpenBSD: OPENBSD-PF-MIB.txt,v 1.4 2013/09/07 04:39:30 joel Exp $ +-- $OpenBSD: OPENBSD-PF-MIB.txt,v 1.5 2015/06/10 10:03:59 mikeb Exp $ -- -- Copyright (c) 2004-2013 Joel Knight <knight.joel@gmail.com> -- @@ -33,7 +33,7 @@ IMPORTS FROM SNMPv2-CONF; pfMIBObjects MODULE-IDENTITY - LAST-UPDATED "201308310446Z" + LAST-UPDATED "201506091728Z" ORGANIZATION "OpenBSD" CONTACT-INFO " Author: Joel Knight @@ -43,6 +43,8 @@ pfMIBObjects MODULE-IDENTITY DESCRIPTION "The MIB module for gathering information from OpenBSD's packet filter. " + REVISION "201506091728Z" + DESCRIPTION "Add separate counter for failed 'route-to' applications" REVISION "201308310446Z" DESCRIPTION "Add pf(4) table byte/packet counters for 'match' rules" REVISION "201302242033Z" @@ -251,6 +253,14 @@ pfCntTranslate OBJECT-TYPE translation was requested and no unused port was available." ::= { pfCounters 16 } +pfCntNoRoute OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The number of packets that were dropped because policy based routing + was requested but no target addresses were available." + ::= { pfCounters 17 } -- pfStateTable diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c index 8e4d98fba7e..dcf3eb3bb92 100644 --- a/usr.sbin/snmpd/mib.c +++ b/usr.sbin/snmpd/mib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mib.c,v 1.75 2015/01/21 21:50:33 deraadt Exp $ */ +/* $OpenBSD: mib.c,v 1.76 2015/06/10 10:03:59 mikeb Exp $ */ /* * Copyright (c) 2012 Joel Knight <joel@openbsd.org> @@ -1451,6 +1451,7 @@ static struct oid openbsd_mib[] = { { MIB(pfCntSrcLimit), OID_RD, mib_pfcounters }, { MIB(pfCntSynproxy), OID_RD, mib_pfcounters }, { MIB(pfCntTranslate), OID_RD, mib_pfcounters }, + { MIB(pfCntNoRoute), OID_RD, mib_pfcounters }, { MIB(pfStateCount), OID_RD, mib_pfscounters }, { MIB(pfStateSearches), OID_RD, mib_pfscounters }, { MIB(pfStateInserts), OID_RD, mib_pfscounters }, @@ -1707,7 +1708,8 @@ mib_pfcounters(struct oid *oid, struct ber_oid *o, struct ber_element **elm) { 13, &s.counters[PFRES_MAXSTATES] }, { 14, &s.counters[PFRES_SRCLIMIT] }, { 15, &s.counters[PFRES_SYNPROXY] }, - { 16, &s.counters[PFRES_TRANSLATE] } + { 16, &s.counters[PFRES_TRANSLATE] }, + { 17, &s.counters[PFRES_NOROUTE] } }; if (pf_get_stats(&s)) diff --git a/usr.sbin/snmpd/mib.h b/usr.sbin/snmpd/mib.h index 4fff5ecb255..03f0171de86 100644 --- a/usr.sbin/snmpd/mib.h +++ b/usr.sbin/snmpd/mib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mib.h,v 1.35 2014/11/19 10:24:40 blambert Exp $ */ +/* $OpenBSD: mib.h,v 1.36 2015/06/10 10:03:59 mikeb Exp $ */ /* * Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org> @@ -490,6 +490,7 @@ #define MIB_pfCntSrcLimit MIB_pfCounters, 14 #define MIB_pfCntSynproxy MIB_pfCounters, 15 #define MIB_pfCntTranslate MIB_pfCounters, 16 +#define MIB_pfCntNoRoute MIB_pfCounters, 17 #define MIB_pfStateTable MIB_pfMIBObjects, 3 #define MIB_pfStateCount MIB_pfStateTable, 1 #define MIB_pfStateSearches MIB_pfStateTable, 2 @@ -1057,6 +1058,7 @@ { MIBDECL(pfCntSrcLimit) }, \ { MIBDECL(pfCntSynproxy) }, \ { MIBDECL(pfCntTranslate) }, \ + { MIBDECL(pfCntNoRoute) }, \ { MIBDECL(pfStateTable) }, \ { MIBDECL(pfStateCount) }, \ { MIBDECL(pfStateSearches) }, \ |