-
Notifications
You must be signed in to change notification settings - Fork 2
/
logger.h
47 lines (41 loc) · 2.27 KB
/
logger.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _LOGGER_H
#define _LOGGER_H
#include <pthread.h>
#include "config.h"
typedef struct
{
unsigned char keep_alive_auth_send[CONFIG_SIZE_KEEP_ALIVE_AUTH];
unsigned char keep_alive_heart_beat_send[CONFIG_SIZE_KEEP_ALIVE_HEART_BEAT];
long time_keep_alive_auth_send;
long time_keep_alive_auth_receive;
long time_keep_alive_heart_beat_send;
long time_keep_alive_heart_beat_receive;
unsigned long count_keep_alive_auth_send;
unsigned long count_keep_alive_auth_receive;
unsigned long count_keep_alive_heart_beat_send;
unsigned long count_keep_alive_heart_beat_receive;
pthread_mutex_t mutex_keep_alive_auth_send;
pthread_mutex_t mutex_keep_alive_auth_receive;
pthread_mutex_t mutex_keep_alive_heart_beat_send;
pthread_mutex_t mutex_keep_alive_heart_beat_receive;
} Logger;
void logger_init(Logger *logger_this);
void logger_log_challenge_send(unsigned char *buffer_send);
void logger_log_challenge_receive(unsigned char *buffer_receive, unsigned long size);
void logger_log_auth_send(unsigned char *buffer_send, unsigned long size);
void logger_log_auth_receive(unsigned char *buffer_receive, unsigned long size);
void logger_log_keep_alive_auth_send(Logger *logger_this, unsigned char *buffer_send);
void logger_log_keep_alive_auth_receive(Logger *logger_this, unsigned char *buffer_receive, unsigned long size);
void logger_log_keep_alive_heart_beat_send(Logger *logger_this, unsigned char *buffer_send);
void logger_log_keep_alive_heart_beat_receive(Logger *logger_this, unsigned char *buffer_receive, unsigned long size);
void logger_log_logout_send(unsigned char *buffer_send);
void logger_log_logout_receive(unsigned char *buffer_receive, unsigned long size);
void logger_try_lock_mutex_keep_alive_auth_send(Logger *logger_this);
void logger_unlock_mutex_keep_alive_auth_send(Logger *logger_this);
void logger_try_lock_mutex_keep_alive_auth_receive(Logger *logger_this);
void logger_unlock_mutex_keep_alive_auth_receive(Logger *logger_this);
void logger_try_lock_mutex_keep_alive_heart_beat_send(Logger *logger_this);
void logger_unlock_mutex_keep_alive_heart_beat_send(Logger *logger_this);
void logger_try_lock_mutex_keep_alive_heart_beat_receive(Logger *logger_this);
void logger_unlock_mutex_keep_alive_heart_beat_receive(Logger *logger_this);
#endif