Re: Summary of meeting between NET-SNMP devs and ICEI

2018-05-13 Thread Robert Story
On Sun, 13 May 2018 18:15:16 -0700 Keith wrote:
KM> On Sun, May 13, 2018, at 3:41 PM, Bart Van Assche wrote:
KM> > Should a list of to-do items be added to the Net-SNMP wiki?  
KM> 
KM> I think a to-do wiki page on github would be a good idea to
KM> deal with what needs to be done. Then, as each item is tackled
KM> we should have a wiki page that details the requirement for
KM> each list item. 

There is an ancient TODO list here:

  http://www.net-snmp.org/docs/TODO.html

Something in the wiki would probably be better, and we can redirect
that static page to the wiki...

Robert

--
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: [PATCH 01/15] Cygwin64: Fix winExtDLL build

2018-05-13 Thread Robert Story
On Sun, 13 May 2018 14:31:39 -0700 Bart wrote:
BVA> The winExtDLL code assumes that sizeof(oid) == 4. Hence define
BVA> the 'oid' type as unsigned int when building with MSVC, MinGW
BVA> or Cygwin. This patch avoids that building winExtDLL with
BVA> Cygwin64 fails on the following statement:
BVA> 
BVA> netsnmp_static_assert(sizeof(oid) == sizeof(UINT));

I don't think this technically meets criteria for RC phase, but it
would be nice if most platforms built, so I'll vote for this one
for 5.8.

Robert

--
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: [PATCH 00/15] Clean up Net-SNMP public header files

2018-05-13 Thread Robert Story
On Sun, 13 May 2018 14:31:38 -0700 Bart wrote:
BVA> Since Net-SNMP version 5.8 will be released soon and since no
BVA> prior version has been released from the v5.8 (master) branch
BVA> yet this is a good time to review the public header files and
BVA> verify whether any potentially backwards incompatible changes
BVA> should be made.

Unfortunately I don't really see any backwards compatibility fixes
here. It all looks like cleanup, which doesn't meet the criteria
for patches at this point in the release process. The Cygwin build
fix is a possible exception, so I'll +1 that one. One more vote
from the core team and it will go in.

Robert

--
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: Summary of meeting between NET-SNMP devs and ICEI

2018-05-13 Thread Keith Mendoza


On Sun, May 13, 2018, at 3:41 PM, Bart Van Assche wrote:
> On 04/12/18 08:31, Ian Bruene wrote:
> > This morning we (Keith, Ian) met with an assortment of the NET-SNMP 
> > developers / contributors (primarily Bart Van Assche) to discuss how we 
> > could best help the project. The meeting went well, at least form our 
> > perspective.
> > 
> > The pain points we identified were:
> > 
> > * bug mountain
> > 
> > * help users on the mailing list
> > 
> > * patch / MR handling process
> > 
> > * move out of SourceForge
> > 
> > * clean up headers in /include/net-snmp/system/ which are a mess and 
> > have import loops
> > 
> > * #ifdef hell / too many supported configurations
> > 
> > Keith is currently focused on streamlining the process of handling merge 
> > requests, which will make it easier to handle the bug mountain. I will 
> > probably be focusing on the headers for now in hopes that it will make 
> > other processes easier as well. We can help on the repo move whenever 
> > y'all are ready to pull the trigger on that.
> 
> Should a list of to-do items be added to the Net-SNMP wiki?

I think a to-do wiki page on github would be a good idea to deal with what 
needs to be done. Then, as each item is tackled we should have a wiki page that 
details the requirement for each list item. 

> 
> Also, how about adding the following item to the above list: getting rid 
> of 'makedepend' for generating dependency files. Makedepend is 
> considered deprecated and does not work properly on modern systems. Any 
> build system that supports dependency generation is a possible 
> alternative (automake, cmake, ...). See also 
> https://en.wikipedia.org/wiki/Makedepend and 
> https://bugs.freedesktop.org/show_bug.cgi?id=10021.

I think this can be dealt with as part of migrating from autotools to cmake. I 
would also suggest looking into rolling in the #ifdef hell; as cmake can be 
used to deal with the things that #ifdef is dealing with.
 
> 
> Bart.
> 
> --
> 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


-- 
Thanks,
Keith (pantherse)

--
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: 5.8.rc1 is available

2018-05-13 Thread Robert Story
On Thu, 10 May 2018 08:46:17 -0700 Bart wrote:
BVA> On 05/06/18 17:32, Robert Story wrote:
BVA> > The first release candidate for the next release of Net-SNMP
BVA> > is available for testing [1]. [...]
BVA> [...]
BVA> Since we are preparing the first v5.8 release, do you think
BVA> this is a good time to review the Net-SNMP public header
BVA> files? There may be symbols in the public header files that
BVA> shouldn't be there.

Yes, that is a good idea.

BVA> Other issues I'd like to bring up are the
BVA> circular dependency between  and
BVA> 

The circular dependency is handled by each file using an ifdef to
protect against multiple included. It is possible that cleanup of
includes in the code to include the right things and in the right
order could eliminate the loop. I think 5.9 is probably the right
place to try such an undertaking.

BVA> and also that the compilation time probably can be reduced by
BVA> limiting the number of files included from .

True. Another idea for 5.9.

Robert

--
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: [PATCH] install openbsd6.h header

2018-05-13 Thread Robert Story
On Fri, 11 May 2018 21:48:52 +0100 Stuart wrote:
SH> From 216f6e4e5c600dc82c27fe67a01bb8f4304d0ddb Mon Sep 17
SH> 00:00:00 2001 From: Stuart Henderson 
SH> Date: Fri, 11 May 2018 21:48:22 +0100
SH> Subject: [PATCH] Install missing system header files

Thanks again. Applied for 5.8.rc2.

Robert

--
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: removed USM_{AUTH,PRIV}_PROTO_*_LEN macros

2018-05-13 Thread Robert Story
On Sat, 12 May 2018 12:38:10 +0100 Stuart wrote:
SH> The USM_*_PROTO_*_LEN constant macros removed in 329a9d3c9 are
SH> used in other programs using Net-SNMP libraries. I noticed a
SH> problem building PHP against 5.8.rc1 but looking at
SH> codesearch.debian.net I find a few other programs that will be
SH> affected too: openvas-libraries, zabbix, openhpi, cacti-spine.

