winstub.c needs to have the 1st argument type in getnetbyaddr changed
to uint32_t to build on cygwin


I'm guessing the cygwin headers have changed because net-snmp used to
build for me with no problems on cygwin.  But now I get the same error
all the way back to version 5.6.1:

libtool: compile:  gcc -I../../include -DNETSNMP_ENABLE_IPV6
-fno-strict-aliasing -g -O2 -Ucygwin -Dcygwin=cygwin -c winstub.c
-DDLL_EXPORT -DPIC -o .libs/winstub.o
winstub.c:244:1: error: conflicting types for 'getnetbyaddr'
 getnetbyaddr(long net, int type)
 ^
In file included from winstub.c:32:0:
/usr/include/netdb.h:221:16: note: previous declaration of
'getnetbyaddr' was here
 struct netent *getnetbyaddr (uint32_t, int);
                ^
Makefile:98: recipe for target 'winstub.lo' failed
make[2]: *** [winstub.lo] Error 1
make[2]: Leaving directory '/source/net-snmp-5.7.3/apps/snmpnetstat'
Makefile:425: recipe for target 'subdirs' failed
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory '/source/net-snmp-5.7.3/apps'
Makefile:656: recipe for target 'subdirs' failed
make: *** [subdirs] Error 1

/source/net-snmp-5.7.3
$


http://pubs.opengroup.org/onlinepubs/7908799/xns/getnetbyaddr.html says
SYNOPSIS
    #include <netdb.h>
    struct netent *getnetbyaddr(uint32_t net, int type);
    struct netent *getnetbyname(const char *name);
    struct netent *getnetent(void);



winstub.c has

#if (defined(WIN32) || defined(cygwin) || defined(aix4))
  ...
#if HAVE_NETDB_H
#include <netdb.h>
#endif
  ...
struct netent  *
getnetbyaddr(long net, int type)
{
    return 0;
}


So I tried changing "long" to "uint32_t"

struct netent  *
getnetbyaddr(uint32_t net, int type)
{
    return 0;
}

and it builds with no errors.  "make install" had some permission
problems, but I finally got them straightened out:

$ snmpwalk -V
NET-SNMP version: 5.7.3

/source/net-snmp-5.7.3
$ snmpwalk -v 2c -c public demo.snmplabs.com system
RFC1213-MIB::sysDescr.0 = STRING: "SunOS zeus.snmplabs.com 4.1.3_U1 1 sun4m"
RFC1213-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.20408
RFC1213-MIB::sysUpTime.0 = Timeticks: (362177966) 41 days, 22:02:59.66
RFC1213-MIB::sysContact.0 = STRING: "SNMP Laboratories, i...@snmplabs.com"
RFC1213-MIB::sysName.0 = STRING: "zeus.snmplabs.com"
RFC1213-MIB::sysLocation.0 = STRING: "Moscow, Russia"
RFC1213-MIB::sysServices.0 = INTEGER: 72
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (362178041) 41 days, 22:03:00.41
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-SMI::enterprises.20408.1.1
SNMPv2-MIB::sysORDescr.1 = STRING: New system description
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (12) 0:00:00.12

/source/net-snmp-5.7.3
$


Lee

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to