summaryrefslogtreecommitdiffstats
path: root/ksim
diff options
context:
space:
mode:
authorFrançois Andriot <francois.andriot@free.fr>2021-10-03 11:03:10 +0200
committerFrançois Andriot <francois.andriot@free.fr>2021-10-03 11:03:10 +0200
commit2742adaad38201278eebb61f94bb961e023b5fee (patch)
tree25bd931560ffa55ec6eb41727c967ff63f4c4789 /ksim
parentd142c720f67ac6d2180aca015c64a1290a0ae8eb (diff)
downloadtdeutils-2742adaad38201278eebb61f94bb961e023b5fee.tar.gz
tdeutils-2742adaad38201278eebb61f94bb961e023b5fee.zip
ksim/monitors/snmp: add AES privacy protocol, conditional build of DES privacy protocol
Signed-off-by: François Andriot <francois.andriot@free.fr>
Diffstat (limited to 'ksim')
-rw-r--r--ksim/monitors/snmp/session.cpp7
-rw-r--r--ksim/monitors/snmp/snmp.cpp3
-rw-r--r--ksim/monitors/snmp/snmp.h5
3 files changed, 13 insertions, 2 deletions
diff --git a/ksim/monitors/snmp/session.cpp b/ksim/monitors/snmp/session.cpp
index 6839283..b52fe5c 100644
--- a/ksim/monitors/snmp/session.cpp
+++ b/ksim/monitors/snmp/session.cpp
@@ -186,9 +186,16 @@ bool Session::initialize( ErrorInfo *error )
}
switch ( source.privacy.protocol ) {
+ case AESPrivacy: {
+ d->defaultSession.securityPrivProto = usmAESPrivProtocol;
+ d->defaultSession.securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
+ break;
+ }
case DESPrivacy: {
+#ifndef NETSNMP_DISABLE_DES
d->defaultSession.securityPrivProto = usmDESPrivProtocol;
d->defaultSession.securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN;
+#endif
break;
}
default: assert( false );
diff --git a/ksim/monitors/snmp/snmp.cpp b/ksim/monitors/snmp/snmp.cpp
index 333f0d2..1256228 100644
--- a/ksim/monitors/snmp/snmp.cpp
+++ b/ksim/monitors/snmp/snmp.cpp
@@ -48,7 +48,8 @@ static const struct EnumStringMapInfo
{ MD5Auth, "MD5", 0 },
{ SHA1Auth, "SHA1", 0 },
{ 0, 0, 0 }
-}, privacyProtocolStrings[ 2 ] = {
+}, privacyProtocolStrings[ 3 ] = {
+ { AESPrivacy, "AES", 0 },
{ DESPrivacy, "DES", 0 },
{ 0, 0, 0 }
};
diff --git a/ksim/monitors/snmp/snmp.h b/ksim/monitors/snmp/snmp.h
index c00e110..4b1e4fb 100644
--- a/ksim/monitors/snmp/snmp.h
+++ b/ksim/monitors/snmp/snmp.h
@@ -46,7 +46,10 @@ TQStringList allAuthenticationProtocols();
TQString authenticationProtocolToString( AuthenticationProtocol proto );
AuthenticationProtocol stringToAuthenticationProtocol( TQString string, bool *ok = 0 );
-enum PrivacyProtocol { DESPrivacy };
+enum PrivacyProtocol {
+ AESPrivacy,
+ DESPrivacy
+};
TQStringList allPrivacyProtocols();
TQString privacyProtocolToString( PrivacyProtocol proto );
PrivacyProtocol stringToPrivacyProtocol( TQString string, bool *ok = 0 );