Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang
erlang
1565-snmp-Types-and-specs-for-snmp_index-get-2....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1565-snmp-Types-and-specs-for-snmp_index-get-2.patch of Package erlang
From da9d8806accb453b2187ac13b7158eeb2bf4fe02 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Mon, 15 Jan 2024 13:13:46 +0100 Subject: [PATCH 45/67] [snmp] Types and specs for snmp_index:get/2 --- lib/snmp/doc/src/snmp_index.xml | 12 +++++------- lib/snmp/src/agent/snmp_index.erl | 5 +++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/snmp/doc/src/snmp_index.xml b/lib/snmp/doc/src/snmp_index.xml index 22ccaf45cd..8b6fbfe3e8 100644 --- a/lib/snmp/doc/src/snmp_index.xml +++ b/lib/snmp/doc/src/snmp_index.xml @@ -243,6 +243,7 @@ get_next_pid(Oid, SnmpIndex) -> See the <seeerl marker="#1">warning note</seeerl> above.</p> </desc> </func> + <func> <name name="delete" arity="2" clause_i="1" since=""/> <fsummary>Delete an item from the index</fsummary> @@ -251,19 +252,16 @@ get_next_pid(Oid, SnmpIndex) -> Returns a new structure.</p> </desc> </func> + <func> - <name since="">get(Index, KeyOid) -> {ok, {KeyOid, Value}} | undefined</name> + <name name="get" arity="2" clause_i="1" since=""/> <fsummary>Get the item with <c>KeyOid</c></fsummary> - <type> - <v>Index = index()</v> - <v>KeyOid = oid()</v> - <v>Value = term()</v> - </type> <desc> <p>Gets the item with key <c>KeyOid</c>. Could be used from - within an SNMP instrumentation function.</p> + within an SNMP instrumentation function.</p> </desc> </func> + <func> <name since="">get_last(Index) -> {ok, {KeyOid, Value}} | undefined</name> <fsummary>Get the last item in the index structure</fsummary> diff --git a/lib/snmp/src/agent/snmp_index.erl b/lib/snmp/src/agent/snmp_index.erl index 6c92f08cf2..ee8bff5972 100644 --- a/lib/snmp/src/agent/snmp_index.erl +++ b/lib/snmp/src/agent/snmp_index.erl @@ -96,6 +96,11 @@ do_new(KeyTypes, EtsName, EtsOpts) -> end. +-spec get(Index, KeyOid) -> {ok, {KeyOid, Value}} | undefined when + Index :: index(), + KeyOid :: snmp:oid(), + Value :: term(). + get(#tab{id = OrdSet}, KeyOid) -> ?vlog("get -> entry with" "~n OrdSet: ~p" -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor