diff options
author | Micael Karlberg <[email protected]> | 2011-05-16 10:09:25 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-05-16 10:09:25 +0200 |
commit | 3e907e4468651206b8c6c97290e37a5a82102e2f (patch) | |
tree | b9a39fe5fc37c32313f7ae89f2f98a4a68ccfd40 /lib/snmp/src/agent/snmp_community_mib.erl | |
parent | b19a2c6648e65b5ad1b8a0351928856fad941f99 (diff) | |
parent | c2a1108ff4cfdb2a5763349e4f505bed49871cc8 (diff) | |
download | otp-3e907e4468651206b8c6c97290e37a5a82102e2f.tar.gz otp-3e907e4468651206b8c6c97290e37a5a82102e2f.tar.bz2 otp-3e907e4468651206b8c6c97290e37a5a82102e2f.zip |
OTP-9022: Fixed endode/decode of values of type Counter32.
OTP-9088: [agent] Added support for sending traps to IPv6 targets.
OTP-9119: [agent] To be able to handle multiple engine-id(s) when
sending trap(s), the function
snmp_community_mib:add_community/6 has been added.
OTP-9162: [manager] The API for snmp requests has been augmented to
allow the caller to override some configuration.
OTP-9174: [manager] The old API functions (for get and set
requests) are now officially deprecated.
OTP-9183: [agent] Pass extra info through the agent to the net-if
process when sending notifications.
OTP-9208: Added type specs for functions that do not return.
Kostis Sagonas
Merge branch 'bmk/snmp/snmp420_integration' into dev
Diffstat (limited to 'lib/snmp/src/agent/snmp_community_mib.erl')
-rw-r--r-- | lib/snmp/src/agent/snmp_community_mib.erl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/snmp/src/agent/snmp_community_mib.erl b/lib/snmp/src/agent/snmp_community_mib.erl index 5644a43345..3debe0a30e 100644 --- a/lib/snmp/src/agent/snmp_community_mib.erl +++ b/lib/snmp/src/agent/snmp_community_mib.erl @@ -25,7 +25,7 @@ snmpTargetAddrExtTable/3, community2vacm/2, vacm2community/2, get_target_addr_ext_mms/2]). --export([add_community/5, delete_community/1]). +-export([add_community/5, add_community/6, delete_community/1]). -export([check_community/1]). -include("SNMP-COMMUNITY-MIB.hrl"). @@ -128,12 +128,16 @@ read_community_config_files(Dir) -> Comms. check_community({Index, CommunityName, SecName, CtxName, TransportTag}) -> + EngineID = get_engine_id(), + check_community({Index, CommunityName, SecName, + EngineID, CtxName, TransportTag}); +check_community({Index, CommunityName, SecName, + EngineID, CtxName, TransportTag}) -> snmp_conf:check_string(Index,{gt,0}), snmp_conf:check_string(CommunityName), snmp_conf:check_string(SecName), snmp_conf:check_string(CtxName), snmp_conf:check_string(TransportTag), - EngineID = get_engine_id(), Comm = {Index, CommunityName, SecName, EngineID, CtxName, TransportTag, ?'StorageType_nonVolatile', ?'RowStatus_active'}, {ok, Comm}; @@ -173,6 +177,13 @@ table_del_row(Tab, Key) -> %% FIXME: does not work with mnesia add_community(Idx, CommName, SecName, CtxName, TransportTag) -> Community = {Idx, CommName, SecName, CtxName, TransportTag}, + do_add_community(Community). + +add_community(Idx, CommName, SecName, EngineId, CtxName, TransportTag) -> + Community = {Idx, CommName, SecName, EngineId, CtxName, TransportTag}, + do_add_community(Community). + +do_add_community(Community) -> case (catch check_community(Community)) of {ok, Row} -> Key = element(1, Row), |