Re: Unsigned long long to conter64

2011-03-11 Thread Dave Shield
On 11 March 2011 05:16, sujata patra sujata_patra2...@yahoo.com wrote:
 I have an unsigned long long data , which need to be assigned to counter64.
 I can assign that using high part and low part.

That's the correct approach, yes.


 The problem is size, as well as endian ness. While conversion do I have to
 check ENDIAN(BIG ENDIAN)  ness also ?

You need to ensure that the upper 32-bits are assigned to the 'high' field
(in the native byte ordering),  and the lower 32-bits are assigned to the
'low' field.   This is typically done by a 32-bit right-shift, and masking
against 0x respectively.


 In addition what will happen over the net, If the master agent is on Big
 ENDIAN box and sub-agent is in Little Endian?

The library takes care of converting between native and network byte
ordering.   You don't need to worry about this.

Dave

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: [PATCH 0/4] ip-forward-mib performance improvements

2011-03-11 Thread Robert Story
On Mon, 28 Feb 2011 12:37:17 -0800 Stephen wrote:
SH These patches fix the problems with walking the forwarding mib when a
SH router has full BGP feed.

Excellent! I'm glad someone finally had the time to fix this.

The first 3 patches are no-brainers. I'll apply them shortly.

The netlink one is a bit problematic, in that it unconditionally replaces the
old code, and we need to support older systems which might not have netlink.
Is there some header/constant we can check for that will indicate whether or
not we can get the route table via netlink?


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: CFV: TZ offset handling

2011-03-11 Thread Robert Story
On Wed, 9 Mar 2011 11:20:36 + Dave wrote:
DS Unfortunately, our code (in snmplib/snmp-tc.c:date_n_time())
DS treats them as equivalent, and hence gets the wrong answer
DS when using the tm_gmtoff form.
DS 
DS The fix (attached) is clearly trivial, and I'd like to include this
DS in 5.5.1   (although it's not strictly a show-stopper).

+1

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: CFV: 5.5.1 release

2011-03-11 Thread Robert Story
On Wed, 9 Mar 2011 11:20:43 + Dave wrote:
DS It doesn't really seem worth spinning another RC release
DS just for these two changes.   How would people feel about
DS me going straight to the final 5.5.1 release?

fine with me.

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: CFV: TZ offset handling

2011-03-11 Thread Thomas Anders
Dave Shield wrote:
 The fix (attached) is clearly trivial, and I'd like to include this
 in 5.5.1   (although it's not strictly a show-stopper).

+1


Thomas

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: CFV: 5.5.1 release

2011-03-11 Thread Bart Van Assche
On Thu, Mar 10, 2011 at 10:11 PM, Dave Shield d.t.shi...@liverpool.ac.ukwrote:

 On 10 March 2011 20:17, Bart Van Assche bvanass...@acm.org wrote:
  You might have missed this patch, reporting a bug in 5.5, 5.6 and trunk:
 
 https://sourceforge.net/tracker/?func=detailatid=312694aid=3203806group_id=12694
 .


 Correct - I hadn't spotted that.
 I'll have a proper look at it in the morning.

 Question:
   Is this
  a)a sufficiently significant problem,
 and/or
  b)a sufficiently trivial fix

 to warrent including in 5.5.1 at this late stage?


To answer your questions: that patch (already applied on trunk and 5.6
branch) contains a fix for a potential memory corruption problem. This issue
only affects those users that use a large number of file descriptors (more
than FD_SETSIZE).

Bart.
--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: [PATCH 0/4] ip-forward-mib performance improvements

2011-03-11 Thread Stephen Hemminger
On Fri, 11 Mar 2011 08:46:51 -0500
Robert Story rst...@freesnmp.com wrote:

 On Mon, 28 Feb 2011 12:37:17 -0800 Stephen wrote:
 SH These patches fix the problems with walking the forwarding mib when a
 SH router has full BGP feed.
 
 Excellent! I'm glad someone finally had the time to fix this.
 
 The first 3 patches are no-brainers. I'll apply them shortly.
 
 The netlink one is a bit problematic, in that it unconditionally replaces the
 old code, and we need to support older systems which might not have netlink.
 Is there some header/constant we can check for that will indicate whether or
 not we can get the route table via netlink?

I don't think keeping old code is necessary since netlink has been around
since linux 2.2 (1999) and netlink is already used in if-mib and etherlike-mib.


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: real time neighbour table updates

2011-03-11 Thread Bart Van Assche
 2011/3/4 Wes Hardaker harda...@users.sourceforge.net

  On Tue, 01 Mar 2011 07:54:10 +0200, Timo Teräs timo.te...@iki.fi
 said:

 TT What's the usual time frame for getting patches reviewed and committed?
 TT Could someone take a look at this?

 It's actually on my todo list to go review the patches.  They're always
 reviewed before the next release, and I (and others) try to do them
 frequently but it depends on our real work life as to when we get to
 them.  The important thing is that because they're in the tracker we
 can't forget about them, so you put it in the right place!

 [and I got better for a bit about reviewing more regularly, but you hit
 me during a particularly busy time; I should have time next week to review]


As you can see on the tracker I've had a look at this patch. I stopped
however because I'm not convinced that the introduction of the new flag
NETSNMP_CACHE_AUTO_SYNCHRONIZED is justified.

See also
http://sourceforge.net/tracker/?func=detailaid=3123596group_id=12694atid=312694
.

Bart.
--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: [PATCH 0/4] ip-forward-mib performance improvements

