Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
1572-snmp-Types-and-specs-for-snmp_notification...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1572-snmp-Types-and-specs-for-snmp_notification_mib-add_n.patch of Package erlang
From 81eabea3f58eda6c47a4215d6c445fb94eaef8ed Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Mon, 15 Jan 2024 18:28:33 +0100 Subject: [PATCH 52/67] [snmp] Types and specs for snmp_notification_mib:add_notify/3 --- lib/snmp/doc/src/Makefile | 1 + lib/snmp/doc/src/snmp_notification_mib.xml | 59 +++++++++++++++----- lib/snmp/doc/src/snmp_target_mib.xml | 4 ++ lib/snmp/doc/src/specs.xml | 1 + lib/snmp/src/agent/snmp_notification_mib.erl | 18 ++++++ 5 files changed, 69 insertions(+), 14 deletions(-) diff --git a/lib/snmp/doc/src/Makefile b/lib/snmp/doc/src/Makefile index 90afd67b00..b6652ae7b0 100644 --- a/lib/snmp/doc/src/Makefile +++ b/lib/snmp/doc/src/Makefile @@ -60,6 +60,7 @@ SPECS_FILES = \ $(SPECDIR)/specs_snmp.xml \ $(SPECDIR)/specs_snmp_community_mib.xml \ $(SPECDIR)/specs_snmp_framework_mib.xml \ + $(SPECDIR)/specs_snmp_notification_mib.xml \ $(SPECDIR)/specs_snmp_target_mib.xml \ $(SPECDIR)/specs_snmp_generic.xml \ $(SPECDIR)/specs_snmp_index.xml \ diff --git a/lib/snmp/doc/src/snmp_notification_mib.xml b/lib/snmp/doc/src/snmp_notification_mib.xml index 964bbebc6c..b9eac7c41c 100644 --- a/lib/snmp/doc/src/snmp_notification_mib.xml +++ b/lib/snmp/doc/src/snmp_notification_mib.xml @@ -41,6 +41,42 @@ </p> <p>The configuration files are described in the SNMP User's Manual.</p> </description> + + + <datatypes> + <datatype> + <name name="notify_name"/> + <desc> + <p> + <c><![CDATA[SnmpAdminString (SIZE(1..32))]]></c> + </p> + </desc> + </datatype> + + <datatype> + <name name="notify_tag"/> + <!-- + <desc> + <p> + TBD + </p> + </desc> + --> + </datatype> + + <datatype> + <name name="notify_type"/> + <!-- + <desc> + <p> + TBD + </p> + </desc> + --> + </datatype> + + </datatypes> + <funcs> <func> <name since="">configure(ConfDir) -> void()</name> @@ -92,28 +128,23 @@ <p><c>ConfDir</c> is a string which points to the directory where the configuration files are found. </p> - <p>The configuration file read is: <c>notify.conf</c>. - <marker id="add_notify"></marker> -</p> + <p>The configuration file read is: <c>notify.conf</c>.</p> + + <marker id="add_notify"></marker> </desc> </func> + <func> - <name since="">add_notify(Name, Tag, Type) -> Ret</name> + <name name="add_notify" arity="3" clause_i="1" since=""/> <fsummary>Added one notify definition</fsummary> - <type> - <v>Name = string()</v> - <v>Tag = string()</v> - <v>Type = trap | inform</v> - <v>Ret = {ok, Key} | {error, Reason}</v> - <v>Key = term()</v> - <v>Reason = term()</v> - </type> <desc> <p>Adds a notify definition to the agent config. - Equivalent to one line in the <c>notify.conf</c> file.</p> - <marker id="delete_notify"></marker> + Equivalent to one line in the <c>notify.conf</c> file.</p> + + <marker id="delete_notify"></marker> </desc> </func> + <func> <name since="">delete_notify(Key) -> Ret</name> <fsummary>Delete one notify definition</fsummary> diff --git a/lib/snmp/doc/src/snmp_target_mib.xml b/lib/snmp/doc/src/snmp_target_mib.xml index cc5ce0f3e7..69f88fa6a7 100644 --- a/lib/snmp/doc/src/snmp_target_mib.xml +++ b/lib/snmp/doc/src/snmp_target_mib.xml @@ -51,6 +51,10 @@ <datatype> <name name="tag_value"/> <desc> + <note> + <p>"An octet string containing a tag value. + Tag values are preferably in human-readable form."</p> + </note> <p> <c><![CDATA[OCTET STRING (SIZE (0..255))]]></c> </p> diff --git a/lib/snmp/doc/src/specs.xml b/lib/snmp/doc/src/specs.xml index 374bf1c1b0..45036db0e4 100644 --- a/lib/snmp/doc/src/specs.xml +++ b/lib/snmp/doc/src/specs.xml @@ -3,6 +3,7 @@ <xi:include href="../specs/specs_snmp.xml"/> <xi:include href="../specs/specs_snmp_community_mib.xml"/> <xi:include href="../specs/specs_snmp_framework_mib.xml"/> + <xi:include href="../specs/specs_snmp_notification_mib.xml"/> <xi:include href="../specs/specs_snmp_target_mib.xml"/> <xi:include href="../specs/specs_snmp_generic.xml"/> <xi:include href="../specs/specs_snmp_index.xml"/> diff --git a/lib/snmp/src/agent/snmp_notification_mib.erl b/lib/snmp/src/agent/snmp_notification_mib.erl index 3f1ba5d8b3..69c941ed0b 100644 --- a/lib/snmp/src/agent/snmp_notification_mib.erl +++ b/lib/snmp/src/agent/snmp_notification_mib.erl @@ -28,6 +28,12 @@ -export([add_notify/3, delete_notify/1]). -export([check_notify/1]). +-export_type([ + notify_name/0, + notify_tag/0, + notify_type/0 + ]). + -include("snmpa_internal.hrl"). -include("SNMP-NOTIFICATION-MIB.hrl"). -include("SNMPv2-TC.hrl"). @@ -41,6 +47,11 @@ -endif. +-type notify_name() :: snmp_framework_mib:admin_string(). +-type notify_tag() :: snmp_target_mib:tag_value(). +-type notify_type() :: trap | inform. + + %%----------------------------------------------------------------- %% Func: configure/1 %% Args: Dir is the directory where the configuration files are found. @@ -153,6 +164,13 @@ table_del_row(Tab, Key) -> snmpa_mib_lib:table_del_row(db(Tab), Key). +-spec add_notify(Name, Tag, Type) -> {ok, Key} | {error, Reason} when + Name :: notify_name(), + Tag :: notify_tag(), + Type :: notify_type(), + Key :: term(), + Reason :: term(). + %% FIXME: does not work with mnesia add_notify(Name, Tag, Type) -> Notif = {Name, Tag, Type}, -- 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