diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-2dparityfec.c | 306 | ||||
-rw-r--r-- | epan/dissectors/packet-bittorrent.c | 212 | ||||
-rw-r--r-- | epan/dissectors/packet-dccp.c | 58 | ||||
-rw-r--r-- | epan/dissectors/packet-dvb-ipdc.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ip.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-kdsp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-lisp-data.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-lisp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-mpls-pm.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-mpls-psc.c | 38 | ||||
-rw-r--r-- | epan/dissectors/packet-mpls-y1711.c | 23 | ||||
-rw-r--r-- | epan/dissectors/packet-reload.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-sflow.c | 78 | ||||
-rw-r--r-- | epan/dissectors/packet-spice.c | 268 | ||||
-rw-r--r-- | epan/dissectors/packet-wol.c | 15 |
15 files changed, 528 insertions, 512 deletions
diff --git a/epan/dissectors/packet-2dparityfec.c b/epan/dissectors/packet-2dparityfec.c index b88ce0270b..fcf72344d9 100644 --- a/epan/dissectors/packet-2dparityfec.c +++ b/epan/dissectors/packet-2dparityfec.c @@ -164,154 +164,154 @@ void proto_register_2dparityfec(void) module_t *module_2dparityfec; /* Payload type definitions */ -static hf_register_info hf[] = { - {&hf_2dparityfec_snbase_low, - { "SNBase low", - "2dparityfec.snbase_low", - FT_UINT16, - BASE_DEC, - NULL, - 0x0, - NULL, - HFILL} }, - - {&hf_2dparityfec_length_recovery, - { "Length recovery", - "2dparityfec.lr", - FT_UINT16, - BASE_HEX, - NULL, - 0x0, - NULL, - HFILL} }, - - {&hf_2dparityfec_rfc2733_ext, - { "RFC2733 Extension (E)", - "2dparityfec.e", - FT_BOOLEAN, - 8, - NULL, - 0x80, - NULL, - HFILL} }, - - {&hf_2dparityfec_pt_recovery, - { "Payload Type recovery", - "2dparityfec.ptr", - FT_UINT8, - BASE_HEX, - NULL, - 0x7f, - NULL, - HFILL} }, - - {&hf_2dparityfec_mask, - { "Mask", - "2dparityfec.mask", - /*FT_UINT32*/FT_UINT24, - BASE_HEX, - NULL, - /*0x00ffffff*/0x0, - NULL, - HFILL} }, - - {&hf_2dparityfec_ts_recovery, - { "Timestamp recovery", - "2dparityfec.tsr", - FT_UINT32, - BASE_HEX, - NULL, - 0x0, - NULL, - HFILL} }, - - {&hf_2dparityfec_ts_pro_mpeg_ext, - { "Pro-MPEG Extension (X)", - "2dparityfec.x", - FT_BOOLEAN, - 8, - NULL, - 0x80, - NULL, - HFILL} }, - - {&hf_2dparityfec_row_flag, - { "Row FEC (D)", - "2dparityfec.d", - FT_BOOLEAN, - 8, - NULL, - 0x40, - NULL, - HFILL} }, - - {&hf_2dparityfec_type, - { "Type", - "2dparityfec.type", - FT_UINT8, - BASE_DEC, - VALS(fec_type_names), - 0x38, - NULL, - HFILL} }, - - {&hf_2dparityfec_index, - { "Index", - "2dparityfec.index", - FT_UINT8, - BASE_DEC, - NULL, - 0x07, - NULL, - HFILL} }, - - {&hf_2dparityfec_offset, - { "Offset", - "2dparityfec.offset", - FT_UINT8, - BASE_DEC, - NULL, - 0x0, - NULL, - HFILL} }, - - {&hf_2dparityfec_na, - { "NA", - "2dparityfec.na", - FT_UINT8, - BASE_DEC, - NULL, - 0x0, - NULL, - HFILL} }, - - {&hf_2dparityfec_snbase_ext, - { "SNBase ext", - "2dparityfec.snbase_ext", - FT_UINT8, - BASE_DEC, - NULL, - 0x0, - NULL, - HFILL} }, - - {&hf_2dparityfec_payload, - { "FEC Payload", - "2dparityfec.payload", - FT_BYTES, - BASE_NONE, - NULL, - 0x0, - NULL, - HFILL} } - - -}; + static hf_register_info hf[] = { + {&hf_2dparityfec_snbase_low, + { "SNBase low", + "2dparityfec.snbase_low", + FT_UINT16, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL} }, + + {&hf_2dparityfec_length_recovery, + { "Length recovery", + "2dparityfec.lr", + FT_UINT16, + BASE_HEX, + NULL, + 0x0, + NULL, + HFILL} }, + + {&hf_2dparityfec_rfc2733_ext, + { "RFC2733 Extension (E)", + "2dparityfec.e", + FT_BOOLEAN, + 8, + NULL, + 0x80, + NULL, + HFILL} }, + + {&hf_2dparityfec_pt_recovery, + { "Payload Type recovery", + "2dparityfec.ptr", + FT_UINT8, + BASE_HEX, + NULL, + 0x7f, + NULL, + HFILL} }, + + {&hf_2dparityfec_mask, + { "Mask", + "2dparityfec.mask", + /*FT_UINT32*/FT_UINT24, + BASE_HEX, + NULL, + /*0x00ffffff*/0x0, + NULL, + HFILL} }, + + {&hf_2dparityfec_ts_recovery, + { "Timestamp recovery", + "2dparityfec.tsr", + FT_UINT32, + BASE_HEX, + NULL, + 0x0, + NULL, + HFILL} }, + + {&hf_2dparityfec_ts_pro_mpeg_ext, + { "Pro-MPEG Extension (X)", + "2dparityfec.x", + FT_BOOLEAN, + 8, + NULL, + 0x80, + NULL, + HFILL} }, + + {&hf_2dparityfec_row_flag, + { "Row FEC (D)", + "2dparityfec.d", + FT_BOOLEAN, + 8, + NULL, + 0x40, + NULL, + HFILL} }, + + {&hf_2dparityfec_type, + { "Type", + "2dparityfec.type", + FT_UINT8, + BASE_DEC, + VALS(fec_type_names), + 0x38, + NULL, + HFILL} }, + + {&hf_2dparityfec_index, + { "Index", + "2dparityfec.index", + FT_UINT8, + BASE_DEC, + NULL, + 0x07, + NULL, + HFILL} }, + + {&hf_2dparityfec_offset, + { "Offset", + "2dparityfec.offset", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL} }, + + {&hf_2dparityfec_na, + { "NA", + "2dparityfec.na", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL} }, + + {&hf_2dparityfec_snbase_ext, + { "SNBase ext", + "2dparityfec.snbase_ext", + FT_UINT8, + BASE_DEC, + NULL, + 0x0, + NULL, + HFILL} }, + + {&hf_2dparityfec_payload, + { "FEC Payload", + "2dparityfec.payload", + FT_BYTES, + BASE_NONE, + NULL, + 0x0, + NULL, + HFILL} } + + + }; /* Setup protocol subtree array */ -static gint *ett[] = { - &ett_2dparityfec, -}; + static gint *ett[] = { + &ett_2dparityfec, + }; proto_2dparityfec = proto_register_protocol( "Pro-MPEG Code of Practice #3 release 2 FEC Protocol", /* name */ @@ -325,10 +325,10 @@ static gint *ett[] = { proto_reg_handoff_2dparityfec); prefs_register_bool_preference(module_2dparityfec, "enable", - "Decode Pro-MPEG FEC on RTP dynamic payload type 96", - "Enable this option to recognise all traffic on RTP dynamic payload type 96 (0x60) " - "as FEC data corresponding to Pro-MPEG Code of Practice #3 release 2", - &dissect_fec); + "Decode Pro-MPEG FEC on RTP dynamic payload type 96", + "Enable this option to recognise all traffic on RTP dynamic payload type 96 (0x60) " + "as FEC data corresponding to Pro-MPEG Code of Practice #3 release 2", + &dissect_fec); } @@ -353,10 +353,10 @@ void proto_reg_handoff_2dparityfec(void) * * Local Variables: * c-basic-offset: 3 - * tab-width: 3 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * ex: set shiftwidth=3 tabstop=3 expandtab: - * :indentSize=3:tabSize=3:noTabs=true: + * ex: set shiftwidth=3 tabstop=8 expandtab: + * :indentSize=3:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c index 02d15ab725..08a695370e 100644 --- a/epan/dissectors/packet-bittorrent.c +++ b/epan/dissectors/packet-bittorrent.c @@ -45,19 +45,19 @@ * http://bitconjurer.org/BitTorrent/protocol.html */ -#define BITTORRENT_MESSAGE_CHOKE 0 -#define BITTORRENT_MESSAGE_UNCHOKE 1 -#define BITTORRENT_MESSAGE_INTERESTED 2 -#define BITTORRENT_MESSAGE_NOT_INTERESTED 3 -#define BITTORRENT_MESSAGE_HAVE 4 -#define BITTORRENT_MESSAGE_BITFIELD 5 -#define BITTORRENT_MESSAGE_REQUEST 6 -#define BITTORRENT_MESSAGE_PIECE 7 -#define BITTORRENT_MESSAGE_CANCEL 8 -#define BITTORRENT_MESSAGE_PORT 9 -#define BITTORRENT_MESSAGE_EXTENDED 20 - -#define BITTORRENT_HEADER_LENGTH 4 +#define BITTORRENT_MESSAGE_CHOKE 0 +#define BITTORRENT_MESSAGE_UNCHOKE 1 +#define BITTORRENT_MESSAGE_INTERESTED 2 +#define BITTORRENT_MESSAGE_NOT_INTERESTED 3 +#define BITTORRENT_MESSAGE_HAVE 4 +#define BITTORRENT_MESSAGE_BITFIELD 5 +#define BITTORRENT_MESSAGE_REQUEST 6 +#define BITTORRENT_MESSAGE_PIECE 7 +#define BITTORRENT_MESSAGE_CANCEL 8 +#define BITTORRENT_MESSAGE_PORT 9 +#define BITTORRENT_MESSAGE_EXTENDED 20 + +#define BITTORRENT_HEADER_LENGTH 4 /* * Azureus messages are specified by name so these are made up numbers @@ -74,23 +74,23 @@ static const value_string bittorrent_messages[] = { - { BITTORRENT_MESSAGE_CHOKE, "Choke" }, - { BITTORRENT_MESSAGE_UNCHOKE, "Unchoke" }, - { BITTORRENT_MESSAGE_INTERESTED, "Interested" }, + { BITTORRENT_MESSAGE_CHOKE, "Choke" }, + { BITTORRENT_MESSAGE_UNCHOKE, "Unchoke" }, + { BITTORRENT_MESSAGE_INTERESTED, "Interested" }, { BITTORRENT_MESSAGE_NOT_INTERESTED, "Not Interested" }, - { BITTORRENT_MESSAGE_HAVE, "Have" }, - { BITTORRENT_MESSAGE_BITFIELD, "Bitfield" }, - { BITTORRENT_MESSAGE_REQUEST, "Request" }, - { BITTORRENT_MESSAGE_PIECE, "Piece" }, - { BITTORRENT_MESSAGE_CANCEL, "Cancel" }, - { BITTORRENT_MESSAGE_PORT, "Port" }, - { BITTORRENT_MESSAGE_EXTENDED, "Extended" }, - { AZUREUS_MESSAGE_KEEP_ALIVE, "Keepalive" }, - { AZUREUS_MESSAGE_HANDSHAKE, "Azureus Handshake" }, - { AZUREUS_MESSAGE_BT_HANDSHAKE, "Azureus BitTorrent Handshake" }, - { AZUREUS_MESSAGE_PEER_EXCHANGE, "Azureus Peer Exchange" }, - { AZUREUS_MESSAGE_JPC_HELLO, "Azureus PeerCache Hello" }, - { AZUREUS_MESSAGE_JPC_REPLY, "Azureus PeerCache Reply" }, + { BITTORRENT_MESSAGE_HAVE, "Have" }, + { BITTORRENT_MESSAGE_BITFIELD, "Bitfield" }, + { BITTORRENT_MESSAGE_REQUEST, "Request" }, + { BITTORRENT_MESSAGE_PIECE, "Piece" }, + { BITTORRENT_MESSAGE_CANCEL, "Cancel" }, + { BITTORRENT_MESSAGE_PORT, "Port" }, + { BITTORRENT_MESSAGE_EXTENDED, "Extended" }, + { AZUREUS_MESSAGE_KEEP_ALIVE, "Keepalive" }, + { AZUREUS_MESSAGE_HANDSHAKE, "Azureus Handshake" }, + { AZUREUS_MESSAGE_BT_HANDSHAKE, "Azureus BitTorrent Handshake" }, + { AZUREUS_MESSAGE_PEER_EXCHANGE, "Azureus Peer Exchange" }, + { AZUREUS_MESSAGE_JPC_HELLO, "Azureus PeerCache Hello" }, + { AZUREUS_MESSAGE_JPC_REPLY, "Azureus PeerCache Reply" }, { 0, NULL } }; @@ -104,27 +104,27 @@ static const value_string azureus_priorities[] = { struct amp_message { const char *name; - guint32 value; + guint32 value; }; static const struct amp_message amp_messages[] = { - { "BT_KEEP_ALIVE", AZUREUS_MESSAGE_KEEP_ALIVE }, - { "BT_CHOKE", BITTORRENT_MESSAGE_CHOKE }, - { "BT_UNCHOKE", BITTORRENT_MESSAGE_UNCHOKE }, - { "BT_INTERESTED", BITTORRENT_MESSAGE_INTERESTED }, - { "BT_UNINTERESTED", BITTORRENT_MESSAGE_NOT_INTERESTED }, - { "BT_HAVE", BITTORRENT_MESSAGE_HAVE }, - { "BT_BITFIELD", BITTORRENT_MESSAGE_BITFIELD }, - { "BT_REQUEST", BITTORRENT_MESSAGE_REQUEST }, - { "BT_PIECE", BITTORRENT_MESSAGE_PIECE }, - { "BT_CANCEL", BITTORRENT_MESSAGE_CANCEL }, - { "BT_PORT", BITTORRENT_MESSAGE_PORT }, - { "BT_EXTENDED", BITTORRENT_MESSAGE_EXTENDED }, - { "AZ_HANDSHAKE", AZUREUS_MESSAGE_HANDSHAKE }, - { "BT_HANDSHAKE", AZUREUS_MESSAGE_BT_HANDSHAKE }, + { "BT_KEEP_ALIVE", AZUREUS_MESSAGE_KEEP_ALIVE }, + { "BT_CHOKE", BITTORRENT_MESSAGE_CHOKE }, + { "BT_UNCHOKE", BITTORRENT_MESSAGE_UNCHOKE }, + { "BT_INTERESTED", BITTORRENT_MESSAGE_INTERESTED }, + { "BT_UNINTERESTED", BITTORRENT_MESSAGE_NOT_INTERESTED }, + { "BT_HAVE", BITTORRENT_MESSAGE_HAVE }, + { "BT_BITFIELD", BITTORRENT_MESSAGE_BITFIELD }, + { "BT_REQUEST", BITTORRENT_MESSAGE_REQUEST }, + { "BT_PIECE", BITTORRENT_MESSAGE_PIECE }, + { "BT_CANCEL", BITTORRENT_MESSAGE_CANCEL }, + { "BT_PORT", BITTORRENT_MESSAGE_PORT }, + { "BT_EXTENDED", BITTORRENT_MESSAGE_EXTENDED }, + { "AZ_HANDSHAKE", AZUREUS_MESSAGE_HANDSHAKE }, + { "BT_HANDSHAKE", AZUREUS_MESSAGE_BT_HANDSHAKE }, { "AZ_PEER_EXCHANGE", AZUREUS_MESSAGE_PEER_EXCHANGE }, - { "JPC_HELLO", AZUREUS_MESSAGE_JPC_HELLO }, - { "JPC_REPLY", AZUREUS_MESSAGE_JPC_REPLY }, + { "JPC_HELLO", AZUREUS_MESSAGE_JPC_HELLO }, + { "JPC_REPLY", AZUREUS_MESSAGE_JPC_REPLY }, { NULL, 0 } }; @@ -162,20 +162,20 @@ static gint hf_azureus_jpc_session = -1; static gint hf_bittorrent_port = -1; static gint hf_bittorrent_extended = -1; -static gint ett_bittorrent = -1; -static gint ett_bittorrent_msg = -1; -static gint ett_peer_id = -1; -static gint ett_bittorrent_bdict = -1; -static gint ett_bittorrent_bdict_entry = -1; -static gint ett_bittorrent_blist = -1; +static gint ett_bittorrent = -1; +static gint ett_bittorrent_msg = -1; +static gint ett_peer_id = -1; +static gint ett_bittorrent_bdict = -1; +static gint ett_bittorrent_bdict_entry = -1; +static gint ett_bittorrent_blist = -1; -static gboolean bittorrent_desegment = TRUE; +static gboolean bittorrent_desegment = TRUE; static gboolean decode_client_information = FALSE; struct client_information { - char id[5]; /* string length must be <= 4 to allow space for NUL termination byte */ - char ver_len; - const char *name; /* NULL means array entry terminates the array */ + char id[5]; /* string length must be <= 4 to allow space for NUL termination byte */ + char ver_len; + const char *name; /* NULL means array entry terminates the array */ }; static struct client_information peer_id[] = { @@ -265,19 +265,20 @@ static struct client_information peer_id[] = { {"", 0, NULL} }; -static guint get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) +static guint +get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { - guint8 type; + guint8 type; guint32 length; if (tvb_get_guint8(tvb, offset) == 19 && tvb_memeql(tvb, offset + 1, "BitTorrent protocol", 19) == 0) { /* Return the length of a Handshake message */ - return 1 + /* pstrlen */ - 19 + /* pstr */ - 8 + /* reserved */ - 20 + /* SHA1 hash of the info key */ - 20; /* peer id */ + return 1 + /* pstrlen */ + 19 + /* pstr */ + 8 + /* reserved */ + 20 + /* SHA1 hash of the info key */ + 20; /* peer id */ } else { /* Try to validate the length of the message indicated by the header. */ length = tvb_get_ntohl(tvb, offset); @@ -312,13 +313,14 @@ static guint get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, in } } -static int dissect_bencoding_str(tvbuff_t *tvb, packet_info *pinfo _U_, +static int +dissect_bencoding_str(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, int length, proto_tree *tree, proto_item *ti, int treeadd) { guint8 ch; - int stringlen = 0, nextstringlen; - int used; - int izero = 0; + int stringlen = 0, nextstringlen; + int used; + int izero = 0; if (length<2) { if (tree) { @@ -379,8 +381,9 @@ static int dissect_bencoding_str(tvbuff_t *tvb, packet_info *pinfo _U_, return -1; } -static int dissect_bencoding_int(tvbuff_t *tvb, packet_info *pinfo _U_, - int offset, int length, proto_tree *tree, proto_item *ti, int treeadd) +static int +dissect_bencoding_int(tvbuff_t *tvb, packet_info *pinfo _U_, + int offset, int length, proto_tree *tree, proto_item *ti, int treeadd) { gint32 ival=0; int neg = 0; @@ -446,12 +449,13 @@ static int dissect_bencoding_int(tvbuff_t *tvb, packet_info *pinfo _U_, return -1; } -static int dissect_bencoding_rec(tvbuff_t *tvb, packet_info *pinfo _U_, - int offset, int length, proto_tree *tree, int level, proto_item *treei, int treeadd) +static int +dissect_bencoding_rec(tvbuff_t *tvb, packet_info *pinfo _U_, + int offset, int length, proto_tree *tree, int level, proto_item *treei, int treeadd) { guint8 op; - int oplen = 0, op1len, op2len; - int used; + int oplen = 0, op1len, op2len; + int used; proto_item *ti = NULL, *td = NULL; proto_tree *itree = NULL, *dtree = NULL; @@ -565,26 +569,28 @@ static int dissect_bencoding_rec(tvbuff_t *tvb, packet_info *pinfo _U_, return -1; } -static void dissect_bencoding(tvbuff_t *tvb, packet_info *pinfo _U_, +static void +dissect_bencoding(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, int length, proto_tree *tree) { - dissect_bencoding_rec(tvb, pinfo, offset, length, tree, 0, NULL, 0); + dissect_bencoding_rec(tvb, pinfo, offset, length, tree, 0, NULL, 0); } -static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static void +dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - int offset = 0; - int i; - int isamp = 0; + int offset = 0; + int i; + int isamp = 0; proto_tree *mtree; - guint16 type = 0; - guint32 typelen = 0; - guint8 prio = 0; - guint32 length; + guint16 type = 0; + guint32 typelen = 0; + guint8 prio = 0; + guint32 length; const char *msgtype = NULL; proto_item *ti; - guint32 piece_index, piece_begin, piece_length; - guint32 stringlen; + guint32 piece_index, piece_begin, piece_length; + guint32 stringlen; if (tvb_bytes_exist(tvb, offset + BITTORRENT_HEADER_LENGTH, 1)) { /* Check for data from the middle of a message. */ @@ -688,9 +694,9 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto proto_tree_add_uint(mtree, hf_bittorrent_piece_length, tvb, offset, 4, piece_length); proto_item_append_text(ti, ", Piece (Idx:0x%x,Begin:0x%x,Len:0x%x)", piece_index, piece_begin, piece_length); - col_append_fstr(pinfo->cinfo, COL_INFO, ", Piece (Idx:0x%x,Begin:0x%x,Len:0x%x)", piece_index, piece_begin, piece_length); + col_append_fstr(pinfo->cinfo, COL_INFO, ", Piece (Idx:0x%x,Begin:0x%x,Len:0x%x)", piece_index, piece_begin, piece_length); - break; + break; case BITTORRENT_MESSAGE_PORT: /* port as payload */ @@ -707,16 +713,16 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto proto_tree_add_item(mtree, hf_bittorrent_piece_index, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(ti, ", Piece (Idx:0x%x)", piece_index); - col_append_fstr(pinfo->cinfo, COL_INFO, ", Piece (Idx:0x%x)", piece_index); + col_append_fstr(pinfo->cinfo, COL_INFO, ", Piece (Idx:0x%x)", piece_index); - break; + break; case BITTORRENT_MESSAGE_BITFIELD: proto_tree_add_item(mtree, hf_bittorrent_bitfield_data, tvb, offset, length, ENC_NA); proto_item_append_text(ti, ", Len:0x%x", length); col_append_fstr(pinfo->cinfo, COL_INFO, ", Len:0x%x", length); - break; + break; case BITTORRENT_MESSAGE_PIECE: piece_index = tvb_get_ntohl(tvb, offset); @@ -731,7 +737,7 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto proto_item_append_text(ti, ", Idx:0x%x,Begin:0x%x,Len:0x%x", piece_index, piece_begin, length); col_append_fstr(pinfo->cinfo, COL_INFO, ", Idx:0x%x,Begin:0x%x,Len:0x%x", piece_index, piece_begin, length); - break; + break; case AZUREUS_MESSAGE_HANDSHAKE: case AZUREUS_MESSAGE_PEER_EXCHANGE: @@ -755,10 +761,11 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto } } -static int dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +static int +dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { - int offset = 0; - int i; + int offset = 0; + int i; char *version; col_set_str(pinfo->cinfo, COL_INFO, "Handshake"); @@ -788,7 +795,8 @@ static int dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, pr return offset; } -static void dissect_bittorrent_tcp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static +void dissect_bittorrent_tcp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti; @@ -811,14 +819,16 @@ static void dissect_bittorrent_tcp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto } -static void dissect_bittorrent (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static +void dissect_bittorrent (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { tcp_dissect_pdus(tvb, pinfo, tree, bittorrent_desegment, BITTORRENT_HEADER_LENGTH, get_bittorrent_pdu_length, dissect_bittorrent_tcp_pdu); } -static gboolean test_bittorrent_packet (tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree) +static +gboolean test_bittorrent_packet (tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree) { conversation_t *conversation; @@ -985,10 +995,10 @@ proto_reg_handoff_bittorrent(void) * * Local Variables: * c-basic-offset: 3 - * tab-width: 3 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * ex: set shiftwidth=3 tabstop=3 expandtab: - * :indentSize=3:tabSize=3:noTabs=true: + * ex: set shiftwidth=3 tabstop=8 expandtab: + * :indentSize=3:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-dccp.c b/epan/dissectors/packet-dccp.c index ee9792a146..07460b5f96 100644 --- a/epan/dissectors/packet-dccp.c +++ b/epan/dissectors/packet-dccp.c @@ -71,8 +71,8 @@ * Some definitions and the dissect_options() logic have been taken * from Arnaldo Carvalho de Melo's DCCP implementation, thanks! */ -#define DCCP_HDR_LEN 16 /* base DCCP header length, with 48 bits seqnums */ -#define DCCP_HDR_LEN_MIN 12 /* with 24 bits seqnum */ +#define DCCP_HDR_LEN 16 /* base DCCP header length, with 48 bits seqnums */ +#define DCCP_HDR_LEN_MIN 12 /* with 24 bits seqnum */ #define DCCP_HDR_PKT_TYPES_LEN_MAX 12 /* max per packet type extra * header length */ @@ -190,15 +190,15 @@ static dissector_handle_t data_handle; /* preferences */ static gboolean dccp_summary_in_tree = TRUE; -static gboolean try_heuristic_first = FALSE; -static gboolean dccp_check_checksum = TRUE; +static gboolean try_heuristic_first = FALSE; +static gboolean dccp_check_checksum = TRUE; static void decode_dccp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int sport, int dport) { tvbuff_t *next_tvb; - int low_port, high_port; + int low_port, high_port; next_tvb = tvb_new_subset_remaining(tvb, offset); @@ -236,10 +236,10 @@ decode_dccp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo, * number of 0 to disable the port. */ if (sport > dport) { - low_port = dport; + low_port = dport; high_port = sport; } else { - low_port = sport; + low_port = sport; high_port = dport; } @@ -275,7 +275,7 @@ static guint64 tvb_get_ntoh_var(tvbuff_t *tvb, gint offset, guint nbytes) { const guint8 *ptr; - guint64 value = 0; + guint64 value = 0; ptr = tvb_get_ptr(tvb, offset, nbytes); if (nbytes > 5) @@ -299,9 +299,9 @@ dissect_feature_options(proto_tree *dccp_options_tree, tvbuff_t *tvb, int offset, guint8 option_len, guint8 option_type) { - guint8 feature_number = tvb_get_guint8(tvb, offset + 2); + guint8 feature_number = tvb_get_guint8(tvb, offset + 2); proto_item *dccp_item, *hidden_item; - int i; + int i; hidden_item = proto_tree_add_uint(dccp_options_tree, hf_dccp_feature_number, tvb, @@ -386,12 +386,12 @@ dissect_options(tvbuff_t *tvb, packet_info *pinfo _U_, * if here I'm sure there is at least offset_end - offset_start bytes * in tvb and it should be options */ - int offset = offset_start; - guint8 option_type = 0; - guint8 option_len = 0; - int i; - guint32 p; - proto_item *dccp_item = NULL; + int offset = offset_start; + guint8 option_type = 0; + guint8 option_len = 0; + int i; + guint32 p; + proto_item *dccp_item = NULL; proto_item *hidden_item; while (offset < offset_end) { @@ -635,19 +635,19 @@ dccp_csum_coverage(const e_dccphdr *dccph, guint len) static void dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_tree *dccp_tree = NULL; + proto_tree *dccp_tree = NULL; proto_tree *dccp_options_tree = NULL; - proto_item *dccp_item = NULL; + proto_item *dccp_item = NULL; proto_item *hidden_item; - vec_t cksum_vec[4]; - guint32 phdr[2]; - guint16 computed_cksum; - guint offset = 0; - guint len = 0; - guint reported_len = 0; - guint advertised_dccp_header_len = 0; - guint options_len = 0; + vec_t cksum_vec[4]; + guint32 phdr[2]; + guint16 computed_cksum; + guint offset = 0; + guint len = 0; + guint reported_len = 0; + guint advertised_dccp_header_len = 0; + guint options_len = 0; e_dccphdr *dccph; /* get at least a full message header */ @@ -1436,10 +1436,10 @@ proto_reg_handoff_dccp(void) * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=4 tabstop=4 expandtab: - * :indentSize=4:tabSize=4:noTabs=true: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-dvb-ipdc.c b/epan/dissectors/packet-dvb-ipdc.c index de78e5c342..300455f824 100644 --- a/epan/dissectors/packet-dvb-ipdc.c +++ b/epan/dissectors/packet-dvb-ipdc.c @@ -111,11 +111,11 @@ proto_reg_handoff_dvb_ipdc(void) * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=4 tabstop=4 expandtab: - * :indentSize=4:tabSize=4:noTabs=true: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index a99e23cdc8..d2119ac470 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -2571,11 +2571,11 @@ proto_reg_handoff_ip(void) * * Local variables: * c-basic-offset: 2 - * tab-width: 2 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=2 tabstop=2 expandtab: - * :indentSize=2:tabSize=2:noTabs=true: + * vi: set shiftwidth=2 tabstop=8 expandtab: + * :indentSize=2:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-kdsp.c b/epan/dissectors/packet-kdsp.c index 004e0f7fe9..7087a3f221 100644 --- a/epan/dissectors/packet-kdsp.c +++ b/epan/dissectors/packet-kdsp.c @@ -1011,10 +1011,10 @@ proto_reg_handoff_kdsp(void) * * Local variables: * c-basic-offset: 2 - * tab-width: 2 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=2 tabstop=2 expandtab: - * :indentSize=2:tabSize=2:noTabs=true: + * vi: set shiftwidth=2 tabstop=8 expandtab: + * :indentSize=2:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-lisp-data.c b/epan/dissectors/packet-lisp-data.c index cb25b1825e..5d546dea86 100644 --- a/epan/dissectors/packet-lisp-data.c +++ b/epan/dissectors/packet-lisp-data.c @@ -293,10 +293,10 @@ proto_reg_handoff_lisp_data(void) * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=4 tabstop=4 expandtab: - * :indentSize=4:tabSize=4:noTabs=true: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-lisp.c b/epan/dissectors/packet-lisp.c index 47b6f0e52c..c9ba624a5b 100644 --- a/epan/dissectors/packet-lisp.c +++ b/epan/dissectors/packet-lisp.c @@ -1041,10 +1041,10 @@ proto_reg_handoff_lisp(void) * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=4 tabstop=4 expandtab: - * :indentSize=4:tabSize=4:noTabs=true: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-mpls-pm.c b/epan/dissectors/packet-mpls-pm.c index b65af5a3cd..76257cdb16 100644 --- a/epan/dissectors/packet-mpls-pm.c +++ b/epan/dissectors/packet-mpls-pm.c @@ -1439,10 +1439,10 @@ proto_reg_handoff_mpls_pm(void) * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=4 tabstop=4 expandtab: - * :indentSize=4:tabSize=4:noTabs=true: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-mpls-psc.c b/epan/dissectors/packet-mpls-psc.c index d925763e4c..94b7bca272 100644 --- a/epan/dissectors/packet-mpls-psc.c +++ b/epan/dissectors/packet-mpls-psc.c @@ -1,6 +1,6 @@ /* packet-mpls-psc.c * - * Routines for MPLS[-TP] Protection State Coordination (PSC) Protocol: it + * Routines for MPLS[-TP] Protection State Coordination (PSC) Protocol: it * should conform to RFC 6378. * * Copyright 2012 _FF_ @@ -119,17 +119,17 @@ const range_string mpls_psc_dpath_rvals[] = { static void dissect_mpls_psc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *ti = NULL; + proto_item *ti = NULL; proto_tree *psc_tree = NULL; - guint32 offset = 0; - guint8 req = 0; - guint8 fpath = 0; - guint8 path = 0; + guint32 offset = 0; + guint8 req = 0; + guint8 fpath = 0; + guint8 path = 0; /* build cinfo */ - req = (tvb_get_guint8(tvb, offset) & 0x3C) >> 2; + req = (tvb_get_guint8(tvb, offset) & 0x3C) >> 2; fpath = tvb_get_guint8(tvb, offset + 2); - path = tvb_get_guint8(tvb, offset + 3); + path = tvb_get_guint8(tvb, offset + 3); col_clear(pinfo->cinfo, COL_PROTOCOL); col_clear(pinfo->cinfo, COL_INFO); @@ -144,7 +144,7 @@ dissect_mpls_psc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (!tree) { return; } - + /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_mpls_psc, tvb, 0, -1, ENC_NA); psc_tree = proto_item_add_subtree(ti, ett_mpls_psc); @@ -166,7 +166,7 @@ dissect_mpls_psc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(psc_tree, hf_mpls_psc_dpath, tvb, offset, 1, ENC_NA); offset += 1; /* tlv len */ - proto_tree_add_item(psc_tree, hf_mpls_psc_tlvlen, tvb, offset, 1, + proto_tree_add_item(psc_tree, hf_mpls_psc_tlvlen, tvb, offset, 1, ENC_BIG_ENDIAN); } @@ -184,9 +184,9 @@ proto_register_mpls_psc(void) { &hf_mpls_psc_req, { - "Request", "mpls.psc.req", FT_UINT8, + "Request", "mpls.psc.req", FT_UINT8, BASE_RANGE_STRING | BASE_DEC, - RVALS(&mpls_psc_req_rvals), + RVALS(&mpls_psc_req_rvals), 0x3C, NULL, HFILL } }, @@ -195,7 +195,7 @@ proto_register_mpls_psc(void) { "Protection Type", "mpls.psc.pt", FT_UINT8, BASE_RANGE_STRING | BASE_DEC, - RVALS(&mpls_psc_pt_rvals), + RVALS(&mpls_psc_pt_rvals), 0x03, NULL, HFILL } }, @@ -204,7 +204,7 @@ proto_register_mpls_psc(void) { "R", "mpls.psc.rev", FT_UINT8, BASE_RANGE_STRING | BASE_DEC, - RVALS(&mpls_psc_rev_rvals), + RVALS(&mpls_psc_rev_rvals), 0x80, NULL, HFILL } }, @@ -213,7 +213,7 @@ proto_register_mpls_psc(void) { "Fault Path", "mpls.psc.fpath", FT_UINT8, BASE_RANGE_STRING | BASE_DEC, - RVALS(&mpls_psc_fpath_rvals), + RVALS(&mpls_psc_fpath_rvals), 0x0, NULL, HFILL } }, @@ -229,7 +229,7 @@ proto_register_mpls_psc(void) { &hf_mpls_psc_tlvlen, { - "TLV Length", "mpls.psc.tlvlen", FT_UINT16, BASE_DEC, NULL, + "TLV Length", "mpls.psc.tlvlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, @@ -262,10 +262,10 @@ proto_reg_handoff_mpls_psc(void) * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=4 tabstop=4 expandtab: - * :indentSize=4:tabSize=4:noTabs=true: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-mpls-y1711.c b/epan/dissectors/packet-mpls-y1711.c index ebbff9fd68..4b1766bc22 100644 --- a/epan/dissectors/packet-mpls-y1711.c +++ b/epan/dissectors/packet-mpls-y1711.c @@ -101,12 +101,13 @@ static const value_string y1711_defect_type_vals[] = { static int dissect_mpls_y1711(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_tree *mpls_y1711_tree = NULL; - struct mplsinfo *mplsinfo = pinfo->private_data; - proto_item *ti = NULL; - int functype = -1; - int offset = 0; - const guint8 allone[] = { 0xff, 0xff }; + proto_tree *mpls_y1711_tree = NULL; + struct mplsinfo *mplsinfo = pinfo->private_data; + proto_item *ti = NULL; + int functype = -1; + int offset = 0; + + const guint8 allone[] = { 0xff, 0xff }; const guint8 allzero[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -152,7 +153,7 @@ dissect_mpls_y1711(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* checks for exp, bos and ttl encoding */ if (mplsinfo->label != LABEL_OAM_ALERT) proto_tree_add_text(mpls_y1711_tree, tvb, offset - 4, 3, - "Warning: Y.1711 but no OAM alert label (%d) ?!", + "Warning: Y.1711 but no OAM alert label (%d) ?!", LABEL_OAM_ALERT); if (mplsinfo->exp != 0) @@ -421,7 +422,7 @@ void proto_reg_handoff_mpls_y1711(void) { mpls_y1711_handle = find_dissector("mpls_y1711"); - dissector_add_uint("mpls.label", + dissector_add_uint("mpls.label", LABEL_OAM_ALERT /* 14 */, mpls_y1711_handle); } @@ -431,10 +432,10 @@ proto_reg_handoff_mpls_y1711(void) * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=4 tabstop=4 expandtab: - * :indentSize=4:tabSize=4:noTabs=true: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-reload.c b/epan/dissectors/packet-reload.c index b8cc15716c..3f05238a52 100644 --- a/epan/dissectors/packet-reload.c +++ b/epan/dissectors/packet-reload.c @@ -5935,10 +5935,10 @@ proto_reg_handoff_reload(void) * * Local variables: * c-basic-offset: 2 - * tab-width: 2 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=2 tabstop=2 expandtab: - * :indentSize=2:tabSize=2:noTabs=true: + * vi: set shiftwidth=2 tabstop=8 expandtab: + * :indentSize=2:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c index 1cafea508f..5eeab5220b 100644 --- a/epan/dissectors/packet-sflow.c +++ b/epan/dissectors/packet-sflow.c @@ -115,12 +115,12 @@ static const value_string sflow_5_ieee80211_versions [] = { #define SFLOW_245_COUNTERS_VLAN 7 static const value_string sflow_245_counterstype[] = { - { SFLOW_245_COUNTERS_GENERIC, "Generic counters"}, + { SFLOW_245_COUNTERS_GENERIC, "Generic counters"}, { SFLOW_245_COUNTERS_ETHERNET, "Ethernet counters"}, - { SFLOW_245_COUNTERS_FDDI, "FDDI counters"}, - { SFLOW_245_COUNTERS_VG, "100baseVG counters"}, - { SFLOW_245_COUNTERS_WAN, "WAN counters"}, - { SFLOW_245_COUNTERS_VLAN, "VLAN counters"}, + { SFLOW_245_COUNTERS_FDDI, "FDDI counters"}, + { SFLOW_245_COUNTERS_VG, "100baseVG counters"}, + { SFLOW_245_COUNTERS_WAN, "WAN counters"}, + { SFLOW_245_COUNTERS_VLAN, "VLAN counters"}, { 0, NULL} }; @@ -132,8 +132,8 @@ static const value_string sflow_245_counterstype[] = { static const value_string sflow_245_packet_information_type[] = { { SFLOW_245_PACKET_DATA_TYPE_HEADER, "Packet headers are sampled"}, - { SFLOW_245_PACKET_DATA_TYPE_IPV4, "IP Version 4 data"}, - { SFLOW_245_PACKET_DATA_TYPE_IPV6, "IP Version 6 data"}, + { SFLOW_245_PACKET_DATA_TYPE_IPV4, "IP Version 4 data"}, + { SFLOW_245_PACKET_DATA_TYPE_IPV6, "IP Version 6 data"}, { 0, NULL} }; @@ -156,22 +156,22 @@ static const value_string sflow_245_packet_information_type[] = { #define SFLOW_5_HEADER_80211_AMSDU_SUBFRAME 17 static const value_string sflow_245_header_protocol[] = { - { SFLOW_245_HEADER_ETHERNET, "Ethernet"}, - { SFLOW_245_HEADER_TOKENBUS, "Token Bus"}, - { SFLOW_245_HEADER_TOKENRING, "Token Ring"}, - { SFLOW_245_HEADER_FDDI, "FDDI"}, - { SFLOW_245_HEADER_FRAME_RELAY, "Frame Relay"}, - { SFLOW_245_HEADER_X25, "X.25"}, - { SFLOW_245_HEADER_PPP, "PPP"}, - { SFLOW_245_HEADER_SMDS, "SMDS"}, - { SFLOW_245_HEADER_AAL5, "ATM AAL5"}, - { SFLOW_245_HEADER_AAL5_IP, "ATM AAL5-IP (e.g., Cisco AAL5 mux)"}, - { SFLOW_245_HEADER_IPv4, "IPv4"}, - { SFLOW_245_HEADER_IPv6, "IPv6"}, - { SFLOW_245_HEADER_MPLS, "MPLS"}, - { SFLOW_5_HEADER_POS, "PPP over SONET/SDH (RFC 1662, 2615)"}, - { SFLOW_5_HEADER_80211_MAC, "802.11 MAC"}, - { SFLOW_5_HEADER_80211_AMPDU, "802.11n Aggregated MPDU"}, + { SFLOW_245_HEADER_ETHERNET, "Ethernet"}, + { SFLOW_245_HEADER_TOKENBUS, "Token Bus"}, + { SFLOW_245_HEADER_TOKENRING, "Token Ring"}, + { SFLOW_245_HEADER_FDDI, "FDDI"}, + { SFLOW_245_HEADER_FRAME_RELAY, "Frame Relay"}, + { SFLOW_245_HEADER_X25, "X.25"}, + { SFLOW_245_HEADER_PPP, "PPP"}, + { SFLOW_245_HEADER_SMDS, "SMDS"}, + { SFLOW_245_HEADER_AAL5, "ATM AAL5"}, + { SFLOW_245_HEADER_AAL5_IP, "ATM AAL5-IP (e.g., Cisco AAL5 mux)"}, + { SFLOW_245_HEADER_IPv4, "IPv4"}, + { SFLOW_245_HEADER_IPv6, "IPv6"}, + { SFLOW_245_HEADER_MPLS, "MPLS"}, + { SFLOW_5_HEADER_POS, "PPP over SONET/SDH (RFC 1662, 2615)"}, + { SFLOW_5_HEADER_80211_MAC, "802.11 MAC"}, + { SFLOW_5_HEADER_80211_AMPDU, "802.11n Aggregated MPDU"}, { SFLOW_5_HEADER_80211_AMSDU_SUBFRAME, "A-MSDU Subframe"}, { 0, NULL} }; @@ -2393,11 +2393,11 @@ dissect_sflow_5_expanded_flow_sample(tvbuff_t *tvb, packet_info *pinfo, static gint dissect_sflow_24_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, proto_item *parent) { struct sflow_24_counters_sample_header counters_header; - struct if_counters ifc; - struct ethernet_counters ethc; + struct if_counters ifc; + struct ethernet_counters ethc; struct token_ring_counters tokc; - struct vg_counters vgc; - struct vlan_counters vlanc; + struct vg_counters vgc; + struct vlan_counters vlanc; /* grab the flow header. This will remain in network byte order, so must convert each item before use */ @@ -2580,8 +2580,8 @@ dissect_sflow_5_expanded_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint o static gint dissect_sflow_245_samples(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, guint32 version) { proto_tree *sflow_245_sample_tree; - proto_item *ti; /* tree item */ - guint32 sample_type, enterprise, format, length; + proto_item *ti; /* tree item */ + guint32 sample_type, enterprise, format, length; /* decide what kind of sample it is. */ sample_type = tvb_get_ntohl(tvb, offset); @@ -2657,15 +2657,15 @@ static int dissect_sflow_245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* Set up structures needed to add the protocol subtree and manage it */ - proto_item *ti; - proto_tree *sflow_245_tree; - guint32 version, sub_agent_id, seqnum; - struct sflow_address_details addr_details; - struct sflow_address_type addr_type = {hf_sflow_agent_address_v4, hf_sflow_agent_address_v6}; + proto_item *ti; + proto_tree *sflow_245_tree; + guint32 version, sub_agent_id, seqnum; + struct sflow_address_details addr_details; + struct sflow_address_type addr_type = {hf_sflow_agent_address_v4, hf_sflow_agent_address_v6}; - guint32 numsamples; + guint32 numsamples; volatile guint offset = 0; - guint i = 0; + guint i = 0; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "sFlow"); @@ -3471,10 +3471,10 @@ proto_reg_handoff_sflow_245(void) { * * Local Variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * ex: set shiftwidth=4 tabstop=4 noexpandtab - * :indentSize=4:tabSize=4:noTabs=true: + * ex: set shiftwidth=4 tabstop=8 noexpandtab + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-spice.c b/epan/dissectors/packet-spice.c index d0e974f6ab..70b036de30 100644 --- a/epan/dissectors/packet-spice.c +++ b/epan/dissectors/packet-spice.c @@ -165,7 +165,7 @@ static const value_string playback_mode_vals[] = { #define SPICE_PLAYBACK_CAP_CELT_0_5_1 0 #define SPICE_PLAYBACK_CAP_VOLUME 1 -#define SPICE_PLAYBACK_CAP_CELT_0_5_1_MASK (1 << SPICE_PLAYBACK_CAP_CELT_0_5_1) +#define SPICE_PLAYBACK_CAP_CELT_0_5_1_MASK (1 << SPICE_PLAYBACK_CAP_CELT_0_5_1) #define SPICE_PLAYBACK_CAP_VOLUME_MASK (1 << SPICE_PLAYBACK_CAP_VOLUME) /* 0x2 */ /* main channel */ @@ -296,7 +296,7 @@ static const value_string record_client_message_types[] = { /* record channel capabilities - same as playback */ #define SPICE_RECORD_CAP_CELT_0_5_1 0 -#define SPICE_RECORD_CAP_CELT_0_5_1_MASK (1 << SPICE_RECORD_CAP_CELT_0_5_1) +#define SPICE_RECORD_CAP_CELT_0_5_1_MASK (1 << SPICE_RECORD_CAP_CELT_0_5_1) /* display channel */ /* display channel server messages */ @@ -615,8 +615,8 @@ typedef struct { gint16 y; } point16_t; -#define SPICE_BRUSH_TYPE_NONE 0 -#define SPICE_BRUSH_TYPE_SOLID 1 +#define SPICE_BRUSH_TYPE_NONE 0 +#define SPICE_BRUSH_TYPE_SOLID 1 #define SPICE_BRUSH_TYPE_PATTERN 2 static const value_string brush_types_vs[] = { @@ -701,8 +701,8 @@ static const value_string image_type_vs[] = { }; /* FIXME - those flags should be bit-wise, I guess! */ -#define IMAGE_FLAGS_CACHE_ME (1 << 0) -#define IMAGE_FLAGS_HIGH_BITS_SET (1 << 1) +#define IMAGE_FLAGS_CACHE_ME (1 << 0) +#define IMAGE_FLAGS_HIGH_BITS_SET (1 << 1) #define IMAGE_FLAGS_REPLACE_ME (1 << 2) static const value_string image_flags_vs[] = { { 0, "None" }, @@ -728,11 +728,11 @@ static const value_string rop_descriptor_vs[] = { }; #define QUIC_IMAGE_TYPE_INVALID 0 -#define QUIC_IMAGE_TYPE_GRAY 1 -#define QUIC_IMAGE_TYPE_RGB16 2 -#define QUIC_IMAGE_TYPE_RGB24 3 -#define QUIC_IMAGE_TYPE_RGB32 4 -#define QUIC_IMAGE_TYPE_RGBA 5 +#define QUIC_IMAGE_TYPE_GRAY 1 +#define QUIC_IMAGE_TYPE_RGB16 2 +#define QUIC_IMAGE_TYPE_RGB24 3 +#define QUIC_IMAGE_TYPE_RGB32 4 +#define QUIC_IMAGE_TYPE_RGBA 5 static const value_string quic_type_vs[] = { { QUIC_IMAGE_TYPE_INVALID, "INVALID" }, @@ -795,20 +795,20 @@ static const value_string Pixmap_types_vs[] = { #define SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION 0 -#define SPICE_COMMON_CAP_AUTH_SPICE 1 -#define SPICE_COMMON_CAP_AUTH_SASL 2 -#define SPICE_COMMON_CAP_MINI_HEADER 3 +#define SPICE_COMMON_CAP_AUTH_SPICE 1 +#define SPICE_COMMON_CAP_AUTH_SASL 2 +#define SPICE_COMMON_CAP_MINI_HEADER 3 #define SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION_MASK (1 << SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION) /* 0x1 */ -#define SPICE_COMMON_CAP_AUTH_SPICE_MASK (1 << SPICE_COMMON_CAP_AUTH_SPICE) /* 0x2 */ -#define SPICE_COMMON_CAP_AUTH_SASL_MASK (1 << SPICE_COMMON_CAP_AUTH_SASL) /*0x4 */ -#define SPICE_COMMON_CAP_MINI_HEADER_MASK (1 << SPICE_COMMON_CAP_MINI_HEADER) +#define SPICE_COMMON_CAP_AUTH_SPICE_MASK (1 << SPICE_COMMON_CAP_AUTH_SPICE) /* 0x2 */ +#define SPICE_COMMON_CAP_AUTH_SASL_MASK (1 << SPICE_COMMON_CAP_AUTH_SASL) /* 0x4 */ +#define SPICE_COMMON_CAP_MINI_HEADER_MASK (1 << SPICE_COMMON_CAP_MINI_HEADER) static const value_string spice_auth_select_vs[] = { { SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION, "Auth Selection" }, - { SPICE_COMMON_CAP_AUTH_SPICE, "Spice" }, - { SPICE_COMMON_CAP_AUTH_SASL, "SASL" }, - { SPICE_COMMON_CAP_MINI_HEADER, "Mini header" }, + { SPICE_COMMON_CAP_AUTH_SPICE, "Spice" }, + { SPICE_COMMON_CAP_AUTH_SASL, "SASL" }, + { SPICE_COMMON_CAP_MINI_HEADER, "Mini header" }, { 0, NULL } }; @@ -1012,10 +1012,10 @@ dissect_ID(tvbuff_t *tvb, proto_tree *tree, const guint32 offset) static guint32 dissect_Pixmap(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *Pixmap_tree; - guint32 PixmapSize; - guint32 strides, height, pallete_ptr; + guint32 PixmapSize; + guint32 strides, height, pallete_ptr; ti = proto_tree_add_text(tree, tvb, offset, 0, "Pixmap"); /* size is fixed later */ Pixmap_tree = proto_item_add_subtree(ti, ett_Pixmap); @@ -1049,9 +1049,10 @@ dissect_Pixmap(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static guint8 dissect_CursorHeader(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint16 *width, guint16 *height) { - proto_item *ti=NULL; - proto_tree *CursorHeader_tree; - const guint8 type = tvb_get_guint8(tvb, offset + 8); + proto_item *ti = NULL; + proto_tree *CursorHeader_tree; + const guint8 type = tvb_get_guint8(tvb, offset + 8); + *width = tvb_get_letohs(tvb, offset + 8 + 1); *height = tvb_get_letohs(tvb, offset + 8 + 1 + 2); @@ -1078,12 +1079,12 @@ dissect_CursorHeader(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint16 *w static guint32 dissect_RedCursor(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; - proto_tree *RedCursor_tree; - guint8 type; - guint16 height, width; - guint32 init_offset = offset, data_size = 0; - const guint16 flags = tvb_get_letohs(tvb, offset); + proto_item *ti = NULL; + proto_tree *RedCursor_tree; + guint8 type; + guint16 height, width; + guint32 init_offset = offset, data_size = 0; + const guint16 flags = tvb_get_letohs(tvb, offset); ti = proto_tree_add_text(tree, tvb, offset, 2, "RedCursor"); /* FIXME - fix size if flag is not NONE */ RedCursor_tree = proto_item_add_subtree(ti, ett_RedCursor); @@ -1137,9 +1138,9 @@ dissect_RedCursor(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static guint8 dissect_ImageDescriptor(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; - proto_tree *ImageDescriptor_tree; - const guint8 type = tvb_get_guint8(tvb, offset + 8); + proto_item *ti = NULL; + proto_tree *ImageDescriptor_tree; + const guint8 type = tvb_get_guint8(tvb, offset + 8); if (tree) { ti = proto_tree_add_text(tree, tvb, offset, sizeof_ImageDescriptor, "Image Descriptor"); @@ -1162,9 +1163,9 @@ dissect_ImageDescriptor(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static guint32 dissect_ImageQuic(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; - proto_tree *ImageQuic_tree; - const guint32 QuicSize = tvb_get_letohl(tvb, offset); + proto_item *ti = NULL; + proto_tree *ImageQuic_tree; + const guint32 QuicSize = tvb_get_letohl(tvb, offset); if (tree) { ti = proto_tree_add_text(tree, tvb, offset, QuicSize + 4, "QUIC Image"); @@ -1264,9 +1265,9 @@ dissect_ImageLZ_common(tvbuff_t *tvb, proto_tree *tree, guint32 offset, const gb static guint32 dissect_ImageLZ_JPEG(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; - proto_tree *LZ_JPEG_tree; - const guint32 LZ_JPEGSize = tvb_get_letohl(tvb, offset); + proto_item *ti = NULL; + proto_tree *LZ_JPEG_tree; + const guint32 LZ_JPEGSize = tvb_get_letohl(tvb, offset); ti = proto_tree_add_text(tree, tvb, offset, LZ_JPEGSize + 4, "LZ_JPEG Image"); LZ_JPEG_tree = proto_item_add_subtree(ti, ett_LZ_JPEG); @@ -1281,9 +1282,9 @@ dissect_ImageLZ_JPEG(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static guint32 dissect_ImageGLZ_RGB(tvbuff_t *tvb, proto_tree *tree, guint32 offset, const guint32 size) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *GLZ_RGB_tree; - guint32 GLZ_RGBSize; + guint32 GLZ_RGBSize; if (size == 0) { /* if no size was passed to us, need to fetch it. Otherwise, we already have it from the callee */ GLZ_RGBSize = tvb_get_letohl(tvb, offset); @@ -1305,9 +1306,9 @@ dissect_ImageGLZ_RGB(tvbuff_t *tvb, proto_tree *tree, guint32 offset, const guin static guint32 dissect_ImageLZ_RGB(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; - proto_tree *LZ_RGB_tree; - const guint32 LZ_RGBSize = tvb_get_letohl(tvb, offset); + proto_item *ti = NULL; + proto_tree *LZ_RGB_tree; + const guint32 LZ_RGBSize = tvb_get_letohl(tvb, offset); ti = proto_tree_add_text(tree, tvb, offset, LZ_RGBSize + 4, "LZ_RGB Image"); LZ_RGB_tree = proto_item_add_subtree(ti, ett_LZ_RGB); @@ -1322,9 +1323,9 @@ dissect_ImageLZ_RGB(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static guint32 dissect_ImageLZ_PLT(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *LZ_PLT_tree; - guint32 LZ_PLTSize, pal_size; + guint32 LZ_PLTSize, pal_size; const guint32 current_offset = offset; @@ -1368,10 +1369,10 @@ dissect_ImageLZ_PLT(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static guint32 dissect_ImageJPEG_Alpha(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *JPEG_tree; - tvbuff_t *jpeg_tvb; - guint32 JPEG_Size, Data_Size; + tvbuff_t *jpeg_tvb; + guint32 JPEG_Size, Data_Size; /*TODO: const guint8 flags = tvb_get_guint8(tvb, offset); dissect and present */ offset += 1; @@ -1397,9 +1398,9 @@ dissect_ImageJPEG_Alpha(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui static guint32 dissect_ImageJPEG(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, const guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *JPEG_tree; - tvbuff_t *jpeg_tvb; + tvbuff_t *jpeg_tvb; const guint32 JPEG_Size = tvb_get_letohl(tvb, offset); ti = proto_tree_add_text(tree, tvb, offset, JPEG_Size + 4, "JPEG Image (%u bytes)", JPEG_Size); @@ -1442,9 +1443,9 @@ dissect_ImageZLIB_GLZ_stream(tvbuff_t *tvb, proto_tree *ZLIB_GLZ_tree, packet_in static guint32 dissect_ImageZLIB_GLZ(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *ZLIB_GLZ_tree; - guint32 ZLIB_GLZSize, ZLIB_uncompSize; + guint32 ZLIB_GLZSize, ZLIB_uncompSize; ZLIB_uncompSize = tvb_get_letohl(tvb, offset); ZLIB_GLZSize = tvb_get_letohl(tvb, offset + 4); /* compressed size */ @@ -1466,8 +1467,8 @@ dissect_ImageZLIB_GLZ(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint static guint32 dissect_Image(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset) { - guint32 ImageSize = 0; - const guint8 type = dissect_ImageDescriptor(tvb, tree, offset);; + guint32 ImageSize = 0; + const guint8 type = dissect_ImageDescriptor(tvb, tree, offset);; offset += sizeof_ImageDescriptor; @@ -1516,9 +1517,9 @@ dissect_Image(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offse static SpiceRect dissect_SpiceRect(tvbuff_t *tvb, proto_tree *tree, const guint32 offset, const gint32 id) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *rect_tree; - SpiceRect rect; + SpiceRect rect; rect.left = tvb_get_letohl(tvb, offset); rect.top = tvb_get_letohl(tvb, offset + 4); @@ -1553,10 +1554,10 @@ rect_is_empty(const SpiceRect r) static guint32 dissect_RectList(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; - proto_tree *rectlist_tree; - guint32 i; - const guint32 rectlist_size = tvb_get_letohl(tvb, offset); + proto_item *ti = NULL; + proto_tree *rectlist_tree; + guint32 i; + const guint32 rectlist_size = tvb_get_letohl(tvb, offset); if (tree) { ti = proto_tree_add_text(tree, tvb, offset, 4 + (rectlist_size * sizeof_SpiceRect), @@ -1578,9 +1579,9 @@ dissect_RectList(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static guint8 dissect_Clip(tvbuff_t *tvb, proto_tree *tree, const guint32 offset) { - proto_item *ti=NULL; - proto_tree *Clip_tree; - const guint8 type = tvb_get_guint8(tvb, offset); + proto_item *ti = NULL; + proto_tree *Clip_tree; + const guint8 type = tvb_get_guint8(tvb, offset); if (tree) { ti = proto_tree_add_text(tree, tvb, offset, 1, "SpiceClip"); @@ -1594,9 +1595,9 @@ dissect_Clip(tvbuff_t *tvb, proto_tree *tree, const guint32 offset) static point32_t dissect_POINT32(tvbuff_t *tvb, proto_tree *tree, const guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *point_tree; - point32_t point; + point32_t point; point.x = tvb_get_letohl(tvb, offset); point.y = tvb_get_letohl(tvb, offset + 4); @@ -1615,9 +1616,9 @@ dissect_POINT32(tvbuff_t *tvb, proto_tree *tree, const guint32 offset) static point16_t dissect_POINT16(tvbuff_t *tvb, proto_tree *tree, const guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *point16_tree; - point16_t point16; + point16_t point16; point16.x = tvb_get_letohs(tvb, offset); point16.y = tvb_get_letohs(tvb, offset + 2); @@ -1636,9 +1637,9 @@ dissect_POINT16(tvbuff_t *tvb, proto_tree *tree, const guint32 offset) static guint32 dissect_Mask(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *Mask_tree; - guint32 bitmap; + guint32 bitmap; ti = proto_tree_add_text(tree, tvb, offset, sizeof_Mask, "Mask"); Mask_tree = proto_item_add_subtree(ti, ett_Mask); @@ -1668,9 +1669,9 @@ dissect_Mask(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static guint32 dissect_Brush(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; - proto_tree *brush_tree; - const guint8 type = tvb_get_guint8(tvb, offset); + proto_item *ti = NULL; + proto_tree *brush_tree; + const guint8 type = tvb_get_guint8(tvb, offset); switch(type) { case SPICE_BRUSH_TYPE_SOLID: @@ -1710,11 +1711,12 @@ dissect_Brush(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static guint32 dissect_DisplayBase(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *DisplayBase_tree; - SpiceRect rect; - guint8 clip_type; - guint32 clip_size = 0; + SpiceRect rect; + guint8 clip_type; + guint32 clip_size = 0; + ti = proto_tree_add_text(tree, tvb, offset, sizeof_DisplayBase, "SpiceMsgDisplayBase"); DisplayBase_tree = proto_item_add_subtree(ti, ett_DisplayBase); proto_tree_add_item(DisplayBase_tree, hf_display_surface_id, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -1732,7 +1734,8 @@ dissect_DisplayBase(tvbuff_t *tvb, proto_tree *tree, guint32 offset) return sizeof_DisplayBase; } -static const gchar* get_message_type_string(const guint16 message_type, const spice_conversation_t *spice_info, const gboolean client_message) +static const gchar* get_message_type_string(const guint16 message_type, const spice_conversation_t *spice_info, + const gboolean client_message) { if (message_type < SPICE_FIRST_AVAIL_MESSAGE) { /* this is a common message */ @@ -1788,7 +1791,8 @@ static const gchar* get_message_type_string(const guint16 message_type, const sp return "Unknown message"; } static void -dissect_spice_mini_data_header(tvbuff_t *tvb, proto_tree *tree, const spice_conversation_t *spice_info, const gboolean client_message, const guint16 message_type, guint32 offset) +dissect_spice_mini_data_header(tvbuff_t *tvb, proto_tree *tree, const spice_conversation_t *spice_info, + const gboolean client_message, const guint16 message_type, guint32 offset) { if (tree) { proto_tree_add_text(tree, tvb, offset, 2, "Message type: %s (%d)", get_message_type_string(message_type, spice_info, client_message), message_type); @@ -1798,7 +1802,8 @@ dissect_spice_mini_data_header(tvbuff_t *tvb, proto_tree *tree, const spice_conv } static void -dissect_spice_data_header(tvbuff_t *tvb, proto_tree *tree, const spice_conversation_t *spice_info, const gboolean client_message, const guint16 message_type, guint32 *sublist_size, guint32 offset) +dissect_spice_data_header(tvbuff_t *tvb, proto_tree *tree, const spice_conversation_t *spice_info, + const gboolean client_message, const guint16 message_type, guint32 *sublist_size, guint32 offset) { *sublist_size = tvb_get_letohl(tvb, offset + 14); @@ -1854,9 +1859,9 @@ dissect_spice_common_client_messages(tvbuff_t *tvb, proto_tree *tree, const guin static guint32 dissect_spice_common_server_messages(tvbuff_t *tvb, proto_tree *tree, const guint16 message_type, guint32 offset, const guint32 total_message_size) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *server_message_tree; - guint32 message_len, severity, visibility; + guint32 message_len, severity, visibility; switch(message_type) { /* @@ -1971,11 +1976,11 @@ dissect_spice_display_client(tvbuff_t *tvb, proto_tree *tree, const guint16 mess static guint32 dissect_spice_display_server(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, const guint16 message_type, guint32 offset) { - guint32 data_size, displayBaseLen; - guint8 clip_type; - guint16 glyphs; - SpiceRect r; - tvbuff_t *jpeg_tvb; + guint32 data_size, displayBaseLen; + guint8 clip_type; + guint16 glyphs; + SpiceRect r; + tvbuff_t *jpeg_tvb; switch(message_type) { case SPICE_DISPLAY_MODE: @@ -2088,15 +2093,15 @@ dissect_spice_display_server(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo /* source area */ dissect_SpiceRect(tvb, tree, offset, -1); offset += sizeof_SpiceRect; - + data_size = dissect_Brush(tvb, tree, offset); offset += data_size; proto_tree_add_text(tree, tvb, offset, 1, "ROP3"); - offset += 1; + offset += 1; proto_tree_add_text(tree, tvb, offset, 1, "scale mode"); offset += 1; - + offset += dissect_Mask(tvb, tree, offset); /*FIXME - need to understand what the rest of the message contains. */ data_size = dissect_Image(tvb, tree, pinfo, offset); @@ -2385,7 +2390,7 @@ static guint32 dissect_spice_main_server(tvbuff_t *tvb, proto_tree *tree, const guint16 message_type, guint32 offset) { guint32 num_channels, i, agent_msg_type, agent_msg_len, name_len; - guint8 channel_type; + guint8 channel_type; switch(message_type) { case SPICE_MAIN_INIT: @@ -2469,9 +2474,9 @@ dissect_spice_main_server(tvbuff_t *tvb, proto_tree *tree, const guint16 message static guint32 dissect_spice_main_client(tvbuff_t *tvb, proto_tree *tree, const guint16 message_type, guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *main_tree; - guint32 agent_msg_type, agent_msg_len; + guint32 agent_msg_type, agent_msg_len; switch(message_type) { case SPICEC_MAIN_MOUSE_MODE_REQUEST: @@ -2608,11 +2613,12 @@ dissect_spice_inputs_server(tvbuff_t *tvb, proto_tree *tree, const guint16 messa static guint32 dissect_spice_data_server_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, spice_conversation_t *spice_info, guint32 offset, const guint32 total_message_size) { - proto_item *ti=NULL, *msg_ti=NULL; + proto_item *ti = NULL, *msg_ti=NULL; proto_tree *data_header_tree, *message_tree; - guint16 message_type; - guint32 message_size, sublist_size, old_offset; - guint32 header_size; + guint16 message_type; + guint32 message_size, sublist_size, old_offset; + guint32 header_size; + if (spice_info->client_mini_header && spice_info->server_mini_header) { header_size = sizeof_SpiceMiniDataHeader; message_type = tvb_get_letohs(tvb, offset); @@ -2690,11 +2696,11 @@ dissect_spice_data_server_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf static guint32 dissect_spice_data_client_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, spice_conversation_t *spice_info, guint32 offset) { - proto_item *ti=NULL; + proto_item *ti = NULL; proto_tree *data_header_tree; - guint16 message_type; + guint16 message_type; guint32 /** message_size,**/ sublist_size; - guint32 header_size; + guint32 header_size; if (spice_info->client_mini_header && spice_info->server_mini_header) { header_size = sizeof_SpiceMiniDataHeader; @@ -2758,9 +2764,9 @@ static void dissect_spice_common_capabilities(tvbuff_t *tvb, proto_tree *tree, guint32 offset, const int caps_len, spice_conversation_t *spice_info, gboolean is_client) { /* TODO: save common and per-channel capabilities in spice_info ? */ - int i; - guint32 val; - proto_item *ti=NULL; + int i; + guint32 val; + proto_item *ti = NULL; proto_tree *auth_tree; for(i = 0; i != caps_len ; i++) { @@ -2800,11 +2806,11 @@ static void dissect_spice_link_capabilities(tvbuff_t *tvb, proto_tree *tree, guint32 offset, const int caps_len, const spice_conversation_t *spice_info) { /* TODO: save common and per-channel capabilities in spice_info ? */ - int i; - guint32 val; - proto_item *ti=NULL; + int i; + guint32 val; + proto_item *ti = NULL; proto_tree *cap_tree; - + for(i = 0; i != caps_len ; i++) { val = tvb_get_letohl(tvb, offset); switch (spice_info->channel_type) { @@ -2863,11 +2869,11 @@ dissect_spice_link_capabilities(tvbuff_t *tvb, proto_tree *tree, guint32 offset, static void dissect_spice_link_client_pdu(tvbuff_t *tvb, proto_tree *tree, spice_conversation_t *spice_info) { - guint32 offset; - guint32 common_caps_len, channel_caps_len; - proto_item *ti=NULL; + guint32 offset; + guint32 common_caps_len, channel_caps_len; + proto_item *ti = NULL; proto_tree *link_header_tree = NULL; - proto_tree *caps_tree = NULL; + proto_tree *caps_tree = NULL; if (tree) { ti = proto_tree_add_item(tree, hf_link_client, tvb, 0, sizeof_SpiceLinkHeader, ENC_NA); @@ -2915,9 +2921,9 @@ dissect_spice_link_client_pdu(tvbuff_t *tvb, proto_tree *tree, spice_conversatio static void dissect_spice_link_server_pdu(tvbuff_t *tvb, proto_tree *tree, spice_conversation_t *spice_info) { - guint32 offset; - guint32 common_caps_len, channel_caps_len; - proto_item *ti=NULL; + guint32 offset; + guint32 common_caps_len, channel_caps_len; + proto_item *ti = NULL; proto_tree *link_tree = NULL; proto_tree *caps_tree = NULL; @@ -2964,18 +2970,18 @@ static int dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - conversation_t *conversation; + conversation_t *conversation; spice_conversation_t *spice_info; - spice_packet_t *per_packet_info; - guint32 avail; - guint32 pdu_len = 0; - guint32 offset; - proto_item *ti=NULL; - proto_tree *spice_tree=NULL; - proto_tree *spice_data_tree=NULL; - gboolean client_sasl_list=FALSE; - gboolean first_record_in_frame; - guint8 sasl_auth_result; + spice_packet_t *per_packet_info; + guint32 avail; + guint32 pdu_len = 0; + guint32 offset; + proto_item *ti = NULL; + proto_tree *spice_tree = NULL; + proto_tree *spice_data_tree = NULL; + gboolean client_sasl_list = FALSE; + gboolean first_record_in_frame; + guint8 sasl_auth_result; conversation = find_or_create_conversation(pinfo); @@ -3512,7 +3518,7 @@ proto_register_spice(void) { "Volume playback channel support", "spice.playback_cap_volume", FT_BOOLEAN, 3, TFS(&tfs_set_notset), SPICE_PLAYBACK_CAP_VOLUME_MASK, NULL, HFILL } - }, + }, { &hf_record_cap_celt, { "CELT 0.5.1 record channel support", "spice.record_cap_celt", FT_BOOLEAN, 3, TFS(&tfs_set_notset), SPICE_RECORD_CAP_CELT_0_5_1_MASK, @@ -4092,11 +4098,11 @@ proto_reg_handoff_spice(void) * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=4 tabstop=4 expandtab: - * :indentSize=4:tabSize=4:noTabs=true: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-wol.c b/epan/dissectors/packet-wol.c index 68a16b7671..dadee7046a 100644 --- a/epan/dissectors/packet-wol.c +++ b/epan/dissectors/packet-wol.c @@ -88,10 +88,10 @@ static gint ett_wol_macblock = -1; static int dissect_wol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - guint len; - gint offset; - guint8 sync[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - guint8 *mac; + guint len; + gint offset; + guint8 sync[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + guint8 *mac; const guint8 *passwd; /* Set up structures needed to add the protocol subtree and manage it */ @@ -352,11 +352,10 @@ proto_reg_handoff_wol(void) * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=4 tabstop=4 expandtab: - * :indentSize=4:tabSize=4:noTabs=true: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ - |