diff options
author | Micael Karlberg <[email protected]> | 2019-03-26 11:25:50 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-03-28 17:14:56 +0100 |
commit | c842e38a1be4a92f14a309a6ccb66f33b5585088 (patch) | |
tree | 48eb5183611fbc4e730411b7e130d17284ac6fcf /lib/snmp/src/agent/snmpa_get_mechanism.erl | |
parent | 1b581f323eb740c054c5055602e7263b7463ffb1 (diff) | |
download | otp-c842e38a1be4a92f14a309a6ccb66f33b5585088.tar.gz otp-c842e38a1be4a92f14a309a6ccb66f33b5585088.tar.bz2 otp-c842e38a1be4a92f14a309a6ccb66f33b5585088.zip |
[snmp|agent] Add the default get-mechanism module snmpa_get
Added the snmpa_get module as the default get-mechanism
for the agent.
This has been done by simply moving the do_get, do_get_next
and do_get_bulk functions from the snmpa_agent module.
Some functions where also moved into the lib module (with
the idea of beeing more generally useful).
OTP-15691
Diffstat (limited to 'lib/snmp/src/agent/snmpa_get_mechanism.erl')
-rw-r--r-- | lib/snmp/src/agent/snmpa_get_mechanism.erl | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/lib/snmp/src/agent/snmpa_get_mechanism.erl b/lib/snmp/src/agent/snmpa_get_mechanism.erl index 1a2133778e..7be4ae79a2 100644 --- a/lib/snmp/src/agent/snmpa_get_mechanism.erl +++ b/lib/snmp/src/agent/snmpa_get_mechanism.erl @@ -24,28 +24,45 @@ %% This module defines the behaviour for the undocumented (hidden) %% get-mechanism feature. This allows for implementing your own %% handling of get, get-next and get-bulk requests. -%% Probably only useful for special cases (optimization). +%% Probably only useful for special cases (e.g. optimization). %% -%% ----------- do_get/3 ----------------------------------------------------- +%% ----------- do_get/2,3 ----------------------------------------------------- + +%% Purpose: Handles all VBs in a request that is inside the +%% mibview (local). + +-callback do_get(UnsortedVBs :: [snmp:varbind()], + IsNotification :: boolean()) -> + {noError, 0, ResVBs :: [snmp:varbind()]} | + {ErrStatus :: snmp:error_status(), ErrIndex :: snmp:error_index(), []}. + + +%% Purpose: Handles "get-requests". -callback do_get(MibView :: snmp_view_based_acm_mib:mibview(), - VBs :: [snmp:varbind()], + UnsortedVBs :: [snmp:varbind()], IsNotification :: boolean()) -> {noError, 0, ResVBs :: [snmp:varbind()]} | {ErrStatus :: snmp:error_status(), ErrIndex :: snmp:error_index(), []}. + + %% ----------- do_get_next/2 ------------------------------------------------ --callback do_get_next(MibView :: snmp_view_based_acm_mib:mibview(), - VBs :: [snmp:varbind()]) -> +%% Purpose: Handles "get-next-requests". + +-callback do_get_next(MibView :: snmp_view_based_acm_mib:mibview(), + UnsortedVBs :: [snmp:varbind()]) -> {noError, 0, ResVBs :: [snmp:varbind()]} | {ErrStatus :: snmp:error_status(), ErrIndex :: snmp:error_index(), []}. + + %% ----------- do_get_bulk/6 ------------------------------------------------ -callback do_get_bulk(MibView :: snmp_view_based_acm_mib:mibview(), |