pass DPD and keepalive values to occtl

This commit is contained in:
Nikos Mavrogiannopoulos
2015-11-19 12:21:37 +01:00
parent 01a6435fad
commit ba44c2a6c1
3 changed files with 15 additions and 0 deletions

View File

@@ -47,6 +47,8 @@ message user_info_rep
repeated string no_routes = 25;
optional string local_dev_ip = 26;
repeated string domains = 27; /* split-dns domains */
required uint32 dpd = 28;
required uint32 keepalive = 29;
}
message user_list_rep

View File

@@ -373,6 +373,16 @@ static int append_user_info(method_ctx *ctx,
tmp *= 1000;
rep->tx_per_sec = tmp;
if (ctmp->config.dpd)
rep->dpd = ctmp->config.dpd;
else
rep->dpd = ctx->s->config->dpd;
if (ctmp->config.keepalive)
rep->keepalive = ctmp->config.keepalive;
else
rep->dpd = ctx->s->config->dpd;
rep->domains = ctx->s->config->split_dns;
rep->n_domains = ctx->s->config->split_dns_size;

View File

@@ -753,6 +753,7 @@ int common_info_cmd(UserListRep * args, FILE *out, cmd_params_st *params)
char *groupname = "";
char str_since[64];
char tmpbuf[MAX_TMPSTR_SIZE];
char tmpbuf2[MAX_TMPSTR_SIZE];
struct tm *tm;
time_t t;
unsigned at_least_one = 0;
@@ -829,6 +830,8 @@ int common_info_cmd(UserListRep * args, FILE *out, cmd_params_st *params)
print_iface_stats(args->user[i]->tun, args->user[i]->conn_time, out, params, 1);
print_pair_value(out, params, "DPD", int2str(tmpbuf, args->user[i]->dpd), "KeepAlive", int2str(tmpbuf2, args->user[i]->keepalive), 1);
print_single_value(out, params, "Hostname", args->user[i]->hostname, 1);
print_time_ival7(tmpbuf, time(0), t);