2011-03-11 Thread Stephen Hemminger
On Fri, 11 Mar 2011 08:46:51 -0500
Robert Story rst...@freesnmp.com wrote:

 On Mon, 28 Feb 2011 12:37:17 -0800 Stephen wrote:
 SH These patches fix the problems with walking the forwarding mib when a
 SH router has full BGP feed.
 
 Excellent! I'm glad someone finally had the time to fix this.
 
 The first 3 patches are no-brainers. I'll apply them shortly.
 
 The netlink one is a bit problematic, in that it unconditionally replaces the
 old code, and we need to support older systems which might not have netlink.
 Is there some header/constant we can check for that will indicate whether or
 not we can get the route table via netlink?

There are 3 more small performance improvements I put in patch database.
  1. Use realloc when growing container

  2. Replace data_size with constant

  3. Reorder comparisions in sort


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: [PATCH 0/4] ip-forward-mib performance improvements

2011-03-11 Thread Bart Van Assche
On Fri, Mar 11, 2011 at 6:42 PM, Stephen Hemminger shemmin...@vyatta.comwrote:

 On Fri, 11 Mar 2011 08:46:51 -0500
 Robert Story rst...@freesnmp.com wrote:

  On Mon, 28 Feb 2011 12:37:17 -0800 Stephen wrote:
  SH These patches fix the problems with walking the forwarding mib when a
  SH router has full BGP feed.
 
  Excellent! I'm glad someone finally had the time to fix this.
 
  The first 3 patches are no-brainers. I'll apply them shortly.
 
  The netlink one is a bit problematic, in that it unconditionally replaces
 the
  old code, and we need to support older systems which might not have
 netlink.
  Is there some header/constant we can check for that will indicate whether
 or
  not we can get the route table via netlink?

 There are 3 more small performance improvements I put in patch database.
  1. Use realloc when growing container

  2. Replace data_size with constant

  3. Reorder comparisons in sort


Does number (3) refer to patch #3195537 ? That patch has already been
applied as r20077.

Bart.
--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: [PATCH 0/4] ip-forward-mib performance improvements

2011-03-11 Thread Stephen Hemminger
On Fri, 11 Mar 2011 18:46:56 +0100
Bart Van Assche bvanass...@acm.org wrote:

 On Fri, Mar 11, 2011 at 6:42 PM, Stephen Hemminger 
 shemmin...@vyatta.comwrote:
 
  On Fri, 11 Mar 2011 08:46:51 -0500
  Robert Story rst...@freesnmp.com wrote:
 
   On Mon, 28 Feb 2011 12:37:17 -0800 Stephen wrote:
   SH These patches fix the problems with walking the forwarding mib when a
   SH router has full BGP feed.
  
   Excellent! I'm glad someone finally had the time to fix this.
  
   The first 3 patches are no-brainers. I'll apply them shortly.
  
   The netlink one is a bit problematic, in that it unconditionally replaces
  the
   old code, and we need to support older systems which might not have
  netlink.
   Is there some header/constant we can check for that will indicate whether
  or
   not we can get the route table via netlink?
 
  There are 3 more small performance improvements I put in patch database.
   1. Use realloc when growing container
 
   2. Replace data_size with constant
 
   3. Reorder comparisons in sort
 
 
 Does number (3) refer to patch #3195537 ? That patch has already been
 applied as r20077.
 
 Bart.

yes.

-- 

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


mib2c: varbinds: enums

2011-03-11 Thread Eric Smith
I'm trying to access enums for varbinds and I end up with error saying
uninitialized value in hash element

Code:
@foreach $noti notifications@
  @foreach $varb varbinds@
 @if $varb.enums@
   (
   @foreach $vare $varv enum@
  varbing-enum$varv $vare
   @end@
   )
@end@
  @end@
@end@

Error:
Use of uninitialized value in hash element at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/SNMP.pm line
1366, GEN0 line 68263.

The @if $varb.enums@ executes successfully, but the enum values are not
printed out. Can someone help?

Eric
--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: mib2c: varbinds: enums

2011-03-11 Thread Bill Fenner
On Fri, Mar 11, 2011 at 5:05 PM, Eric Smith eri...@gmail.com wrote:
 I'm trying to access enums for varbinds and I end up with error saying
 uninitialized value in hash element

 Code:
 @foreach $noti notifications@
   @foreach $varb varbinds@
  @if $varb.enums@
    (

Here's a horrible thing to suggest: here, try:
@perleval $currentvar = $varbind; 1;@

    @foreach $vare $varv enum@
   varbing-enum$varv $vare
    @end@
    )
     @end@
   @end@
 @end@

My suggestion completely relies on the internals of mib2c, which is
very likely to change (e.g., if this behavior gets fixed, obviously).

I think the problem is that nobody anticipated wanting to access enums
in the notification varbind context, so didn't use the same loop
variable as in the columns or scalars loops.

(Or, if you want to try a mib2c patch, off the top of my head, go find
this code in the foreach ... varbinds section:

  $return = do_a_loop($stash, \$vars{$var}, $varbind,
  \$currentvarbind, $varbind);

and turn it into

  $return = do_a_loop($stash, \$vars{$var}, $varbind,
  \$currentvarbind, $varbind,
  \$currentvar, $scalar);

(adding the 3rd line, and changing the ); to a , in the 2nd line).)

  Bill


 Error:
 Use of uninitialized value in hash element at
 /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/SNMP.pm line
 1366, GEN0 line 68263.

 The @if $varb.enums@ executes successfully, but the enum values are not
 printed out. Can someone help?

 Eric

 --
 Colocation vs. Managed Hosting
 A question and answer guide to determining the best fit
 for your organization - today and in the future.
 http://p.sf.net/sfu/internap-sfd2d
 ___
 Net-snmp-coders mailing list
 Net-snmp-coders@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/net-snmp-coders



--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders