aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nt-tpcp.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2011-09-21 23:42:55 +0000
committerBill Meier <wmeier@newsguy.com>2011-09-21 23:42:55 +0000
commitad1efb6b9c4c2c50289d7264d6ae79afcb1ae7b4 (patch)
tree66b6a5f30acef7b0ac0af0bfe5790ecbd6f3a998 /epan/dissectors/packet-nt-tpcp.c
parentd4a982fd1f3fc47924ac8beeae756b6273d26221 (diff)
(Trivial) Remove trailing whitespace from lines for a few files.
svn path=/trunk/; revision=39084
Diffstat (limited to 'epan/dissectors/packet-nt-tpcp.c')
-rw-r--r--epan/dissectors/packet-nt-tpcp.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/epan/dissectors/packet-nt-tpcp.c b/epan/dissectors/packet-nt-tpcp.c
index f3b616e671..f68640a38c 100644
--- a/epan/dissectors/packet-nt-tpcp.c
+++ b/epan/dissectors/packet-nt-tpcp.c
@@ -7,23 +7,23 @@
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
-*
+*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-*
+*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifdef HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
@@ -38,7 +38,7 @@
#include <epan/packet.h>
#include <epan/addr_resolv.h> /* this is for get_hostname and get_udp_port */
-#define UDP_PORT_TPCP 3121
+#define UDP_PORT_TPCP 3121
/* TPCP version1/2 PDU format */
typedef struct _tpcppdu_t {
@@ -104,17 +104,17 @@ static gint ett_tpcp = -1;
static gint ett_tpcp_flags = -1;
-static void
+static void
dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
tpcpdu_t tpcph;
proto_tree *tpcp_tree = NULL, *field_tree = NULL;
proto_item *ti, *tf;
guint8 length = TPCP_VER_1_LENGTH;
-
+
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TPCP");
col_clear(pinfo->cinfo, COL_INFO);
-
+
/* need to find out which version!! */
tpcph.version = tvb_get_guint8(tvb, 0);
/* as version 1 and 2 are so similar use the same structure, just don't use as much for version 1*/
@@ -127,12 +127,12 @@ dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else {
memset (&tpcph, 0, sizeof (tpcph));
}
-
-
+
+
tpcph.id = g_ntohs(tpcph.id);
tpcph.flags = g_ntohs(tpcph.flags);
tpcph.cport = g_ntohs(tpcph.cport);
-
+
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO,"%s id %d CPort %s CIP %s SIP %s",
val_to_str(tpcph.type, type_vals, "Unknown"),
@@ -140,43 +140,43 @@ dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
get_udp_port(tpcph.cport),
ip_to_str((guint8 *)&tpcph.caddr),
ip_to_str((guint8 *)&tpcph.saddr));
-
+
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_tpcp, tvb, 0, length,
"Alteon WebSystems - Transparent Proxy Cache Protocol");
-
+
tpcp_tree = proto_item_add_subtree(ti, ett_tpcp);
-
+
proto_tree_add_item(tpcp_tree, hf_tpcp_version, tvb, 0, 1, tpcph.version);
-
+
proto_tree_add_uint_format(tpcp_tree, hf_tpcp_type, tvb, 1, 1, tpcph.type,
- "Type: %s (%d)",
- val_to_str(tpcph.type, type_vals, "Unknown"), tpcph.type);
-
+ "Type: %s (%d)",
+ val_to_str(tpcph.type, type_vals, "Unknown"), tpcph.type);
+
/* flags next , i'll do that when I can work out how to do it :-( */
tf = proto_tree_add_text(tpcp_tree, tvb, 2, 2, "Flags: 0x%04x",tpcph.flags);
-
- field_tree = proto_item_add_subtree(tf, ett_tpcp_flags);
+
+ field_tree = proto_item_add_subtree(tf, ett_tpcp_flags);
proto_tree_add_boolean(field_tree, hf_tpcp_flags_tcp, tvb, 2, 2, tpcph.flags);
proto_tree_add_boolean(field_tree, hf_tpcp_flags_redir, tvb, 2,2, tpcph.flags);
proto_tree_add_boolean(field_tree, hf_tpcp_flags_xon, tvb, 2, 2, tpcph.flags);
proto_tree_add_boolean(field_tree, hf_tpcp_flags_xoff, tvb, 2, 2, tpcph.flags);
-
+
proto_tree_add_uint(tpcp_tree, hf_tpcp_id, tvb, 4, 2, tpcph.id);
-
+
proto_tree_add_uint_format(tpcp_tree, hf_tpcp_cport, tvb, 6, 2, tpcph.cport,
"Client Source port: %s", get_udp_port(tpcph.cport));
-
- proto_tree_add_ipv4(tpcp_tree, hf_tpcp_caddr, tvb, 8, 4, tpcph.caddr);
-
- proto_tree_add_ipv4(tpcp_tree, hf_tpcp_saddr, tvb, 12, 4, tpcph.saddr);
-
+
+ proto_tree_add_ipv4(tpcp_tree, hf_tpcp_caddr, tvb, 8, 4, tpcph.caddr);
+
+ proto_tree_add_ipv4(tpcp_tree, hf_tpcp_saddr, tvb, 12, 4, tpcph.saddr);
+
if (tpcph.version == TPCP_VER_2) {
- proto_tree_add_ipv4(tpcp_tree, hf_tpcp_vaddr, tvb, 16, 4, tpcph.vaddr);
- proto_tree_add_ipv4(tpcp_tree, hf_tpcp_rasaddr, tvb, 20, 4, tpcph.rasaddr);
+ proto_tree_add_ipv4(tpcp_tree, hf_tpcp_vaddr, tvb, 16, 4, tpcph.vaddr);
+ proto_tree_add_ipv4(tpcp_tree, hf_tpcp_rasaddr, tvb, 20, 4, tpcph.rasaddr);
proto_tree_add_text(tpcp_tree, tvb, 24, 4, "Signature: %u", tpcph.signature);
}
-
+
}
}
@@ -187,59 +187,59 @@ proto_register_tpcp(void)
{ &hf_tpcp_version,
{ "Version", "tpcp.version", FT_UINT8, BASE_DEC, NULL, 0x0,
"TPCP version", HFILL }},
-
+
{ &hf_tpcp_type,
{ "Type", "tpcp.type", FT_UINT8, BASE_DEC,NULL, 0x0,
"PDU type", HFILL }},
-
+
{ &hf_tpcp_flags_tcp,
{ "UDP/TCP", "tpcp.flags.tcp", FT_BOOLEAN, 8, TFS(&tfs_set_notset), TF_TPCP_UDPTCP,
"Protocol type", HFILL }},
-
+
{ &hf_tpcp_flags_redir,
{ "No Redirect", "tpcp.flags.redir", FT_BOOLEAN, 8, TFS(&tfs_set_notset), TF_TPCP_DONTREDIRECT,
"Don't redirect client", HFILL }},
-
+
{ &hf_tpcp_flags_xon,
{ "XON", "tpcp.flags.xon", FT_BOOLEAN, 8, TFS(&tfs_set_notset), TF_TPCP_XON,
NULL, HFILL }},
-
+
{ &hf_tpcp_flags_xoff,
{ "XOFF", "tpcp.flags.xoff", FT_BOOLEAN, 8, TFS(&tfs_set_notset), TF_TPCP_XOFF,
NULL, HFILL }},
-
+
{ &hf_tpcp_id,
{ "Client indent", "tpcp.cid", FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
-
+
{ &hf_tpcp_cport,
{ "Client Source Port", "tpcp.cport", FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
-
+
{ &hf_tpcp_caddr,
{ "Client Source IP address", "tpcp.caddr", FT_IPv4, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
-
+
{ &hf_tpcp_saddr,
{ "Server IP address", "tpcp.saddr", FT_IPv4, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
-
+
{ &hf_tpcp_vaddr,
{ "Virtual Server IP address", "tpcp.vaddr", FT_IPv4, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
-
+
{ &hf_tpcp_rasaddr,
{ "RAS server IP address", "tpcp.rasaddr", FT_IPv4, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
-
+
};
-
-
+
+
static gint *ett[] = {
&ett_tpcp,
&ett_tpcp_flags,
};
-
+
proto_tpcp = proto_register_protocol("Alteon - Transparent Proxy Cache Protocol",
"TPCP", "tpcp");
proto_register_field_array(proto_tpcp, hf, array_length(hf));
@@ -250,7 +250,7 @@ void
proto_reg_handoff_tpcp(void)
{
dissector_handle_t tpcp_handle;
-
+
tpcp_handle = create_dissector_handle(dissect_tpcp, proto_tpcp);
dissector_add_uint("udp.port", UDP_PORT_TPCP, tpcp_handle);
}