diff options
author | Micael Karlberg <[email protected]> | 2019-07-08 14:51:57 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-07-08 14:51:57 +0200 |
commit | c8854dd4ecfde41e89907620628138786e953229 (patch) | |
tree | d74b6c3fbb2bfeab05b1c5a7309b633a22b7b8bc /lib/snmp/src/agent/snmpa_authentication_service.erl | |
parent | fc9ba88b2f1304b6a6f1ca1ad014f1ff91fc890e (diff) | |
parent | a9bd3c189f87a1138ca780956d27398f9d5a5aec (diff) | |
download | otp-c8854dd4ecfde41e89907620628138786e953229.tar.gz otp-c8854dd4ecfde41e89907620628138786e953229.tar.bz2 otp-c8854dd4ecfde41e89907620628138786e953229.zip |
Merge branch 'bmk/snmp/20190627/dialyzer/OTP-15932' into maint
Diffstat (limited to 'lib/snmp/src/agent/snmpa_authentication_service.erl')
-rw-r--r-- | lib/snmp/src/agent/snmpa_authentication_service.erl | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/lib/snmp/src/agent/snmpa_authentication_service.erl b/lib/snmp/src/agent/snmpa_authentication_service.erl index e4238a8384..b6b9f5bd96 100644 --- a/lib/snmp/src/agent/snmpa_authentication_service.erl +++ b/lib/snmp/src/agent/snmpa_authentication_service.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2016. All Rights Reserved. +%% Copyright Ericsson AB 2004-2019. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -19,13 +19,27 @@ %% -module(snmpa_authentication_service). --export([behaviour_info/1]). - -behaviour_info(callbacks) -> - [{init_check_access, 2}]; -behaviour_info(_) -> - undefined. - +-export_type([ + acm_data/0 + ]). + +-type acm_data() :: {community, + SecModel :: 0 | 1 | 2 | 3, % any | v1 | v2c | v3 + Community :: string(), + %% Oids for either: + %% transportDomainUdpIpv4 | transportDomainUdpIpv6 + TDomain :: snmp:oid(), + TAddress :: [non_neg_integer()]} | + {v3, + MsgID :: integer(), + SecModel :: 0 | 1 | 2 | 3, % any | v1 | v2c | v3 + SecName :: string(), + %% noAuthNoPriv | authNoPriv | authPriv + SecLevel :: 1 | 2 | 3, + ContextEngineID :: string(), + ContextName :: string(), + SecData :: term()}. + %%----------------------------------------------------------------- %% init_check_access(Pdu, ACMData) @@ -46,9 +60,7 @@ behaviour_info(_) -> %% Variable = snmpInBadCommunityNames | %% snmpInBadCommunityUses | %% snmpInASNParseErrs -%% Reason = snmp_message_decoding | -%% {bad_community_name, Address, Community}} | -%% {invalid_access, Access, Op} +%% Reason = {bad_community_name, Address, Community}} %% %% Purpose: Called once for each Pdu. Returns a MibView %% which is later used for each variable in the pdu. @@ -57,3 +69,14 @@ behaviour_info(_) -> %% %% NOTE: This function is executed in the Master agents's context %%----------------------------------------------------------------- + +-callback init_check_access(Pdu, ACMData) -> + {ok, MibView, ContextName} | + {error, Reason} | + {discarded, Variable, Reason} when + Pdu :: snmp:pdu(), + ACMData :: acm_data(), + MibView :: snmp_view_based_acm_mib:mibview(), + ContextName :: string(), + Reason :: term(), + Variable :: snmpInBadCommunityNames. |