Add debug option to show ip_proto
This commit is contained in:
@@ -662,6 +662,7 @@ int main (int argc, char **argv)
|
|||||||
{ "noquickack", NULL, option_option },
|
{ "noquickack", NULL, option_option },
|
||||||
{ "retry", &retry_opts, option_option },
|
{ "retry", &retry_opts, option_option },
|
||||||
{ "daemon", NULL, option_option },
|
{ "daemon", NULL, option_option },
|
||||||
|
{ "debug", NULL, option_option },
|
||||||
{ "version", NULL, option_option },
|
{ "version", NULL, option_option },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
@@ -678,6 +679,7 @@ int main (int argc, char **argv)
|
|||||||
const int delay = option_is_set(opts, "delay");
|
const int delay = option_is_set(opts, "delay");
|
||||||
const int keepalive = option_is_set(opts, "keepalive");
|
const int keepalive = option_is_set(opts, "keepalive");
|
||||||
const int noquickack = option_is_set(opts, "noquickack");
|
const int noquickack = option_is_set(opts, "noquickack");
|
||||||
|
const int debug = option_is_set(opts, "debug");
|
||||||
|
|
||||||
if (buffer_size < 2048) {
|
if (buffer_size < 2048) {
|
||||||
buffer_size = 2048;
|
buffer_size = 2048;
|
||||||
@@ -893,6 +895,12 @@ int main (int argc, char **argv)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _0_(debug) {
|
||||||
|
const int ip_version = ip_get_version(data, GT_MTU_MAX);
|
||||||
|
const ssize_t ip_proto = ip_get_proto(data, GT_MTU_MAX);
|
||||||
|
gt_log("%s: version=%i size=%zi proto=%zi\n", sockname, ip_version, ip_size, ip_proto);
|
||||||
|
}
|
||||||
|
|
||||||
blks[blk_write++].size = r;
|
blks[blk_write++].size = r;
|
||||||
blk_count++;
|
blk_count++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user