Thanks for reporting this. Those macros have been restored and will
be in 5.8.rc2.

Robert

--
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: Summary of meeting between NET-SNMP devs and ICEI

2018-05-13 Thread Bart Van Assche

On 04/12/18 08:31, Ian Bruene wrote:
This morning we (Keith, Ian) met with an assortment of the NET-SNMP 
developers / contributors (primarily Bart Van Assche) to discuss how we 
could best help the project. The meeting went well, at least form our 
perspective.


The pain points we identified were:

* bug mountain

* help users on the mailing list

* patch / MR handling process

* move out of SourceForge

* clean up headers in /include/net-snmp/system/ which are a mess and 
have import loops


* #ifdef hell / too many supported configurations

Keith is currently focused on streamlining the process of handling merge 
requests, which will make it easier to handle the bug mountain. I will 
probably be focusing on the headers for now in hopes that it will make 
other processes easier as well. We can help on the repo move whenever 
y'all are ready to pull the trigger on that.


Should a list of to-do items be added to the Net-SNMP wiki?

Also, how about adding the following item to the above list: getting rid 
of 'makedepend' for generating dependency files. Makedepend is 
considered deprecated and does not work properly on modern systems. Any 
build system that supports dependency generation is a possible 
alternative (automake, cmake, ...). See also 
https://en.wikipedia.org/wiki/Makedepend and 
https://bugs.freedesktop.org/show_bug.cgi?id=10021.


Bart.

--
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


[PATCH 15/15] : Reduce the number of #include directives further

2018-05-13 Thread Bart Van Assche
No symbols from ,  nor  are used in
. Hence stop including these files in .
---
 include/net-snmp/types.h   | 19 ---
 include/net-snmp/varbind_api.h |  1 +
 2 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/include/net-snmp/types.h b/include/net-snmp/types.h
index 755740327908..181112577ba6 100644
--- a/include/net-snmp/types.h
+++ b/include/net-snmp/types.h
@@ -16,29 +16,10 @@
  *  Definitions of data structures, used within the library API.
  */
 
-#include 
-
 #ifndef NET_SNMP_CONFIG_H
 #error "Please include  before this file"
 #endif
 
-/*
- * For 'timeval' 
- */
-#if TIME_WITH_SYS_TIME
-# include 
-# include 
-#else
-# if HAVE_SYS_TIME_H
-#  include 
-# else
-#  include 
-# endif
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include 
-#endif
 #include 
 #if 1
 /*
diff --git a/include/net-snmp/varbind_api.h b/include/net-snmp/varbind_api.h
index 7f4850312be5..db78e2a754ea 100644
--- a/include/net-snmp/varbind_api.h
+++ b/include/net-snmp/varbind_api.h
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 
 #ifdef __cplusplus
 extern  "C" {
-- 
2.16.3


--
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


[PATCH 02/15] : Add a missing #include directive

2018-05-13 Thread Bart Van Assche
Since PATH_MAX and MAXPATHLEN are used in this header file, include
the header file that defines these constants.
---
 include/net-snmp/library/tools.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/net-snmp/library/tools.h b/include/net-snmp/library/tools.h
index 19752d7491f4..7a099a5551f1 100644
--- a/include/net-snmp/library/tools.h
+++ b/include/net-snmp/library/tools.h
@@ -16,6 +16,9 @@
 #ifdef HAVE_INTTYPES_H
 #include  /* uintptr_t */
 #endif
