1 After much work and toil, Craig Rodrigues was able to compile libpcap and Ethereal
2 on AIX 4.3.2. His odyssey is document in various e-mails at
3 http://ethereal.zing.org/lists/ethereal-dev/199911/
5 Here are a few excerpts.
9 Subject: Re: [ethereal-dev] Re: [ethereal-users] Problems compiling 0.7.7 under AIX 4.3.2
10 From: Gilbert Ramirez <gram@xiexie.org>
11 Date: Fri, 5 Nov 1999 16:58:17 -0600
12 To: Guy Harris <guy@netapp.com>
13 Cc: Craig Rodrigues <rodrigc@mediaone.net>, ethereal-dev@zing.org
16 On Fri, Nov 05, 1999 at 01:42:44PM -0600, Guy Harris wrote:
21 > Looks suspiciously similar to the previous error; have you tried
22 > recompiling GTK+ with "xlc_r"?
24 I believe glib and gtk+ should both be compiled with xlc_r. I haven't
25 compiled on AIX in a long time, but I think it's because glib is including
26 pthread stuff, so the re-entrant C library, libc_r, is needed.
31 When compiling a multi-threaded program, you should invoke the C compiler
32 using one of the following commands:
35 Invokes the compiler with default language level of ansi.
37 Invokes the compiler with default language level of extended.
40 These commands ensure that the adequate options and libraries are used to be
41 compliant with the X/Open Version 5 Standard. The POSIX Threads
42 Specification 1003.1c is a subset of the X/Open Specification.
44 The following libraries are automatically linked with your program when using these commands:
52 For example, the following command compiles the foo.c multi-threaded C source file and produces the foo executable file:
56 See the cc command for more information about C For AIX.
62 To: ethereal-users@zing.org
63 Subject: [ethereal-dev] AIX: gtk problem solved, now an ethereal problem
64 From: Craig Rodrigues <rodrigc@mediaone.net>
65 Date: Mon, 8 Nov 1999 10:46:25 -0500
66 Cc: ethereal-dev@zing.org
71 After much sweat and toil, I have managed to get gtk 1.2.6 to
72 compile and not dump core under AIX. The solutions were to
73 (1) apply the attached patch to the configure.in in the glib-1.2.6
76 (2) In the file gtk+-1.2.6/gtk/Makefile, add a link flag -lgdk to link
79 I have submitted (1) to the gtk-devel mailing list where it has been
80 accepted. (2) is an uglier problem, but for now, adding -lgdk by hand
83 Now I have a problem....I compiled gtk, and that works.
84 I compiled ethereal (after some minor mods), and it starts,
85 but when I click on Capture -> Start, I get:
87 "There are no network interfaces that can be opened."
89 I am running as root, so I don't think permissions are a problem.
96 http://www.gis.net/~craigr
99 *** configure.in.old Thu Oct 7 17:27:43 1999
100 --- configure.in Sun Nov 7 19:34:36 1999
104 if test "$ac_cv_func_getpwuid_r" = "yes"; then
105 AC_MSG_CHECKING(whether getpwuid_r is posix like)
106 ! # getpwuid_r(0, NULL, NULL, 0) is the signature on
107 ! # solaris, if that is not found, the prog below won't
108 ! # compile, then the posix signature is assumed as
110 ! AC_TRY_COMPILE([#include <pwd.h>],
111 ! [getpwuid_r(0, NULL, NULL, 0);],
112 ! [AC_MSG_RESULT(no)],
113 ! [AC_MSG_RESULT(yes)
114 ! AC_DEFINE(HAVE_GETPWUID_R_POSIX)])
117 if test x"$have_threads" = xposix; then
120 if test "$ac_cv_func_getpwuid_r" = "yes"; then
121 AC_MSG_CHECKING(whether getpwuid_r is posix like)
122 ! # The signature for the POSIX version is:
123 ! # int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **)
124 ! AC_TRY_COMPILE([#include <pwd.h>
125 ! #include <sys/types.h>
126 ! #include <stdlib.h>],
127 ! [getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);],
128 ! [AC_DEFINE(HAVE_GETPWUID_R_POSIX)
129 ! AC_MSG_RESULT(yes)],
130 ! [AC_MSG_RESULT(no)])
133 if test x"$have_threads" = xposix; then
137 To: ethereal-dev@zing.org
138 Subject: Re: [ethereal-dev] AIX: gtk problem solved, now an ethereal problem
139 From: Craig Rodrigues <rodrigc@mediaone.net>
140 Date: Wed, 10 Nov 1999 12:18:47 -0500
146 OK, I'm getting closer and closer to this working on AIX.
150 (1) In a bunch of places in the code I removed '//' style C++ comments
151 which the IBM C compiler didn't like.
153 (2) I also found some places in the code like:
155 enum some_enum { FOO, BAR, };
157 IBM C did not like the trailing "," after BAR.
159 (3) In packet-ipv6.h, IPV6_VERSION is defined, but that is already
160 defined in <netinet/in.h> on AIX 4.3, so for now I just commented that out.
162 (4) in packet-afs.c, when it sucks in <netinet/in.h>, in.h sucks in
163 <sys/machine.h> which defines LITTLE_ENDIAN. This conflicts with
164 LITTLE_ENDIAN in globals.h. So what I did was, in globals.h, I added:
166 #ifdef HAVE_NETINET_IN_H
167 #include <netinet/in.h>
170 So after doing all these things, I can compile ethereal and run it.
172 correct network interfaces on my system: lo0 and en0. However,
173 when I start capturing packets on en0, they are all of the protocol type
174 "TRMAC" and "TR". The only problem is, I'm not on a Token Ring network.
178 No. Time Source Destination Protocol Info
179 1 0.000000 0a:30:a1:08:00:45 06:74:60:08:00:5a TR Token-Ring Unknown
180 2 0.210304 0a:30:a1:08:00:45 06:74:60:08:00:5a TR Token-Ring Unknown
181 3 0.926080 0a:30:a1:08:00:45 06:74:60:08:00:5a TR Token-Ring Unknown
182 4 0.4236416 0a:30:a1:08:00:45 06:74:60:08:00:5a TR Token-Ring Unknown
183 5 0.4712064 6f:06:74:60:08:00 5a:8a:30:a1:00:00 TR MAC Unknown Major Vector: 127
186 ---------------------
187 It turns out that libpcap was using IFT_* numbers instead of DLT_* numbers for
188 link types. That has been fixed
189 ---------------------
192 To: tcpdump-workers@tcpdump.org
193 Subject: [ethereal-dev] Sucess with libpcap under AIX
194 From: Craig Rodrigues <rodrigc@mediaone.net>
195 Date: Sat, 20 Nov 1999 03:34:50 -0500
196 Cc: ethereal-dev@zing.org
201 I have managed to successfully compile and use the latest
202 snapshot of libpcap under AIX using DLPI. bpf is majorly
203 brain-dead under AIX, and very unsupported. Rather than
204 find all the bugs in AIX's bpf, I decided to try using
205 dlpi, which is officially supported.
207 The first step is to get the setup right. To determine if
208 you have the dlpi driver loaded correctly, type:
214 then you are ready to use dlpi.
219 Then you need to type:
220 strload -f /etc/dlpi.conf
222 Check again with strload -q -d dlpi that the dlpi driver is loaded.
224 I had to make one minor code change to pcap-dlpi.c. Maybe someone
225 can explain it to me, because I am not familiar with dlpi or
226 streams programming. It took me hours to figure this out, because
227 I'm not familiar with dlpi.
229 In pcap-dlpi.c, lines 316-320:
230 #if !defined(HAVE_HPUX9) && !defined(HAVE_HPUX10_20) && !defined(sinix)
231 if (dlbindreq(p->fd, 0, ebuf) < 0 ||
232 dlbindack(p->fd, (char *)buf, ebuf) < 0)
237 #if !defined(HAVE_HPUX9) && !defined(HAVE_HPUX10_20) && !defined(sinix)
238 if (dlbindreq(p->fd, 1620, ebuf) < 0 ||
239 dlbindack(p->fd, (char *)buf, ebuf) < 0)
243 I picked the number 1620 out of thin air. The second parameter
244 to dlbindreq() sets the value of dl_sap. This dl_sap
245 value is then passed along to the DLPI driver through
246 the DL_BIND_REQ primitive. I guess that it cannot be 0 under
247 AIX, but I'm not sure.
249 If someone knows anything about DLPI, I'd appreciate a clarification.
250 Basically, I am just using the DLPI specification at:
251 http://www.opengroup.org/onlinepubs/009638599/ which is pretty good.
252 The AIX documentation is not so well written.
254 But basically, after I fixed up pcap-dlpi.c, I managed to get libpcap
255 working under AIX. This enabled me to successfully run Ethereal,
256 ie. all the packets on my Ethernet network correctly showed up
257 as Ethernet and not Token Ring in the Ethereal screen.
262 http://www.gis.net/~craigr