Hi Dave,

The code I generated for ifXTable is by using the ucd-snmp style. 

Also, I gone through the code for ifXTable implementation in the repository. That code 
is generated using the new style i believe. not even in the format of net-snmp 5.1.1 
release.  am i right?

Also, I have taken this code from the repository and trying to compile which results 
in so many errors. These errors should be coz of missing some extra files needed for 
this or someother. That is why i skipped taking the code from the repository and write 
the implementation on my own.

Now, I implemented the code for ifXTable using the ucd-snmp stlye and only problem 
which I have for the counter64 variables. when i try to debug the problem, it is 
coming inside the appropriate case statement and storing the values properly ( I 
printed the "ret_val" variable in the below code) . After the method returns to the 
calling place, there is some problem.

here is the exact code which I put inside this var_ifXTable using counter64 structure.

var_ifXTable(....)
{
    char *ret_val;
    unsigned long long uu_long;
    struct counter64 c64;

    switch (vp->magic)
    {
       ....................
       ....................

       case IFHCINOCTETS:

        ret_val = (char *) calloc(1, 21);

        /* to store the value in c64 structure*/
        c64.high = 0;
        c64.low = 1;

        /* convert the structure into unsigned long long */
        uu_long = c64.high;
        uu_long = uu_long << 32;
        uu_long = uu_long | c64.low;

         /* storing it in a string format */
        sprintf(ret_val, "%lld", uu_long);

        /* return statement expecting string format */
        return (u_char *) ret_val;


       ....................
       ....................
    }
}

can you suggest me the above way is correct or do we need to handle it in different 
way?


Thanks & Regards,
Karthik





----- Original Message -----
From: Dave Shield <[EMAIL PROTECTED]>
Date: Wed, 14 Jul 2004 10:36:04 +0100
To: "Karthikeyan N" <[EMAIL PROTECTED]>
Subject: Re: Counter64 objects retrieval 

> 
> > Currently , I am trying to implement the counter64 objects in ifXTable
> 
> Just to check - you do know that there is already an implementation
> of the ifXTable in the current CVS code ?
> (It's part of a long-overdue re-working of the whole IF-MIB code)
> 
> 
> > Inside the IFHCINOCTETS case statement I retrieved the value through
> > ioctl calls and storing the value in "unsigned long long" type in linux
> 
> Also note that Counter64 values should be stored as a "struct counter64"
> variable.
> 
> But you're probably much better off looking at the existing
> implementation, rather than trying to duplicate this yourself.
> 
> Dave
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by Black Hat Briefings & Training.
> Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
> digital self defense, top technical experts, no vendor pitches, 
> unmatched networking opportunities. Visit www.blackhat.com
> _______________________________________________
> Net-snmp-coders mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

-- 
______________________________________________
IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com 
Check out our value-added Premium features, such as an extra 20MB for mail storage, 
POP3, e-mail forwarding, and ads-free mailboxes!

Powered by Outblaze


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to