-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice.h
31 lines (28 loc) · 1.08 KB
/
service.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "user_queue.h"
#include <argon2.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define MEMORY_USAGE 512
#define SALT_SIZE 16
#define HASH_SIZE 32
#define HASHED_PASSWORD_SIZE 128
extern bool fileInUse;
extern pthread_mutex_t lockFile;
extern pthread_cond_t condFile;
extern bool isSeatBooked[257];
extern pthread_mutex_t lockSeat;
extern pthread_cond_t condSeat;
void generate_salt(uint8_t *salt);
void hash_password(char *password, char *hashed_password);
int validate_password(char *password_to_validate, char *hashed_password);
void action0(int clientFD, uint32_t userID, int actionID, int seatNumber);
void action1(int clientFD, UserQueue *queue, uint32_t userID, char *password);
void action2(int clientFD, UserQueue *queue, uint32_t userID, int seatNumber);
void action3(int clientFD, UserQueue *queue, uint32_t userID, int seatNumber);
void action4(int clientFD, UserQueue *queue, uint32_t userID, int seatNumber);
void action5(int clientFD, UserQueue *queue, uint32_t userID, int seatNumber);