Added a statusallnb stroke command to show status non-blocking
This commit is contained in:
@@ -389,7 +389,8 @@ static void log_auth_cfgs(FILE *out, peer_cfg_t *peer_cfg, bool local)
|
||||
}
|
||||
|
||||
METHOD(stroke_list_t, status, void,
|
||||
private_stroke_list_t *this, stroke_msg_t *msg, FILE *out, bool all)
|
||||
private_stroke_list_t *this, stroke_msg_t *msg, FILE *out,
|
||||
bool all, bool wait)
|
||||
{
|
||||
enumerator_t *enumerator, *children;
|
||||
ike_cfg_t *ike_cfg;
|
||||
@@ -531,7 +532,7 @@ METHOD(stroke_list_t, status, void,
|
||||
|
||||
fprintf(out, "Security Associations:\n");
|
||||
enumerator = charon->controller->create_ike_sa_enumerator(
|
||||
charon->controller, TRUE);
|
||||
charon->controller, wait);
|
||||
while (enumerator->enumerate(enumerator, &ike_sa))
|
||||
{
|
||||
bool ike_printed = FALSE;
|
||||
|
||||
@@ -47,8 +47,10 @@ struct stroke_list_t {
|
||||
* @param msg stroke message
|
||||
* @param out stroke console stream
|
||||
* @param all TRUE for "statusall"
|
||||
* @param wait TRUE to wait for IKE_SA entries, FALSE to skip if locked
|
||||
*/
|
||||
void (*status)(stroke_list_t *this, stroke_msg_t *msg, FILE *out, bool all);
|
||||
void (*status)(stroke_list_t *this, stroke_msg_t *msg, FILE *out,
|
||||
bool all, bool wait);
|
||||
|
||||
/**
|
||||
* Log pool leases to stroke console.
|
||||
|
||||
@@ -322,11 +322,11 @@ static void stroke_del_ca(private_stroke_socket_t *this,
|
||||
* show status of daemon
|
||||
*/
|
||||
static void stroke_status(private_stroke_socket_t *this,
|
||||
stroke_msg_t *msg, FILE *out, bool all)
|
||||
stroke_msg_t *msg, FILE *out, bool all, bool wait)
|
||||
{
|
||||
pop_string(msg, &(msg->status.name));
|
||||
|
||||
this->list->status(this->list, msg, out, all);
|
||||
this->list->status(this->list, msg, out, all, wait);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -546,10 +546,13 @@ static job_requeue_t process(stroke_job_context_t *ctx)
|
||||
stroke_rekey(this, msg, out);
|
||||
break;
|
||||
case STR_STATUS:
|
||||
stroke_status(this, msg, out, FALSE);
|
||||
stroke_status(this, msg, out, FALSE, TRUE);
|
||||
break;
|
||||
case STR_STATUS_ALL:
|
||||
stroke_status(this, msg, out, TRUE);
|
||||
stroke_status(this, msg, out, TRUE, TRUE);
|
||||
break;
|
||||
case STR_STATUS_ALL_NOBLK:
|
||||
stroke_status(this, msg, out, TRUE, FALSE);
|
||||
break;
|
||||
case STR_ADD_CONN:
|
||||
stroke_add_conn(this, msg);
|
||||
|
||||
Reference in New Issue
Block a user