3 #include <linenoise/linenoise.h>
5 #include "client_auth.h"
6 #include "signal_handlers.h"
9 struct ClientAuth client_auth;
11 static bool name_prompt()
13 if (! (client_auth.name = linenoise("Enter name: ")))
16 dragonnet_peer_send_ToServerAuth(client, &(ToServerAuth) {
17 .name = client_auth.name,
20 printf("Authenticating as %s...\n", client_auth.name);
21 client_auth.state = AUTH_WAIT;
26 bool client_auth_init()
28 client_auth.state = AUTH_INIT;
30 while (! interrupted) {
31 switch (client_auth.state) {
50 void client_auth_deinit()
52 linenoiseFree(client_auth.name);