+#ifdef HAVE_SYS_PARAM_H
+#include  /* PATH_MAX (Linux), MAXPATHLEN (BSD) */
+#endif
 
 #ifdef __cplusplus
 extern  "C" {
@@ -24,7 +27,7 @@ extern  "C" {
 
 
 /*
- * General acros and constants.
+ * General macros and constants.
  */
 #ifdef WIN32
 #  define SNMP_MAXPATH MAX_PATH
-- 
2.16.3


--
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


[PATCH 06/15] win32/config.h.borland: Remove this header file

2018-05-13 Thread Bart Van Assche
The latest Borland C++ compiler version was released in 1999. Since
no new versions of that compiler were released after that date, remove
support for the Borland compiler.
---
 win32/config.h.borland | 772 -
 1 file changed, 772 deletions(-)
 delete mode 100644 win32/config.h.borland

diff --git a/win32/config.h.borland b/win32/config.h.borland
deleted file mode 100644
index 4825425622f0..
--- a/win32/config.h.borland
+++ /dev/null
@@ -1,772 +0,0 @@
-/* config.h:  a general config file */
-
-/* Define IN_UCD_SNMP_SOURCE if compiling inside the ucd-snmp source tree */
-#define IN_UCD_SNMP_SOURCE 1
-
-/* UC-Davis' IANA-assigned enterprise number is 2021 */
-#define ENTERPRISE_NUMBER 2021
-
-/* don't change these values! */
-#define NETSNMP_SNMPV1  0x   /* readable by anyone */
-#define NETSNMP_SNMPV2ANY   0xA000   /* V2 Any type (includes NoAuth) */
-#define NETSNMP_SNMPV2AUTH  0x8000   /* V2 Authenticated requests only */
-
-/* default list of mibs to load */
-#define NETSNMP_DEFAULT_MIBS 
"IP-MIB;IF-MIB;TCP-MIB;UDP-MIB;SNMPv2-MIB;RFC1213-MIB;UCD-SNMP-MIB;UCD-DEMO-MIB;SNMP-TARGET-MIB;SNMP-VIEW-BASED-ACM-MIB;SNMP-COMMUNITY-MIB;UCD-DLMOD-MIB;SNMP-FRAMEWORK-MIB;SNMP-MPD-MIB;SNMP-USER-BASED-SM-MIB;SNMP-NOTIFICATION-MIB;SNMPv2-TM"
-
-/* default location to look for mibs to load using the above tokens
-   and/or those in the MIBS envrionment variable*/
-
-#define NETSNMP_DEFAULT_MIBDIRS "/USR/MIBS"
-
-/* default mib files to load, specified by path. */
-
-#undef NETSNMP_DEFAULT_MIBFILES
-
-/* should we compile to use special opaque types: float, double,
-   counter64, i64, ui64, union? */
-#define NETSNMP_WITH_OPAQUE_SPECIAL_TYPES 1
-
-/* comment the next line if you are compiling with libsnmp.h
-   and are not using the UC-Davis SNMP library. */
-#define UCD_SNMP_LIBRARY 1
-
-/* define if you want to compile support for both authentication and
-   privacy support. */
-#define NETSNMP_ENABLE_SCAPI_AUTHPRIV 1
-
-/* define if you are using the internal MD5 code */
-#define NETSNMP_USE_INTERNAL_MD5 1
-
-/* add in recent CMU library extensions (not complete) */
-#define CMU_COMPATIBLE 1
-
-/* should "--" comments in mibs be a comment till the end of the line
-   or also until another "--", the latter being the technically
-   correct. */
-#undef MIB_COMMENT_IS_EOL_TERMINATED
-
-/* debugging stuff */
-#undef NETSNMP_NO_DEBUGGING   /* if defined, we optimize the code
-  to exclude all debugging calls. */
-#define NETSNMP_ALWAYS_DEBUG 0/* Always print debugging information and
-  ignore the -D flag passed to the cmds */
-
-/* Define if using alloca.c.  */
-#undef C_ALLOCA
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
-   This function is required for alloca.c support on those systems.  */
-#undef CRAY_STACKSEG_END
-
-/* Define if you have alloca, as a function or macro.  */
-#undef HAVE_ALLOCA
-
-/* Define if you have  and it should be used (not on Ultrix).  */
-#undef HAVE_ALLOCA_H
-
-/* Define if you have the getmntent function.  */
-#undef HAVE_GETMNTENT
-
-/* Define if you have  that is POSIX.1 compatible.  */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to `long' if  doesn't define.  */
-#undef off_t
-
-/* Define to `int' if  doesn't define.  */
-#undef pid_t
-
-/* Define as the return type of signal handlers (int or void).  */
-#define RETSIGTYPE void
-
-/* Define if you have raise() instead of alarm() */
-
-#define HAVE_RAISE 1
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
-
-/* Define if you have the ANSI C header files.  */
-#define STDC_HEADERS 1
-
-/* Define if you can safely include both  and .  */
-#define TIME_WITH_SYS_TIME 1
-
-/* Define if you have the gettimeofday function.  */
-#undef HAVE_GETTIMEOFDAY
-
-/* Define if you have the  header file.  */
-#undef HAVE_SYS_TIME_H
-
-/* Define if your processor stores words with the most significant
-   byte first (like Motorola and SPARC, unlike Intel and VAX).  */
-#undef WORDS_BIGENDIAN
-
-#define SNMPDLMODPATH "/USR/LIB/DLMOD"
-#define SNMPLIBPATH "/USR/LIB"
-#define SNMPSHAREPATH "/USR/SHARE/SNMP"
-#define SNMPCONFPATH "/USR"
-
-/* SNMPPATH contains (more) important files */
-
-#undef SNMPPATH
-
-/* NETSNMP_LOGFILE:  If defined it closes stdout/err/in and opens this in 
out/err's
-   place.  (stdin is closed so that sh scripts won't wait for it) */
-
-#undef NETSNMP_LOGFILE
-
-/* NETSNMP_PERSISTENT_DIRECTORY: If defined, the library is capabile of saving
-   persisant information to this directory in the form of configuration
-   lines: 

[PATCH 04/15] : Add a missing forward declaration

2018-05-13 Thread Bart Van Assche
This change allows this header file to be included before .
---
 include/net-snmp/session_api.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/net-snmp/session_api.h b/include/net-snmp/session_api.h
index e99305a664b9..a471ab7169e4 100644
--- a/include/net-snmp/session_api.h
+++ b/include/net-snmp/session_api.h
@@ -24,6 +24,7 @@ extern  "C" {
 #endif
 
 struct session_list;
+struct timeval;
 
 NETSNMP_IMPORT
 voidsnmp_sess_init(netsnmp_session *);
-- 
2.16.3


--
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


[PATCH 10/15] libsnmp: Remove ONE_SEC definition

2018-05-13 Thread Bart Van Assche
Since the ONE_SEC constant is only used in a few places, remove the
definition of this constant and expand the constant where it was used.
---
 agent/mibgroup/agentx/agentx_config.c | 2 +-
 agent/mibgroup/agentx/client.c| 6 +++---
 include/net-snmp/definitions.h| 2 --
 snmplib/snmp_api.c| 4 ++--
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/agent/mibgroup/agentx/agentx_config.c 
b/agent/mibgroup/agentx/agentx_config.c
index b590c7a689a4..9c6a1882555b 100644
--- a/agent/mibgroup/agentx/agentx_config.c
+++ b/agent/mibgroup/agentx/agentx_config.c
@@ -127,7 +127,7 @@ agentx_parse_agentx_timeout(const char *token, char *cptr)
 return;
 }
 netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
-   NETSNMP_DS_AGENT_AGENTX_TIMEOUT, x * ONE_SEC);
+   NETSNMP_DS_AGENT_AGENTX_TIMEOUT, x * 1000L * 1000L);
 }
 
 void
diff --git a/agent/mibgroup/agentx/client.c b/agent/mibgroup/agentx/client.c
index 7a53301c338d..315f402395b8 100644
--- a/agent/mibgroup/agentx/client.c
+++ b/agent/mibgroup/agentx/client.c
@@ -118,10 +118,10 @@ agentx_open_session(netsnmp_session * ss)
 timeout = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_AGENTX_TIMEOUT);
 if (timeout < 0) 
-pdu->time = 0;
+pdu->time = 0;
 else
-   /* for master TIMEOUT is usec, but Agentx Open specifies sec */
-   pdu->time = timeout/ONE_SEC;
+/* for master TIMEOUT is usec, but Agentx Open specifies sec */
+pdu->time = timeout / (1000L * 1000L);
 
 snmp_add_var(pdu, version_sysoid, version_sysoid_len,
 's', "Net-SNMP AgentX sub-agent");
diff --git a/include/net-snmp/definitions.h b/include/net-snmp/definitions.h
index 27405c468204..e79aa5d05c6a 100644
--- a/include/net-snmp/definitions.h
+++ b/include/net-snmp/definitions.h
@@ -7,8 +7,6 @@
 
 #define MAX_OID_LEN128 /* max subid's in an oid */
 
-#define ONE_SEC 100L
-
 /*
  *  For the initial release, this will just refer to the
  *  relevant UCD header files.
diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c
index 554767a83708..fe7b31fd38cd 100644
--- a/snmplib/snmp_api.c
+++ b/snmplib/snmp_api.c
@@ -186,7 +186,7 @@ static oid  default_enterprise[] = { 1, 3, 6, 1, 4, 1, 
3, 1, 1 };
 
 #define DEFAULT_COMMUNITY   "public"
 #define DEFAULT_RETRIES5
-#define DEFAULT_TIMEOUTONE_SEC
+#define DEFAULT_TIMEOUT(1000L * 1000L)
 #define DEFAULT_REMPORTSNMP_PORT
 #define DEFAULT_ENTERPRISE  default_enterprise
 #define DEFAULT_TIME   0
@@ -1266,7 +1266,7 @@ _sess_copy(netsnmp_session * in_session)
 if (timeout <= 0)
 session->timeout = DEFAULT_TIMEOUT;
 else
-session->timeout = timeout * ONE_SEC;
+session->timeout = timeout * 1000L * 1000L;
 }
 session->sessid = snmp_get_next_sessid();
 
-- 
2.16.3


--
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


[PATCH 14/15] : Stop including from

2018-05-13 Thread Bart Van Assche
Add #include  and/or
 #include  where necessary.
---
 include/net-snmp/library/snmp_api.h   | 2 +-
 include/net-snmp/library/snmp_transport.h | 2 ++
 include/net-snmp/types.h  | 2 --
 snmplib/cert_util.c   | 1 +
 snmplib/snmp-tc.c | 1 +
 snmplib/snmp.c| 1 +
 snmplib/snmp_client.c | 3 +++
 snmplib/transports/snmpAAL5PVCDomain.c| 1 +
 snmplib/transports/snmpDTLSUDPDomain.c| 1 +
 snmplib/transports/snmpIPv4BaseDomain.c   | 1 +
 snmplib/transports/snmpIPv6BaseDomain.c   | 1 +
 snmplib/transports/snmpSSHDomain.c| 1 +
 snmplib/transports/snmpSTDDomain.c| 2 +-
 snmplib/transports/snmpTCPDomain.c| 1 +
 snmplib/transports/snmpTCPIPv6Domain.c| 1 +
 snmplib/transports/snmpTLSBaseDomain.c| 2 ++
 snmplib/transports/snmpTLSTCPDomain.c | 1 +
 snmplib/transports/snmpUDPDomain.c| 1 +
 snmplib/transports/snmpUDPIPv6Domain.c| 1 +
 snmplib/transports/snmpUnixDomain.c   | 2 ++
 snmplib/vacm.c| 2 ++
 21 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/include/net-snmp/library/snmp_api.h 
b/include/net-snmp/library/snmp_api.h
index a7d62e36a486..6a9adeec2093 100644
--- a/include/net-snmp/library/snmp_api.h
+++ b/include/net-snmp/library/snmp_api.h
@@ -760,7 +760,7 @@ struct netsnmp_transport_s;
 struct session_list {
struct session_list *next;
netsnmp_session *session;
-   netsnmp_transport *transport;
+   struct netsnmp_transport_s *transport;
struct snmp_internal_session *internal;
 };
 
diff --git a/include/net-snmp/library/snmp_transport.h 
b/include/net-snmp/library/snmp_transport.h
index 5f3d3266194e..7d09b104b3e2 100644
--- a/include/net-snmp/library/snmp_transport.h
+++ b/include/net-snmp/library/snmp_transport.h
@@ -1,6 +1,8 @@
 #ifndef _SNMP_TRANSPORT_H
 #define _SNMP_TRANSPORT_H
 
+#include 
+
 /*
  * Portions of this file are copyrighted by:
  * Copyright (c) 2016 VMware, Inc. All rights reserved.
diff --git a/include/net-snmp/types.h b/include/net-snmp/types.h
index fe4deccd4efd..755740327908 100644
--- a/include/net-snmp/types.h
+++ b/include/net-snmp/types.h
@@ -513,8 +513,6 @@ typedef struct netsnmp_large_fd_set_s {
 fd_set  lfs_set;
 } netsnmp_large_fd_set;
 
-#include 
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/snmplib/cert_util.c b/snmplib/cert_util.c
index ad79e37f5a56..890214afb577 100644
--- a/snmplib/cert_util.c
+++ b/snmplib/cert_util.c
@@ -80,6 +80,7 @@ netsnmp_feature_child_of(tls_fingerprint_build, cert_util_all)
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
diff --git a/snmplib/snmp-tc.c b/snmplib/snmp-tc.c
index f5531b142e13..11cc7ace4c3a 100644
--- a/snmplib/snmp-tc.c
+++ b/snmplib/snmp-tc.c
@@ -30,6 +30,7 @@
 #endif
 
 #include 
+#include 
 #include/* for "internal" definitions */
 #include 
 
diff --git a/snmplib/snmp.c b/snmplib/snmp.c
index 661ffac9e816..2b7e6faf1b04 100644
--- a/snmplib/snmp.c
+++ b/snmplib/snmp.c
@@ -69,6 +69,7 @@ SOFTWARE.
 #include 
 #include   /* for "internal" definitions */
 #include 
+#include 
 #include 
 
 /** @mainpage Net-SNMP Coding Documentation
diff --git a/snmplib/snmp_client.c b/snmplib/snmp_client.c
index 2a463518556a..b202aaa55e1d 100644
--- a/snmplib/snmp_client.c
+++ b/snmplib/snmp_client.c
@@ -95,8 +95,11 @@ SOFTWARE.
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/snmplib/transports/snmpAAL5PVCDomain.c 
b/snmplib/transports/snmpAAL5PVCDomain.c
index ccc550031555..e826ac0c3e57 100644
--- a/snmplib/transports/snmpAAL5PVCDomain.c
+++ b/snmplib/transports/snmpAAL5PVCDomain.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
diff --git a/snmplib/transports/snmpDTLSUDPDomain.c 
b/snmplib/transports/snmpDTLSUDPDomain.c
index 4965eca91d01..392cb8246612 100644
--- a/snmplib/transports/snmpDTLSUDPDomain.c
+++ b/snmplib/transports/snmpDTLSUDPDomain.c
@@ -26,6 +26,7 @@ netsnmp_feature_require(sockaddr_size)
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/snmplib/transports/snmpIPv4BaseDomain.c 
b/snmplib/transports/snmpIPv4BaseDomain.c
index 910bb56234db..50143ec1d925 100644
--- a/snmplib/transports/snmpIPv4BaseDomain.c
+++ b/snmplib/transports/snmpIPv4BaseDomain.c
@@ -33,6 +33,7 @@
 #endif
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/snmplib/transports/snmpIPv6BaseDomain.c 
b/snmplib/transports/snmpIPv6BaseDomain.c
index 4336b6a6ae9d..850a36a9bf0f 100644
--- a/snmplib/transports/snmpIPv6BaseDomain.c
+++ b/snmplib/transports/snmpIPv6BaseDomain.c
@@ -52,6 +52,7 @@
 #endif
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/snmplib/transports/snmpSSHDomain.c 
b/snmplib/transports/snmpSSHDomain.c
index 3ca4f81c9f93..de3e0968c454 100644
--- a/snmplib/transports/snmpSSHDomain.c
+++ 

[PATCH 00/15] Clean up Net-SNMP public header files

2018-05-13 Thread Bart Van Assche
Hello,

Since Net-SNMP version 5.8 will be released soon and since no prior version
has been released from the v5.8 (master) branch yet this is a good time to
review the public header files and verify whether any potentially backwards
incompatible changes should be made. The patches in this series are what I
came up with myself. As usual, feedback is welcome.

Bart.

Bart Van Assche (15):
  Cygwin64: Fix winExtDLL build
  : Add a missing #include directive
  : Add missing #include directives
  : Add a missing forward declaration
  : Add a missing #include directive
  win32/config.h.borland: Remove this header file
  include/net-snmp/system/*: Remove unused preprocessor symbols
  Darwin: Move SNMP_CFRelease() definition
  libsnmp: Fix the recursive dependency between  and

  libsnmp: Remove ONE_SEC definition
  libsnmp: Define MAX_OID_LEN once instead of three times
  : Remove this header file
  : Remove this header file
  : Stop including from 
  : Reduce the number of #include directives further

 agent/Makefile.depend   |  84 ---
 agent/helpers/Makefile.depend   |  54 --
 agent/mibgroup/Makefile.depend  | 334 --
 agent/mibgroup/agentx/agentx_config.c   |   2 +-
 agent/mibgroup/agentx/client.c  |   6 +-
 agent/mibgroup/host/data_access/swinst_darwin.c |   3 +
 apps/Makefile.depend|  62 --
 apps/snmpnetstat/Makefile.depend|  16 -
 include/net-snmp/agent/snmp_agent.h |   1 +
 include/net-snmp/definitions.h  |  32 -
 include/net-snmp/library/asn1.h |   2 -
 include/net-snmp/library/libsnmp.h  | 174 --
 include/net-snmp/library/oid.h  |  11 +
 include/net-snmp/library/snmp_api.h |  18 +-
 include/net-snmp/library/snmp_transport.h   |   2 +
 include/net-snmp/library/tools.h|   5 +-
 include/net-snmp/library/types.h|  70 ---
 include/net-snmp/net-snmp-includes.h|   7 +-
 include/net-snmp/session_api.h  |   1 +
 include/net-snmp/system/aix.h   |   2 +-
 include/net-snmp/system/cygwin.h|   4 -
 include/net-snmp/system/darwin10.h  |   7 -
 include/net-snmp/system/darwin11.h  |   7 -
 include/net-snmp/system/darwin12.h  |   7 -
 include/net-snmp/system/darwin13.h  |   7 -
 include/net-snmp/system/darwin14.h  |   7 -
 include/net-snmp/system/darwin7.h   |   3 -
 include/net-snmp/system/darwin9.h   |   7 -
 include/net-snmp/system/dragonfly.h |   4 -
 include/net-snmp/system/dynix.h |   3 -
 include/net-snmp/system/freebsd.h   |   3 -
 include/net-snmp/system/freebsd2.h  |   1 -
 include/net-snmp/system/freebsd3.h  |   2 -
 include/net-snmp/system/freebsd4.h  |   4 -
 include/net-snmp/system/generic.h   |  14 -
 include/net-snmp/system/hpux.h  |  10 -
 include/net-snmp/system/linux.h |   2 -
 include/net-snmp/system/mingw32.h   |   3 -
 include/net-snmp/system/mips.h  |   2 -
 include/net-snmp/system/netbsd.h|   5 -
 include/net-snmp/system/nto-qnx6.h  |   3 -
 include/net-snmp/system/openbsd.h   |   1 -
 include/net-snmp/system/openbsd5.h  |   2 -
 include/net-snmp/system/solaris.h   |   3 -
 include/net-snmp/types.h|  76 ++-
 include/net-snmp/varbind_api.h  |   1 +
 snmplib/Makefile.depend | 150 -
 snmplib/Makefile.in |   1 -
 snmplib/cert_util.c |   1 +
 snmplib/snmp-tc.c   |   1 +
 snmplib/snmp.c  |   1 +
 snmplib/snmp_api.c  |   4 +-
 snmplib/snmp_client.c   |   3 +
 snmplib/transports/snmpAAL5PVCDomain.c  |   1 +
 snmplib/transports/snmpDTLSUDPDomain.c  |   1 +
 snmplib/transports/snmpIPv4BaseDomain.c |   1 +
 snmplib/transports/snmpIPv6BaseDomain.c |   1 +
 snmplib/transports/snmpSSHDomain.c  |   1 +
 snmplib/transports/snmpSTDDomain.c  |   2 +-
 snmplib/transports/snmpTCPDomain.c  |   1 +
 snmplib/transports/snmpTCPIPv6Domain.c  |   1 +
 snmplib/transports/snmpTLSBaseDomain.c  |   2 +
 snmplib/transports/snmpTLSTCPDomain.c   |   1 +
 snmplib/transports/snmpUDPDomain.c  |   1 +
 snmplib/transports/snmpUDPIPv6Domain.c  |   1 +
 snmplib/transports/snmpUnixDomain.c |   2 +
 snmplib/vacm.c  |   2 +
 win32/config.h.borland  | 772 
 win32/dist/installer/net-snmp.nsi   

[PATCH 13/15] : Remove this header file

2018-05-13 Thread Bart Van Assche
Since this header file is not included from any other source file,
remove it.
---
 include/net-snmp/library/libsnmp.h | 174 -
 win32/dist/installer/net-snmp.nsi  |   1 -
 2 files changed, 175 deletions(-)
 delete mode 100644 include/net-snmp/library/libsnmp.h

diff --git a/include/net-snmp/library/libsnmp.h 
b/include/net-snmp/library/libsnmp.h
deleted file mode 100644
index 6a073003ba38..
--- a/include/net-snmp/library/libsnmp.h
+++ /dev/null
@@ -1,174 +0,0 @@
-#ifndef _LIBSNMP_H_
-#define _LIBSNMP_H_
-
-#ifdef __cplusplus
-extern  "C" {
-#endif
-
-/*
- * Definitions for the Simple Network Management Protocol (RFC 1067).
- *
- */
-/**
- *
- *   Copyright 1998 by Carnegie Mellon University
- * 
- *   All Rights Reserved
- * 
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of CMU not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * 
- * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * 
- * $Id$
- * 
- **/
-
-#include 
-
-#if HAVE_STDLIB_H
-#include 
-#endif
-#if HAVE_UNISTD_H
-#include 
-#endif
-#if HAVE_STRING_H
-#include 
-#else
-#include 
-#endif
-#include 
-#if HAVE_NETINET_IN_H
-#include 
-#endif
-#if TIME_WITH_SYS_TIME
-# include 
-# include 
-#else
-# if HAVE_SYS_TIME_H
-#  include 
-# else
-#  include 
-# endif
-#endif
-#if HAVE_SYS_SELECT_H
-#include 
-#endif
-#include 
-#include 
-#if HAVE_NETDB_H
-#include 
-#endif
-#if HAVE_ARPA_INET_H
-#include 
-#endif
-
-#ifdef UCD_SNMP_LIBRARY
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define Version version /* netsnmp_session member */
-
-#define SMI_NOSUCHOBJECT  SNMP_NOSUCHOBJECT
-#define SMI_NOSUCHINSTANCESNMP_NOSUCHINSTANCE
-#define SMI_ENDOFMIBVIEW  SNMP_ENDOFMIBVIEW
-
-
-#else   /* !UCD_SNMP_LIBRARY */
-
-#include 
-#ifndef WIN32
-#include 
-#endif
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-/*
- * Load UC-Davis differential 
- */
-
-#define SNMP_MSG_GET GET_REQ_MSG
-#define SNMP_MSG_GETNEXT GETNEXT_REQ_MSG
-#define SNMP_MSG_RESPONSE GET_RSP_MSG
-#ifndef NETSNMP_NO_WRITE_SUPPORT
-#define SNMP_MSG_SET SET_REQ_MSG
-#endif /* !NETSNMP_NO_WRITE_SUPPORT */
-#define SNMP_MSG_TRAP TRP_REQ_MSG
-#define SNMP_MSG_GETBULK(ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5)
-#define SNMP_MSG_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
-#define SNMP_MSG_TRAP2  (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7)
-#define SNMP_MSG_REPORT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8)
-#define SNMP_NOSUCHOBJECTSMI_NOSUCHOBJECT
-#define SNMP_NOSUCHINSTANCE  SMI_NOSUCHINSTANCE
-#define SNMP_ENDOFMIBVIEWSMI_ENDOFMIBVIEW
-
-#define ASN_IPADDRESS   (ASN_APPLICATION | 0)
-#define ASN_UNSIGNED(ASN_APPLICATION | 2)   /* RFC 1902 - same as GAUGE */
-#define ASN_TIMETICKS   (ASN_APPLICATION | 3)
-
-#define snmp_perror(X) perror(X)
-#define snmp_set_dump_packet(X)
-#define snmp_set_quick_print(X)
-#define snmp_set_do_debugging(X)
-#define snmp_set_full_objid(X)
-#define snmp_set_suffix_only(X)
-
-#define VersionInfo snmp_Version
-#define get_node read_objid
-#define version Version /* netsnmp_session member */
-
-#define SNMP_VERSION_2c SNMP_VERSION_2
-#define SNMP_VERSION_2p 129
-
-#define SOCK_STARTUP winsock_startup()
-#define SOCK_CLEANUP winsock_cleanup()
-
-#endif  /* !UCD_SNMP_LIBRARY */
-
-#ifdef __cplusplus
-}
-#endif
-#endif  /* _LIBSNMP_H_ */
diff --git a/win32/dist/installer/net-snmp.nsi 
b/win32/dist/installer/net-snmp.nsi
index 48eae9adc1db..da6c142119bf 100644
--- a/win32/dist/installer/net-snmp.nsi
+++ b/win32/dist/installer/net-snmp.nsi
@@ -1238,7 +1238,6 @@ Section Uninstall
   Delete "$INSTDIR\include\net-snmp\library\snmpCallbackDomain.h"
   Delete "$INSTDIR\include\net-snmp\library\snmp_debug.h"
   

[PATCH 05/15] : Add a missing #include directive

2018-05-13 Thread Bart Van Assche
Since the snmp_agent.h header file uses the definitions from snmp_api.h,
include that header file.
---
 include/net-snmp/agent/snmp_agent.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/net-snmp/agent/snmp_agent.h 
b/include/net-snmp/agent/snmp_agent.h
index 8545c37ed9a9..818a528de17c 100644
--- a/include/net-snmp/agent/snmp_agent.h
+++ b/include/net-snmp/agent/snmp_agent.h
@@ -30,6 +30,7 @@
 extern  "C" {
 #endif
 
+#include 
 #include 
 #include 
 #include 
-- 
2.16.3


--
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


[PATCH 07/15] include/net-snmp/system/*: Remove unused preprocessor symbols

2018-05-13 Thread Bart Van Assche
Several preprocessor symbols are defined or undefined in system header
files but are not used anywhere in the Net-SNMP code base. Hence remove
the #define and #undef directives for these symbols from the system
header files.
---
 include/net-snmp/system/aix.h   |  2 +-
 include/net-snmp/system/cygwin.h|  4 
 include/net-snmp/system/darwin10.h  |  2 --
 include/net-snmp/system/darwin11.h  |  2 --
 include/net-snmp/system/darwin12.h  |  2 --
 include/net-snmp/system/darwin13.h  |  2 --
 include/net-snmp/system/darwin14.h  |  2 --
 include/net-snmp/system/darwin7.h   |  3 ---
 include/net-snmp/system/darwin9.h   |  2 --
 include/net-snmp/system/dragonfly.h |  4 
 include/net-snmp/system/dynix.h |  3 ---
 include/net-snmp/system/freebsd.h   |  3 ---
 include/net-snmp/system/freebsd2.h  |  1 -
 include/net-snmp/system/freebsd3.h  |  2 --
 include/net-snmp/system/freebsd4.h  |  4 
 include/net-snmp/system/generic.h   | 14 --
 include/net-snmp/system/hpux.h  | 10 --
 include/net-snmp/system/linux.h |  2 --
 include/net-snmp/system/mingw32.h   |  3 ---
 include/net-snmp/system/mips.h  |  2 --
 include/net-snmp/system/netbsd.h|  5 -
 include/net-snmp/system/nto-qnx6.h  |  3 ---
 include/net-snmp/system/openbsd.h   |  1 -
 include/net-snmp/system/openbsd5.h  |  2 --
 include/net-snmp/system/solaris.h   |  3 ---
 25 files changed, 1 insertion(+), 82 deletions(-)

diff --git a/include/net-snmp/system/aix.h b/include/net-snmp/system/aix.h
index 46beb317fd06..5d6c34b6a0b1 100644
--- a/include/net-snmp/system/aix.h
+++ b/include/net-snmp/system/aix.h
@@ -1,6 +1,6 @@
 #include 
 #include 
-#undef TOTAL_MEMORY_SYMBOL
+
 #undef NPROC_SYMBOL
 #undef RTHASHSIZE_SYMBOL
 #undef RTHOST_SYMBOL
diff --git a/include/net-snmp/system/cygwin.h b/include/net-snmp/system/cygwin.h
index a9b76fb5d7de..5704f757da35 100644
--- a/include/net-snmp/system/cygwin.h
+++ b/include/net-snmp/system/cygwin.h
@@ -6,7 +6,3 @@
 #ifdef HAVE_STDINT_H
 #include /* uint32_t */
 #endif
-
-#undef bsdlike
-#undef MBSTAT_SYMBOL
-#undef TOTAL_MEMORY_SYMBOL
diff --git a/include/net-snmp/system/darwin10.h 
b/include/net-snmp/system/darwin10.h
index b9e2a5dd3bd5..2afd8bd1cbcd 100644
--- a/include/net-snmp/system/darwin10.h
+++ b/include/net-snmp/system/darwin10.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin11.h 
b/include/net-snmp/system/darwin11.h
index 93e76e2fdeaa..f600aadebe3a 100644
--- a/include/net-snmp/system/darwin11.h
+++ b/include/net-snmp/system/darwin11.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin12.h 
b/include/net-snmp/system/darwin12.h
index 22bcc57bd135..9cd8f1dd6a77 100644
--- a/include/net-snmp/system/darwin12.h
+++ b/include/net-snmp/system/darwin12.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin13.h 
b/include/net-snmp/system/darwin13.h
index db46762df1d3..e185fe2ea895 100644
--- a/include/net-snmp/system/darwin13.h
+++ b/include/net-snmp/system/darwin13.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin14.h 
b/include/net-snmp/system/darwin14.h
index 53f5101b0866..b54e3ae13fc7 100644
--- a/include/net-snmp/system/darwin14.h
+++ b/include/net-snmp/system/darwin14.h
@@ -61,8 +61,6 @@
  * use new host resources files as well
  */
 #define NETSNMP_INCLUDE_HOST_RESOURCES
-#define NETSNMP_INCLUDE_HRSWINST_REWRITES
-#define NETSNMP_INCLUDE_HRSWRUN_REWRITES
 #undef NETSNMP_INCLUDE_HRSWRUN_WRITE_SUPPORT
 #define NETSNMP_CAN_GET_DISK_LABEL 1
 
diff --git a/include/net-snmp/system/darwin7.h 
b/include/net-snmp/system/darwin7.h
index 8d4554d45ee9..db034cace5eb 100644
--- a/include/net-snmp/system/darwin7.h
+++ b/include/net-snmp/system/darwin7.h
@@ -7,9 +7,6 @@
  */
 #undef HAVE_FSTAB_H
 
-#define MBSTAT_SYMBOL "mbstat"
-#undef TOTAL_MEMORY_SYMBOL
-
 #define SWAPFILE_DIR "/private/var/vm"
 #define SWAPFILE_PREFIX "swapfile"
 
diff --git a/include/net-snmp/system/darwin9.h 
b/include/net-snmp/system/darwin9.h
index 

[PATCH 01/15] Cygwin64: Fix winExtDLL build

2018-05-13 Thread Bart Van Assche
The winExtDLL code assumes that sizeof(oid) == 4. Hence define the
'oid' type as unsigned int when building with MSVC, MinGW or Cygwin.
This patch avoids that building winExtDLL with Cygwin64 fails on the
following statement:

netsnmp_static_assert(sizeof(oid) == sizeof(UINT));
---
 include/net-snmp/library/oid.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/net-snmp/library/oid.h b/include/net-snmp/library/oid.h
index e7adf41d97ee..8c0b2b70a6cb 100644
--- a/include/net-snmp/library/oid.h
+++ b/include/net-snmp/library/oid.h
@@ -5,6 +5,16 @@
 #include 
 #endif
 
+#if defined(_WIN32) || defined(__CYGWIN__)
+/*
+ * The winExtDLL implementation assumes that the size of an OID component is
+ * 32 bits. See also the definition of SnmpVarBindList on MSDN
+ * (https://msdn.microsoft.com/en-us/library/windows/desktop/aa378929.aspx).
+ */
+typedef unsigned int oid;
+#define MAX_SUBID   0xUL
+#define NETSNMP_PRIo ""
+#else
 #ifndef EIGHTBIT_SUBIDS
 typedef u_long oid;
 #define MAX_SUBID   0xUL
@@ -14,5 +24,6 @@ typedef uint8_t oid;
 #define MAX_SUBID   0xFF
 #define NETSNMP_PRIo ""
 #endif
+#endif
 
 #endif /* NETSNMP_LIBRARY_OID_H */
-- 
2.16.3


--
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


[PATCH 11/15] libsnmp: Define MAX_OID_LEN once instead of three times

2018-05-13 Thread Bart Van Assche
---
 include/net-snmp/definitions.h  | 6 --
 include/net-snmp/library/asn1.h | 2 --
 include/net-snmp/types.h| 1 +
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/include/net-snmp/definitions.h b/include/net-snmp/definitions.h
index e79aa5d05c6a..1dfca03ab572 100644
--- a/include/net-snmp/definitions.h
+++ b/include/net-snmp/definitions.h
@@ -1,12 +1,6 @@
 #ifndef NET_SNMP_DEFINITIONS_H
 #define NET_SNMP_DEFINITIONS_H
 
-/**
- *  Defined constants, and other similar enumerations.
- */
-
-#define MAX_OID_LEN128 /* max subid's in an oid */
-
 /*
  *  For the initial release, this will just refer to the
  *  relevant UCD header files.
diff --git a/include/net-snmp/library/asn1.h b/include/net-snmp/library/asn1.h
index f7d8c12a5007..2e977ef144e6 100644
--- a/include/net-snmp/library/asn1.h
+++ b/include/net-snmp/library/asn1.h
@@ -43,8 +43,6 @@ SOFTWARE.
  * Use is subject to license terms specified in the COPYING file
  */
 
-#define MIN_OID_LEN2
-#define MAX_OID_LEN128 /* max subid's in an oid */
 #ifndef MAX_NAME_LEN/* conflicts with some libraries */
 #define MAX_NAME_LEN   MAX_OID_LEN /* obsolete. use MAX_OID_LEN */
 #endif
diff --git a/include/net-snmp/types.h b/include/net-snmp/types.h
index 47cab44960a1..f63388261c44 100644
--- a/include/net-snmp/types.h
+++ b/include/net-snmp/types.h
@@ -138,6 +138,7 @@ typedef union {
 } netsnmp_vardata;
 
 
+#define MIN_OID_LEN2
 #define MAX_OID_LEN128 /* max subid's in an oid */
 
 /** @typedef struct variable_list netsnmp_variable_list
-- 
2.16.3


--
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


[PATCH 08/15] Darwin: Move SNMP_CFRelease() definition

2018-05-13 Thread Bart Van Assche
Define the SNMP_CFRelease() macro once instead of multiple times.
---
 agent/mibgroup/host/data_access/swinst_darwin.c | 3 +++
 include/net-snmp/system/darwin10.h  | 5 -
 include/net-snmp/system/darwin11.h  | 5 -
 include/net-snmp/system/darwin12.h  | 5 -
 include/net-snmp/system/darwin13.h  | 5 -
 include/net-snmp/system/darwin14.h  | 5 -
 include/net-snmp/system/darwin9.h   | 5 -
 7 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/agent/mibgroup/host/data_access/swinst_darwin.c 
b/agent/mibgroup/host/data_access/swinst_darwin.c
index c0f50fa39ba9..4612a483e119 100644
--- a/agent/mibgroup/host/data_access/swinst_darwin.c
+++ b/agent/mibgroup/host/data_access/swinst_darwin.c
@@ -43,6 +43,9 @@ static netsnmp_container *dirs = NULL;
 
 /* -
  */
+
+#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
+
 void
 netsnmp_swinst_arch_init( void )
 {
diff --git a/include/net-snmp/system/darwin10.h 
b/include/net-snmp/system/darwin10.h
index 2afd8bd1cbcd..97200c153c82 100644
--- a/include/net-snmp/system/darwin10.h
+++ b/include/net-snmp/system/darwin10.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin11.h 
b/include/net-snmp/system/darwin11.h
index f600aadebe3a..79271028875c 100644
--- a/include/net-snmp/system/darwin11.h
+++ b/include/net-snmp/system/darwin11.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin12.h 
b/include/net-snmp/system/darwin12.h
index 9cd8f1dd6a77..f74e7810c570 100644
--- a/include/net-snmp/system/darwin12.h
+++ b/include/net-snmp/system/darwin12.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin13.h 
b/include/net-snmp/system/darwin13.h
index e185fe2ea895..4a7d6b9df76e 100644
--- a/include/net-snmp/system/darwin13.h
+++ b/include/net-snmp/system/darwin13.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin14.h 
b/include/net-snmp/system/darwin14.h
index b54e3ae13fc7..0eb9a95cfd72 100644
--- a/include/net-snmp/system/darwin14.h
+++ b/include/net-snmp/system/darwin14.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin9.h 
b/include/net-snmp/system/darwin9.h
index e1f64a8cac38..b5d14c83382b 100644
--- a/include/net-snmp/system/darwin9.h
+++ b/include/net-snmp/system/darwin9.h
@@ -114,11 +114,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
-- 
2.16.3


--
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


[PATCH 03/15] : Add missing #include directives

2018-05-13 Thread Bart Van Assche
Make sure that the struct timeval definition is included when it is
used inside this header file.
---
 include/net-snmp/library/snmp_api.h | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/net-snmp/library/snmp_api.h 
b/include/net-snmp/library/snmp_api.h
index 6cde26958bb5..a7d62e36a486 100644
--- a/include/net-snmp/library/snmp_api.h
+++ b/include/net-snmp/library/snmp_api.h
@@ -37,6 +37,21 @@
 
 #include 
 
+#ifdef SNMP_NEED_REQUEST_LIST
+#if TIME_WITH_SYS_TIME
+# include  /* struct timeval */
+# include 
+#else
+# if HAVE_SYS_TIME_H
+#  include 
+# else
+#  include 
+# endif
+#endif
+#else
+struct timeval;
+#endif
+
 #ifndef DONT_SHARE_ERROR_WITH_OTHER_THREADS
 #define SET_SNMP_ERROR(x) snmp_errno=(x)
 #else
@@ -70,7 +85,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
OF THIS
 SOFTWARE.
 **/
 
-struct timeval;
 /*
  * A list of all the outstanding requests for a particular session.
  */
-- 
2.16.3


--
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