Remove the deja.com URLs for netnews articles with groups.google.com
[obnox/wireshark/wip.git] / README.hpux
1 $Id: README.hpux,v 1.17 2002/04/29 22:55:22 guy Exp $
2
3 Contents:
4
5 1 - Building ethereal
6 2 - Building GTK+/GLib with HP's C compiler
7 3 - nettl support
8 4 - libpcap on HP-UX
9 5 - HP-UX patches to fix packet capture problems
10
11 1 - Building ethereal
12
13 The Software Porting And Archive Centre for HP-UX, at
14
15         http://hpux.connect.org.uk/
16
17 (with mirrors in various countries, listed on the Centre's home page;
18 you may want to choose a mirror closer to you) has ported versions, in
19 both source and binary form, for Ethereal, as well as for the libpcap,
20 GLib, GTK+, and zlib libraries that it uses.
21
22 The changes they've made appear largely to be compile option changes; if
23 you've downloaded the source to the latest version of Ethereal (the
24 version on the Centre's site may not necessarily be the latest version),
25 it should be able to compile, perhaps with those changes.
26
27 They appear to have used HP-UX's "cc" compiler, with the options "-Ae
28 -O"; there's a comment "Add -Dhpux_9 if building under 9.X".  It may
29 also build with GCC.
30
31 They currently have libpcap 0.6.2; libpcap 0.6.2, and later versions,
32 include changes to properly open network devices when given the name
33 reported by the lanscan and ifconfig commands - earlier versions didn't
34 do this correctly.  Therefore, we strongly suggest you use libpcap 0.6.2
35 or later, not libpcap 0.5.2.
36
37 2 - Building GTK+/GLib with HP's C compiler
38
39 By default, HP's C compiler doesn't support "long long int" to provide
40 64-bit integral data types on 32-bit platforms; the "-Ae" flag must be
41 supplied to enable extensions such as that.
42
43 Ethereal's "configure" script automatically includes that flag if it
44 detects that the native compiler is being used on HP-UX; however, the
45 configure scripts for GTK+ and GLib don't do so, which means that 64-bit
46 integer support won't be enabled.
47
48 This may prevent some parts of Ethereal from compiling; in order to get
49 64-bit integer support in GTK+/GLib, edit all the Makefiles for GTK+ and
50 GLib, as generated by the GTK+ and GLib "configure" scripts, to add
51 "-Ae" to all "CFLAGS = " definitions found in those Makefiles.  (If a
52 Makefile lacks a "CFLAGS = " definition, there's no need to add a
53 definition that includes "-Ae".)
54
55 3 - nettl support
56
57 nettl is used on HP-UX to trace various streams based subsystems.  Ethereal
58 can read nettl files containing IP frames (NS_LS_IP subsystem) and LAPB
59 frames (SX25L2 subsystem).
60 It has been tested with files generated on HP-UX 9.04 and 10.20.
61
62 Use the following commands to generate a trace (cf. nettl(1M)):
63
64 # IP capture. 0x30000000 means PDU in and PDU out :
65 nettl -tn 0x30000000 -e NS_LS_IP -f tracefile
66 # X25 capture. You must specify an interface :
67 nettl -tn 0x30000000 -e SX25l2 -d /dev/x25_0 -f tracefile
68 # stop capture. subsystem is NS_LS_IP or SX25L2 :
69 nettl -tf -e subsystem
70
71 One may be able to specify "-tn pduin pduout" rather than
72 "-tn 0x30000000"; the nettl man page for HP-UX 10.30 implies that it
73 should work.
74
75 4 - libpcap on HP-UX
76
77 If you want to use Ethereal to capture packets, you will have to install
78 libpcap; binary distributions are, as noted above, available from the
79 Software Porting And Archive Centre for HP-UX, as well as source code.
80
81 The source code is also available from the official home of libpcap and
82 tcpdump, at
83
84         http://www.tcpdump.org/
85
86 if you want a version later than the version available from the Software
87 Porting And Archive Centre; however, the versions available from
88 tcpdump.org might not, for example, include support for building libpcap
89 as a shared library.
90
91 5 - HP-UX patches to fix packet capture problems
92
93 Note that packet-capture programs such as Ethereal/Tethereal or tcpdump
94 may, on HP-UX, not be able to see packets sent from the machine on which
95 they're running.  Some articles on groups.google.com discussing this
96 are:
97
98         http://groups.google.com/groups?selm=82ld3v%2480i%241%40mamenchi.zrz.TU-Berlin.DE
99
100 which says:
101
102   Newsgroups: comp.sys.hp.hpux 
103   Subject:  Re: Did someone made tcpdump working on 10.20 ?
104   Date: 12/08/1999
105   From: Lutz Jaenicke <jaenicke@emserv1.ee.TU-Berlin.DE>
106
107   In article <82ks5i$5vc$1@news1.dti.ne.jp>, mtsat <mtsat@iris.dti.ne.jp>
108   wrote:
109    >Hello,
110    >
111    >I downloaded and compiled tcpdump3.4 a couple of week ago. I tried to use
112    >it, but I can only see incoming data, never outgoing.
113    >Someone (raj) explained me that a patch was missing, and that this patch
114    >must me "patched" (poked) in order to see outbound data in promiscuous mode.
115    >Many things to do .... So the question is : did someone has already this
116    >"ready to use" PHNE_**** patch ?
117   
118    Two things:
119    1. You do need a late "LAN products cumulative patch" (e.g.  PHNE_18173
120   for   s700/10.20).
121    2. You must use
122 echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem
123      You can insert this e.g. into /sbin/init.d/lan
124   
125    Best regards,
126    Lutz
127
128 and
129
130         http://groups.google.com/groups?selm=88cf4t%24p03%241%40web1.cup.hp.com
131
132 which says:
133
134   Newsgroups: comp.sys.hp.hpux 
135   Subject: Re: tcpdump only shows incoming packets
136   Date: 02/15/2000
137   From: Rick Jones <foo@bar.baz.invalid>
138
139   Harald Skotnes <harald@cc.uit.no> wrote:
140   > I am running HPUX 11.0 on a C200 hanging on a 100Mb switch. I have
141   > compiled libpcap-0.4 an tcpdump-3.4 and it seems to work. But at a
142   > closer look I only get to see the incoming packets not the
143   > outgoing. I have tried tcpflow-0.12 which also uses libpcap and the
144   > same thing happens.  Could someone please give me a hint on how to
145   > get this right?
146   
147   Search/Read the archives ?-)
148   
149   What you are seeing is expected, un-patched, behaviour for an HP-UX
150   system.  On 11.00, you need to install the latest lancommon/DLPI
151   patches, and then the latest driver patch for the interface(s) in use. 
152   At that point, a miracle happens and you should start seeing outbound
153   traffic.
154
155 [That article also mentions the patch that appears below.]
156
157 and
158
159         http://groups.google.com/groups?selm=38AA973E.96BE7DF7%40cc.uit.no
160
161 which says:
162
163   Newsgroups: comp.sys.hp.hpux
164   Subject: Re: tcpdump only shows incoming packets
165   Date: 02/16/2000
166   From: Harald Skotnes <harald@cc.uit.no>
167
168   Rick Jones wrote:
169   
170         ...
171
172   > What you are seeing is expected, un-patched, behaviour for an HP-UX
173   > system. On 11.00, you need to install the latest lancommon/DLPI
174   > patches, and then the latest driver patch for the interface(s) in
175   > use. At that point, a miracle happens and you should start seeing
176   > outbound traffic.
177   
178   Thanks a lot.  I have this problem on several machines running HPUX
179   10.20 and 11.00.  The machines where patched up before y2k so did not
180   know what to think.  Anyway I have now installed PHNE_19766,
181   PHNE_19826, PHNE_20008, PHNE_20735 on the C200 and now I can see the
182   outbound traffic too.  Thanks again.
183
184 (although those patches may not be the ones to install - there may be
185 later patches).
186
187 Another posting:
188
189         http://groups.google.com/groups?selm=7d6gvn%24b3%241%40ocean.cup.hp.com
190
191 indicates that you need to install the optional STREAMS product to do
192 captures on HP-UX 9.x:
193
194   Newsgroups: comp.sys.hp.hpux
195   Subject:  Re: tcpdump HP/UX 9.x
196   Date: 03/22/1999
197   From: Rick Jones <foo@bar.baz>
198
199   Dave Barr (barr@cis.ohio-state.edu) wrote:
200   : Has anyone ported tcpdump (or something similar) to HP/UX 9.x?
201   
202   I'm reasonably confident that any port of tcpdump to 9.X would require
203   the (then optional) STREAMS product.  This would bring DLPI, which is
204   what one uses to access interfaces in promiscuous mode.
205   
206   I'm not sure that HP even sells the 9.X STREAMS product any longer,
207   since HP-UX 9.X is off the pricelist (well, maybe 9.10 for the old 68K
208   devices). 
209   
210   Your best bet is to be up on 10.20 or better if that is at all
211   possible.  If your hardware is supported by it, I'd go with HP-UX 11. 
212   If you want to see the system's own outbound traffic, you'll never get
213   that functionality on 9.X, but it might happen at some point for 10.20
214   and 11.X. 
215   
216   rick jones
217
218 (as per other messages cited here, the ability to see the system's own
219 outbound traffic did happen).
220
221 An additional note, from Jost Martin, for HP-UX 10.20:
222
223         Q: How do I get ethereral on HPUX to capture the _outgoing_ packets
224            of an interface
225         A: You need to get PHNE_20892,PHNE_20725 and PHCO_10947 (or
226            newer, this is as of 4.4.00) and its dependencies.  Then you can
227            enable the feature as descibed below:
228
229         Patch Name: PHNE_20892
230         Patch Description: s700 10.20 PCI 100Base-T cumulative patch
231                 To trace the outbound packets, please do the following
232                 to turn on a global promiscuous switch before running
233                 the promiscuous applications like snoop or tcpdump:
234
235                 adb -w /stand/vmunix /dev/mem
236                 lanc_outbound_promisc_flag/W 1
237                 (adb will echo the result showing that the flag has
238                 been changed)
239                 $quit
240         (Thanks for this part to HP-support, Ratingen)
241
242                 The attached hack does this and some security-related stuff
243         (thanks to hildeb@www.stahl.bau.tu-bs.de (Ralf Hildebrandt) who
244         posted the security-part some time ago)
245
246                  <<hack_ip_stack>> 
247
248                 (Don't switch IP-forwarding off, if you need it !)
249                 Install the hack as /sbin/init.d/hacl_ip_stack (adjust
250         permissions !) and make a sequencing-symlink
251         /sbin/rc2.d/S350hack_ip_stack pointing to this script. 
252                 Now all this is done on every reboot.
253
254 Here's the "hack_ip_stack" script:
255
256 -----------------------------------Cut Here-------------------------------------
257 #!/sbin/sh
258 #
259 # nettune:  hack kernel parms for safety
260
261 OKAY=0
262 ERROR=-1
263
264 # /usr/contrib/bin fuer nettune auf Pfad
265 PATH=/sbin:/usr/sbin:/usr/bin:/usr/contrib/bin
266 export PATH
267
268
269 ##########
270 #  main  #
271 ##########
272
273 case $1 in
274    start_msg)
275       print "Tune IP-Stack for security"
276       exit $OKAY
277       ;;
278
279    stop_msg)
280       print "This action is not applicable"
281       exit $OKAY
282       ;;
283
284    stop)
285       exit $OKAY
286       ;;
287
288    start)
289       ;;  # fall through
290
291    *)
292       print "USAGE: $0 {start_msg | stop_msg | start | stop}" >&2
293       exit $ERROR
294       ;;
295    esac
296
297 ###########
298 #  start  #
299 ###########
300
301 #
302 # tcp-Sequence-Numbers nicht mehr inkrementieren sondern random
303 # Syn-Flood-Protection an
304 # ip_forwarding aus
305 # Source-Routing aus
306 # Ausgehende Packets an ethereal/tcpdump etc.
307
308 /usr/contrib/bin/nettune -s tcp_random_seq 2 || exit $ERROR
309 /usr/contrib/bin/nettune -s hp_syn_protect 1 || exit $ERROR
310 /usr/contrib/bin/nettune -s ip_forwarding 0 || exit $ERROR
311 echo 'ip_block_source_routed/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem || exit $ERROR
312 echo 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem  || exit $ERROR
313
314 exit $OKAY
315 -----------------------------------Cut Here-------------------------------------