stroke_keyword_t kw;
};
+static int output_verbosity = 1; /* CONTROL */
+
static char* push_string(stroke_msg_t *msg, char *string)
{
unsigned long string_start = msg->length;
ctl_addr.sun_family = AF_UNIX;
strcpy(ctl_addr.sun_path, STROKE_SOCKET);
- msg->output_verbosity = 1; /* CONTROL */
+ msg->output_verbosity = output_verbosity;
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0)
/* we prompt if we receive a magic keyword */
if ((byte_count >= 12 &&
- strcmp(buffer + byte_count - 12, "Passphrase:\n") == 0) ||
+ streq(buffer + byte_count - 12, "Passphrase:\n")) ||
(byte_count >= 10 &&
- strcmp(buffer + byte_count - 10, "Password:\n") == 0) ||
+ streq(buffer + byte_count - 10, "Password:\n")) ||
(byte_count >= 5 &&
- strcmp(buffer + byte_count - 5, "PIN:\n") == 0))
+ streq(buffer + byte_count - 5, "PIN:\n")))
{
/* remove trailing newline */
pass = strrchr(buffer, '\n');
printf(" Initiate a connection:\n");
printf(" stroke up NAME\n");
printf(" where: NAME is a connection name added with \"stroke add\"\n");
+ printf(" Initiate a connection without blocking:\n");
+ printf(" stroke up-nb NAME\n");
+ printf(" where: NAME is a connection name added with \"stroke add\"\n");
printf(" Terminate a connection:\n");
printf(" stroke down NAME\n");
printf(" where: NAME is a connection name added with \"stroke add\"\n");
+ printf(" Terminate a connection without blocking:\n");
+ printf(" stroke down-nb NAME\n");
+ printf(" where: NAME is a connection name added with \"stroke add\"\n");
printf(" Terminate a connection by remote srcip:\n");
printf(" stroke down-srcip START [END]\n");
printf(" where: START and optional END define the clients source IP\n");
}
res = del_connection(argv[2]);
break;
+ case STROKE_UP_NOBLK:
+ output_verbosity = -1;
+ /* fall-through */
case STROKE_UP:
if (argc < 3)
{
}
res = initiate_connection(argv[2]);
break;
+ case STROKE_DOWN_NOBLK:
+ output_verbosity = -1;
+ /* fall-through */
case STROKE_DOWN:
if (argc < 3)
{
case STROKE_LIST_ALGS:
case STROKE_LIST_PLUGINS:
case STROKE_LIST_ALL:
- res = list(token->kw, argc > 2 && strcmp(argv[2], "--utc") == 0);
+ res = list(token->kw, argc > 2 && streq(argv[2], "--utc"));
break;
case STROKE_REREAD_SECRETS:
case STROKE_REREAD_CACERTS: