Re: Doubt with SEQUENCE

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAKoMtGYUP22YcFMZ8WZ_uNWx3MkqTrYCQywb+crYFP7wWQhT2w@mail.gmail.com>
On 10 January 2013 14:38, Felipe Augusto de Souza <[email protected]> wrote:
> However, I have been trying to set a structure which is intended to be a
> command with two paramaters (actually, two integers), but I always need to
> be sent together.
>
> I am trying to do like this:
>
> Command ::= SEQUENCE {
> commandNumber     Integer32,
> secondsOfCommand  Integer32
> }

No - that won't work.   It's not valid SMI.

Remember, SNMP is the *Simple* Network Management Protocol.
In particular, it doesn't use full ASN.1 to define data - it uses a
simplified subset ('SMI')
   One of the simplifications that has been made is to omit any
form of structure (other than tables).  So SEQUENCE is not
a valid element within a MIB module.



> imposeCommand OBJECT-TYPE
>     SYNTAX      Command
>     MAX-ACCESS  read-write
>     STATUS      mandatory
>     DESCRIPTION
>     ""
>     ::= {Test 1 }
>
> It is not working.

You would need to define two separate MIB objects,
and document within the DESCRIPTION clauses
that they must always be accessed/updated together.

Or else define a table, indexed by commandNumber,
with commandSeconds as an (accessible) column.



> How I can make this variables be set together ? Only by defining a PDU error
> in my application ?

See above

> Is Sequence only for define a row in a table ?

Yes

Dave

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.