I try to make cvs source on FreeBSD 4.8, But can not.
Because of
#define if_type if_data.ifi_type
at /usr/include/net/if_var.h .
problem code is mibII/interfaces.c .
gcc -I../../include -I. -I../../agent -I../../agent/mibgroup -I../../snmplib -g -O2
-Dfreebsd4 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -Wcast-qual
-Wno-char-subscripts -c mibII/interfaces.c -o mibII/interfaces.o
../../include/net-snmp/agent/table_container.h:57: warning: called from here
In file included from mibII/interfaces.c:204:
../../include/net-snmp/data_access/interface.h: At top level:
../../include/net-snmp/data_access/interface.h:107: syntax error before `.'
../../include/net-snmp/data_access/interface.h:115: syntax error before `.'
../../include/net-snmp/data_access/interface.h:118: syntax error before `.'
*** Error code 1
***********************
Check gcc -E -C mibII/interfaces.c , strange rewrite.
line 206 at agent/mibgroup/mibII/interface.c
#include "interfaces.h"
line 93 at include/net-snmp/data_access/interface.h
typedef struct netsnmp_interface_entry_s {
netsnmp_index oid_index;
int flags;
oid index;
/*
* "Static" information
* Typically constant for a given interface
*/
char *if_name;
char *if_descr;
int if_type; <--- !!!!
But gcc rewrite like this.
int if_data.ifi_type ; <---- !!!!
reason is /usr/include/net/if_var.h .
#define if_mtu if_data.ifi_mtu
#define if_type if_data.ifi_type <---- !!!!
#define if_physical if_data.ifi_physical
#define if_addrlen if_data.ifi_addrlen
#define if_hdrlen if_data.ifi_hdrlen
#define if_metric if_data.ifi_metric
#define if_baudrate if_data.ifi_baudrate
#define if_hwassist if_data.ifi_hwassist
#define if_ipackets if_data.ifi_ipackets
#define if_ierrors if_data.ifi_ierrors
#define if_opackets if_data.ifi_opackets
#define if_oerrors if_data.ifi_oerrors
#define if_collisions if_data.ifi_collisions
#define if_ibytes if_data.ifi_ibytes
#define if_obytes if_data.ifi_obytes
#define if_imcasts if_data.ifi_imcasts
#define if_omcasts if_data.ifi_omcasts
#define if_iqdrops if_data.ifi_iqdrops
#define if_noproto if_data.ifi_noproto
#define if_lastchange if_data.ifi_lastchange
line 88 at agent/mibgroup/mibII/interface.c
#if HAVE_NET_IF_VAR_H
#include <net/if_var.h>
#endif
In FreeBSD, configure found if_var.h. so define HAVE_NET_IF_VAR_H
********
BTW
BSD/OS 4.1 /usr/include/net/if.h
#define if_mtu if_data.ifi_mtu
#define if_type if_data.ifi_type
NetBSD 1.6.2
#define if_mtu if_data.ifi_mtu
#define if_type if_data.ifi_type
********
which is better?
1) edit include/net-snmp/data_access/interface.h
typedef struct netsnmp_interface_entry_s {
int if_type;
change if_type to another label name if_???.
2) edit somewhere
#ifdef freebsd
#undef if_type
#endif
I think, "#define if_type" is historical define,
so please change label name.
--
Akihiro IIJIMA [EMAIL PROTECTED]
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Net-snmp-users mailing list
[EMAIL PROTECTED]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users