Hi Greeting:

        I found the way to change the returning value if some object is not in 
one device.
        #####
            case IFINUCASTPKTS:
        {
            long_return = (u_long) ifnet.if_ipackets;
#if STRUCT_IFNET_HAS_IF_IMCASTS
            long_return -= (u_long) ifnet.if_imcasts;
#endif
        }
        return (u_char *) & long_return;
    case IFINNUCASTPKTS:
#if STRUCT_IFNET_HAS_IF_IMCASTS
        long_return = (u_long) ifnet.if_imcasts;
#else
#if 0  <=============================
#if NO_DUMMY_VALUES
        return NULL;
#endif <=============================

#endif
        long_return = (u_long) 0;       /* XXX */
#endif
        return (u_char *) & long_return;


-Jim
-----Original Message-----
From: Jim Su [mailto:[EMAIL PROTECTED]
Sent: Monday, December 12, 2005 11:39 AM
To: Net-Snmp-Users
Subject: change the return value in V1 interface counter

Hi Greeting:

    I try to add support to return the Linux interface counter from my agent. 
The Net-Snmp version is 5.1.2. I've received the suggestion to upgrade to 5.2.2 
which has the implementation of ifXTable for Linux interface. I tried to move 
my agent to 5.2.2. For some reason the agent crashed. I can't upgrade to 5.2.2 
for a while even I resolve the crash problem because some other front end 
application (written by other developer) will have too much change if the 
Net-SNMP version is upgraded. So I have to find a work around with the current 
version - 5.1.2.
    I was suggested to try to modify the source code in NET-SNMP 5.1.2 in the 
V1 handling of interface to return 0 for the unknown object (the counters not 
found in the device) so the polling to the interface ifindex won't be aborted 
just for one single unknown counter. Is this feasible? It seems the interface 
implementation in V1 the entire polling is failed and dropped if one of the 
counter is not found even all the other are found. Is this true? Which file to 
be modified if I want to change the return of the unknown counter (e.g. the 
ifInNUcastPkts) with value 0 so the rest successful polling counters can be 
returned?
    Thanks in advance for any pointer.

Thanks,
-Jim

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 2005/12/9

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 2005/12/9
 

Reply via email to