xref: /aosp_15_r20/external/libpcap/doc/README.aix (revision 8b26181f966a6af5cf6981a6f474313de533bb28)
1*8b26181fSAndroid Build Coastguard Worker# Compiling libpcap on AIX
2*8b26181fSAndroid Build Coastguard Worker
3*8b26181fSAndroid Build Coastguard Worker* Autoconf is expected to work everywhere.
4*8b26181fSAndroid Build Coastguard Worker* Neither AIX lex nor AIX yacc nor AIX m4 are suitable.
5*8b26181fSAndroid Build Coastguard Worker
6*8b26181fSAndroid Build Coastguard Worker## AIX 7.1
7*8b26181fSAndroid Build Coastguard Worker
8*8b26181fSAndroid Build Coastguard Worker* libpcap build fails with rpcapd enabled.
9*8b26181fSAndroid Build Coastguard Worker* GNU M4 1.4.17 works.
10*8b26181fSAndroid Build Coastguard Worker* flex 2.6.4 and GNU Bison 3.5.1 work.
11*8b26181fSAndroid Build Coastguard Worker* CMake 3.16.0 works.
12*8b26181fSAndroid Build Coastguard Worker* GCC 8.3.0 works, XL C 12.1.0 works.
13*8b26181fSAndroid Build Coastguard Worker
14*8b26181fSAndroid Build Coastguard Worker## AIX 7.2
15*8b26181fSAndroid Build Coastguard Worker
16*8b26181fSAndroid Build Coastguard Worker* libpcap build fails with rpcapd enabled.
17*8b26181fSAndroid Build Coastguard Worker* GNU M4 1.4.17 works.
18*8b26181fSAndroid Build Coastguard Worker* flex 2.5.35 and GNU Bison 3.0.4 work.
19*8b26181fSAndroid Build Coastguard Worker* GCC 7.2.0 works, XL C 13.1.3 works.
20*8b26181fSAndroid Build Coastguard Worker
21*8b26181fSAndroid Build Coastguard Worker## Other AIX-related information
22*8b26181fSAndroid Build Coastguard Worker
23*8b26181fSAndroid Build Coastguard WorkerUsing BPF:
24*8b26181fSAndroid Build Coastguard Worker
25*8b26181fSAndroid Build Coastguard Worker(1) AIX 4.x's version of BPF is undocumented and somewhat unstandard; the
26*8b26181fSAndroid Build Coastguard Worker    current BPF support code includes changes that should work around
27*8b26181fSAndroid Build Coastguard Worker    that; it appears to compile and work on at least one AIX 4.3.3
28*8b26181fSAndroid Build Coastguard Worker    machine.
29*8b26181fSAndroid Build Coastguard Worker
30*8b26181fSAndroid Build Coastguard Worker    Note that the BPF driver and the "/dev/bpf" devices might not exist
31*8b26181fSAndroid Build Coastguard Worker    on your machine; AIX's tcpdump loads the driver and creates the
32*8b26181fSAndroid Build Coastguard Worker    devices if they don't already exist.  Our libpcap should do the
33*8b26181fSAndroid Build Coastguard Worker    same, and the configure script should detect that it's on an AIX
34*8b26181fSAndroid Build Coastguard Worker    system and choose BPF even if the devices aren't there.
35*8b26181fSAndroid Build Coastguard Worker
36*8b26181fSAndroid Build Coastguard Worker    Also note that tcpdump _binary_ compiled on AIX 4 may have a problem
37*8b26181fSAndroid Build Coastguard Worker    doing the initial loading of the BPF driver if copied to AIX 5 and
38*8b26181fSAndroid Build Coastguard Worker    run there (GH #52). tcpdump binary natively compiled on AIX 5 should
39*8b26181fSAndroid Build Coastguard Worker    not have this issue.
40*8b26181fSAndroid Build Coastguard Worker
41*8b26181fSAndroid Build Coastguard Worker(2) If libpcap doesn't compile on your machine when configured to use
42*8b26181fSAndroid Build Coastguard Worker    BPF, or if the workarounds fail to make it work correctly, you
43*8b26181fSAndroid Build Coastguard Worker    should send to [email protected] a detailed bug
44*8b26181fSAndroid Build Coastguard Worker    report (if the compile fails, send us the compile error messages;
45*8b26181fSAndroid Build Coastguard Worker    if it compiles but fails to work correctly, send us as detailed as
46*8b26181fSAndroid Build Coastguard Worker    possible a description of the symptoms, including indications of the
47*8b26181fSAndroid Build Coastguard Worker    network link-layer type being wrong or time stamps being wrong).
48*8b26181fSAndroid Build Coastguard Worker
49*8b26181fSAndroid Build Coastguard Worker    If you fix the problems yourself, please submit a patch by forking
50*8b26181fSAndroid Build Coastguard Worker    the branch at
51*8b26181fSAndroid Build Coastguard Worker
52*8b26181fSAndroid Build Coastguard Worker	https://github.com/the-tcpdump-group/libpcap/tree/master
53*8b26181fSAndroid Build Coastguard Worker
54*8b26181fSAndroid Build Coastguard Worker    and issuing a pull request, so we can incorporate the fixes into the
55*8b26181fSAndroid Build Coastguard Worker    next release.
56*8b26181fSAndroid Build Coastguard Worker
57*8b26181fSAndroid Build Coastguard Worker    If you don't fix the problems yourself, you can, as a workaround,
58*8b26181fSAndroid Build Coastguard Worker    make libpcap use DLPI instead of BPF.
59*8b26181fSAndroid Build Coastguard Worker
60*8b26181fSAndroid Build Coastguard Worker    This can be done by specifying the flag:
61*8b26181fSAndroid Build Coastguard Worker
62*8b26181fSAndroid Build Coastguard Worker       --with-pcap=dlpi
63*8b26181fSAndroid Build Coastguard Worker
64*8b26181fSAndroid Build Coastguard Worker    to the "configure" script for libpcap.
65*8b26181fSAndroid Build Coastguard Worker
66*8b26181fSAndroid Build Coastguard WorkerIf you use DLPI:
67*8b26181fSAndroid Build Coastguard Worker
68*8b26181fSAndroid Build Coastguard Worker(1) It is a good idea to have the latest version of the DLPI driver on
69*8b26181fSAndroid Build Coastguard Worker    your system, since certain versions may be buggy and cause your AIX
70*8b26181fSAndroid Build Coastguard Worker    system to crash.  DLPI is included in the fileset bos.rte.tty.  I
71*8b26181fSAndroid Build Coastguard Worker    found that the DLPI driver that came with AIX 4.3.2 was buggy, and
72*8b26181fSAndroid Build Coastguard Worker    had to upgrade to bos.rte.tty 4.3.2.4:
73*8b26181fSAndroid Build Coastguard Worker
74*8b26181fSAndroid Build Coastguard Worker	    lslpp -l bos.rte.tty
75*8b26181fSAndroid Build Coastguard Worker
76*8b26181fSAndroid Build Coastguard Worker	    bos.rte.tty     4.3.2.4  COMMITTED  Base TTY Support and Commands
77*8b26181fSAndroid Build Coastguard Worker
78*8b26181fSAndroid Build Coastguard Worker    Updates for AIX filesets can be obtained from:
79*8b26181fSAndroid Build Coastguard Worker    ftp://service.software.ibm.com/aix/fixes/
80*8b26181fSAndroid Build Coastguard Worker
81*8b26181fSAndroid Build Coastguard Worker    These updates can be installed with the smit program.
82*8b26181fSAndroid Build Coastguard Worker
83*8b26181fSAndroid Build Coastguard Worker(2) After compiling libpcap, you need to make sure that the DLPI driver
84*8b26181fSAndroid Build Coastguard Worker    is loaded.  Type:
85*8b26181fSAndroid Build Coastguard Worker
86*8b26181fSAndroid Build Coastguard Worker	    strload -q -d dlpi
87*8b26181fSAndroid Build Coastguard Worker
88*8b26181fSAndroid Build Coastguard Worker    If the result is:
89*8b26181fSAndroid Build Coastguard Worker
90*8b26181fSAndroid Build Coastguard Worker	    dlpi: yes
91*8b26181fSAndroid Build Coastguard Worker
92*8b26181fSAndroid Build Coastguard Worker    then the DLPI driver is loaded correctly.
93*8b26181fSAndroid Build Coastguard Worker
94*8b26181fSAndroid Build Coastguard Worker    If it is:
95*8b26181fSAndroid Build Coastguard Worker
96*8b26181fSAndroid Build Coastguard Worker	    dlpi: no
97*8b26181fSAndroid Build Coastguard Worker
98*8b26181fSAndroid Build Coastguard Worker    Then you need to type:
99*8b26181fSAndroid Build Coastguard Worker
100*8b26181fSAndroid Build Coastguard Worker	    strload -f /etc/dlpi.conf
101*8b26181fSAndroid Build Coastguard Worker
102*8b26181fSAndroid Build Coastguard Worker    Check again with strload -q -d dlpi that the dlpi driver is loaded.
103*8b26181fSAndroid Build Coastguard Worker
104*8b26181fSAndroid Build Coastguard Worker    Alternatively, you can uncomment the lines for DLPI in
105*8b26181fSAndroid Build Coastguard Worker    /etc/pse.conf and reboot the machine; this way DLPI will always
106*8b26181fSAndroid Build Coastguard Worker    be loaded when you boot your system.
107*8b26181fSAndroid Build Coastguard Worker
108*8b26181fSAndroid Build Coastguard Worker(3) There appears to be a problem in the DLPI code in some versions of
109*8b26181fSAndroid Build Coastguard Worker    AIX, causing a warning about DL_PROMISC_MULTI failing; this might
110*8b26181fSAndroid Build Coastguard Worker    be responsible for DLPI not being able to capture outgoing packets.
111