aboutsummaryrefslogtreecommitdiff
path: root/src/netcosm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/netcosm.h')
-rw-r--r--src/netcosm.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/netcosm.h b/src/netcosm.h
index d7251ad..4f04e5b 100644
--- a/src/netcosm.h
+++ b/src/netcosm.h
@@ -1,4 +1,5 @@
#include <arpa/inet.h>
+#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <gcrypt.h>
@@ -14,12 +15,17 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <time.h>
#include <unistd.h>
#define USERFILE "users.dat"
#define MAX_FAILURES 3
#define NETCOSM_VERSION "v0.1"
+#define PRIV_NONE -1
+#define PRIV_USER 0
+#define PRIV_ADMIN 1337
+
struct authinfo_t {
bool success;
const char *user;
@@ -30,3 +36,7 @@ void client_main(int fd, struct sockaddr_in *addr, int);
void __attribute__((noreturn)) error(const char *fmt, ...);
void first_run_setup(void);
struct authinfo_t auth_check(const char*, const char*);
+
+/* add or change a user */
+bool add_change_user(const char *user2, const char *pass2, int level);
+bool auth_remove(const char*);