Freenode?
Are there any thoughts about the #net-snmp channel and Freenode, which seems to be in quite an upheaval, with larger projects abandoning it for Libera.Chat, started by the wave of resigning freenode admins. Ref: https://lwn.net/Articles/856543/ For reasons nobody can remember, I (SJFriedl) am still a channel op on Freenode's #net-snmp, though I haven't done significant Net SNMP work in quite some time. I have "reserved" the #net-snmp channel on Libera.Chat but none of this is mine; have the powers that be thought about what to do with IRC? I don't have a strong opinion one way or another. Steve --- Steve Friedl // Software & Network Security Consultant // 714-345-4571 st...@unixwiz.net // Southern California USA // I speak for me only ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
RE: Summary of meeting between NET-SNMP devs and ICEI
Wow, these are names from the past; I find it hard to believe there is any legitimate need to support these going forward. Steve - who's ported to almost all of those platforms -Original Message- From: Eric S. Raymond [mailto:e...@thyrsus.com] Sent: Wednesday, April 25, 2018 8:25 PM To: Bart Van AsscheCc: Susan Sons ; net-snmp-coders@lists.sourceforge.net; Robert Story Subject: Re: Summary of meeting between NET-SNMP devs and ICEI Bart Van Assche : > Which of the following files under include/net-snmp/system do you > think are still relevant today? No changes other than trivial changes > have been made to these files in the past ten years: > > dynix.h irix.h osf5.h svr5.h ultrix.h LOL. I've seen this movie before. It's very common in codebases of this age and size range. Nuke them from orbit, sez I. -- http://www.catb.org/~esr/;>Eric S. Raymond My work is funded by the Internet Civil Engineering Institute: https://icei.org Please visit their site and donate: the civilization you save might be your own. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
RE: C99 (was: Re: Fix patch for SF bug 2833)
net-snmp is expected to build on Windows, which gpsd does not; it's not clear how much this impacts compiler choice. -Original Message- From: Eric S. Raymond [mailto:e...@thyrsus.com] Sent: Thursday, March 22, 2018 10:32 AM To: Bill FennerCc: Net-SNMP Coders Subject: C99 (was: Re: Fix patch for SF bug 2833) Bill Fenner : > On Thu, Mar 22, 2018 at 9:16 AM, Eric S. Raymond wrote: > > > On the other hand, I question whether the extra overhead is a real > > issue in 2018. > > > I have the same question, but know that I have no useful opinion here > - my "embedded system" ships with 4 gigs minimum, but the project has > more use cases than mine. Bart's objection about changing the public ABI is a showstopper and I wihdraw the suggestion. On the other hand... >For example, the project did decide to back off from introducing c99 constructs. *This* is an issue about which I know something important that does not seem to have percolated into general knowledge yet. I lead the GPSD project, a daemon for handling GPSes and other geolocation sources. It's deployed *everywhere* - smartphones, driverless cars, marine navigation systems, main battle tanks, drones and UAVs, first-responder comm gear, you name it. If GPSD makes an assumption that breaks any Unix build chain or portability anywhere, I get a complaint right quick. I've fielded dozens of these. Maybe the weirdest one was due to actual signed chars on a 360 mainframe. There came a point at which I got tired of seeing legacy ifdefs from ancient big iron in my codebase. Thought about my options, decided to move to assuming C99 and SuSv2. I shipped a point release on this premise expecting at least some minor pushback from some odd legacy environment. I heard not a peep, and never have since. And this was in 2009. If that's not enough, since 2015 I have led the NTPsec project. Based on GPSD experience we made the same decision to assume a C99/SuSv2 base. With no problems whatsoever except that on old versions of MacOS one of the time primitives is broken. That's how I learned that the standards people won. Our traditional twitchiness about tossing out any portability shim back to the year zero is obsolete. And bear in mind that GPSD/NTPsec probably exercises a wider swathe of the host API than snmpd does, so the test has been more stringent. GPSD has to get deep into odd corners of the tty driver and kernel PPS; NTPsec gets even further into system clock handling. I can say with confidence that assuming C99 is *very* safe in 2018. -- http://www.catb.org/~esr/;>Eric S. Raymond My work is funded by the Internet Civil Engineering Institute: https://icei.org Please visit their site and donate: the civilization you save might be your own. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
RE: Access the SNMP Counters without increasing them
You probably can’t; these stats are maintained within the SNMP agent in a static array (defined in snmplib/snmp_api.c, and there’s no programmatic access to it other than through the agent interface that’s going to increment the counters. From: Gustav Evertsson [mailto:m...@guzzzt.com] Sent: Thursday, May 02, 2013 11:49 PM To: Tim Cox Cc: net-snmp-coders@lists.sourceforge.net Subject: Re: Access the SNMP Counters without increasing them Thank you very much for the help. My main issue is not to send the data to the GUI, the problem is to get it out of the net-snmp library. The find your data part in your suggestion. How do I read snmpInPkts, snmpOutPkts etc out of the library from C function calls? /Gustav On Thu, 2 May 2013 23:44:26 +0200 Tim Cox timmiles...@gmx.ch wrote: It really depends on being able to see your agent's data from a program which is not itself SNMP and using sockets which are not SNMP's sockets I'm assuming you are talking about two different machines, one containing an agent and the other a manager You want to interrogate data which is in the SNMP agent's space without actually being that agent. If you are talking about an embedded system with a flat global address space, this is easy. Otherwise you may find it best to include your piece of enquiry code in your agent It doesn't sound important to me at all, but this is how you do it you don't use SNMP's sockets. You use one of the other 6 available socket addresses on the target system It will be easiest if your new piece of code is a thread of the agent #include sys/socket.h #include netinet/in.h #include errno.h static struct sockaddr_in here = { AF_INET, HTONS(A_NICE_PORT_NUMBER_MAYBE_44004) } ; static struct sockaddr_in there = { AF_INET } ; static int sixteen = 16; void listener() { int s = socket(AF_INET, SOCK_DGRAM); int x = bind(s, (struct sockaddr *) here, 16); char data[DATA]; if (s 0) printf(yon's mingin\n); else { if (x 0) printf(yon's awfu\n); else { for (;;) { x = recvfrom(s, data, DATA, 0, (struct sockaddr *) there, sixteen); if (x 0) break / find your data and format your response / x = send(s, data, HOWEVER_LONG_YOUR_RESPONSE_IS, 0, (struct sockaddr *) there, 16); } printf(listener stopped %d\n, errno); } } } and you need something in your GUI program to call this listener. Decide for yourself if it should block on response. I don't advise it. But I don't advise you to make this feature of your application so important in the first place #include sys/socket.h #include netinet/in.h #include errno.h int requestor(char *data) { static struct sockaddr_in there = { AF_INET, HTONS(A_NICE_PORT_NUMBER_MAYBE_44004), { REMOTE_NETWORK_ADDRESS } } ; static struct sockaddr_in here = { AF_INET } ; static int sixteen = 16; static int s = -1; int x; if (s 0) { s = socket(AF_INET, SOCK_DGRAM); if (s 0) return -1; x = bind(s, (struct sockaddr *) here, 16); if (x 0) { s = -1; return -2 } } x = sendto(s, data, sizeof(enquiry), 0, (struct sockaddr *) there, 16); of (x 0) return -3; x = recvfrom(s, data, MAXIMUM, 0, (struct sockaddr *), there, sixteen); if (x 0) return -4; return x; } Am 02.05.2013 um 08:39 schrieb Gustav Evertsson: Can you describe the socket method a bit more? I have tested to implement it with these calls, but that will increase the counters: snmp_sess_init( session ); session.peername = 127.0.0.1; SOCK_STARTUP; ss = snmp_open(session); snmp_synch_response(ss, pdu, response); snmp_close(ss); SOCK_CLEANUP; /Gustav On Tue, 30 Apr 2013 15:44:56 +0200 (CEST) Tim Cox timmiles...@gmx.ch wrote: If this is really so important access the MIB variables from a socket program or decrement the send and receive counts by 1 between acquiring and displaying (you need a running count of course)Gesendet: Dienstag, 30. April 2013 um 15:35 Uhr Von: Gustav Evertsson m...@guzzzt.com An: Tim Cox timmiles...@gmx.ch Cc: net-snmp-coders@lists.sourceforge.net Betreff: Re: Access the SNMP Counters without increasing them Yes, the problem is that they are increased when read from the GUI. They should only be increased when read from SNMP. When the user opens the GUI it is not visible that the counters comes from the SNMP interface and it therefore looks strange to the user. I could inform them that the request goes over
RE: tcpdump for snmp packets
What does not work mean? From: Ravi Kumar [mailto:mynets...@gmail.com] Sent: Monday, October 17, 2011 5:07 AM To: net-snmp-coders Subject: tcpdump for snmp packets Hi All, Can any one tell me how can i filter snmp packets using tcpdump ? Following command does not work from me. tcpdump -i eth1 -T snmp (src port 161 or 162) -w test.log Thanks. -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
RE: RFV: Disk calculation overflow
No, the variable it's dividing is long long - the missing dot was an error in posting the patch (though I did all the testing with the right way). Changing it from 100 to 100.0 would be a great plan. Steve -Original Message- From: Dave Shield [mailto:d.t.shi...@liverpool.ac.uk] Sent: Thursday, September 22, 2011 2:20 PM To: Niels Baggesen Cc: Net-SNMP coders Subject: Re: RFV: Disk calculation overflow On 22 September 2011 22:05, Niels Baggesen n...@users.sourceforge.net wrote: Den 22-09-2011 11:15, Dave Shield skrev: I've therefore applied a version of Steve's patch (using local float variables rather than casts) to the 5.6, 5.7 and master code lines. It seems that you lost the period that made the 100 into a float :-( But the variable that it's dividing is a float anyway, so does that matter? If it does, then perhaps it would be clearer to use '100.0' rather than '100.' Dave -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
RE: RFV: Disk calculation overflow
Then that's not what I based my patch on - somebody else snuck in those floats. I tested on rc1, which I thought was current at the time (or at least was the latest tarball at the time). My code, which I tested quite a bit, is: static int _percent( unsigned long long value, unsigned long long total ) { /* avoid division by zero */ if (total == 0) return 0; float pct = (value * 100.) / total; pct += 0.5; /* rounding */ return (int) pct; } Steve -Original Message- From: Dave Shield [mailto:d.t.shi...@liverpool.ac.uk] Sent: Thursday, September 22, 2011 2:39 PM To: Niels Baggesen; Steve Friedl Cc: Net-SNMP coders Subject: Re: RFV: Disk calculation overflow On 22 September 2011 22:21, Steve Friedl st...@unixwiz.net wrote: No, the variable it's dividing is long long - the missing dot was an error in posting the patch (though I did all the testing with the right way). Errr... no. From the 5.7.1.rc3 tarball: static int _percent( unsigned long long value, unsigned long long total ) { float v=value, t=total, pct; /* avoid division by zero */ if (total == 0) return 0; pct = (v*100)/t; /* Calculate percentage using floating point arithmetic, to avoid overflow errors */ pct += 0.5; /* rounding */ return (int)pct; } 'v*100' is float times integer, so surely the result should be float, as required? Dave -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
RE: RFV: Disk calculation overflow
[is waiting for a patch] Submitted; #3409692 Steve -Original Message- From: Wes Hardaker [mailto:harda...@users.sourceforge.net] Sent: Wednesday, September 14, 2011 4:23 PM To: Steve Friedl Cc: 'Bart Van Assche'; 'Dave Shield'; 'Net-SNMP coders' Subject: Re: RFV: Disk calculation overflow On Fri, 2 Sep 2011 10:48:55 -0700, Steve Friedl st...@unixwiz.net said: SF There are other floats in that MIB, and I'd imagine that any SF compiler that could handle unsigned long long could deal with a float. That's the really true part: with other floats already in the file, I agree it's probably safest to simply use a float. [is wating for a patch] -- Wes Hardaker Please mail all replies to net-snmp-coders@lists.sourceforge.net -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: IPv6
On Mon, Sep 12, 2011 at 03:42:38PM +0200, Martin Knappe wrote: I have a very general question for a start. It seems to me that IPv6 connectivity is not currently supported by net-snmp, is that correct? I was not able to: 1) set up the snmp-agent to listen on v6-addresses and respond to requests 2) send snmp traps with snmptrap or from within my own code with the C API Please, can someone confirm my observations or correct me if I'm wrong? You didn't show how you tried to do it, but it's certainly supported via snmpd. man snmpd shows that you can provide the listening address as: udp6:10161 listen on port 10161 on all IPv6 interfaces. I presume traps work likewise with ipv6. Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
RE: Which error code to choose?
Robert Story wrote: sorry for the delay, I took a little vacation. Hmmm, I don't remember +3 votes for any vacation - did I miss something? :-) -- Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
RE: unable to run snmpd as non-root user
What does unable mean? What happens when you try? -Original Message- From: Ravi Kumar [mailto:mynets...@gmail.com] Sent: Monday, March 28, 2011 9:22 AM To: net-snmp-coders Subject: unable to run snmpd as non-root user Hi, Could any one tell me why the snmpd does not run with sudo as given below. $ sudo /home/ravi/net-snmp-5.5/agent/snmpd -c /home/ravi/net-snmp-5.5/local/snmpd.conf,/var/net-snmp/snmpd.conf -C -u ravi I am trying to run snmpd as root with sudo command on 161 port and switch back to user ravi using -u option. User ravi is included in /etc/sudoers file. Thanks, Ravi -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
RE: unable to run snmpd as non-root user
Ok, well probably the next step is to turn on some debugging and/or look around at system logs. What else have you tried to try to figure this out yourself? If you run it *without* -u ravi does it make any difference? Could it be that it's not finding the libraries because sudo changes the path? What if you sudo bash and then run it directly that way? -Original Message- From: Ravi Kumar [mailto:mynets...@gmail.com] Sent: Monday, March 28, 2011 10:37 AM To: Steve Friedl Cc: net-snmp-coders Subject: Re: unable to run snmpd as non-root user snmpd quits. as soon as I execute it. On 3/28/11, Steve Friedl st...@unixwiz.net wrote: What does unable mean? What happens when you try? -Original Message- From: Ravi Kumar [mailto:mynets...@gmail.com] Sent: Monday, March 28, 2011 9:22 AM To: net-snmp-coders Subject: unable to run snmpd as non-root user Hi, Could any one tell me why the snmpd does not run with sudo as given below. $ sudo /home/ravi/net-snmp-5.5/agent/snmpd -c /home/ravi/net-snmp-5.5/local/snmpd.conf,/var/net-snmp/snmpd.conf -C -u ravi I am trying to run snmpd as root with sudo command on 161 port and switch back to user ravi using -u option. User ravi is included in /etc/sudoers file. Thanks, Ravi -- -- -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: unable to cross compile Internal Crypto Support
On Thu, Feb 10, 2011 at 09:12:11AM -0800, Wes Hardaker wrote: On Thu, 10 Feb 2011 16:56:39 +, Dave Shield d.t.shi...@liverpool.ac.uk said: DS Wes - is it worth trying to catch SIGQUIT, DS and handling this in a similar way to SIGINT. I don't think you can do that. It's certainly possible to catch SIGQUIT, but since this is how people generate a core dump for debugging, it would interfere with somebody trying to get an agent working (though certainly not the most common case). Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: unable to cross compile Internal Crypto Support
On Thu, Feb 10, 2011 at 11:12:45AM -0800, Wes Hardaker wrote: On Thu, 10 Feb 2011 17:23:41 +, Dave Shield d.t.shi...@liverpool.ac.uk said: DS Ctrl-\ DS gives the same output as using Ctrl-C to kill the agent. DS (using read_config as a convenient way of tracking DS shutdown processing)Without the patch, I get And what happens when we're stuck in an infinite loop and you hit Ctrl-\ then? It won't exit and we'll need to resort to ctrl-z, kill %1 instead. IMHO, the separation between the two is a good thing. Making them align gives less control to the user for getting out of a mess. I completely concur w/ Wes here. -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: SNMP in Quagga
On Tue, Nov 23, 2010 at 02:48:13PM +0100, Quagga Snmp wrote: Quagga itself does not support SNMP agent (server daemon) functionality but is able to connect to a SNMP agent using the SMUX protocol. I want that quagga support SNMP agent (daemon snmpd) without installing other software, I mean, if you install Quagga software in a PC, immediately you can send snmpget or snmpwalk to that PC and receive the answer. This is a bad idea if for no other reason that running Quagga's built-in SNMP daemon would prevent somebody from running the real one, perhaps with additional MIBs. I do understand the nice notion of having things all-in-one, but I believe it comes at too high a cost in lost modularity. Doing this via an SMUX plugin is really, really the right way to do this. Steve (who's done a Quagga SMUX plugin before) 2010/11/23 Dave Shield d.t.shi...@liverpool.ac.uk On 23 November 2010 12:09, Quagga Snmp quaggas...@gmail.com wrote: I´m working in a project of my university. The tarjet is to insert a snmp daemon in Quagga (routing suite). Is anyone working in this? I'm no expert on Quagga, but I believe it already has SNMP support (running as a SMUX subagent) See http://www.quagga.net/docs/docs-info.php#SEC143 Dave -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: SNMP in Quagga
On Tue, Nov 23, 2010 at 03:18:03PM +0100, Quagga Snmp wrote: But, with SMUX I need a intermediary, or not? I guess so, depending on what you mean. It's been a while since I worked on this, but if I recall correctly you'd need two things: * Stock snmpd, the same one that ships with the distro (assuming it's been compiled with SMUX support - I don't know if that's the default). This is installed and configured in the usual way. * SMUX agent piece that bolts directly onto Quagga. The config for snmpd identifies the SMUX agent and which part of the OID tree it serves up, and then standard SNMP queries to the daemon will serve up the proper answers, either from your SMUX agent or from other parts of the MIB tree supported by the agent. Is this not your understanding? Steve For example, I want to ask which is the value of ip_forward in PC(1) from PC(2). Thanks. 2010/11/23 Steve Friedl st...@unixwiz.net On Tue, Nov 23, 2010 at 02:48:13PM +0100, Quagga Snmp wrote: Quagga itself does not support SNMP agent (server daemon) functionality but is able to connect to a SNMP agent using the SMUX protocol. I want that quagga support SNMP agent (daemon snmpd) without installing other software, I mean, if you install Quagga software in a PC, immediately you can send snmpget or snmpwalk to that PC and receive the answer. This is a bad idea if for no other reason that running Quagga's built-in SNMP daemon would prevent somebody from running the real one, perhaps with additional MIBs. I do understand the nice notion of having things all-in-one, but I believe it comes at too high a cost in lost modularity. Doing this via an SMUX plugin is really, really the right way to do this. Steve (who's done a Quagga SMUX plugin before) 2010/11/23 Dave Shield d.t.shi...@liverpool.ac.uk On 23 November 2010 12:09, Quagga Snmp quaggas...@gmail.com wrote: I´m working in a project of my university. The tarjet is to insert a snmp daemon in Quagga (routing suite). Is anyone working in this? I'm no expert on Quagga, but I believe it already has SNMP support (running as a SMUX subagent) See http://www.quagga.net/docs/docs-info.php#SEC143 Dave -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: SNMP in Quagga
On Tue, Nov 23, 2010 at 04:29:31PM +0100, Quagga Snmp wrote: In this situation, in PC(1) is necessary to install two things: quagga AND stock snmpd. I understand what you say. I have to do this project to finish my university studies, if I wanted to do this, I ´d use your idea. Quagga is constructed in modules ( rip daemon, bgp daemon, etc...). In my project, I want the snmp daemon into quagga. I need install only one thing: quagga, and then I can obtein OID variables from another PC. I wish you understand me. I do understand you: you wish to install only one thing. And I have wishes too: that I were dating Heidi Klum and that I had as much money as Bill Gates. But they aren't likely. Trying to incorporate SNMPD into your own project seems like a really poor idea even though I see why you would want this. But I recommend that you take a different approach. You may decide someday that you really really do have to include snmpd with your project, but you do not have to make that decision now. Break the project into two parts. FIRST: do the SMUX interface with a separate install of SNMPD. You have to do this anyway in order to provide the functionality, so you may as well work on the part you cannot avoid. SECOND: if you really feel like you must package snmpd with quagga, then do that AFTER you have the SMUX functionality working. This way you spend your time working on the part you must have, and you might change your mind on the packaging part later. Good luck. Steve 2010/11/23 Steve Friedl st...@unixwiz.net On Tue, Nov 23, 2010 at 03:18:03PM +0100, Quagga Snmp wrote: But, with SMUX I need a intermediary, or not? I guess so, depending on what you mean. It's been a while since I worked on this, but if I recall correctly you'd need two things: * Stock snmpd, the same one that ships with the distro (assuming it's been compiled with SMUX support - I don't know if that's the default). This is installed and configured in the usual way. * SMUX agent piece that bolts directly onto Quagga. The config for snmpd identifies the SMUX agent and which part of the OID tree it serves up, and then standard SNMP queries to the daemon will serve up the proper answers, either from your SMUX agent or from other parts of the MIB tree supported by the agent. Is this not your understanding? Steve For example, I want to ask which is the value of ip_forward in PC(1) from PC(2). Thanks. 2010/11/23 Steve Friedl st...@unixwiz.net On Tue, Nov 23, 2010 at 02:48:13PM +0100, Quagga Snmp wrote: Quagga itself does not support SNMP agent (server daemon) functionality but is able to connect to a SNMP agent using the SMUX protocol. I want that quagga support SNMP agent (daemon snmpd) without installing other software, I mean, if you install Quagga software in a PC, immediately you can send snmpget or snmpwalk to that PC and receive the answer. This is a bad idea if for no other reason that running Quagga's built-in SNMP daemon would prevent somebody from running the real one, perhaps with additional MIBs. I do understand the nice notion of having things all-in-one, but I believe it comes at too high a cost in lost modularity. Doing this via an SMUX plugin is really, really the right way to do this. Steve (who's done a Quagga SMUX plugin before) 2010/11/23 Dave Shield d.t.shi...@liverpool.ac.uk On 23 November 2010 12:09, Quagga Snmp quaggas...@gmail.com wrote: I´m working in a project of my university. The tarjet is to insert a snmp daemon in Quagga (routing suite). Is anyone working in this? I'm no expert on Quagga, but I believe it already has SNMP support (running as a SMUX subagent) See http://www.quagga.net/docs/docs-info.php#SEC143 Dave -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net
Re: Strange behavior with SNMP walk.
On Wed, Sep 01, 2010 at 07:25:21PM +, Yehiel Samson wrote: There is a strange behavior with the SNMP walker, if I perform the following command: snmpwalk -One -v2c -c public IP 1.3.6.1.4.1.4491.2.1.20.1.23 I receive this answer: .1.3.6.1.4.1.4491.2.1.20.1.23.1.2.536870914.256 = Hex-STRING: 01 02 03 04 .1.3.6.1.4.1.4491.2.1.20.1.23.1.2.536870914.16777217 = Hex-STRING: 01 02 03 .1.3.6.1.4.1.4491.2.1.20.1.23.1.2.536870914.16777218 = Hex-STRING: 01 02 03 04 But if I perform a full complete SNMP walk snmpwalk -One -v2c -c public IP /tmp/file These values do not appear in the output file. The latter is not a complete walk. From the snmpwalk man page: If no OID argument is present, snmpwalk will search the subtree rooted at SNMPv2-SMI::mib-2 If you really want a full walk, I normally walk starting at .1 (though there is probably a better way) Also, snmpbulkwalk is going to be a lot faster for you; try it like this: snmpbulkwalk -One -v2c -c public IP .1 /tmp/file Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: Documentation
On Fri, Aug 13, 2010 at 04:52:19PM +0200, rene.meu...@ing.be wrote: I have downloaded net-snmp for Solaris. I would like to find a documentation, programming guide and/or reference guide, about the c api. I'm mainly interested in the way to process incoming snmpv1, snmpv2 and snmpv3 traps. Could you help me, please? There is a host of resources on the http://www.net-snmp.org/ site - have you checked there first before asking others for help? Steve Thanks in advance for your reply. René Meurée Contractor ING Group/OPSIT Banking/CBS Payments Belgium/System Service Delivery/SM TRS P.O. BOX 60, Cours Saint-Michel , 1040 Etterbeek, Belgium Tél: +32 (0)2 7389216 mailto: rene.meu...@ing.be mailto: swift.t...@ing.be -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: difference between snmpwalk and snmpbulk
On Fri, Jul 30, 2010 at 07:30:54PM +0530, shardul kumar wrote: Hi All, Could any one please let me know why do we need snmpbulk while snmpwalk(using GETNEXT) is already available for bulk data transfer. I mean to say if I am able to retrieve all the rows of a table using GETNEXT then what is so special in GETBULK ? It's a huge performance win to be able to return more than one OID at a time, especially when there's some distance between agent and client. Try timing an snmpbulkwalk of something across a VPN tunnel on the other side of the country, then do the same thing with snmpwalk. Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: truncating integer value 32 bits
On Mon, Jun 28, 2010 at 09:01:29PM +0530, Prakash wrote: How to handle u_int64_t type variables. u_int64_t value = 39952034381; when I tried to set the value, I am getting the following message. truncating integer value 32 bits The integral constant 39952034381 is too large to fit into a 32-bit integer, which is what you intend when you just give a sequence of digits. This is independent of where the value goes when it's assigned. If you intend a long-long integral value, then add LL: u_int64_t value = 39952034381LL; But this is actually an *unsigned* long long, so make it: u_int64_t value = 39952034381LLU; Please note: it's helpful when you mention the type of compiler when asking for compiler help. Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: To fork Net-SNMP over the comments issue? (was: Re: Is it policy to strip comments from the source code that we commit?)
On Mon, May 24, 2010 at 07:11:02AM +0300, Omer Zak wrote: 2. Is anyone else in favor of forking the Net-SNMP project over the comments issue? Forking a major project over *comments*? -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: Software License
On Wed, May 05, 2010 at 09:34:22AM -0400, Michael A Wagner wrote: Are there any license terms associated with this software? If so, please tell me where to find them or send me a copy of the license agreement. There's a License link on the home page of the project - did you look? http://www.net-snmp.org/about/license.html -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: Bugs discovered by a research group at CWRU
On Mon, Aug 31, 2009 at 03:59:17PM -0400, Gang Shu wrote: Hi Dave, Thanks a lot for your kind reply. However, I am still confused about the function 'shutdown_notification_log()', since there is no explicitly resource release statement in it. Could you please give me more details? Thanks! There is an explicit resource release statement: exit(0); I believe the idea is that when it's known that the program is about to exit soon anyway, there's no concerted effort to release all the memory because the OS will clean it up soon anyway. Steve void shutdown_notification_log(void) { max_logged = 0; check_log_size(0, NULL); } Best, Gang -Original Message- From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf Of Dave Shield Sent: Monday, August 31, 2009 2:13 PM To: Gang Shu Cc: net-snmp-coders@lists.sourceforge.net Subject: Re: Bugs discovered by a research group at CWRU 2009/8/31 Gang Shu gxs...@case.edu: Could you please tell us where the global variables nlmLogTable and table_set have been freed? This data structure will be freed when the agent shuts down. I strongly suspect it's not explicitly released - most of the MIB module handlers don't bother to clean up fully, since they will typically only be unloaded as part of the agent shutting down (when it will release all allocated memory anyway). The natural place to handle this resource release would probably be in the 'shutdown_notification_log()' routine. Dave -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: Windows - MSVC 2008, 64-bit and Platform SDK
On Mon, Apr 27, 2009 at 10:51:45AM -0700, Wes Hardaker wrote: On Sun, 26 Apr 2009 21:11:09 -0400, Alex Burger ale...@users.sourceforge.net said: I'm going to defer all judgment to those more familiar with windows development than I. Thus take these comments as minor: AB 4) I don't think we need to support Windows NT anymore and we certainly AB don't need to support Windows 9x. I'm not sure I buy NT being gone. I suspect it's still in greater use than it possibly should be. But again, I'll defer and am not voting. Sadly, Windows NT4 is still in use by plenty of systems - I still run into them in the medical industry attached to CAT scanners and the like - but these are legacy systems for which development has been frozen for a long time. Even if vendors are still [barely] supporting the code - as Microsoft does for a big fee - it stretches the imagination that anybody is undergoing new development on this platform. If I were king, I'd be happy to drop NT4 support from the current release and invite those poor self-abusing souls who need it to use version N-1 on that platform. Alex wrote: For #2, we can either distribute the Microsoft DLLs (1.4Meg) or require that the user install the 'Microsoft Visual C++ 2008 Redistributable Package' from the Microsoft web site. It's probably easier to just include the DLLs. I think it makes me a little nervous to take responsibility for distributing somebody else's binaries when it's not so hard to point them to the right place. But depending on how the installer is built I guess it might be so much more convenient for the to just include them. Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | 714 694-0494 st...@unixwiz.net | Orange County, CA | Microsoft MVP | unixwiz.net -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: Is it possible to retrieve one ROW of a table only?
On Wed, Sep 03, 2008 at 12:01:18PM -0700, Need Help wrote: I can not figure out which SNMP command will allow me to query one complete row of data from a table only. For example, assume my table has 10 rows in it with 20 columns for each row.. How can I query row #7 to get all 20 columns of data? I don't believe there is an obvious way to solve this obvious problem: you can walk a table easily by column, but not by row. If you know the index, you can snmpget col1.7 col2.7 col3.7 col4.7 etc. and I think they can be put in a single request. You and everybody else wishes it were trivial to do what you're asking. Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: addding new fd in select() for recieving request
On Mon, Jun 09, 2008 at 11:53:23AM +0530, [EMAIL PROTECTED] wrote: I am thinking of doing it in following manner. Please comment on the following if it is wrong It's been a while since I have done this, but I think that the count of FDs is not being set properly. ** NOTE INLINE main() { fd_set master; fd_set read_fds; int listener; int fdmax;** UNUSED int newfd; FD_ZERO(master); FD_ZERO(read_fds); listener = socket(AF_INET, SOCK_STREAM, 0); bind(listener, (struct sockaddr *)myaddr, sizeof(myaddr)); listen(listener, 10) // add the listener to the master set FD_SET(listener, master); fdmax = listener; ** UNUSED while() { int numfds = listener+1;** ADD THIS read_fds = master; snmp_select_info(numfds, read_fds, NULL, 0); select(numfds,read_fds,0,0,NULL) if (FD_ISSET(listener , read_fds)) { newfd = accept(listener, (struct sockaddr *)remoteaddr,addrlen) //function1 ---reads the data add it to queue and forward to manager as a TRAP } } } -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: How to integrate NetSNMP into a working Linux environment?
On Thu, Jun 07, 2007 at 12:32:00PM -0700, Need Help wrote: Ok, my company would like me to start discussing how to incorporate NetSNMP into the company's build environment. I explained the following stuff: Your company should probably retain a consultant experienced in these matters, because it's likely to rapidly wander outside the bounds of of the library itself, and what help you're likely to get here. Steve - Indicated ./configure, make and make install were required for NetSNMP - Indicated snmp.conf and snmpd.conf files exist to define stuff - Indicated certain environment variables could be used if desired - Indicated other stuff as well as much as I came across so far :P During this discussion, the build-production people at my company informed me we can not perform the configure command as part of our build process. Instead it would be necessary to understand exactly what the configure command (and I guess the make and make install commands as well) do behind the scenes so our build process and perform these exact steps ourselves. I was told we do not want to execute a script file with all of the required commands and options in it as well. Anyway, is this a common approach to integrating NetSNMP into a business application (ie: not using the standard setup commands/options as part of the command line or in a script file)? It scares me not to use the standard steps to get NetSNMP configured/running. Perhaps someone can explain to me whether this is weird or not. If so, then perhaps you can give me a quick overview as to how NetSNMP should normally be integrated in a build system. I understand no one knows how our build system works (neither do I), but any input into this topic would be greatly appreciated. Is it crazy to think we can perform everything that ./configure, make and make install does oursleves without using those commands? Perhaps we do not need many of the things these commands do to set up NetSNMP? I obviously had no answers for my company on this issue, so I am asking for help from people who have gone through this before. - Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: Is this a bug? Strange walk behavior
On Wed, May 23, 2007 at 09:09:17AM +0100, Dave Shield wrote: On 23/05/07, Steve Friedl [EMAIL PROTECTED] wrote: Let's start by walking the leading part: $ snmpbulkwalk localhost bgp4PathAttrASPathSegment.64.160 ?? where is 64.160.0.0 ? bgp4PathAttrASPathSegment. 64.160.71.0 .24. 10.1.1.4 = (data) First thing - I'd suggest you test this using snmpgetnext rather that snmpwalk. Yah, getnext has the same behavior. Secondly - yes this looks like a bug. The next step is to locate exactly where this problem arises. Try restarting the master agent using the '-d' flag, and running the same snmpgetnext command. What do the packet dumps look like? Well the packet dumps only show the SNMP stuff; I don't see any activity about smux, so I ran tcpdump. $ snmpgetnext -Os localhost bgp4PathAttrASPathSegment.64.160.0 bgp4PathAttrASPathSegment. 64.160.71.0 .24. 204.11.217.34 = Hex-STRING: 02 03 0D 1C 04 D7 35 B7 So that's the wrong one. (s/b 64.170.0.0 .12.). Digging in, these are the -d packet dumps, and I doubt that these are going to provide anything interesting: SNMPD -d DUMPS -- Received 49 bytes from UDP: [127.0.0.1]:8372 : 30 2F 02 01 01 04 07 XX XX XX XX XX XX XX A1 210/.xxx.! 0016: 02 04 4E 43 DD 51 02 01 00 02 01 00 30 13 30 11..NC.Q..0.0. 0032: 06 0D 2B 06 01 02 01 0F 06 01 05 40 81 20 00 05[EMAIL PROTECTED] .. 0048: 00. Connection from UDP: [127.0.0.1]:8372 Received SNMP packet(s) from UDP: [127.0.0.1]:8372 GETNEXT message -- BGP4-MIB::bgp4PathAttrASPathSegment.64.160.0 Sending 65 bytes to UDP: [127.0.0.1]:8372 : 30 3F 02 01 01 04 07 XX XX XX XX XX XX XX A2 310?.xxx.1 0016: 02 04 4E 43 DD 51 02 01 00 02 01 00 30 23 30 21..NC.Q..0#0! 0032: 06 15 2B 06 01 02 01 0F 06 01 05 40 81 20 47 00[EMAIL PROTECTED] G. 0048: 18 81 4C 0B 81 59 22 04 08 02 03 0D 1C 04 D7 35..L..Y5 0064: B7. Looking at the SMUX stuff might be more productive, though it looks kinda ugly without protocol decoders. I think I'm going to have an easier time of this by digging into the bgpd (formerly zebra) daemon code itself and adding some debug. 06:36:15.048194 localhost.smux localhost.9814: P [tcp sum ok] 7:45(38) ack 47 win 32768 nop,nop,timestamp 245487376 245486622 (DF) (ttl 64, id 11976, len 90) 0x 4500 005a 2ec8 4000 4006 0dd4 7f00 0001[EMAIL PROTECTED]@... 0x0010 7f00 0001 00c7 2656 f53a f04c 2abe 41b0..V.:.L*.A. 0x0020 8018 8000 5a3e 0101 080a 0ea1 d710Z.. 0x0030 0ea1 d41e a182 0022 0201 0102 0100 0201... 0x0040 0030 8200 1530 8200 1106 0d2b 0601 0201.0...0.+ 0x0050 0f06 0105 4081 2000 0500 [EMAIL PROTECTED] 06:36:15.048335 localhost.9814 localhost.smux: P [tcp sum ok] 47:101(54) ack 45 win 32768 nop,nop,timestamp 245487376 245487376 (DF) (ttl 64, id 11977, len 106) 0x 4500 006a 2ec9 4000 4006 0dc3 7f00 0001[EMAIL PROTECTED]@... 0x0010 7f00 0001 2656 00c7 2abe 41b0 f53a f072V..*.A..:.r 0x0020 8018 8000 ff01 0101 080a 0ea1 d710 0x0030 0ea1 d710 a282 0032 0201 0102 0100 0201...2 0x0040 0030 8200 2530 8200 2106 152b 0601 0201.0..%0..!..+ 0x0050 0f06 0105 4081 2047 0018 814c 0b81 5922[EMAIL PROTECTED] 0x0060 0408 0203 0d1c 04d7 35b7 5. 06:36:15.143999 localhost.smux localhost.9814: . [tcp sum ok] 45:45(0) ack 101 win 32768 nop,nop,timestamp 245487386 245487376 (DF) (ttl 64, id 11981, len 52) 0x 4500 0034 2ecd 4000 4006 0df5 7f00 0001[EMAIL PROTECTED]@... 0x0010 7f00 0001 00c7 2656 f53a f072 2abe 41e6..V.:.r*.A. 0x0020 8010 8000 b3dd 0101 080a 0ea1 d71a 0x0030 0ea1 d710 Thanks for the help. Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Is this a bug? Strange walk behavior
Hello all, I'm sure this is not a bug in net-snmp per se, but perhaps it's a bug in an application with an SMUX add-in. My only goal here is to find out if this is actually a bug or not (I think it is). If so, I'll dig inside the application to address it. The BGP4 MIB provides for, among other things, access to a router's BGP routing table, and this is useful for network management purposes. This is a snippet of a table, in order, and thne parts after the leading bgp4PathAttrASPathSegment are a network number, the CIDR /## nbits, and the IP address of a router. I've added a bit of spacing to make it easier to read. We never care about the router part, but the Network and /## both are: Network /## Router .. --- - bgp4PathAttrASPathSegment. 64.158.223.0 .24. 10.1.1.5 = (data) bgp4PathAttrASPathSegment. 64.159.64.0 .19. 10.1.1.5 = (data) bgp4PathAttrASPathSegment. 64.160.0.0 .12. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.160.71.0 .24. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.160.100.0 .23. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.160.143.0 .24. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.160.151.0 .24. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.160.254.0 .24. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.161.79.0 .24. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.161.99.0 .24. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.161.255.0 .24. 10.1.1.5 = (data) This part is all in order. The line marked is the interesting one, and the entry I seem to have a hard time locating. I have always believed that when doing a table walk, providing an OID gets you the first OID *after* the one provided, but I don't know that this is doing the right thing. Let's start by walking the leading part: $ snmpbulkwalk localhost bgp4PathAttrASPathSegment.64.160 ?? where is 64.160.0.0 ? bgp4PathAttrASPathSegment. 64.160.71.0 .24. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.160.100.0 .23. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.160.143.0 .24. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.160.151.0 .24. 10.1.1.4 = (data) bgp4PathAttrASPathSegment. 64.160.254.0 .24. 10.1.1.4 = (data) It looks like it entirely skips the first entry even though it appears to be the next one purportedly in line. It seems that I have to fill out zeros of the IP address *and* fill in the /nbits to get it: $ snmpbulkwalk localhost bgp4PathAttrASPathSegment.64.160.0 bgp4PathAttrASPathSegment.64.160.0 = No Such Instance currently exists at this OID $ snmpbulkwalk localhost bgp4PathAttrASPathSegment.64.160.0.0 bgp4PathAttrASPathSegment.64.160.0.0 = No Such Instance currently exists at this OID $ snmpbulkwalk localhost bgp4PathAttrASPathSegment.64.160.0.0.0 bgp4PathAttrASPathSegment.64.160.0.0.0 = No Such Instance currently exists at this OID $ snmpbulkwalk localhost bgp4PathAttrASPathSegment.64.160.0.0.12 bgp4PathAttrASPathSegment.64.160.0.0 .12. 10.1.1.4 = (data) I think that all of these should return at least the first line, maybe more. I am seeing this behavior in the Quagga BGP daemon, which plugs in as an SMUX extension to net-snmp. When I make the same queries against the real Juniper routers, I get the behavior I expect. Is this a bug? Or is an implementation allowed to do things like this if it makes internal implementation easier (as this almost certainly does). Thanks, Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: Problems building 5.4 on Linux
On Tue, Mar 27, 2007 at 04:13:26PM +0200, Eirik Nordbr wrote: The library libelf seems to be installed: $ ls -l /usr/lib/libelf* -rwxr-xr-x 1 root root 65492 Aug 13 2006 /usr/lib/libelf-0.97.1.so lrwxrwxrwx 1 root root16 Feb 21 09:13 /usr/lib/libelf.so.1 - libelf-0.97.1.so That's the shared object used at runtime (provided by the elfutils-libelf package), but not the libelf.a library required to compile against it. Look for a something like a elfutils-libelf-devel package to provide this. Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: scope reductions
On Sun, Mar 04, 2007 at 06:07:08PM +0100, Magnus Fromreide wrote: On sön, 2007-03-04 at 13:55 +0100, Thomas Anders wrote: Magnus Fromreide wrote: Are patches like the attached ones of interest for the project or should I just ignore such things when I see them? Cleanup is always appreciated. The advantage of the patches is that they make the code more local so you do not have to keep track of lots of function scope variables, see for instance make-zone-local where there are two uses of the variable, 25 and 50 lines from the declaration or make-len-local where the use is 90 lines from the declaration. make-len-local Move the len variable from function scope to the scope of the if clause where it i used. make-zone-local Move the zone variable from function scopes of the two if clauses where it is used. Don't these two patches introduce potential problems with C89 compilers? No. In both cases the declarations is at the start of a block, and as far as I know it have always been valid to declare variables at the start of a block, even if it is an inner block. Steve the language lawyer concurs, with hearty applause: scope reductions make code easier to understand and maintain. Steve :-) -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: net-snmp-5.4 bug report
On Sun, Feb 25, 2007 at 11:36:34PM +0800, Moore Michael wrote: Hi there I use net-snmp-5.4, and there's a NULL pointer operator in snmplib/snmp_api.c void * snmp_sess_pointer(netsnmp_session * session) { struct session_list *slp; snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION); for (slp = Sessions; slp!=NULL; slp = slp-next) { if (slp-session == session) { /* ^--- here for the loop end, slp=NULL then slp-session illegal, or change the for loop to while loop; such as while(slp!=NULL) { xxx; slp=slp-next; } */ break; } } This code is perfectly valid: for (slp = Sessions; slp; slp = slp-next) { if (slp-session == session) { break; } } is the same as slp = Sessions; /* initialization part */ while ( slp != NULL ) /* test part */ { if ( slp-session == session ) break; slp = slp-next;/* increment part */ } In particular, the increment is not done until after the slp!=NULL test has been performed. Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: CVS MAIN+5.4.x broken
On Thu, Feb 22, 2007 at 11:37:23AM -0800, Wes Hardaker wrote: soapbox AR. Can I pay $1Mil to all our customers to let us reimplement configure in perl instead of a billion incompatible minor shell scripting languages. /soapbox I'd like to be the first to sign up for that $1M beta test ;-) Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: Mixing sync and async calls?
On Wed, Feb 14, 2007 at 01:17:05PM -0800, [EMAIL PROTECTED] wrote: I'm writing a program that, in essence, polls a number of devices simultaneously. They're slow to respond individually, and I have a lot to go through - doing them sequentially would take forever. I set up a callback function and send my requests off via snmp_send(), use snmp_wait() and everything is happy. However, in one case, while processing the async response in my callback function, I need to fetch a different piece of information before I can finish with processing. I make an entire new SNMP session, and send it off to snmp_synch_response. Unfortuantely, snmp_synch_response never returns - it looks like it sends the request off and uses snmp_wait(), but that unfortuantely just goes back to processing the async responses. This eventually just blows over the stack (hitting bt in gdb and getting 500+ stack frames is not a pleasant experience). Right now, I'm looking at having to just call the command-line snmpget to do what I want (it would be rather difficult to get this fed back into the async processing) - is that the only solution to this? Is there a way to get NET-SNMP to ignore the async requests while its supposed to be processing the single sync request? The proper way to handle this is to have an object per device, and work with a *list* of things you need to poll. You'll kick the process for one request by transacting the first OID, and during the callback process mark that one as finished. Then, in the main loop having finished the first OID, you'll kick off the second. Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: question on timeticks and long into char stuffing
On Wed, Jan 17, 2007 at 12:01:19AM +0100, Alef Veld wrote: Thanks Wes. I figured out the 1 part. I'm not sure what you mean exactly by number 2 though. Do you mean that the long is defined 32bits on my machine ? If so, are you implying i need an even bigger number to host the long * ? I just need a proper way to stuff the long * dereferenced value into my char * pointer. I'm probably just missing something though that will pop op one of these days :-) The largest 32-bit integer is 4294967296, and this forms: 4294967296 ticks @ 100th of a sec 42949672 seconds 715827 minutes 11930 hours 497 days If the device is up for more than 497 days, it wraps around to zero, and you can't really tell directly whether it was a reboot or a counter wrap (though it's probably possible to intuit this via other means, such as noting that the interface counters didn't reset). But if it's a Windows, machine, this won't ever come up ;-) Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] AV == Alef Veld [EMAIL PROTECTED] writes: AV The other question i have is, how do i calculate the uptime in days, AV because all i have is the number of timeticks. Or can you actually AV read out the days. I don't think so, so there must be some algorithm AV for that. 2 points: 1) sysuptime is in 1/100s of a second. So you can calculate the number of days by sysUpTime/100/60/60/24. 2) it is defined as a 32 bit integer. Thus it does wrap after that and you can't determine if it's been up longer than the wrap time. -- Wes Hardaker Sparta, Inc. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: SNMP Agent over HP printer
On Tue, Dec 19, 2006 at 10:38:39PM -0800, K.M. wrote: The Host Resources MIB [RFC1514] provides two status objects that can be used to describe the status of a printer: hrDeviceStatus and hrPrinterStatus. What you need is to implement this MIB in the printer. My question is How to implement this over HP printer. it is done in Ricoh 4500 and 4510, OKI C9500 and XEROX Phaser 860 printers and i am looking to implement it in HP . I think it is clear now Mr.Shield . !! I think you won't get this easily. The DeskJet 5550 is a discontinued low-end desktop printer with nearly no local intelligence: it doesn't run SNMP or TCP/IP (it's a parallel or USB printer) so there is simply no place to do anything with SNMP on this printer. Almost everything is done in the driver. The only way to monitor the printer is with whatever tools HP gives you. Now: if you are some kind of OEM who wishes to resell this printer to your customers for some niche market (as I've done for a customer with a Kodak printer meant for the medical market), you can invest a very large amount of resources reverse engineering how it all works, but this is a very long and hard road that is probably well beyond your best efforts. Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: rfv: MSVC Workspace build fixes
On Sat, Nov 18, 2006 at 03:01:42PM -0500, Alex Burger wrote: *This patch only affects building with the MSVC Workspace*. I haven't tried it myself - I do all my Windows builds on the command line (menus are for wimps) - but have looked at all of this and find that it does just what he says it does, will obviously not affect other platforms (which minimizes the risk of surprise dorkage), and it includes some pretty comprehensive doco changes. If I were building on Win32, I'd want these changes and would really appreciate the thoughtful information on building the DLLs on the various versions (even though MSVC 6 is obsolete, it's still very widely used - good man for covering it). I give this a +1 Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: Adjustment of snmpset.c
On Sat, Nov 18, 2006 at 06:12:17PM +0100, =?ISO-8859-2?q?Roman =A9ustek?= wrote: do anybody know source code of snmpset? http://www.opensource.apple.com/darwinsource/10.2/net_snmp-7/net-snmp/apps/snmpset.c I need to adjust it in the way that the main function would copy the parameters from the memory and no from command line. From structure, what would be exactly the same as a argv structure. So I changed name of main function to for example int set (int argc, char *argv[]) /this parametres are local, that\'s means that they aren\'t the same sturcture as argv form command line/.then created such structure as argv int myargc = 9; char *myarvg [9]; myargv [0] = \.\; .. .. myargv [8]; and called set (myargc, myargv); but the result was Segmentation Fauld. Could anybody help me figure out where is the problem ? Thanks There are several issues here, one of which is an outright bug, but this is a poor way to solve this problem in any case. The better way to do this is from a shell script, not modifying the source. But let's say that you are determined to do it this way, it's much wiser to let the compiler do the counting for you: char*myargv[100]; // room for plenty char**pargv = myargv; // starts at the front *pargv++ = program name; *pargv++ = arg1; *pargv++ = ... *pargv++ = last arg here; *pargv = 0; // you MUST include NULL termination /* argcargv */ set( (int)(pargv - myargv), myargv); Note #1: there's no way to get the count wrong, because pargv maintains it for you. Just imagine using fixed indexes with either #ifdef code, or runtime if/else code - it would be a nightmare. Pointers are your friend. Note #2: I think your bug is failing to include a final NULL parameter in the argument list. This is part of the spec, and it's common for this to be *relied* on by consumers of argc/argv, BUT: the NULL is not included in the count. Note #3: string constants are really /const/, but pointed-to argv members are supposed to be writable. It's bad form to mix them, it *will* fault on some platforms if the strings are actually modified, so you really should use writable strings. The ugly way: char*myargv[100]; // room for plenty char**pargv = myargv; // starts at the front *pargv++ = strdup(program name); *pargv++ = strdup(arg1); *pargv++ = ... *pargv++ = strdup(last arg here); *pargv = 0; It's cheating and ugly, but then so is modifying snmpset in this way, so it probably would work fine. Good luck, Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: synchronous versus asynchronous
On Tue, Nov 14, 2006 at 07:10:38PM +0100, Alef Veld wrote: If i wanted to discover a large amount of hosts, which method would be better. How does asynchronous work? Does it just send a bunch of udp packets in a threaded fashion? Another thing; as i start my foray in this snmp world :-), there seem to be _almost_ no librarys who deal directly with snmp. Almost all apps use a library like ucd or net-snmp. Why is this ? Although i'd rather code my own snmp client software i recognize the work and options that have been put into net-snmp so i will probably decide not to invent the wheel again. It's just that i find the net-snmp library pretty difficult to understand, and i wonder if there are some bare bones snmp client whose only hook is the systems headers/libraries. The clear winner here is async: you can poll hundreds of hosts from a modest machine with a single thread. This is because the great bulk of the time spent by your program is *waiting for I/O*, and when it works synchronously, this time is serialized. You can ameliorate this somewhat by using multiple threads, but that still serializes within a single thread. Threading introduces its own complexity - especially since I don't think that NET-SNMP is fully threadsafe - and this doesn't scale to hundreds of hosts. I've seen single-threaded sync applications that have a very hard time polling 100 hosts in 5 minutes, especially if one of them is down - those retries and timeouts are all fully serialized, and your app is doing nothing most of the time. With async, I/O waits are 100% parallized, so you max out either on your network bandwidth, or your CPU, but not on wall-clock time. The core of your application will be an event loop. You'll have some concept of a work-to-do list (hosts with lists of OIDs to request). In each loop, you send as many requests as you can (up to some reasonable limit), and the library keeps track of which ones are waiting for a response. Then you crank the I/O with a select() call, and hand the results to the SNMP library. It runs through the list of file descriptors which have fired, reads the responses, and matches them up with the requests it's kept track of. When it matches this response up, it fires your callback to process it, and you'll take the response PDU, decode it, and store the data somewhere. Then you tell the library that this request has been satisfied, and it frees up one slot for another request you'll submit at the next loop. Timeouts are handled as well, with the same callback mechanisms. Make no mistake: async processing is much, much more complicated, and even those who have been writing communications controllers for 20 years *cough* me *cough* have some slow slogging. But async is a slam-dunk win for performance. Some time ago I wrote an async *DNS* resolver to crank through Apache log files (doing IP to name resolutions), and it was able to do on the order of 100 resolutions per second on an old slow machine. fastzolver - Very fast Asynchronous DNS resolver for Webalizer http://www.unixwiz.net/tools/fastzolver.html In fact, most async apps require a way to pace themselves so they don't blow out the infrastructure. Steve (async kind of guy) -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: synchronous versus asynchronous
On Tue, Nov 14, 2006 at 09:11:48PM +0100, Alef Veld wrote: So basically if i understand correctly async is using select with nonblocking sockets and a large set of file descriptors? I assume you use that since you stated that net-snmp is not thread-safe. And in addition you just send a whole bunch of udp sendto's in a event loop? that's really something i would like to have. basically i want to write a function that does async snmp and in that same function it calculates the netblock it needs to snmp to by supplying a net/prefix as argument. However, i feel really stupid when looking at the net-snmp library or even example code. It seems bloody complicated :-). I'm now using a modified version of the sync demo app to use with snmpv1 (Seems to work for snmpv2 to?) but as stated before, it sucks up cpu bigtime if it finds a host who it cannot connect to. Bloody complicated hits the nail on the head, though it's not impossible to understand. My recommendation is to do it in perl first, because it's way easier to cobble something together that way. The perl bindings are *excellent*. It takes a while to really get a handle on how to use it well, and I've been working on a generic async polling engine that does all the hard stuff: give it a work list and tell it to go. I'm doing one of these in C now, but I'd never have gotten the factoring right had I not started in perl first. Sadly, there isn't any really good prototype code out there for it, though I may see if I can put some together. My code is part of a larger infrastructure that won't be so easy to just pull out. But perl's really the place to start if you can. Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: RFV: Enable fix library DLL support for Windows
On Thu, Oct 26, 2006 at 08:11:42AM -0400, Alex Burger wrote: I would like to enable DLL support for the applications including snmpd and snmptrapd. We currently only support using the library DLL when building the Perl module. After some research and testing, it appears that the applications work fine with the library DLL and there doesn't seem to be any issues with data corruption like we originally thought there would be. For the applications to work, all extern declared variables in the library that are used by the applications must be changed to NETSNMP_IMPORT. Most were changed already in the past but some were missed. These changes will also fix the problem with SNMP v3 encryption in the Perl module reported recently (SNMPv3 - problem with auth/encr sessions with Perl module). The attached patch fixes the externs, and allows for building with the DLL in the MSVC command line build system. This should not affect non-Windows in any way, and will only affect Windows by allowing the user to build with the DLL without having to modify the build files by hand. It will also fix the SNMP v3 issue with Perl. I've been running Alex's patches (to pre4, at least) on my Win32 box, and snmpd.exe and the snmp{bulk}walk.exe are working just fine (not exactly a comprehensive test). I have run them all under the HeapAgent memory debugger as well without any leaks or other problems. I don't know how the do not use the DLL directive came to pass, but I have been shipping netsnmp_dll.dll with a project using net-snmp-5.1 without any problems. But maybe a few thoughts on the patches: ++ net-snmp-5.4.pre4.dll/win32/libsnmp_dll/libsnmp.def Isn't this built from libsnmp.def.in ? +++ net-snmp-5.4.pre4.dll/win32/snmptrapd/Makefile.in Wed Oct 25 08:22:38 2006 @@ -8,7 +8,7 @@ # Set to 1 to allow the building using the DLL version of SNMPLIB. This is # NOT supported as this program is NOT thread safe and it WILL cause # problems! -ALLOW_DLL=0 +ALLOW_DLL=1 (various Makefile.in) Shouldn't the NOT supported comment be removed, or at least amended? Otherwise, I would like to have DLL support - it sure makes the deliverables smaller. Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] diff -ur net-snmp-5.4.pre4.fresh/include/net-snmp/library/snmpTCPDomain.h net-snmp-5.4.pre4.dll/include/net-snmp/library/snmpTCPDomain.h --- net-snmp-5.4.pre4.fresh/include/net-snmp/library/snmpTCPDomain.h Thu Sep 14 20:48:48 2006 +++ net-snmp-5.4.pre4.dll/include/net-snmp/library/snmpTCPDomain.hWed Oct 25 09:59:20 2006 @@ -23,7 +23,7 @@ */ #define TRANSPORT_DOMAIN_TCP_IP 1,3,6,1,2,1,100,1,5 -extern oid netsnmp_snmpTCPDomain[]; +NETSNMP_IMPORT oid netsnmp_snmpTCPDomain[]; netsnmp_transport *netsnmp_tcp_transport(struct sockaddr_in *addr, int local); diff -ur net-snmp-5.4.pre4.fresh/include/net-snmp/library/snmpTCPIPv6Domain.h net-snmp-5.4.pre4.dll/include/net-snmp/library/snmpTCPIPv6Domain.h --- net-snmp-5.4.pre4.fresh/include/net-snmp/library/snmpTCPIPv6Domain.h Thu Jan 29 09:13:58 2004 +++ net-snmp-5.4.pre4.dll/include/net-snmp/library/snmpTCPIPv6Domain.h Wed Oct 25 09:59:44 2006 @@ -14,7 +14,7 @@ */ #define TRANSPORT_DOMAIN_TCP_IPV61,3,6,1,2,1,100,1,6 -extern oid netsnmp_TCPIPv6Domain[]; +NETSNMP_IMPORT oid netsnmp_TCPIPv6Domain[]; netsnmp_transport *netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local); diff -ur net-snmp-5.4.pre4.fresh/include/net-snmp/library/snmpUDPIPv6Domain.h net-snmp-5.4.pre4.dll/include/net-snmp/library/snmpUDPIPv6Domain.h --- net-snmp-5.4.pre4.fresh/include/net-snmp/library/snmpUDPIPv6Domain.h Fri Jul 30 16:01:24 2004 +++ net-snmp-5.4.pre4.dll/include/net-snmp/library/snmpUDPIPv6Domain.h Wed Oct 25 09:59:58 2006 @@ -14,7 +14,7 @@ */ #define TRANSPORT_DOMAIN_UDP_IPV61,3,6,1,2,1,100,1,2 -extern oid netsnmp_UDPIPv6Domain[]; +NETSNMP_IMPORT oid netsnmp_UDPIPv6Domain[]; netsnmp_transport *snmp_udp6_transport(struct sockaddr_in6 *addr, int local); diff -ur net-snmp-5.4.pre4.fresh/include/net-snmp/library/snmpUnixDomain.h net-snmp-5.4.pre4.dll/include/net-snmp/library/snmpUnixDomain.h --- net-snmp-5.4.pre4.fresh/include/net-snmp/library/snmpUnixDomain.h Thu Sep 14 20:48:48 2006 +++ net-snmp-5.4.pre4.dll/include/net-snmp/library/snmpUnixDomain.h Wed Oct 25 10:00:44 2006 @@ -23,7 +23,7 @@ */ #define TRANSPORT_DOMAIN_LOCAL 1,3,6,1,2,1,100,1,13 -extern oid netsnmp_UnixDomain[]; +NETSNMP_IMPORT oid netsnmp_UnixDomain[]; netsnmp_transport *netsnmp_unix_transport(struct sockaddr_un *addr, int local); diff -ur
Re: pass-through persist and daemon re-configuration with HUP signal
On Wed, Oct 25, 2006 at 11:27:19AM -0400, Robert Story wrote: You should be getting a SIGPIPE when you select on stdin, since it has been closed. No: SIGPIPE is generated when *writing* to a pipe with no readers on the other end. *Reading* (or selecting) from a closed pipe just gets a normal EOF. Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: why do we install all system headers?
On Thu, Aug 17, 2006 at 01:32:36AM +0200, Thomas Anders wrote: is there a good reason why make install currently installs all of include/net-snmp/system/*.h and not just the one(s) for the system in question? Even cross-compiling only has a *single* target system, so why? Is it only to save us from having to figure out which one we need (since for some systems they are nested)? I have less experience porting Net-SNMP than the rest of you, but it strikes me as highly counterproductive to spend any time on this kind of optimization. Organizing the *system-provided* header files for a build is a hard problem (FreeBSD has been awful), but one must put in the time anyway: there is no magic shortcut that Just Makes It Work. Organizing the *library-provided* header files does indeed have a magic shortcut that Just Makes It Work: ship them all. The upside: - include/net-snmp/system/ has a few less files The downside: - no saving on the tarball size (need to ship them anyway) - much more complicated ./configure configuration - ongoing maintenance nightmare and source of bug reports Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: net-snmp error using MS VC++
On Mon, Mar 13, 2006 at 03:04:03PM -, Ian Dineen wrote: hi all, i'm getting the following errors when compiling sample code in Microsoft Visual Studio 6 C++, ive compiled the net-snmp libraries, and i am able to use the supplied executables (eg. snmpget.exe) from the command line with no problems. I've changed the setting of VC++ as according the the readme.win32 file but with no success. here is the errors which i get when compiling the sample code for a snmpget request. .obj : error LNK2001: unresolved external symbol _winsock_cleanup .obj : error LNK2001: unresolved external symbol _snmp_close .obj : error LNK2001: unresolved external symbol _snmp_free_pdu .obj : error LNK2001: unresolved external symbol _snmp_errstring .obj : error LNK2001: unresolved external symbol _print_variable .obj : error LNK2001: unresolved external symbol _snmp_synch_response .obj : error LNK2001: unresolved external symbol _snmp_add_null_var .obj : error LNK2001: unresolved external symbol _read_objid .obj : error LNK2001: unresolved external symbol _snmp_pdu_create .obj : error LNK2001: unresolved external symbol _snmp_log .obj : error LNK2001: unresolved external symbol _snmp_perror .obj : error LNK2001: unresolved external symbol _snmp_open .obj : error LNK2001: unresolved external symbol _winsock_startup .obj : error LNK2001: unresolved external symbol _snmp_sess_init .obj : error LNK2001: unresolved external symbol _init_snmp Either you're not linking with the SNMP libraries, or you build the libraries with a different calling convention (__stdcall) than you built the main code (using __cdecl). Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: NETSNMP_DS_LIB_DONT_PERSIST_STATE?
On Tue, Jun 28, 2005 at 05:43:19PM +0200, Thomas Anders wrote: Steve Friedl wrote: On Fri, Jun 24, 2005 at 04:06:18PM +0200, Thomas Anders wrote: Agreed. Steve, are you willing to incorporate this into your upcoming patch? Sure. But you get to pick the name this time :-) Now that names have been proposed (by Wes): are you willing to propose a patch? Yes, within a week or two. Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] --- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: NETSNMP_DS_LIB_DONT_PERSIST_STATE?
On Thu, Jun 23, 2005 at 04:08:46PM +0200, Thomas Anders wrote: -Coders, what *exact* impact is netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1); supposed to have? The comment in snmplib/default_store.c indicates don't save/load any persistant state, but in fact snmplib/read_config.c::read_config_files() seems to return immediately without reading *any* (even regular) config file in this case. I must be missing something obvious. Please enlighten me. This was my patch from early last year: http://sourceforge.net/tracker/index.php?func=detailaid=849159group_id=12694atid=312694 All of my code that uses NET-SNMP simply does not care about any config files: it makes a few queries to a particular kind of device, and there is nothing that all the config stuff could be useful for. This allows elision of all config/state loads and saves. I can certainly see how the the name suggests that only the save is suppressed, so I probably ought to submit a second patch that adds some more documentation to this. It was obvious to *me* :-) Steve -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] --- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: winservice _snprintf changes
On Wed, Sep 29, 2004 at 08:30:42PM -0400, [EMAIL PROTECTED] wrote: snprintf(OBJECT, sizeof(OBJECT-1), ... No, snprintf(OBJECT, sizeof OBJECT, ...) works fine: the count includes the NUL byte. Steve --- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] --- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl ___ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: anybody using net-snmp on FreeBSD/AMD64 ( or other 64bit platforms??)
On Thu, Jun 24, 2004 at 10:57:59AM -0400, [EMAIL PROTECTED] wrote: 3. The agent/mibgroup/mibII/ip.c, function int ip_handler, line 892 return NULL is bad, as you've noticed. the value (int) NULL is assumed to be 0, [not universally true!] When one wants a portable value for NULL, one should just use the integral constant 0; this is correct in every case; return 0; /* NULL */ Guaranteed to generate the proper bits on any platform. -- Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED] --- 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