]> git.pld-linux.org Git - packages/wireshark.git/blob - ethereal-distcc.patch
- added missing BR: libelf-devel
[packages/wireshark.git] / ethereal-distcc.patch
1 diff -Naur -X ethereal-dontdiff clean/ethereal-0.9.9/Makefile.am ethereal-0.9.9-distcc/Makefile.am
2 --- clean/ethereal-0.9.9/Makefile.am    2003-01-24 10:50:12.000000000 +1100
3 +++ ethereal-0.9.9-distcc/Makefile.am   2003-03-06 21:06:50.000000000 +1100
4 @@ -170,6 +170,7 @@
5         packet-dec-bpdu.c \
6         packet-dhcpv6.c \
7         packet-diameter.c \
8 +       packet-distcc.c \
9         packet-dlsw.c  \
10         packet-dns.c   \
11         packet-dsi.c   \
12 diff -Naur -X ethereal-dontdiff clean/ethereal-0.9.9/Makefile.nmake ethereal-0.9.9-distcc/Makefile.nmake
13 --- clean/ethereal-0.9.9/Makefile.nmake 2003-01-23 13:45:42.000000000 +1100
14 +++ ethereal-0.9.9-distcc/Makefile.nmake        2003-03-06 21:06:50.000000000 +1100
15 @@ -113,6 +113,7 @@
16         packet-dec-bpdu.c \
17         packet-dhcpv6.c \
18         packet-diameter.c \
19 +       packet-distcc.c \
20         packet-dlsw.c  \
21         packet-dns.c   \
22         packet-dsi.c   \
23 diff -Naur -X ethereal-dontdiff clean/ethereal-0.9.9/packet-distcc.c ethereal-0.9.9-distcc/packet-distcc.c
24 --- clean/ethereal-0.9.9/packet-distcc.c        1970-01-01 10:00:00.000000000 +1000
25 +++ ethereal-0.9.9-distcc/packet-distcc.c       2003-03-09 20:22:26.000000000 +1100
26 @@ -0,0 +1,532 @@
27 +/* packet-distcc.c
28 + * Routines for distcc dissection
29 + * Copyright 2003, Brad Hards <bradh@xxxxxxxxxxxxx>
30 + *
31 + * $Id$
32 + *
33 + * Ethereal - Network traffic analyzer
34 + * By Gerald Combs <gerald@xxxxxxxxxxxx>
35 + * Copyright 1998 Gerald Combs
36 + *
37 + * This program is free software; you can redistribute it and/or
38 + * modify it under the terms of the GNU General Public License
39 + * as published by the Free Software Foundation; either version 2
40 + * of the License, or (at your option) any later version.
41 + * 
42 + * This program is distributed in the hope that it will be useful,
43 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
44 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
45 + * GNU General Public License for more details.
46 + * 
47 + * You should have received a copy of the GNU General Public License
48 + * along with this program; if not, write to the Free Software
49 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
50 + */
51 +
52 +#ifdef HAVE_CONFIG_H
53 +# include "config.h"
54 +#endif
55 +
56 +#include <stdio.h>
57 +#include <stdlib.h>
58 +
59 +#include <string.h>
60 +#include <time.h>
61 +#include <glib.h>
62 +
63 +#include <epan/packet.h>
64 +#include <epan/strutil.h>
65 +#include <epan/conversation.h>
66 +
67 +#include "prefs.h"
68 +
69 +typedef enum _distcc_state {
70 +    DISTCC_DIST = 0,
71 +    DISTCC_ARGS = 1,
72 +    DISTCC_DOTI = 2,
73 +    DISTCC_DOTI_CONT = 3,
74 +    DISTCC_DONE = 4,
75 +    DISTCC_STAT = 5,
76 +    DISTCC_SERR = 6,
77 +    DISTCC_SOUT = 7,
78 +    DISTCC_DOTO = 8,
79 +    DISTCC_DOTO_CONT = 9
80 +} distcc_state_t;
81 +
82 +/* this is used to represent the _initial_ state of the frame */
83 +/* each frame can contain multiple protocol elements */
84 +struct distcc_frame_state_t {
85 +    distcc_state_t     state;
86 +    int                        done_sub_len;
87 +    guint              len_remaining;
88 +};
89 +
90 +/* this is a guide to the current conversation state */
91 +/* we need the length remaining because source and object elements can
92 +   easily span multiple frames, and we need to track the
93 +   internal"sub-state" in DOTI and DOTO */ 
94 +struct distcc_conversation_state_t {
95 +    distcc_state_t     state;
96 +    guint              len_remaining;
97 +};
98 +
99 +static int proto_distcc = -1;
100 +
101 +static int hf_distcc_hdr_magic = -1;
102 +static int hf_distcc_hdr_version = -1;
103 +static int hf_distcc_hdr_argc = -1;
104 +static int hf_distcc_hdr_argv = -1;
105 +static int hf_distcc_doti_magic = -1;
106 +static int hf_distcc_done_magic = -1;
107 +static int hf_distcc_done_version = -1;
108 +static int hf_distcc_stat_magic = -1;
109 +static int hf_distcc_stat_result = -1;
110 +static int hf_distcc_serr_magic = -1;
111 +static int hf_distcc_sout_magic = -1;
112 +static int hf_distcc_doto_magic = -1;
113 +
114 +static gint ett_distcc = -1;
115 +
116 +dissector_handle_t distcc_handle;
117 +
118 +
119 +#define TCP_PORT_DISTCC        3632
120 +
121 +static int glb_distcc_tcp_port = TCP_PORT_DISTCC;
122 +
123 +/* Packet dissection routine called by tcp (& udp) when port 3632 detected */
124 +static void
125 +dissect_distcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
126 +{
127 +    int                                offset = 0;
128 +    proto_item                                 *ti;
129 +    proto_tree                                 *distcc_tree;
130 +    conversation_t                     *conversation;
131 +    struct distcc_conversation_state_t *conversation_data;
132 +    struct distcc_frame_state_t                *frame_data;
133 +    gchar                              cmd_line_argc_string[9];
134 +    int                                cmd_line_argc;
135 +    int                                        yalv = 0;
136 +    gchar                              cmd_line_argv_len_string[9];
137 +    int                                cmd_line_argv_len;
138 +    gchar                              doti_length_string[9];
139 +    gchar                              doti_magic[9];
140 +    guint                              doti_length;
141 +    guint                              actual_bytes_remaining;
142 +    gchar                              sout_length_string[9];
143 +    guint                              sout_length;
144 +    gchar                              serr_length_string[9];
145 +    guint                              serr_length;
146 +    gchar                              doto_length_string[9];
147 +    guint                              doto_length;
148 +
149 +    if (check_col(pinfo->cinfo, COL_PROTOCOL))
150 +        col_set_str(pinfo->cinfo, COL_PROTOCOL, "DISTCC");
151 +
152 +    if (check_col(pinfo->cinfo, COL_INFO))
153 +        col_clear(pinfo->cinfo, COL_INFO);
154 +
155 +    conversation = find_conversation(&pinfo->src, &pinfo->dst, pinfo->ptype,
156 +                                    pinfo->srcport, pinfo->destport, 0);
157 +    if (conversation == NULL) {
158 +       conversation = conversation_new(&pinfo->src, &pinfo->dst,
159 +                                       pinfo->ptype, pinfo->srcport,
160 +                                       pinfo->destport, 0);
161 +       conversation_data = malloc(sizeof(struct distcc_conversation_state_t));
162 +       conversation_data->state = DISTCC_DIST;
163 +       conversation_add_proto_data(conversation, proto_distcc, conversation_data);
164 +    }
165 +
166 +    conversation_set_dissector(conversation, distcc_handle);
167 +   
168 +    ti = proto_tree_add_item(tree, proto_distcc, tvb, 0, -1, FALSE);
169 +
170 +    distcc_tree = proto_item_add_subtree(ti, ett_distcc);
171 +
172 +    conversation_data = conversation_get_proto_data(conversation, proto_distcc);
173 +
174 +    frame_data = p_get_proto_data(pinfo->fd, proto_distcc);
175 +    if (!frame_data) {
176 +       /* then we haven't seen this frame before */
177 +       frame_data = malloc(sizeof(struct distcc_frame_state_t));
178 +       frame_data->state = conversation_data->state;
179 +       frame_data->len_remaining = conversation_data->len_remaining;
180 +       p_add_proto_data(pinfo->fd, proto_distcc, frame_data);
181 +    }
182 +
183 +    switch (frame_data->state) {
184 +    case DISTCC_DIST:
185 +       proto_tree_add_item(distcc_tree, hf_distcc_hdr_magic, tvb, offset, 4, TRUE);
186 +       offset += 4;
187 +
188 +       proto_tree_add_item(distcc_tree, hf_distcc_hdr_version, tvb, offset, 8, TRUE);
189 +       offset += 8;
190 +       
191 +       conversation_data->state = DISTCC_ARGS;
192 +       conversation_add_proto_data(conversation, proto_distcc, conversation_data);
193 +       if (tvb_length_remaining(tvb, offset) == 0)
194 +           break;
195 +
196 +    case DISTCC_ARGS:
197 +       proto_tree_add_item(distcc_tree, hf_distcc_hdr_argc, tvb, offset, 12, TRUE);
198 +       offset += 4;
199 +
200 +       tvb_get_nstringz0(tvb, offset, 8, cmd_line_argc_string);
201 +       cmd_line_argc = strtoul(cmd_line_argc_string, NULL, 16);
202 +       proto_tree_add_text(distcc_tree, tvb, offset, 8,
203 +                           "Number of arguments: %i (0x%x)",
204 +                           cmd_line_argc, cmd_line_argc);
205 +       offset +=8;
206 +       for (yalv = 0; yalv<cmd_line_argc; yalv++) {
207 +           proto_tree_add_item(distcc_tree, hf_distcc_hdr_argv, tvb, offset, 12, TRUE);
208 +           offset += 4;
209 +           tvb_get_nstringz0(tvb, offset, 8, cmd_line_argv_len_string);
210 +           cmd_line_argv_len = strtoul(cmd_line_argv_len_string, NULL, 16);
211 +           proto_tree_add_text(distcc_tree, tvb, offset, 8,
212 +                               "Length of argument %i: %i (0x%x)",
213 +                               yalv,
214 +                               cmd_line_argv_len, cmd_line_argv_len);
215 +           offset += 8;
216 +           proto_tree_add_text(distcc_tree, tvb, offset, cmd_line_argv_len,
217 +                               "Argument %i: %s",
218 +                               yalv,
219 +                               tvb_format_text(tvb, offset, cmd_line_argv_len));
220 +           if (check_col(pinfo->cinfo, COL_INFO)) {
221 +               col_append_fstr(pinfo->cinfo,
222 +                               COL_INFO,
223 +                               "%s ", 
224 +                               tvb_format_text(tvb, offset, cmd_line_argv_len));
225 +           }
226 +           offset += cmd_line_argv_len;
227 +       }
228 +       conversation_data->state = DISTCC_DOTI;
229 +       conversation_add_proto_data(conversation, proto_distcc, conversation_data);
230 +       if (tvb_length_remaining(tvb, offset) == 0)
231 +           break;
232 +       
233 +    case DISTCC_DOTI:
234 +       if (check_col(pinfo->cinfo, COL_INFO)) {
235 +           col_append_str(pinfo->cinfo, COL_INFO, "DOTI");
236 +       }
237 +       proto_tree_add_item(distcc_tree, hf_distcc_doti_magic, tvb, offset, 4, TRUE);
238 +       offset += 4;
239 +
240 +       tvb_get_nstringz0(tvb, offset, 8, doti_length_string);
241 +       doti_length = strtoul(doti_length_string, NULL, 16);
242 +       proto_tree_add_text(distcc_tree, tvb, offset, 8,
243 +                           "DOTI Length: %i (0x%x)",
244 +                           doti_length, doti_length);
245 +       offset +=8;
246 +       actual_bytes_remaining = tvb_length_remaining(tvb, offset);
247 +       if (check_col(pinfo->cinfo, COL_INFO)) {        
248 +           col_append_fstr(pinfo->cinfo, COL_INFO,
249 +                           " (%i of %i bytes)", actual_bytes_remaining,
250 +                           doti_length);
251 +       }
252 +       if (actual_bytes_remaining >= doti_length) {
253 +           /* this is the case where we have all the data */
254 +           proto_tree_add_text(distcc_tree, tvb, offset, doti_length,
255 +                               ".i data: %s",
256 +                               tvb_format_text(tvb, offset, doti_length));
257 +           offset += doti_length;
258 +           conversation_data->state = DISTCC_DONE;
259 +       } else {
260 +           /* this is where we have only the start of the data, and
261 +              it continues in a later frame */
262 +           proto_tree_add_text(distcc_tree, tvb, offset, actual_bytes_remaining,
263 +                               "DOTI data: %s",
264 +                               tvb_format_text(tvb, offset, actual_bytes_remaining));
265 +           offset += actual_bytes_remaining;
266 +           conversation_data->state = DISTCC_DOTI_CONT;
267 +           conversation_data->len_remaining = doti_length - actual_bytes_remaining;
268 +       }
269 +       conversation_add_proto_data(conversation, proto_distcc, conversation_data);
270 +       /* we always need to break out at this point */
271 +       break;
272 +
273 +    case DISTCC_DOTI_CONT:
274 +       /* do a sanity check, against dropped frames */
275 +       tvb_get_nstringz0(tvb, offset, 8, doti_magic);
276 +       if (0 == strncmp(doti_magic, "DONE0000", 8)) {
277 +         /*
278 +           printf("failed sanity checking - bailing out to DISTCC_DONE\n");
279 +         */
280 +           conversation_data->state = DISTCC_DONE;
281 +           conversation_add_proto_data(conversation, proto_distcc, conversation_data);
282 +       } else {
283 +           actual_bytes_remaining = tvb_length(tvb);
284 +           if (actual_bytes_remaining >= frame_data->len_remaining) {
285 +               /* this is the case where we have all the data */
286 +               if (check_col(pinfo->cinfo, COL_INFO)) {
287 +                   col_append_fstr(pinfo->cinfo, COL_INFO,
288 +                                   "DOTI Finalisation (%i bytes)", actual_bytes_remaining);
289 +               }
290 +               proto_tree_add_text(distcc_tree, tvb, offset,
291 +                                   conversation_data->len_remaining,
292 +                                   "DOTI data: ...%s",
293 +                                   tvb_format_text(tvb, offset,
294 +                                                   frame_data->len_remaining));
295 +               offset += conversation_data->len_remaining;
296 +               conversation_data->state = DISTCC_DONE;
297 +           } else {
298 +               /* this is where we have only the start of the data, and
299 +                  it continues in a later frame */
300 +               if (check_col(pinfo->cinfo, COL_INFO)) {
301 +                   col_append_fstr(pinfo->cinfo, COL_INFO,
302 +                                   "DOTI Continuation (%i bytes)", actual_bytes_remaining);
303 +               }
304 +               proto_tree_add_text(distcc_tree, tvb, offset, actual_bytes_remaining,
305 +                                   "DOTI data: ...%s...",
306 +                                   tvb_format_text(tvb, offset, actual_bytes_remaining));
307 +               offset += actual_bytes_remaining;
308 +               conversation_data->state = DISTCC_DOTI_CONT;
309 +               /* this routine runs on display, not just on initial pass */
310 +               /* so we use a flag to ensure we only subtract length once */
311 +               if (frame_data->done_sub_len == 0) {
312 +                   conversation_data->len_remaining -= actual_bytes_remaining;
313 +                   frame_data->done_sub_len = 1;
314 +                   p_add_proto_data(pinfo->fd, proto_distcc, frame_data);
315 +               }
316 +           }
317 +           conversation_add_proto_data(conversation, proto_distcc, conversation_data);
318 +           
319 +           break;
320 +       } /* note that we fall through if we failed the sanity check */
321 +    case DISTCC_DONE:
322 +       if (check_col(pinfo->cinfo, COL_INFO)) {
323 +           col_append_str(pinfo->cinfo, COL_INFO, "DONE ");
324 +       }
325 +       proto_tree_add_item(distcc_tree, hf_distcc_done_magic, tvb, offset, 4, TRUE);
326 +       offset += 4;
327 +       proto_tree_add_item(distcc_tree, hf_distcc_done_version, tvb, offset, 8, TRUE);
328 +       offset += 8;
329 +       
330 +       conversation_data->state = DISTCC_STAT;
331 +       conversation_add_proto_data(conversation, proto_distcc, conversation_data);
332 +       if (tvb_length_remaining(tvb, offset) == 0)
333 +           break; /* else fall through, since we have more data */
334 +
335 +    case DISTCC_STAT:
336 +       if (check_col(pinfo->cinfo, COL_INFO)) {
337 +           col_append_str(pinfo->cinfo, COL_INFO, "STAT ");
338 +       }
339 +       proto_tree_add_item(distcc_tree, hf_distcc_stat_magic, tvb, offset, 4, TRUE);
340 +       offset += 4;
341 +       proto_tree_add_item(distcc_tree, hf_distcc_stat_result, tvb, offset, 8, TRUE);
342 +       offset += 8;
343 +
344 +       conversation_data->state = DISTCC_SERR;
345 +       conversation_add_proto_data(conversation, proto_distcc, conversation_data);
346 +       if (tvb_length_remaining(tvb, offset) == 0)
347 +           break;
348 +
349 +    case DISTCC_SERR:
350 +       if (check_col(pinfo->cinfo, COL_INFO)) {
351 +           col_append_str(pinfo->cinfo, COL_INFO, "SERR ");
352 +       }
353 +       proto_tree_add_item(distcc_tree, hf_distcc_serr_magic, tvb, offset, 4, TRUE);
354 +       offset += 4;
355 +       tvb_get_nstringz0(tvb, offset, 8, serr_length_string);
356 +       serr_length = strtoul(serr_length_string, NULL, 16);
357 +       proto_tree_add_text(distcc_tree, tvb, offset, 8,
358 +                           "SERR Length: %i (0x%x)",
359 +                           serr_length, serr_length);
360 +       offset +=8;
361 +       if (serr_length > 0) {
362 +               proto_tree_add_text(distcc_tree, tvb, offset,
363 +                                   serr_length,
364 +                                   "SERR: %s",
365 +                                   tvb_format_text(tvb, offset, serr_length));
366 +               offset += serr_length;
367 +       }
368 +       conversation_data->state = DISTCC_SOUT;
369 +       conversation_add_proto_data(conversation, proto_distcc, conversation_data);
370 +       if (tvb_length_remaining(tvb, offset) == 0)
371 +           break;
372 +
373 +    case DISTCC_SOUT:
374 +       if (check_col(pinfo->cinfo, COL_INFO)) {
375 +           col_append_str(pinfo->cinfo, COL_INFO, "SOUT ");
376 +       }
377 +       proto_tree_add_item(distcc_tree, hf_distcc_sout_magic, tvb, offset, 4, TRUE);
378 +       offset += 4;
379 +       tvb_get_nstringz0(tvb, offset, 8, sout_length_string);
380 +       sout_length = strtoul(sout_length_string, NULL, 16);
381 +       proto_tree_add_text(distcc_tree, tvb, offset, 8,
382 +                           "SOUT Length: %i (0x%x)",
383 +                           sout_length, sout_length);
384 +       offset +=8;
385 +       if (sout_length > 0) {
386 +               proto_tree_add_text(distcc_tree, tvb, offset,
387 +                                   sout_length,
388 +                                   "SOUT: %s",
389 +                                   tvb_format_text(tvb, offset, sout_length));
390 +               offset += sout_length;
391 +       }
392 +       conversation_data->state = DISTCC_DOTO;
393 +       conversation_add_proto_data(conversation, proto_distcc, conversation_data);
394 +       if (tvb_length_remaining(tvb, offset) == 0)
395 +           break;
396 +
397 +    case DISTCC_DOTO:
398 +       if (check_col(pinfo->cinfo, COL_INFO)) {
399 +           col_append_str(pinfo->cinfo, COL_INFO, "DOTO ");
400 +       }
401 +       proto_tree_add_item(distcc_tree, hf_distcc_doto_magic, tvb, offset, 4, TRUE);
402 +       offset += 4;
403 +       tvb_get_nstringz0(tvb, offset, 8, doto_length_string);
404 +       doto_length = strtoul(doto_length_string, NULL, 16);
405 +       proto_tree_add_text(distcc_tree, tvb, offset, 8,
406 +                           "DOTO Length: %i (0x%x)",
407 +                           doto_length, doto_length);
408 +       offset +=8;
409 +       actual_bytes_remaining = tvb_length_remaining(tvb, offset);
410 +       proto_tree_add_text(distcc_tree, tvb, offset, 0,
411 +                           "Bytes in this packet: %i (0x%x)",
412 +                           actual_bytes_remaining, actual_bytes_remaining);
413 +       if (check_col(pinfo->cinfo, COL_INFO)) {
414 +           col_append_fstr(pinfo->cinfo, COL_INFO, "(%i of %i bytes)",
415 +                           actual_bytes_remaining, doto_length);
416 +       }
417 +
418 +       if (actual_bytes_remaining >= doto_length) {
419 +           /* this is the case where we have all the data */
420 +           proto_tree_add_text(distcc_tree, tvb, offset, doto_length,
421 +                               "DOTO data: %s",
422 +                               tvb_format_text(tvb, offset, doto_length));
423 +           offset += doto_length;
424 +       } else {
425 +           /* this is where we have only the start of the data, and
426 +              it continues in a later frame */
427 +           proto_tree_add_text(distcc_tree, tvb, offset, actual_bytes_remaining,
428 +                               "DOTO data: %s",
429 +                               tvb_format_text(tvb, offset, actual_bytes_remaining));
430 +           offset += actual_bytes_remaining;
431 +           conversation_data->state = DISTCC_DOTO_CONT;
432 +           conversation_data->len_remaining = doto_length - actual_bytes_remaining;
433 +           conversation_add_proto_data(conversation, proto_distcc, conversation_data);
434 +       }
435 +       /* we always need to break out at this point */
436 +       break;
437 +
438 +    case DISTCC_DOTO_CONT:
439 +       actual_bytes_remaining = tvb_length(tvb);
440 +       if (actual_bytes_remaining >= frame_data->len_remaining) {
441 +           /* this is the case where we have all the data */
442 +           if (check_col(pinfo->cinfo, COL_INFO)) {
443 +               col_append_fstr(pinfo->cinfo, COL_INFO,
444 +                               "DOTO Finalisation (%i bytes)", actual_bytes_remaining);
445 +           }
446 +           proto_tree_add_text(distcc_tree, tvb, offset,
447 +                               frame_data->len_remaining,
448 +                               "DOTO data: ...%s",
449 +                               tvb_format_text(tvb, offset,
450 +                                               frame_data->len_remaining));
451 +           offset += frame_data->len_remaining;
452 +       } else {
453 +           /* this is where we have only some of the data, and
454 +              it continues in a later frame */
455 +           if (check_col(pinfo->cinfo, COL_INFO)) {
456 +               col_append_fstr(pinfo->cinfo, COL_INFO,
457 +                               "DOTO Continuation (%i bytes)", actual_bytes_remaining);
458 +           }
459 +           proto_tree_add_text(distcc_tree, tvb, offset, actual_bytes_remaining,
460 +                               "DOTO data: ...%s...",
461 +                               tvb_format_text(tvb, offset, actual_bytes_remaining));
462 +           offset += actual_bytes_remaining;
463 +           conversation_data->state = DISTCC_DOTO_CONT;
464 +           /* this routine runs on display, not just on initial pass */
465 +           /* so we use a flag to ensure we only subtract length once */
466 +           /* we will never get DOTI and DOTO in the same frame, since 
467 +              they go in opposing directions, so we can reuse the flag */
468 +           if (frame_data->done_sub_len == 0) {
469 +               conversation_data->len_remaining -= actual_bytes_remaining;
470 +               frame_data->done_sub_len = 1;
471 +               p_add_proto_data(pinfo->fd, proto_distcc, frame_data);
472 +           }
473 +           conversation_add_proto_data(conversation, proto_distcc, conversation_data);
474 +       }
475 +           
476 +       break;
477 +    }
478 +}
479 +
480 +/* Register protocol with Ethereal. */
481 +void
482 +proto_register_distcc(void)
483 +{
484 +    static hf_register_info hf[] = {
485 +       {&hf_distcc_hdr_magic,
486 +        {"Magic Header", "distcc.hdr_magic",
487 +         FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }
488 +       },
489 +       {&hf_distcc_hdr_version,
490 +        {"Header Version", "distcc.hdr_version",
491 +         FT_STRING, BASE_NONE, NULL, 0x0, "DISTCC Version", HFILL }
492 +       },
493 +       {&hf_distcc_hdr_argc,
494 +        {"ARGC", "distcc.hdr_argc",
495 +         FT_STRING, BASE_NONE, NULL, 0x0, "Argument Count Entry", HFILL }
496 +       },
497 +       {&hf_distcc_hdr_argv,
498 +        {"ARGV label", "distcc.hdr_argv",
499 +         FT_STRING, BASE_NONE, NULL, 0x0, "Argument Vector Entry", HFILL }
500 +       },
501 +       {&hf_distcc_doti_magic,
502 +        {"DOTI Magic Header", "distcc.doti_magic",
503 +         FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }
504 +       },
505 +       {&hf_distcc_done_magic,
506 +        {"DONE Magic Header", "distcc.done_magic",
507 +         FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }
508 +       },
509 +       {&hf_distcc_done_version,
510 +        {"Done Version", "distcc.done_version",
511 +         FT_STRING, BASE_NONE, NULL, 0x0, "DISTCC Daemon Version", HFILL }
512 +       },
513 +       {&hf_distcc_stat_result,
514 +        {"STAT result", "distcc.stat_result",
515 +         FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }
516 +       },
517 +       {&hf_distcc_doto_magic,
518 +        {"DOTO Magic Header", "distcc.doto_magic",
519 +         FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }
520 +       },
521 +       {&hf_distcc_stat_magic,
522 +        {"STAT Magic Header", "distcc.stat_magic",
523 +         FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }
524 +       },
525 +       {&hf_distcc_serr_magic,
526 +        {"SERR Magic Header", "distcc.serr_magic",
527 +         FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }
528 +       },
529 +       {&hf_distcc_sout_magic,
530 +        {"SOUT Magic Header", "distcc.sout_magic",
531 +         FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }
532 +       },
533 +    };
534 +
535 +    static gint *ett[] = {
536 +       &ett_distcc,
537 +    };
538 +
539 +    module_t *distcc_module;
540 +
541 +    proto_distcc = proto_register_protocol("Distributed Compiler System",
542 +                                          "DISTCC", "distcc");
543 +    proto_register_field_array(proto_distcc, hf, array_length(hf));
544 +    proto_register_subtree_array(ett, array_length(ett));
545 +
546 +    distcc_module = prefs_register_protocol(proto_distcc, NULL);
547 +    prefs_register_uint_preference(distcc_module, "tcp.port",
548 +                                  "DISTCC TCP Port",
549 +                                  "Set the TCP port for DISTCC messages",
550 +                                  10,
551 +                                  &glb_distcc_tcp_port);
552 +}
553 +void
554 +proto_reg_handoff_distcc(void)
555 +{
556 +    distcc_handle = create_dissector_handle(dissect_distcc, proto_distcc);
557 +    dissector_add("tcp.port", glb_distcc_tcp_port, distcc_handle);
558 +}
This page took 0.073844 seconds and 3 git commands to generate.