- cli_print(cli, "\tUnique SID:\t%lu", session[s].unique_id);
- cli_print(cli, "\tIdle time:\t%u seconds", abs(time_now - session[s].last_packet));
- cli_print(cli, "\tNext Recv:\t%u", session[s].nr);
- cli_print(cli, "\tNext Send:\t%u", session[s].ns);
- cli_print(cli, "\tBytes In/Out:\t%u/%u", session[s].total_cout, session[s].total_cin);
+ cli_print(cli, "\tUnique SID:\t%u", session[s].unique_id);
+ cli_print(cli, "\tOpened:\t\t%u seconds", session[s].opened ? abs(time_now - session[s].opened) : 0);
+ cli_print(cli, "\tIdle time:\t%u seconds", session[s].last_packet ? abs(time_now - session[s].last_packet) : 0);
+ cli_print(cli, "\tBytes In/Out:\t%u/%u", session[s].cout, session[s].cin);
+ if (session[s].timeout)
+ {
+ cli_print(cli, "\tRemaing time:\t%u",
+ (session[s].bundle && bundle[session[s].bundle].num_of_links > 1)
+ ? (unsigned) (session[s].timeout - bundle[session[s].bundle].online_time)
+ : (unsigned) (session[s].timeout - (time_now - session[s].opened)));
+ }
+