Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang
erlang
1569-snmp-Types-and-specs-for-snmp_index-key_to...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1569-snmp-Types-and-specs-for-snmp_index-key_to_oid-2.patch of Package erlang
From cffb79168ae223b7a5dda4927fed0cf077c1c102 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Mon, 15 Jan 2024 17:18:21 +0100 Subject: [PATCH 49/67] [snmp] Types and specs for snmp_index:key_to_oid/2 --- lib/snmp/doc/src/snmp_index.xml | 9 +++------ lib/snmp/src/agent/snmp_index.erl | 6 ++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/snmp/doc/src/snmp_index.xml b/lib/snmp/doc/src/snmp_index.xml index a0161cad15..95685399c0 100644 --- a/lib/snmp/doc/src/snmp_index.xml +++ b/lib/snmp/doc/src/snmp_index.xml @@ -289,18 +289,15 @@ get_next_pid(Oid, SnmpIndex) -> overwrites the old value. </p> </desc> </func> + <func> - <name since="">key_to_oid(Index, Key) -> KeyOid</name> + <name name="key_to_oid" arity="2" clause_i="1" since=""/> <fsummary>Convert a key to an OBJECT IDENTIFIER</fsummary> - <type> - <v>Index = index()</v> - <v>Key = key()</v> - <v>KeyOid = NextKeyOid = oid()</v> - </type> <desc> <p>Converts <c>Key</c> to an OBJECT IDENTIFIER.</p> </desc> </func> + <func> <name since="">new(KeyTypes) -> Index</name> <fsummary>Create a new snmp index structure</fsummary> diff --git a/lib/snmp/src/agent/snmp_index.erl b/lib/snmp/src/agent/snmp_index.erl index 8590492086..9fd082f849 100644 --- a/lib/snmp/src/agent/snmp_index.erl +++ b/lib/snmp/src/agent/snmp_index.erl @@ -176,9 +176,15 @@ delete(#tab{id = OrdSet, keys = KeyTypes} = Tab, Key) -> Tab. +-spec key_to_oid(Index, Key) -> KeyOid when + Index :: index(), + Key :: key(), + KeyOid :: snmp:oid(). + key_to_oid(#tab{keys = KeyTypes}, Key) -> key_to_oid_i(Key, KeyTypes). + to_list(Tuple) when is_tuple(Tuple) -> tuple_to_list(Tuple); to_list(X) -> [X]. -- 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