Yes, and err... no.

The problem we have is with data bandwidth. The SNMP interface we are
trying to implement and support is extended over an air-side interface (I
can't really say anymore than that) where bandwidth may be an issue, and so
string-formatting the data into an ASCII representation doesn't help. Nor
does it help if I try to do type-checking where I would like the perl
script(s) to generate code for me (via private conf files) to type-check
SET's and GET's before they even make it into my user code; i.e. that the
type of value being set/get is type checked against it's ASN1 definition
a-la MIB.

There is an innocuous looking set of functions in the parse.c file within
the Net-snmp libraries which I believe to be called from within the
SNMP.DLL (from SNMP.PM via mib2c.pl) that translates types defined in the
MIB into their ASN types (ASN_INTEGER, ASN_OCTET_STR etc.). Unfortunately,
if I add an attribute to the MIB of type ASN_BOOLEAN or ASN_REAL (ASN_FLOAT
or ASN_DOUBLE) the type returned (logically) is undefined and thus the
variable does not appear in "count_scalars" not in "@foreach $i scalar@",
so no code is generated for it.

The <undef> is valid for sequences (tables) so I don't want to lose that,
however, I do feel that perhaps an extension to one or more of the
functions in parse.c would be appropriate to support these "missing" types,
especially as definitions for them appear (a statement that is probably now
getting boring!) in the asn1_defs.h file.

Unfortunately the code is quite complex, and is further frustrated by the
(necessarily) complex build mechanism, otherwise I would attempt the
changes myself (which I am still willing to do if a more straight-forward
solution is not forthcoming).

Regards

Martin



                                                                           
             "G. S. Marzot"                                                
             <giovanni.marzot@                                             
             verizon.net>                                               An 
                                        [EMAIL PROTECTED] 
             30.05.2006 17:10                                        Kopie 
                                        [EMAIL PROTECTED] 
                                        net                                
              Bitte antworten                                        Thema 
                    an                  Re: Antwort: Re: ASN Standard      
             [EMAIL PROTECTED]          Types                              
                erizon.net                                                 
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




[EMAIL PROTECTED] wrote:
>
>
>
> Giovanni;
>
> Thanks for responding to my posting. The only problem that I really have
> with the OPAQUE data types is that they do not appear in/from the MIB
when
> one uses the type field (provided and supported in the perl scripts).
This
> means that I cannot build type-checking into the code generated from the
> perl script as this does not give me the type ASN_OPAQUE_FLOAT, but
rather
> an ASN_OCTET_STR (if I use the SMI definitions from the example MIBs as
> provided within the Net SNMP package).
>
> What is frustrating is that the Net SNMP code utilises the ASN_BOOLEAN
and
> ASN_FLOAT/DOUBLE types (as defined in the asn1_degs.h file) and even
> provides parser functions for them, however, they are not supported by
the
> SNMP.dll (used by the perl scripts). So, on the one hand, I can generate,
> send, receive and interpret variables of these types, but cannot "see"
> these types within code generated via the perl scripts.
>
> Aarrgghh!!
>
> I am willing to make the changes (locally) to the SNMP dll myself to
extend
> the functionality, if only someone could advise me of where I need to
make
> the changes and how the whole malarky with the the .XS file is supposed
to
> work
>
> Regards
>
> Martin. Frustrated of Munich.
>
Hi Martin,

We should keep this on the list...

I think there may be a way to add better support for these extended types
to the
perl mod...to the extent there is support in the core package...

however, if you use 'UseSprintVal' option in the perl mod...doesn't this
format
the output appropriately. Wes referred me to the load avg. mib in the agent
now
as an example.

[EMAIL PROTECTED] ~]$ perl -MSNMP -e '$sess=new
SNMP::Session(UseSprintValue=>1,Version=>1,Community=>"public");
$val=$sess->get("laLoadFloat.1");print "$SNMP::MIB{laLoadFloat}{syntax},
$SNMP::MIB{laLoadFloat}{type}, $SNMP::MIB{laLoadFloat}{textualConvention}:
$val\n";'
Float, OPAQUE, Float: 0.240000
[EMAIL PROTECTED] ~]$ snmpget -v 1 -c public localhost 'laLoadFloat.1'
UCD-SNMP-MIB::laLoadFloat.1 = Opaque: Float: 0.270000

looks good here...will this work for you?

let me know some specific of what you think the perl mod sold be doing
different
here.

-G




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to