1 $Id: README.irix,v 1.4 2001/01/10 09:54:44 guy Exp $
3 1. Some problems seen by one person who tried to build Ethereal on IRIX;
6 To: ethereal-dev@zing.org
7 Subject: Re: [ethereal-dev] Ethereal on SGI
8 From: Randall Hopper <aa8vb@yahoo.com>
9 Date: Sat, 18 Sep 1999 12:19:31 -0400
11 |> Just tried to build ethereal on SGI IRIX. configure failed because
12 |> there is no net/bpf.h.
14 Thanks for all the help. I pulled the latest today (0.7.3), and after a
15 few fix-ups, I got it built. Here are the tweaks I needed to build it for
16 SGI IRIX 6.5 using gcc.
22 Ethereal doesn't use RPATH (see ld(1) for shared library linking on all
23 platforms that support it (e.g. SGI IRIX, FreeBSD ELF, etc.), just
24 Solaris it appears. Instead, ethereal recommends use of the
25 LD_LIBRARY_PATH hack which causes all sorts problems.
27 On SGI IRIX this is -rpath to the linker, on Solaris -R, on FreeBSD ELF
30 SOLUTION: Slip in my linker flags when configuring ethereal so it can
31 find libgtk, libgmodule, libsnmp, etc. at run-time without
34 env LDFLAGS="-rpath $HOME/software/gtk+-1.2.3/lib:$HOME/software/glib-1.2.3/lib:/usr/local/lib" configure --prefix=$HOME/software/ethereal-0.7.3 --with-gtk-prefix=$HOME/software/gtk+-1.2.3
36 BETTER SOLUTION: Modify configure to support RPATH for more platforms
43 __P not defined -- packet-snmp.c fails to build
44 (gcc version 2.95.1 19990816 (release), SGI IRIX 6.5.5f)
46 SOLUTION: Include gnuc.h -- it defines it
48 --- ORIG/packet-snmp.c Mon Aug 30 11:10:17 1999
49 +++ packet-snmp.c Sat Sep 18 11:35:45 1999
60 ===============================================================================
64 checking for GTK - version >= 1.2.0... 186062:./conftest: rld: Fatal Error: Cannot Successfully map soname 'libgtk-1.2.so.1' under any of the filenames /usr/lib32/libgtk-1.2.so.1:/usr/lib32/internal/libgtk-1.2.so.1:/lib32/libgtk-1.2.so.1:/opt/lib32/libgtk
66 *** Could not run GTK test program, checking why...
67 *** The test program compiled, but did not run. This usually means
68 *** that the run-time linker is not finding GTK or finding the wrong
69 *** version of GTK. If it is not finding GTK, you'll need to set your
70 *** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
71 *** to the installed location Also, make sure you have run ldconfig if that
72 *** is required on your system
74 *** If you have an old version installed, it is best to remove it, although
75 *** you may also be able to get things to work by modifying LD_LIBRARY_PATH
77 *** If you have a RedHat 5.0 system, you should remove the GTK package that
78 *** came with the system with the command
80 *** rpm --erase --nodeps gtk gtk-devel
81 configure: error: GTK+ distribution not found.
83 ==============================================================================
87 gcc -DHAVE_CONFIG_H -I. -I. -I. -Wall -g -O2 -Iwiretap -I/home/rhh/software/gtk+-1.2.3/include -I/home/rhh/software/glib-1.2.3/lib/glib/include -I/home/rhh/software/glib-1.2.3/include -c packet-snmp.c
88 In file included from packet-snmp.c:62:
89 /usr/local/include/ucd-snmp/asn1.h:131: parse error before `__P'
90 /usr/local/include/ucd-snmp/asn1.h:132: parse error before `__P'
91 /usr/local/include/ucd-snmp/asn1.h:133: parse error before `__P'
92 /usr/local/include/ucd-snmp/asn1.h:134: parse error before `__P'
93 /usr/local/include/ucd-snmp/asn1.h:135: parse error before `__P'
95 packet-snmp.c: In function `dissect_snmp':
96 packet-snmp.c:344: warning: implicit declaration of function `asn_parse_header'
97 packet-snmp.c:358: warning: implicit declaration of function `snmp_comstr_parse'
98 packet-snmp.c:358: warning: assignment makes pointer from integer without a cast
99 packet-snmp.c:407: warning: assignment makes pointer from integer without a cast
101 packet-snmp.c: In function `proto_register_snmp':
102 packet-snmp.c:869: warning: implicit declaration of function `init_mib'
103 gmake[2]: *** [packet-snmp.o] Error 1
104 gmake[2]: Leaving directory `/home/rhh/software/PKGS/t/ethereal-0.7.3'
105 gmake[1]: *** [all-recursive] Error 1
106 gmake[1]: Leaving directory `/home/rhh/software/PKGS/t/ethereal-0.7.3'
107 gmake: *** [all-recursive-am] Error 2
109 -------------------------------------------------------------------------------
111 Problem #3 (same as Problem #1):
114 189684:./ethereal: rld: Fatal Error: Cannot Successfully map soname 'libsnmp.so' under any of the filenames /home/rhh/software/gtk+-1.2.3/lib/libsnmp.so:/home/rhh/software/glib-1.2.3/lib/libsnmp.so:/usr/lib32/libsnmp.so:/usr/lib32/internal/libsnmp.so:/lib32/libsnmp.so:/opt/lib32/libsnmp.so:
116 2. Patches to libpcap that may be necessary
118 On IRIX, the libpcap library uses, in "pcap_open_live()", the snapshot
119 length passed in, without reducing it to be less than or equal to the
120 MTU of the interface. If the snapshot length is larger than the
121 interface MTU, IRIX will return an error; this means that, for example,
122 the Ethereal default snapshot length of 65535, chosen so that all of the
123 packet is captured, will not work.
125 Here is a patch to libpcap 0.4 source that should fix that problem. If
126 it doesn't fix the problem, or if it reduces the snapshot length below
127 the MTU (so that a snapshot length of 65535 doesn't capture all the data
128 in the packets), please report this to ethereal-dev@ethereal.com, so
129 that we know that it didn't work - we'll probably send you debugging
130 patches in the hopes of being able to make it work.
132 diff -c ../libpcap-0.4/pcap-snoop.c ./pcap-snoop.c
133 *** ../libpcap-0.4/pcap-snoop.c Tue Apr 8 21:07:01 1997
134 --- ./pcap-snoop.c Tue Jan 18 00:16:18 2000
138 struct sockaddr_raw sr;
139 struct snoopfilter sf;
146 p = (pcap_t *)malloc(sizeof(*p));
152 (void)setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&v, sizeof(v));
153 - if (ioctl(fd, SIOCSNOOPLEN, &snaplen) < 0) {
154 - sprintf(ebuf, "SIOCSNOOPLEN: %s", pcap_strerror(errno));
157 - p->snapshot = snaplen;
159 - if (ioctl(fd, SIOCSNOOPING, &v) < 0) {
160 - sprintf(ebuf, "SIOCSNOOPING: %s", pcap_strerror(errno));
164 * XXX hack - map device name to link layer type
170 strncmp("qaa", device, 3) == 0) {
171 p->linktype = DLT_EN10MB;
172 p->offset = RAW_HDRPAD(sizeof(struct ether_header));
173 + ll_hdrlen = sizeof(struct ether_header);
174 } else if (strncmp("ipg", device, 3) == 0 ||
175 strncmp("rns", device, 3) == 0 || /* O2/200/2000 FDDI */
176 strncmp("xpi", device, 3) == 0) {
177 p->linktype = DLT_FDDI;
178 p->offset = 3; /* XXX yeah? */
180 } else if (strncmp("ppp", device, 3) == 0) {
181 p->linktype = DLT_RAW;
182 + ll_hdrlen = 0; /* DLT_RAW meaning "no PPP header, just the IP packet"? */
183 } else if (strncmp("lo", device, 2) == 0) {
184 p->linktype = DLT_NULL;
185 + ll_hdrlen = 4; /* is this just like BSD's loopback device? */
187 sprintf(ebuf, "snoop: unknown physical layer type");
192 + * XXX - IRIX appears to give you an error if you try to set the
193 + * capture length to be greater than the MTU, so let's try to get
194 + * the MTU first and, if that succeeds, trim the snap length
195 + * to be no greater than the MTU.
197 + (void)strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name));
198 + if (ioctl(fd, SIOCGIFMTU, (char *)&ifr) < 0) {
199 + sprintf(ebuf, "SIOCGIFMTU: %s", pcap_strerror(errno));
204 + * XXX - some versions of IRIX 6.5 define "ifr_mtu" and have an
205 + * "ifru_metric" member of the "ifr_ifru" union in an "ifreq"
206 + * structure, others don't.
208 + * I've no idea what's going on, so, if "ifr_mtu" isn't defined,
209 + * we define it as "ifr_metric", as using that field appears to
210 + * work on the versions that lack "ifr_mtu" (and, on those that
211 + * don't lack it, "ifru_metric" and "ifru_mtu" are both "int"
212 + * members of the "ifr_ifru" union, which suggests that they
213 + * may be interchangeable in this case).
216 + #define ifr_mtu ifr_metric
218 + if (snaplen > ifr.ifr_mtu)
219 + snaplen = ifr.ifr_mtu;
223 + * The argument to SIOCSNOOPLEN is the number of link-layer
224 + * payload bytes to capture - it doesn't count link-layer
227 + snooplen = snaplen - ll_hdrlen;
230 + if (ioctl(fd, SIOCSNOOPLEN, &snooplen) < 0) {
231 + sprintf(ebuf, "SIOCSNOOPLEN: %s", pcap_strerror(errno));
234 + p->snapshot = snaplen;
236 + if (ioctl(fd, SIOCSNOOPING, &v) < 0) {
237 + sprintf(ebuf, "SIOCSNOOPING: %s", pcap_strerror(errno));