2003-05-24 20:49:58 +00:00
|
|
|
/* packet-distcc.c
|
|
|
|
* Routines for distcc dissection
|
|
|
|
* Copyright 2003, Brad Hards <bradh@frogmouth.net>
|
|
|
|
* Copyright 2003, Ronnie Sahlberg, added TCP desegmentation.
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2003-05-24 20:49:58 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2003-05-24 20:49:58 +00:00
|
|
|
*/
|
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
/*
|
|
|
|
* This dissector supports version 1 of the DISTCC protocol:
|
|
|
|
*
|
|
|
|
* https://github.com/distcc/distcc/blob/master/doc/protocol-1.txt
|
|
|
|
*/
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
#include "config.h"
|
2012-04-26 16:47:37 +00:00
|
|
|
|
2003-05-24 20:49:58 +00:00
|
|
|
#include <epan/packet.h>
|
2014-08-04 01:10:24 +00:00
|
|
|
#include <epan/expert.h>
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
#include <wsutil/strtoi.h>
|
2003-05-24 20:49:58 +00:00
|
|
|
|
|
|
|
static int proto_distcc = -1;
|
|
|
|
static int hf_distcc_version = -1;
|
|
|
|
static int hf_distcc_argc = -1;
|
|
|
|
static int hf_distcc_argv = -1;
|
|
|
|
static int hf_distcc_doti_source = -1;
|
|
|
|
static int hf_distcc_stat = -1;
|
|
|
|
static int hf_distcc_serr = -1;
|
|
|
|
static int hf_distcc_sout = -1;
|
|
|
|
static int hf_distcc_doto_object = -1;
|
|
|
|
|
|
|
|
|
|
|
|
static gint ett_distcc = -1;
|
|
|
|
|
2014-08-04 01:10:24 +00:00
|
|
|
static expert_field ei_distcc_short_pdu = EI_INIT;
|
|
|
|
|
2003-05-24 20:49:58 +00:00
|
|
|
|
|
|
|
static gboolean distcc_desegment = TRUE;
|
|
|
|
|
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
#define TCP_PORT_DISTCC 3632
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2013-03-16 16:25:41 +00:00
|
|
|
void proto_register_distcc(void);
|
2003-09-16 17:36:09 +00:00
|
|
|
extern void proto_reg_handoff_distcc(void);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
|
|
|
#define CHECK_PDU_LEN(x) \
|
2019-07-16 22:08:02 +00:00
|
|
|
if(parameter>(guint)tvb_captured_length_remaining(tvb, offset) || parameter < 1){\
|
2015-04-16 13:58:53 +00:00
|
|
|
len=tvb_captured_length_remaining(tvb, offset);\
|
2012-04-26 16:47:37 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "[Short" x " PDU]");\
|
|
|
|
} \
|
|
|
|
tvb_ensure_bytes_exist(tvb, offset, len);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define DESEGMENT_TCP(x) \
|
2012-04-26 16:47:37 +00:00
|
|
|
if(distcc_desegment && pinfo->can_desegment){\
|
2016-01-06 00:58:42 +00:00
|
|
|
/* only attempt reassembly if we have the full segment */\
|
2015-04-16 13:58:53 +00:00
|
|
|
if(tvb_captured_length_remaining(tvb, offset)==tvb_reported_length_remaining(tvb, offset)){\
|
2019-07-16 22:08:02 +00:00
|
|
|
if(parameter>(guint)tvb_captured_length_remaining(tvb, offset)){\
|
2014-08-04 01:10:24 +00:00
|
|
|
proto_tree_add_expert_format(tree, pinfo, &ei_distcc_short_pdu, tvb, offset-12, -1, "[Short " x " PDU]");\
|
2012-04-26 16:47:37 +00:00
|
|
|
pinfo->desegment_offset=offset-12;\
|
2015-04-16 13:58:53 +00:00
|
|
|
pinfo->desegment_len=parameter-tvb_captured_length_remaining(tvb, offset);\
|
2012-04-26 16:47:37 +00:00
|
|
|
return offset+len;\
|
|
|
|
}\
|
|
|
|
}\
|
|
|
|
}
|
2003-05-24 20:49:58 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_distcc_dist(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint32 parameter)
|
|
|
|
{
|
2019-07-16 22:08:02 +00:00
|
|
|
proto_tree_add_uint_format(tree, hf_distcc_version, tvb, offset-12, 12, parameter, "DIST: %u", parameter);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "DIST:%u ", parameter);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
return offset;
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_distcc_done(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint32 parameter)
|
|
|
|
{
|
2019-07-16 22:08:02 +00:00
|
|
|
proto_tree_add_uint_format(tree, hf_distcc_version, tvb, offset-12, 12, parameter, "DONE: %u", parameter);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "DONE:%u ", parameter);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
return offset;
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_distcc_stat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint32 parameter)
|
|
|
|
{
|
2019-07-16 22:08:02 +00:00
|
|
|
proto_tree_add_uint_format(tree, hf_distcc_stat, tvb, offset-12, 12, parameter, "STAT: %u", parameter);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "STAT:%u ", parameter);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
return offset;
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2016-04-15 17:45:03 +00:00
|
|
|
dissect_distcc_argc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint32 parameter)
|
2003-05-24 20:49:58 +00:00
|
|
|
{
|
2013-09-15 01:48:30 +00:00
|
|
|
proto_tree_add_uint(tree, hf_distcc_argc, tvb, offset-12, 12, parameter);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "ARGC:%u ", parameter);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
return offset;
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2019-07-16 22:08:02 +00:00
|
|
|
dissect_distcc_argv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint parameter)
|
2003-05-24 20:49:58 +00:00
|
|
|
{
|
2019-07-16 22:08:02 +00:00
|
|
|
gint len=(gint)parameter;
|
2019-07-16 22:55:23 +00:00
|
|
|
char *argv;
|
2014-08-04 01:10:24 +00:00
|
|
|
proto_item* ti;
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
CHECK_PDU_LEN("ARGV");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
/* see if we need to desegment the PDU */
|
|
|
|
DESEGMENT_TCP("ARGV");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:55:23 +00:00
|
|
|
/*
|
|
|
|
* XXX - we have no idea what encoding is being used, other than
|
|
|
|
* it being some flavor of "extended ASCII"; these days, it's
|
|
|
|
* *probably* UTF-8, but it could conceivably be something else.
|
|
|
|
*/
|
2021-07-16 15:36:34 +00:00
|
|
|
ti = proto_tree_add_item_ret_display_string(tree, hf_distcc_argv, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &argv);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", argv);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
if(len!=(gint)parameter){
|
2014-08-04 01:10:24 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_distcc_short_pdu, "[Short ARGV PDU]");
|
2012-04-26 16:47:37 +00:00
|
|
|
}
|
|
|
|
return offset+len;
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2019-07-16 22:08:02 +00:00
|
|
|
dissect_distcc_serr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint parameter)
|
2003-05-24 20:49:58 +00:00
|
|
|
{
|
2019-07-16 22:08:02 +00:00
|
|
|
gint len=(gint)parameter;
|
2019-07-16 22:55:23 +00:00
|
|
|
char *serr;
|
2014-08-04 01:10:24 +00:00
|
|
|
proto_item* ti;
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
CHECK_PDU_LEN("SERR");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
/* see if we need to desegment the PDU */
|
|
|
|
DESEGMENT_TCP("SERR");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:55:23 +00:00
|
|
|
/*
|
|
|
|
* XXX - we have no idea what encoding is being used, other than
|
|
|
|
* it being some flavor of "extended ASCII"; these days, it's
|
|
|
|
* *probably* UTF-8, but it could conceivably be something else.
|
|
|
|
*/
|
2021-07-16 15:36:34 +00:00
|
|
|
ti = proto_tree_add_item_ret_display_string(tree, hf_distcc_serr, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &serr);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:55:23 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "SERR:%s ", serr);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
if(len!=(gint)parameter){
|
2014-08-04 01:10:24 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_distcc_short_pdu, "[Short SERR PDU]");
|
2012-04-26 16:47:37 +00:00
|
|
|
}
|
|
|
|
return offset+len;
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2019-07-16 22:08:02 +00:00
|
|
|
dissect_distcc_sout(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint parameter)
|
2003-05-24 20:49:58 +00:00
|
|
|
{
|
2019-07-16 22:08:02 +00:00
|
|
|
gint len=(gint)parameter;
|
2019-07-16 22:55:23 +00:00
|
|
|
char *sout;
|
2014-08-04 01:10:24 +00:00
|
|
|
proto_item* ti;
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
CHECK_PDU_LEN("SOUT");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
/* see if we need to desegment the PDU */
|
|
|
|
DESEGMENT_TCP("SOUT");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:55:23 +00:00
|
|
|
/*
|
|
|
|
* XXX - we have no idea what encoding is being used, other than
|
|
|
|
* it being some flavor of "extended ASCII"; these days, it's
|
|
|
|
* *probably* UTF-8, but it could conceivably be something else.
|
|
|
|
*/
|
2021-07-16 15:36:34 +00:00
|
|
|
ti = proto_tree_add_item_ret_display_string(tree, hf_distcc_sout, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &sout);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:55:23 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "SOUT:%s ", sout);
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
if(len!=(gint)parameter){
|
2014-08-04 01:10:24 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_distcc_short_pdu, "[Short SOUT PDU]");
|
2012-04-26 16:47:37 +00:00
|
|
|
}
|
|
|
|
return offset+len;
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2019-07-16 22:08:02 +00:00
|
|
|
dissect_distcc_doti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint parameter)
|
2003-05-24 20:49:58 +00:00
|
|
|
{
|
2019-07-16 22:08:02 +00:00
|
|
|
gint len=(gint)parameter;
|
2014-08-04 01:10:24 +00:00
|
|
|
proto_item* ti;
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
CHECK_PDU_LEN("DOTI");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
/* see if we need to desegment the PDU */
|
|
|
|
DESEGMENT_TCP("DOTI");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "DOTI source ");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2014-08-04 01:10:24 +00:00
|
|
|
ti = proto_tree_add_item(tree, hf_distcc_doti_source, tvb, offset, len, ENC_ASCII|ENC_NA);
|
2019-07-16 22:08:02 +00:00
|
|
|
|
|
|
|
if(len!=(gint)parameter){
|
2014-08-04 01:10:24 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_distcc_short_pdu, "[Short DOTI PDU]");
|
2012-04-26 16:47:37 +00:00
|
|
|
}
|
|
|
|
return offset+len;
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2019-07-16 22:08:02 +00:00
|
|
|
dissect_distcc_doto(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint parameter)
|
2003-05-24 20:49:58 +00:00
|
|
|
{
|
2019-07-16 22:08:02 +00:00
|
|
|
gint len=(gint)parameter;
|
2014-08-04 01:10:24 +00:00
|
|
|
proto_item* ti;
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
CHECK_PDU_LEN("DOTO");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
/* see if we need to desegment the PDU */
|
|
|
|
DESEGMENT_TCP("DOTO");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "DOTO object ");
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2014-08-04 01:10:24 +00:00
|
|
|
ti = proto_tree_add_item(tree, hf_distcc_doto_object, tvb, offset, len, ENC_NA);
|
2019-07-16 22:08:02 +00:00
|
|
|
|
|
|
|
if(len!=(gint)parameter){
|
2014-08-04 01:10:24 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_distcc_short_pdu, "[Short DOTO PDU]");
|
2012-04-26 16:47:37 +00:00
|
|
|
}
|
|
|
|
return offset+len;
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Packet dissection routine called by tcp (& udp) when port 3632 detected */
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_distcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
|
2003-05-24 20:49:58 +00:00
|
|
|
{
|
2012-04-26 16:47:37 +00:00
|
|
|
int offset=0;
|
|
|
|
proto_tree *tree=NULL;
|
|
|
|
proto_item *item=NULL;
|
2013-12-14 01:34:02 +00:00
|
|
|
char buf[13];
|
2012-04-26 16:47:37 +00:00
|
|
|
guint32 parameter;
|
|
|
|
|
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DISTCC ");
|
|
|
|
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
|
|
|
|
if (parent_tree) {
|
|
|
|
item = proto_tree_add_item(parent_tree, proto_distcc, tvb, offset,
|
|
|
|
-1, ENC_NA);
|
|
|
|
tree = proto_item_add_subtree(item, ett_distcc);
|
|
|
|
}
|
|
|
|
|
2013-12-14 01:34:02 +00:00
|
|
|
while (TRUE) {
|
|
|
|
/* read the raw token (4 bytes) and parameter (8 bytes) */
|
|
|
|
tvb_memcpy(tvb, buf, offset, 12);
|
|
|
|
buf[12] = '\0';
|
|
|
|
offset+=12;
|
2012-04-26 16:47:37 +00:00
|
|
|
|
2019-07-16 22:08:02 +00:00
|
|
|
/* get the parameter value */
|
|
|
|
if (!ws_hexstrtou32(buf + 4, NULL, ¶meter))
|
2015-11-15 13:00:10 +00:00
|
|
|
return offset;
|
2012-04-26 16:47:37 +00:00
|
|
|
|
2013-12-14 01:34:02 +00:00
|
|
|
if(!strncmp(buf, "DIST", 4)){
|
2012-04-26 16:47:37 +00:00
|
|
|
offset=dissect_distcc_dist(tvb, pinfo, tree, offset, parameter);
|
2013-12-14 01:34:02 +00:00
|
|
|
} else if(!strncmp(buf, "ARGC", 4)){
|
2012-04-26 16:47:37 +00:00
|
|
|
offset=dissect_distcc_argc(tvb, pinfo, tree, offset, parameter);
|
2013-12-14 01:34:02 +00:00
|
|
|
} else if(!strncmp(buf, "ARGV", 4)){
|
2012-04-26 16:47:37 +00:00
|
|
|
offset=dissect_distcc_argv(tvb, pinfo, tree, offset, parameter);
|
2013-12-14 01:34:02 +00:00
|
|
|
} else if(!strncmp(buf, "DOTI", 4)){
|
2012-04-26 16:47:37 +00:00
|
|
|
offset=dissect_distcc_doti(tvb, pinfo, tree, offset, parameter);
|
2013-12-14 01:34:02 +00:00
|
|
|
} else if(!strncmp(buf, "DONE", 4)){
|
2012-04-26 16:47:37 +00:00
|
|
|
offset=dissect_distcc_done(tvb, pinfo, tree, offset, parameter);
|
2013-12-14 01:34:02 +00:00
|
|
|
} else if(!strncmp(buf, "STAT", 4)){
|
2012-04-26 16:47:37 +00:00
|
|
|
offset=dissect_distcc_stat(tvb, pinfo, tree, offset, parameter);
|
2013-12-14 01:34:02 +00:00
|
|
|
} else if(!strncmp(buf, "SERR", 4)){
|
2012-04-26 16:47:37 +00:00
|
|
|
offset=dissect_distcc_serr(tvb, pinfo, tree, offset, parameter);
|
2013-12-14 01:34:02 +00:00
|
|
|
} else if(!strncmp(buf, "SOUT", 4)){
|
2012-04-26 16:47:37 +00:00
|
|
|
offset=dissect_distcc_sout(tvb, pinfo, tree, offset, parameter);
|
2013-12-14 01:34:02 +00:00
|
|
|
} else if(!strncmp(buf, "DOTO", 4)){
|
2012-04-26 16:47:37 +00:00
|
|
|
offset=dissect_distcc_doto(tvb, pinfo, tree, offset, parameter);
|
|
|
|
} else {
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(tvb, pinfo, tree);
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2012-04-26 16:47:37 +00:00
|
|
|
}
|
|
|
|
}
|
2003-05-24 20:49:58 +00:00
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* Register protocol with Wireshark. */
|
2003-05-24 20:49:58 +00:00
|
|
|
void
|
|
|
|
proto_register_distcc(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
2012-04-26 16:47:37 +00:00
|
|
|
{&hf_distcc_version,
|
|
|
|
{"DISTCC Version", "distcc.version",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{&hf_distcc_argc,
|
|
|
|
{"ARGC", "distcc.argc",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, "Number of arguments", HFILL }
|
|
|
|
},
|
|
|
|
{&hf_distcc_argv,
|
|
|
|
{"ARGV", "distcc.argv",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, "ARGV argument", HFILL }
|
|
|
|
},
|
|
|
|
{&hf_distcc_doti_source,
|
|
|
|
{"Source", "distcc.doti_source",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, "DOTI Preprocessed Source File (.i)", HFILL }
|
|
|
|
},
|
|
|
|
{&hf_distcc_stat,
|
|
|
|
{"Status", "distcc.status",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, "Unix wait status for command completion", HFILL }
|
|
|
|
},
|
|
|
|
{&hf_distcc_serr,
|
|
|
|
{"SERR", "distcc.serr",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, "STDERR output", HFILL }
|
|
|
|
},
|
|
|
|
{&hf_distcc_sout,
|
|
|
|
{"SOUT", "distcc.sout",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, "STDOUT output", HFILL }
|
|
|
|
},
|
|
|
|
{&hf_distcc_doto_object,
|
|
|
|
{"Object", "distcc.doto_object",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0, "DOTO Compiled object file (.o)", HFILL }
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_distcc,
|
|
|
|
};
|
|
|
|
|
2014-08-04 01:10:24 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_distcc_short_pdu, { "distcc.short_pdu", PI_MALFORMED, PI_ERROR, "Short PDU", EXPFILL }},
|
|
|
|
};
|
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
module_t *distcc_module;
|
2014-08-04 01:10:24 +00:00
|
|
|
expert_module_t* expert_distcc;
|
|
|
|
|
|
|
|
proto_distcc = proto_register_protocol("Distcc Distributed Compiler", "DISTCC", "distcc");
|
2012-04-26 16:47:37 +00:00
|
|
|
|
|
|
|
proto_register_field_array(proto_distcc, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2014-08-04 01:10:24 +00:00
|
|
|
expert_distcc = expert_register_protocol(proto_distcc);
|
|
|
|
expert_register_field_array(expert_distcc, ei, array_length(ei));
|
2012-04-26 16:47:37 +00:00
|
|
|
|
2016-10-07 20:25:01 +00:00
|
|
|
distcc_module = prefs_register_protocol(proto_distcc, NULL);
|
|
|
|
|
2012-04-26 16:47:37 +00:00
|
|
|
prefs_register_bool_preference(distcc_module, "desegment_distcc_over_tcp",
|
2016-09-20 21:11:29 +00:00
|
|
|
"Reassemble DISTCC-over-TCP messages spanning multiple TCP segments",
|
2012-04-26 16:47:37 +00:00
|
|
|
"Whether the DISTCC dissector should reassemble messages spanning multiple TCP segments."
|
|
|
|
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
|
|
|
|
&distcc_desegment);
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
2003-09-16 17:36:09 +00:00
|
|
|
|
2003-05-24 20:49:58 +00:00
|
|
|
void
|
|
|
|
proto_reg_handoff_distcc(void)
|
|
|
|
{
|
2016-10-07 20:25:01 +00:00
|
|
|
dissector_handle_t distcc_handle;
|
|
|
|
|
|
|
|
distcc_handle = create_dissector_handle(dissect_distcc, proto_distcc);
|
|
|
|
dissector_add_uint_with_preference("tcp.port", TCP_PORT_DISTCC, distcc_handle);
|
2003-05-24 20:49:58 +00:00
|
|
|
}
|
2014-09-28 23:25:09 +00:00
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2014-09-28 23:25:09 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|