aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_authentication_service.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snmp/src/agent/snmpa_authentication_service.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_authentication_service.erl45
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.