[ First - *please* don't mail me privately, without copying
     any responses to the mailing list.  I don't have the time
     or inclination to offer private, unpaid, SNMP consultancy.
     Keep discussions to the list, where others can both learn
     and offer advice.  Thanks.   ]



2009/3/25 Jeffrey Cao <jcao.li...@gmail.com>:
> On Tue, Mar 24, 2009 at 03:47:32PM +0000, Dave Shield wrote:
>> 2009/3/23 Jeffrey Cao <jcao.li...@gmail.com>:
>> > Another similar question is: if I want put my implement functions in 
>> > several
>> > C source file, rather than just one big C file mymibs.c, how can I do this?
>>
>>
>>   $ configure --with-mib-modules=myMIB1,myMIB2,myMIB3,....
>>
>> This is done widely within the standard agent.
>> Have a look at the code there for various approaches.
>> (Including how to have "--with-mib-modules=myMIB"
>>   automatically pull in the consituent parts)
>>
>> Dave
>
> Thank you Dave.
> But for the second question, I do not mean multi modules. I mean multi C 
> source files.

Yes - that's right.
The configure system implicity assumes that all C source files are MIB modules,
but it doesn't actually care.   You can include any additional code
files that you
require in this way.

   Look at the current code.   There are many examples of utility routines,
separate config processing, and other code files that aren't strictly
MIB modules.   But they will all be included within the agent in the same
way - via "--with-mib-modules"  (either directly or indirectly)


> I compiled one module for net-snmp v5, and several C and H files produced 
> like:
> myMIB_access.c
> myMIB_access.h
> myMIB.c
> myMIB.h
> myMIB_checkfuns.c
> myMIB_checkfuns.h
> myMIB_checkfuns_local.c
> myMIB_checkfuns_local.h
> myMIB_columns.h
> myMIB_enums.h
>
> So, If I run "./configure --with-mib-modules=myMIB", only myMIB.c will be
> compiled into the agent.

Not necessarily.  It depends what is in the file myMIB.h
As I said yesterday:

>> Have a look at the code there for various approaches.
>> (Including how to have "--with-mib-modules=myMIB"
>>   automatically pull in the consituent parts)

Please note that last sentence!  :-)

>                                            Of course I can do
> "./configure --with-mib-modules=myMIB,myMIB_access,..."
> But those C files actually not modules. Moreover, sometimes if some tables
> are complex, and I want to add some supporting functions in another C files
> rather than the module C file. I need some means to compile my new-added C
> files into the agent.

All of that is possible - see above.

In particular, please look at the header file
      agent/mibgroup/mibII/ipCidrRouteTable.h

It's probably not included in the agent any more,
but it does illustrate *exactly* how to handle the
framework you list above.

Dave

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to