summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2013-12-23 16:50:25 +0000
committerJeff Morriss <jeff.morriss.ws@gmail.com>2013-12-23 16:50:25 +0000
commitb20e6a20eb9feaf81ec711627dfc69958b6066bb (patch)
tree3480540dbff067f2157fc4a02dbcef6bc67038ee
parent9e8306c74619da78a51e250d289e52a7cab81706 (diff)
downloadwireshark-b20e6a20eb9feaf81ec711627dfc69958b6066bb.tar.gz
Make the SCTP Decode-As dialog more consistent with the TCP one.
Rename the 2nd SCTP Transport tab to "SCTP(PPID)" to make it obvious what it is. Fix up casing and code formatting in both SCTP and TCP Decode-As code. svn path=/trunk/; revision=54391
-rw-r--r--epan/dissectors/packet-sctp.c42
-rw-r--r--epan/dissectors/packet-tcp.c23
2 files changed, 41 insertions, 24 deletions
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index 74b28fd3cf..50cdebf96d 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -693,33 +693,43 @@ find_assoc_index(assoc_info_t* tmpinfo)
return inf;
}
+/* XXX - redefined here to not create UI dependencies */
+#define UTF8_LEFTWARDS_ARROW "\xe2\x86\x90" /* 8592 / 0x2190 */
+#define UTF8_RIGHTWARDS_ARROW "\xe2\x86\x92" /* 8594 / 0x2192 */
+#define UTF8_LEFT_RIGHT_ARROW "\xe2\x86\x94" /* 8596 / 0x2194 */
-static void sctp_src_prompt(packet_info *pinfo, gchar* result)
+static void
+sctp_src_prompt(packet_info *pinfo, gchar *result)
{
- g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Source (%u)", pinfo->srcport);
+ g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%s%u)", UTF8_RIGHTWARDS_ARROW, pinfo->srcport);
}
-static gpointer sctp_src_value(packet_info *pinfo)
+static gpointer
+sctp_src_value(packet_info *pinfo)
{
return GUINT_TO_POINTER(pinfo->srcport);
}
-static void sctp_dst_prompt(packet_info *pinfo, gchar* result)
+static void
+sctp_dst_prompt(packet_info *pinfo, gchar *result)
{
- g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Destination (%u)", pinfo->destport);
+ g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, pinfo->destport);
}
-static gpointer sctp_dst_value(packet_info *pinfo)
+static gpointer
+sctp_dst_value(packet_info *pinfo)
{
return GUINT_TO_POINTER(pinfo->destport);
}
-static void sctp_both_prompt(packet_info *pinfo _U_, gchar* result)
+static void
+sctp_both_prompt(packet_info *pinfo, gchar *result)
{
- g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both");
+ g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", pinfo->srcport, UTF8_LEFT_RIGHT_ARROW, pinfo->destport);
}
-static void sctp_ppi_prompt1(packet_info *pinfo _U_, gchar* result)
+static void
+sctp_ppi_prompt1(packet_info *pinfo _U_, gchar* result)
{
guint32 ppid = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 0));
@@ -730,7 +740,8 @@ static void sctp_ppi_prompt1(packet_info *pinfo _U_, gchar* result)
}
}
-static void sctp_ppi_prompt2(packet_info *pinfo _U_, gchar* result)
+static void
+sctp_ppi_prompt2(packet_info *pinfo _U_, gchar* result)
{
guint32 ppid = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 1));
@@ -741,18 +752,19 @@ static void sctp_ppi_prompt2(packet_info *pinfo _U_, gchar* result)
}
}
-static gpointer sctp_ppi_value1(packet_info *pinfo)
+static gpointer
+sctp_ppi_value1(packet_info *pinfo)
{
return p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 0);
}
-static gpointer sctp_ppi_value2(packet_info *pinfo)
+static gpointer
+sctp_ppi_value2(packet_info *pinfo)
{
return p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 1);
}
-
static unsigned int
sctp_adler32(const unsigned char *buf, unsigned int len)
{
@@ -4655,13 +4667,13 @@ proto_register_sctp(void)
static build_valid_func sctp_da_dst_values[1] = {sctp_dst_value};
static build_valid_func sctp_da_both_values[2] = {sctp_src_value, sctp_dst_value};
static decode_as_value_t sctp_da_port_values[3] = {{sctp_src_prompt, 1, sctp_da_src_values}, {sctp_dst_prompt, 1, sctp_da_dst_values}, {sctp_both_prompt, 2, sctp_da_both_values}};
- static decode_as_t sctp_da_port = {"sctp", "Transport", "sctp.port", 3, 2, sctp_da_port_values, "SCTP Port as", NULL,
+ static decode_as_t sctp_da_port = {"sctp", "Transport", "sctp.port", 3, 2, sctp_da_port_values, "SCTP", "port(s) as",
decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
static build_valid_func sctp_da_ppi_build_value1[1] = {sctp_ppi_value1};
static build_valid_func sctp_da_ppi_build_value2[1] = {sctp_ppi_value2};
static decode_as_value_t sctp_da_ppi_values[2] = {{sctp_ppi_prompt1, 1, sctp_da_ppi_build_value1}, {sctp_ppi_prompt2, 1, sctp_da_ppi_build_value2}};
- static decode_as_t sctp_da_ppi = {"sctp", "Transport", "sctp.ppi", 2, 0, sctp_da_ppi_values, "SCTP", NULL,
+ static decode_as_t sctp_da_ppi = {"sctp", "SCTP(PPID)", "sctp.ppi", 2, 0, sctp_da_ppi_values, "SCTP", NULL,
decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
/* UAT for header fields */
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 58bac2df2b..756f11c761 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -462,29 +462,34 @@ static guint32 tcp_stream_count;
#define UTF8_RIGHTWARDS_ARROW "\xe2\x86\x92" /* 8594 / 0x2192 */
#define UTF8_LEFT_RIGHT_ARROW "\xe2\x86\x94" /* 8596 / 0x2194 */
-static void tcp_src_prompt(packet_info *pinfo, gchar* result)
+static void
+tcp_src_prompt(packet_info *pinfo, gchar *result)
{
- g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Source (%u%s)", pinfo->srcport, UTF8_RIGHTWARDS_ARROW);
+ g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", pinfo->srcport, UTF8_RIGHTWARDS_ARROW);
}
-static gpointer tcp_src_value(packet_info *pinfo)
+static gpointer
+tcp_src_value(packet_info *pinfo)
{
return GUINT_TO_POINTER(pinfo->srcport);
}
-static void tcp_dst_prompt(packet_info *pinfo, gchar* result)
+static void
+tcp_dst_prompt(packet_info *pinfo, gchar *result)
{
- g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Destination (%s%u)", UTF8_RIGHTWARDS_ARROW, pinfo->destport);
+ g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, pinfo->destport);
}
-static gpointer tcp_dst_value(packet_info *pinfo)
+static gpointer
+tcp_dst_value(packet_info *pinfo)
{
return GUINT_TO_POINTER(pinfo->destport);
}
-static void tcp_both_prompt(packet_info *pinfo, gchar* result)
+static void
+tcp_both_prompt(packet_info *pinfo, gchar *result)
{
- g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Both (%u%s%u)", pinfo->srcport,UTF8_LEFT_RIGHT_ARROW, pinfo->destport);
+ g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", pinfo->srcport, UTF8_LEFT_RIGHT_ARROW, pinfo->destport);
}
/* TCP structs and definitions */
@@ -848,7 +853,7 @@ pdu_store_window_scale_option(guint8 ws, struct tcp_analysis *tcpd)
static void
tcp_analyze_get_acked_struct(guint32 frame, guint32 seq, guint32 ack, gboolean createflag, struct tcp_analysis *tcpd)
{
-
+
wmem_tree_key_t key[4];
key[0].length = 1;