On 12 March 2010 08:51, Manjit <manjit.si...@globaledgesoft.com> wrote: > i want to know about these Macro used in smpd code:
The Net-SNMP suite (in common with many other software packages) is designed to be used with a wide range of operating systems. These can differ in the precise set of library calls that are available. Hence the first step in compiling the code is to run a "configure" scripts, which checks for the presence or absence of the API calls, header files, etc, which the code would want to make use of. Macros of the form #if HAVE_XXX are used to indicate whether particular API calls are available on a given system, so that the code does not attempt to invoke a system call that isn't part of the current operating system. > 1. #if HAVE_GETPID in snmpd.c > 2. #if HAVE_SETGID Both of these are concerned with setting the environment that the SNMP agent will be running in - saving a copy of the PID into a file, and setting the group that the process will run as. > 3. #ifdef HAVE_KVM_OPENFILES in agent/auto_nlist.c > 4. NET_SNMP_CAN_USE_NLIST in kernel.c These two are concerned with how the agent retrieves the data that it will report back to the querying applications. A lot of information about low-level operation of a system (e.g. network statistics, etc) is held in the kernel. These API calls relate to two particular mechanisms for getting that information out of the kernel. > If i will not enable these in my application , will it change the agent > behaviour. If you disable HAVE_GETPID, then the agent/application won't save its process ID in a file. That won't affect the agent itself. If you disable HAVE_SETGID, then the agent will run with the group privileges of the parent application. This may or may not affect what files or other data it can access. If you disable the other two calls, then this could potentially change how the agent retrieves information from the underlying system. This may or may not alter the range of MIBs that will be supported. Dave ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders