In a ChangeHosts request, display 4-byte Internet addresses as IPv4
[obnox/wireshark/wip.git] / print.ps
1 %!
2 %
3 % Code between start/end remarks is put into ps.c
4 % Anything else is thrown away, and is for testing only.
5 %
6 % ---- ethereal preamble start ---- %
7 %!
8 %!PS-Adobe-2.0
9 %
10 % Ethereal - Network traffic analyzer
11 % By Gerald Combs <gerald@zing.org>
12 % Copyright 1998 Gerald Combs
13 %
14 %%Creator: Ethereal
15 %%Title: ethereal.ps
16 %%DocumentFonts: Helvetica Courier
17 %%EndComments
18 %!
19
20 % Get the Imagable Area of the page
21 clippath pathbbox
22
23 % Set vmax to the vertical size of the page,
24 % hmax to the horizontal size of the page.
25 /vmax exch def
26 /hmax exch def
27 pop pop         % junk
28
29 % 1-inch margins
30 /lmargin 72 def
31 /tmargin vmax 72 sub def
32 /bmargin 72 def
33 /pagenumtab hmax 72 sub def
34
35 % Counters
36 /vpos vmax 40 sub def
37 /thispagenum 1 def
38
39 % Strings
40 /pagenostr 7 string def
41
42 % Prints text with possible indenting
43 /putline {
44         exch 10 mul lmargin add         % X
45         vpos                                            % Y
46         moveto
47         show
48
49         /vpos vpos 10 sub def
50
51         vpos bmargin le                         % is vpos <= bottom margin?
52         {
53                 printpagenum showpage
54                 /vpos tmargin def
55         }
56         if                                                      % then formfeed and start at top
57 } def
58
59 % A putline with no indenting
60 /hexdump {
61         lmargin                                         % X
62         vpos                                            % Y
63         moveto
64         show
65
66         /vpos vpos 10 sub def
67
68         vpos bmargin le                         % is vpos <= bottom margin?
69         {
70                 printpagenum showpage
71                 /vpos tmargin def
72         }
73         if                                                      % then formfeed and start at top
74 } def
75
76 % A put line with smaller spacing and no formfeed
77 /titleline {
78         lmargin                                         % X
79         vpos                                            % Y
80         moveto
81         show
82
83         /vpos vpos 8 sub def
84 } def
85
86 % Prints the page number at the top right
87 /printpagenum {
88         gsave
89                 % Set the font to 8 point
90                 /Helvetica findfont 8 scalefont setfont
91
92                 pagenumtab                                      % X
93                 vmax 40 sub                                     % Y
94                 moveto
95                 (Page ) show
96                 thispagenum pagenostr cvs show
97
98                 % thispagenum++
99                 /thispagenum thispagenum 1 add def
100         grestore
101 } def
102         
103 % Set the font to 8 point
104 /Helvetica findfont 8 scalefont setfont
105
106 % Create the title
107 (Ethereal) titleline
108
109 % Reset the vertical position
110 /vpos tmargin def
111
112 % Set the font to 10 point
113 /Courier findfont 10 scalefont setfont
114 % ---- ethereal preamble end ---- %
115
116 % Display our output lines.
117 0 (Ethernet II \(98 on wire, 68 captured\)) putline
118 1 (Destination: 00:00:0c:36:00:2a) putline
119 1 (Source: 00:c0:4f:c7:eb:c0) putline
120 1 (Type: IP \(0x0800\)) putline
121 0 (Ethernet II \(98 on wire, 68 captured\)) putline
122 1 (Source: 00:c0:4f:c7:eb:c0) putline
123 1 (Type: IP \(0x0800\)) putline
124 0 (Source: 00:c0:4f:c7:eb:c0) putline
125
126 % ---- ethereal hex start ---- %
127 % Set the font to 10 point
128 /Courier findfont 10 scalefont setfont
129 () hexdump
130 % ---- ethereal hex end ---- %
131
132 (   0  cc00 0000 0000 0702 0000 0000 0000 0000   ................ ) hexdump
133 (  10  0000 bd0e fe16 0100 3e00 0308 584c 2038   ........>...XL 8 ) hexdump
134 (  20  3020 494d 3300 1601 0034 0016 0101 3500   0 IM3....4....5. ) hexdump
135 (  30  1601 0236 0016 0103 6e00 1601 ff6f 0016   ...6....n....o.. ) hexdump
136 (  40  01ff 7000 1601 ff71 0016 01ff 4800 0104   ..p....q....H... ) hexdump
137 (  50  ff03 0700 2400 0101 0525 0001 0105 2600   ....$....%....&. ) hexdump
138 (  60  0101 0527 0001 0105 6a00 0101 006b 0001   ...'....j....k.. ) hexdump
139 (  70  0100 6c00 0101 006d 0001 0100 3d00 0102   ..l....m....=... ) hexdump
140 (  80  0200 c000 0308 8000 0000 0000 0000 b400   ................ ) hexdump
141 (  90  0104 c0a8 42ef 3900 1608 0505 0505 0000   ....B.9......... ) hexdump
142 (  a0  0000 0003 2036 4120 5269 6e67 0000 0000   .... 6A Ring.... ) hexdump
143 (  b0  0000 0000 0000                            ......           ) hexdump
144
145 % ---- ethereal finale start ---- %
146 % If this is not the first page, then print the page number
147 thispagenum 1 gt                                % is thispagenum > 1 ?
148 {
149         printpagenum
150 }
151 if
152
153 showpage
154 % ---- ethereal finale end ---- %