> I got some problem after running the make :
> the scanner-smi.c failed on the line 149 : undefined symbol: parser.
> This error is general on all the scanner-smi.c.
I could not reconstruct this problem. Probably, for any reason, the
scanner that your flex has generated (scanner-smi.c) has not the right
signature for smilex(). It should be:
int smilex (YYSTYPE *lvalp, void *parser)
I am using
$ flex --version
flex version 2.5.4
Alternatively, you could ensure that you use the scanner (and parser)
C files that are included with the libsmi distribution.
--
!! This message is brought to you via the `libsmi' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <libsmi-request(a)ibr.cs.tu-bs.de>.
!! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.
Libsmi 0.2 is available for download.
Copyright (c) 1999,2000 Frank Strauss, Technical University of Braunschweig.
Libsmi is a C library that allows network management applications to
access SMI MIB module information through a well defined API that
hides the nasty details of locating and parsing SMIv1/v2 MIB modules.
Libsmi supports exact and iterative retrieval functions for all major
SMIv1 and SMIv2 constructs.
The layered concept of libsmi allows to add further methods to
retrieve MIB information from persistent repositories. In fact,
besides the SMIv1/v2 MIB file parser an additional parser for `SMIng',
a new structure of management information elaborated by the Network
Management Research Group of the IRTF, is included. Both parsers are
built on flex/bison grammar specifications.
There are three tools on top of the library and a sh/awk-script:
Smiquery allows simple queries for single MIB module items. Smilint
allows to increase the verbosity of the parser(s), so that MIB module
files can be checked for syntax and semantic errors. Smidump can be
used to dump MIB modules in various formats. The current output
backends allow to dump trees of OIDs, type definitions and recursive
imports, to convert modules between SMIv1, SMIv2 and SMIng, to produce
JIDM compliant CORBA-IDL files, UCD-SNMP code stubs and MOSY style
output. Finally, smistrip allows to strip SMIv1/v2 modules from
documents like RFCs and Internet-Drafts.
Enclosed with the libsmi package, there are all (bug fixed) current
IETF standard MIB modules, as well as some other modules, man pages
for all library functions and tools, the current SMIng specification
and a libsmi test suite.
The software comes with automake/autoconf and libtool support. Hence
it should compile and build with or without shared libraries on most
UNIX style platforms, as well as on W32/cygwin, though it's just
developed on Sun Solaris 2.5.x and Linux.
For those familiar with recent libsmi development: The API has changed
significantly to allow much more efficient lookups during runtime.
This means you have to adjust your applications when you skip from
libsmi 0.1.x to 0.2.
Online information on libsmi together with download and CVS access
information, the (free) license terms, manual pages, and a mailing
list is available at:
http://www.ibr.cs.tu-bs.de/projects/libsmi/
Information on the SMIng project is available at:
http://www.ibr.cs.tu-bs.de/projects/sming/
Enjoy!
Frank Strauss <strauss(a)ibr.cs.tu-bs.de>
--
!! This message is brought to you via the `libsmi' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <libsmi-request(a)ibr.cs.tu-bs.de>.
!! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.
Hi Juergen and others,
As you recall I am working on an snmp-agent back-end that generates
"c" files for the agent. (similar to the idea of -f ucd-c).
So far, accessing the internal data structures and using the compiler
api is working very well. Thanks again for the excellent work.
Now to the question: I would like to add some code to support tabular
objects. For this I need the index information. Specifically I need
the index oid-length.
For example, if the index is (from rfc1213 below) "ipAdEntAddr", the
index oid-length is 4 because it is an IpAddress type.
j:/libsmi-0.1.8/mibs/ietf/RFC-1213:932
================<< start quote ============================
ipAddrEntry OBJECT-TYPE
SYNTAX IpAddrEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"The addressing information for one of this
entity's IP addresses."
INDEX { ipAdEntAddr }
::= { ipAddrTable 1 }
IpAddrEntry ::=
SEQUENCE {
ipAdEntAddr
IpAddress,
ipAdEntIfIndex
INTEGER,
ipAdEntNetMask
IpAddress,
ipAdEntBcastAddr
INTEGER,
ipAdEntReasmMaxSize
INTEGER (0..65535)
}
ipAdEntAddr OBJECT-TYPE
SYNTAX IpAddress
ACCESS read-only
STATUS mandatory
DESCRIPTION
"The IP address to which this entry's addressing
information pertains."
::= { ipAddrEntry 1 }
================== end quote >>==============================
I know I can walk the lost of the index components by
================<< start quote ============================
for (j = 0, smiListItem = smiGetFirstListItem(smiNode); smiListItem;
j++, smiListItem = smiGetNextListItem(smiListItem)) {
if (j) {
print(", ");
}
printWrapped(INDENTVALUE + 1, smiListItem->name);
/* TODO: non-local name if non-local */
} /* TODO: empty? -> print error */
print(");\n");
} /* TODO: else print error */
================== end quote >>==============================
But I would like to find the type of each index variable
to determine the total oid-length of a given index.
Is there a way to get and sminode by it name. Something like:
SmiNode = smiGetNodeByName(ipAdEntAddr);
Thanks,
--
- Yigal
--
!! This message is brought to you via the `libsmi' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <libsmi-request(a)ibr.cs.tu-bs.de>.
!! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.