aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-03-17 19:36:32 +0100
committerAnders Broman <a.broman58@gmail.com>2018-03-17 21:24:54 +0000
commit401e335b7ff1c0df7c7c6442573ec243274692fb (patch)
treecba29d95a6e816658d7d9db6ba7307b83ad1f795
parent296cd7c91d8975731a2f9b5e00cf5f8ed7659623 (diff)
tap-tcp-stream: fix indentation.
Change-Id: I9ec60866dc674d9ec682afc6d644d78255182cac Reviewed-on: https://code.wireshark.org/review/26526 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--ui/tap-tcp-stream.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c
index cd78dee397..eedf08e8f1 100644
--- a/ui/tap-tcp-stream.c
+++ b/ui/tap-tcp-stream.c
@@ -108,15 +108,18 @@ graph_segment_list_get(capture_file *cf, struct tcp_graph *tg, gboolean stream_k
g_log(NULL, G_LOG_LEVEL_DEBUG, "graph_segment_list_get()");
- if (!cf || !tg) return;
+ if (!cf || !tg) {
+ return;
+ }
if (!stream_known) {
struct tcpheader *header = select_tcpip_session(cf, &current);
if (!header) return;
- if (tg->type == GRAPH_THROUGHPUT)
+ if (tg->type == GRAPH_THROUGHPUT) {
ts.direction = COMPARE_CURR_DIR;
- else
+ } else {
ts.direction = COMPARE_ANY_DIR;
+ }
/* Remember stream info in graph */
copy_address(&tg->src_address, &current.ip_src);
@@ -124,8 +127,7 @@ graph_segment_list_get(capture_file *cf, struct tcp_graph *tg, gboolean stream_k
copy_address(&tg->dst_address, &current.ip_dst);
tg->dst_port = current.th_dport;
tg->stream = header->th_stream;
- }
- else {
+ } else {
ts.direction = COMPARE_ANY_DIR;
}
@@ -218,8 +220,6 @@ get_num_acks(struct tcp_graph *tg, int *num_sack_ranges)
return count;
}
-
-
typedef struct _th_t {
int num_hdrs;
#define MAX_SUPPORTED_TCP_HEADERS 8
@@ -242,8 +242,7 @@ tap_tcpip_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, con
stored->th_sport, stored->th_dport,
&header->ip_src, &header->ip_dst,
header->th_sport, stored->th_dport,
- COMPARE_CURR_DIR))
- {
+ COMPARE_CURR_DIR)) {
is_unique = FALSE;
break;
}
@@ -279,8 +278,9 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs)
nstime_t rel_ts;
th_t th = {0, {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}};
- if (!cf || !hdrs)
+ if (!cf || !hdrs) {
return NULL;
+ }
fdata = cf->current_frame;
@@ -292,11 +292,12 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs)
}
/* dissect the current record */
- if (!cf_read_record(cf, fdata))
+ if (!cf_read_record(cf, fdata)) {
return NULL; /* error reading the record */
+ }
- error_string=register_tap_listener("tcp", &th, NULL, 0, NULL, tap_tcpip_packet, NULL);
+ error_string = register_tap_listener("tcp", &th, NULL, 0, NULL, tap_tcpip_packet, NULL);
if (error_string) {
fprintf(stderr, "wireshark: Couldn't register tcp_graph tap: %s\n",
error_string->str);
@@ -359,8 +360,9 @@ int rtt_is_retrans(struct rtt_unack *list, unsigned int seqno)
for (u=list; u; u=u->next) {
if (tcp_seq_eq_or_after(seqno, u->seqno) &&
- tcp_seq_before(seqno, u->end_seqno))
+ tcp_seq_before(seqno, u->end_seqno)) {
return TRUE;
+ }
}
return FALSE;
}
@@ -383,21 +385,24 @@ void rtt_put_unack_on_list(struct rtt_unack **l, struct rtt_unack *new_unack)
struct rtt_unack *u, *list = *l;
for (u=list; u; u=u->next) {
- if (!u->next)
+ if (!u->next) {
break;
+ }
}
- if (u)
+ if (u) {
u->next = new_unack;
- else
+ } else {
*l = new_unack;
+ }
}
void rtt_delete_unack_from_list(struct rtt_unack **l, struct rtt_unack *dead)
{
struct rtt_unack *u, *list = *l;
- if (!dead || !list)
+ if (!dead || !list) {
return;
+ }
if (dead == list) {
*l = list->next;