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, ¤t);
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, ¤t.ip_src);
copy_address(&tg->dst_address, ¤t.ip_dst);
tg->dst_port = current.th_dport;
tg->stream = header->th_stream;
- }
- else {
+ } else {
ts.direction = COMPARE_ANY_DIR;
}
return count;
}
-
-
typedef struct _th_t {
int num_hdrs;
#define MAX_SUPPORTED_TCP_HEADERS 8
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;
}
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;
}
/* 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);
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;
}
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;