fix MSVC unused magic warning
[obnox/wireshark/wip.git] / README.hpux
1 $Id$
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 Versions of libpcap prior to 0.6 didn't handle HP-UX as well as 0.6 and
82 later versions do.  You should install the latest version.
83
84 The source code is also available from the official home of libpcap and
85 tcpdump, at
86
87         http://www.tcpdump.org/
88
89 if you want a version later than the version available from the Software
90 Porting And Archive Centre; however, the versions available from
91 tcpdump.org might not, for example, include support for building libpcap
92 as a shared library.
93
94 5 - HP-UX patches to fix packet capture problems
95
96 Note that packet-capture programs such as Ethereal/Tethereal or tcpdump
97 may, on HP-UX, not be able to see packets sent from the machine on which
98 they're running.  Some articles on groups.google.com discussing this
99 are:
100
101         http://groups.google.com/groups?selm=82ld3v%2480i%241%40mamenchi.zrz.TU-Berlin.DE
102
103 which says:
104
105   Newsgroups: comp.sys.hp.hpux 
106   Subject:  Re: Did someone made tcpdump working on 10.20 ?
107   Date: 12/08/1999
108   From: Lutz Jaenicke <jaenicke@emserv1.ee.TU-Berlin.DE>
109
110   In article <82ks5i$5vc$1@news1.dti.ne.jp>, mtsat <mtsat@iris.dti.ne.jp>
111   wrote:
112    >Hello,
113    >
114    >I downloaded and compiled tcpdump3.4 a couple of week ago. I tried to use
115    >it, but I can only see incoming data, never outgoing.
116    >Someone (raj) explained me that a patch was missing, and that this patch
117    >must me "patched" (poked) in order to see outbound data in promiscuous mode.
118    >Many things to do .... So the question is : did someone has already this
119    >"ready to use" PHNE_**** patch ?
120   
121    Two things:
122    1. You do need a late "LAN products cumulative patch" (e.g.  PHNE_18173
123   for   s700/10.20).
124    2. You must use
125 echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem
126      You can insert this e.g. into /sbin/init.d/lan
127   
128    Best regards,
129    Lutz
130
131 and
132
133         http://groups.google.com/groups?selm=88cf4t%24p03%241%40web1.cup.hp.com
134
135 which says:
136
137   Newsgroups: comp.sys.hp.hpux 
138   Subject: Re: tcpdump only shows incoming packets
139   Date: 02/15/2000
140   From: Rick Jones <foo@bar.baz.invalid>
141
142   Harald Skotnes <harald@cc.uit.no> wrote:
143   > I am running HPUX 11.0 on a C200 hanging on a 100Mb switch. I have
144   > compiled libpcap-0.4 an tcpdump-3.4 and it seems to work. But at a
145   > closer look I only get to see the incoming packets not the
146   > outgoing. I have tried tcpflow-0.12 which also uses libpcap and the
147   > same thing happens.  Could someone please give me a hint on how to
148   > get this right?
149   
150   Search/Read the archives ?-)
151   
152   What you are seeing is expected, un-patched, behaviour for an HP-UX
153   system.  On 11.00, you need to install the latest lancommon/DLPI
154   patches, and then the latest driver patch for the interface(s) in use. 
155   At that point, a miracle happens and you should start seeing outbound
156   traffic.
157
158 [That article also mentions the patch that appears below.]
159
160 and
161
162         http://groups.google.com/groups?selm=38AA973E.96BE7DF7%40cc.uit.no
163
164 which says:
165
166   Newsgroups: comp.sys.hp.hpux
167   Subject: Re: tcpdump only shows incoming packets
168   Date: 02/16/2000
169   From: Harald Skotnes <harald@cc.uit.no>
170
171   Rick Jones wrote:
172   
173         ...
174
175   > What you are seeing is expected, un-patched, behaviour for an HP-UX
176   > system. On 11.00, you need to install the latest lancommon/DLPI
177   > patches, and then the latest driver patch for the interface(s) in
178   > use. At that point, a miracle happens and you should start seeing
179   > outbound traffic.
180   
181   Thanks a lot.  I have this problem on several machines running HPUX
182   10.20 and 11.00.  The machines where patched up before y2k so did not
183   know what to think.  Anyway I have now installed PHNE_19766,
184   PHNE_19826, PHNE_20008, PHNE_20735 on the C200 and now I can see the
185   outbound traffic too.  Thanks again.
186
187 (although those patches may not be the ones to install - there may be
188 later patches).
189
190 And another message to tcpdump-workers@tcpdump.org, from Rick Jones:
191
192   Date: Mon, 29 Apr 2002 15:59:55 -0700
193   From: Rick Jones
194   To: tcpdump-workers@tcpdump.org 
195   Subject: Re: [tcpdump-workers] I Can't Capture the Outbound Traffic
196
197         ...
198
199   http://itrc.hp.com/ would be one place to start in a search for the most
200   up-to-date patches for DLPI and the lan driver(s) used on your system (I
201   cannot guess because 9000/800 is too generic - one hs to use the "model"
202   command these days and/or an ioscan command (see manpage) to guess what
203   the drivers (btlan[3456], gelan, etc) might be involved in addition to
204   DLPI.
205
206   Another option is to upgrade to 11i as outbound promiscuous mode support
207   is there in the base OS, no patches required.
208
209 Another posting:
210
211         http://groups.google.com/groups?selm=7d6gvn%24b3%241%40ocean.cup.hp.com
212
213 indicates that you need to install the optional STREAMS product to do
214 captures on HP-UX 9.x:
215
216   Newsgroups: comp.sys.hp.hpux
217   Subject:  Re: tcpdump HP/UX 9.x
218   Date: 03/22/1999
219   From: Rick Jones <foo@bar.baz>
220
221   Dave Barr (barr@cis.ohio-state.edu) wrote:
222   : Has anyone ported tcpdump (or something similar) to HP/UX 9.x?
223   
224   I'm reasonably confident that any port of tcpdump to 9.X would require
225   the (then optional) STREAMS product.  This would bring DLPI, which is
226   what one uses to access interfaces in promiscuous mode.
227   
228   I'm not sure that HP even sells the 9.X STREAMS product any longer,
229   since HP-UX 9.X is off the pricelist (well, maybe 9.10 for the old 68K
230   devices). 
231   
232   Your best bet is to be up on 10.20 or better if that is at all
233   possible.  If your hardware is supported by it, I'd go with HP-UX 11. 
234   If you want to see the system's own outbound traffic, you'll never get
235   that functionality on 9.X, but it might happen at some point for 10.20
236   and 11.X. 
237   
238   rick jones
239
240 (as per other messages cited here, the ability to see the system's own
241 outbound traffic did happen).
242
243 Rick Jones reports that HP-UX 11i needs no patches for outbound
244 promiscuous mode support.
245
246 An additional note, from Jost Martin, for HP-UX 10.20:
247
248         Q: How do I get ethereral on HPUX to capture the _outgoing_ packets
249            of an interface
250         A: You need to get PHNE_20892,PHNE_20725 and PHCO_10947 (or
251            newer, this is as of 4.4.00) and its dependencies.  Then you can
252            enable the feature as descibed below:
253
254         Patch Name: PHNE_20892
255         Patch Description: s700 10.20 PCI 100Base-T cumulative patch
256                 To trace the outbound packets, please do the following
257                 to turn on a global promiscuous switch before running
258                 the promiscuous applications like snoop or tcpdump:
259
260                 adb -w /stand/vmunix /dev/mem
261                 lanc_outbound_promisc_flag/W 1
262                 (adb will echo the result showing that the flag has
263                 been changed)
264                 $quit
265         (Thanks for this part to HP-support, Ratingen)
266
267                 The attached hack does this and some security-related stuff
268         (thanks to hildeb@www.stahl.bau.tu-bs.de (Ralf Hildebrandt) who
269         posted the security-part some time ago)
270
271                  <<hack_ip_stack>> 
272
273                 (Don't switch IP-forwarding off, if you need it !)
274                 Install the hack as /sbin/init.d/hacl_ip_stack (adjust
275         permissions !) and make a sequencing-symlink
276         /sbin/rc2.d/S350hack_ip_stack pointing to this script. 
277                 Now all this is done on every reboot.
278
279 Here's the "hack_ip_stack" script:
280
281 -----------------------------------Cut Here-------------------------------------
282 #!/sbin/sh
283 #
284 # nettune:  hack kernel parms for safety
285
286 OKAY=0
287 ERROR=-1
288
289 # /usr/contrib/bin fuer nettune auf Pfad
290 PATH=/sbin:/usr/sbin:/usr/bin:/usr/contrib/bin
291 export PATH
292
293
294 ##########
295 #  main  #
296 ##########
297
298 case $1 in
299    start_msg)
300       print "Tune IP-Stack for security"
301       exit $OKAY
302       ;;
303
304    stop_msg)
305       print "This action is not applicable"
306       exit $OKAY
307       ;;
308
309    stop)
310       exit $OKAY
311       ;;
312
313    start)
314       ;;  # fall through
315
316    *)
317       print "USAGE: $0 {start_msg | stop_msg | start | stop}" >&2
318       exit $ERROR
319       ;;
320    esac
321
322 ###########
323 #  start  #
324 ###########
325
326 #
327 # tcp-Sequence-Numbers nicht mehr inkrementieren sondern random
328 # Syn-Flood-Protection an
329 # ip_forwarding aus
330 # Source-Routing aus
331 # Ausgehende Packets an ethereal/tcpdump etc.
332
333 /usr/contrib/bin/nettune -s tcp_random_seq 2 || exit $ERROR
334 /usr/contrib/bin/nettune -s hp_syn_protect 1 || exit $ERROR
335 /usr/contrib/bin/nettune -s ip_forwarding 0 || exit $ERROR
336 echo 'ip_block_source_routed/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem || exit $ERROR
337 echo 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem  || exit $ERROR
338
339 exit $OKAY
340 -----------------------------------Cut Here-------------------------------------