Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang
erlang
1581-snmp-Types-and-specs-for-snmp_pdus-dec_sco...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1581-snmp-Types-and-specs-for-snmp_pdus-dec_scoped_pdu_da.patch of Package erlang
From c1ececde695a5a6049911f6b9243164406777c4a Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Tue, 16 Jan 2024 10:40:09 +0100 Subject: [PATCH 61/67] [snmp] Types and specs for snmp_pdus:dec_scoped_pdu_data/1 --- lib/snmp/doc/src/snmp_pdus.xml | 9 +++------ lib/snmp/src/misc/snmp_pdus.erl | 6 ++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/snmp/doc/src/snmp_pdus.xml b/lib/snmp/doc/src/snmp_pdus.xml index dc99203a19..ed558faed4 100644 --- a/lib/snmp/doc/src/snmp_pdus.xml +++ b/lib/snmp/doc/src/snmp_pdus.xml @@ -145,16 +145,13 @@ <p>Decodes a list of bytes into an SNMP ScopedPdu.</p> </desc> </func> + <func> - <name since="">dec_scoped_pdu_data([byte()]) -> ScopedPduData</name> + <name name="dec_scoped_pdu_data" arity="1" clause_i="1" since=""/> <fsummary>Decode an SNMP ScopedPduData</fsummary> - <type> - <v>ScopedPduData = #scoped_pdu | EncryptedPDU</v> - <v>EncryptedPDU = [byte()]</v> - </type> <desc> <p>Decodes a list of bytes into either a scoped pdu record, or - - if the scoped pdu was encrypted - to a list of bytes.</p> + - if the scoped pdu was encrypted - to a list of bytes.</p> </desc> </func> <func> diff --git a/lib/snmp/src/misc/snmp_pdus.erl b/lib/snmp/src/misc/snmp_pdus.erl index 023b23842e..532d67e354 100644 --- a/lib/snmp/src/misc/snmp_pdus.erl +++ b/lib/snmp/src/misc/snmp_pdus.erl @@ -156,6 +156,12 @@ dec_rest_v3_msg(Bytes) -> Data = Message#message.data, Message#message{data = dec_scoped_pdu_data(Data)}. + +-spec dec_scoped_pdu_data(Bytes) -> ScopedPduData when + Bytes :: [byte()], + ScopedPduData :: scoped_pdu() | EncryptedPDU, + EncryptedPDU :: [byte()]. + dec_scoped_pdu_data([48 | Bytes]) -> % plaintext {ScopedPdu, []} = dec_scoped_pdu_notag(Bytes), ScopedPdu; -- 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