|
net snmp agent invokes delayed handler multiple times for a single query: msg#00320network.net-snmp.user
Hello, I have implemented a mib module in which the handler sets the delegated flag for an incoming snmp request to 1, sends the request using a socket to another process and registers the read socket using register_readfd. The response takes around 10 seconds to arrive, which is then handled by the function registered in register_readfd. I have noticed that when a query for a single object is made using snmpget or snmpgetnext, the handler is invoked more then once (usually twice) and hence the remote process ends up serving 2 identical requests instead of one. What could be causing the handler to be invoked more than once? The code in the handler is as follows: typedef struct { int mode; char oidname[100]; oid name[10]; int value; } server_struct; int delayed_instance_handler(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { char* oidname = (char*)malloc(100); server_struct clst; DEBUGMSGTL(("delayed_instance", "Got request, mode = %d:\n", reqinfo->mode)); switch (reqinfo->mode) { default: requests->delegated = 1; netsnmp_delegated_cache *cache = netsnmp_create_delegated_cache(handler, reginfo, reqinfo, requests, NULL); snprint_objid (oidname, 100, requests->requestvb->name, requests->requestvb->name_length); clst.mode = reqinfo->mode; strcpy(clst.oidname, oidname); /* send data */ rc = sendto(sd, &clst, sizeof(clst), 0, (struct sockaddr *) &remoteServAddr, sizeof(remoteServAddr)); register_readfd(rd, funct, (void*)cache); } return SNMP_ERR_NOERROR; } Thanks, Mayur. ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Net-snmp-users mailing list Net-snmp-users@xxxxxxxxxxxxxxxxxxxxx Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Is net-snmp AgentX considered production ready?: 00320, Robert Story |
|---|---|
| Next by Date: | Re: SNMP listening ports: 00320, Niels Baggesen |
| Previous by Thread: | Is net-snmp AgentX considered production ready?i: 00320, Andreas Vinsander |
| Next by Thread: | Clarification on the types of the objects in an SNMP TRAP: 00320, Kurapati M-G19456 |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |