HI,
I'm Rok. I'm a beginner to snmp.
I have some problems to develop snmp agent.
 
What I to do is to modify receive() function in snmpd.c for my own operation.
I should get all the get/set messages from nms, and parse those, and response.
I had read some mails referring to this subject.. but I can't still solve the problem.
 
-- OS : Sun Solaris 5.8
 

1. Can I use snmp agent in my own program?
   if so, could you tell me the all the included files list ?(eg. header files, libararies, functions)
 

I can see below codes in receive() function (in snmpd.c)
 
  ------------------------------------------------------
   for (i = 0; i < external_readfdlen; i++)
  {
            FD_SET(external_readfd[i], &readfds);
            if (external_readfd[i] >= numfds)
                numfds = external_readfd[i] + 1;
  }
  ------------------------------------------------------
 
what can I use the first argument of FD_SET(external_readfd)?
external_readfd are defined in agent_registry.h as below line
 
 extern int      external_readfd[NUM_EXTERNAL_FDS],   external_readfdlen;
 extern void     (*external_readfdfunc[NUM_EXTERNAL_FDS])   (int, void *);
 
2. should I define the value of "external_readfdlen" ?
3. "external_readfdfunc" is the callback function that receive the Get/Set message?
4. if so, How can I defint "external_readfdfunc"( what is the first/second arguments?)
 

If snmpd receives Get/Set message from nms, it responses the message automatically.
I think snmpd parse the asn.1 packet and make response PDU, and send it to nms. Is it right?
If nms send some request PDUs which could be parsed automatically, shoud I parse and encode it?
(eg. if the message should be parsed only between nms and snmp agent)
 
Somebody advised me that I should use ASN.1 parser/encoder such as "snacc" to solve this problem.
Should I install "snacc"?
 
5. If I make snmp-agent embeded in my program, should I make a ~.conf file(like snmpd.conf)?
 
I have to make snmp-agent as fast as I can.
If you answer the questions, that will great helpful for me.
 
And I'm sorry I wrote too many questions.
Thank you.

Reply via email to