-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathserver.h
53 lines (44 loc) · 1.1 KB
/
server.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
48
49
50
51
52
/*
* af_ktls tool
*
* Copyright (C) 2016 Fridolin Pokorny <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*/
#ifndef SERVER_H_
#define SERVER_H_
#include <stdbool.h>
#include <sys/socket.h>
#include <pthread.h>
#include <gnutls/gnutls.h>
#include <gnutls/dtls.h>
#define SERVER_MAX_MTU (1 << 14)
typedef struct {
gnutls_session_t session;
int fd;
struct sockaddr *cli_addr;
socklen_t cli_addr_size;
} priv_data_st;
struct server_opts {
unsigned verbose_level;
unsigned port;
unsigned mtu;
bool tls;
int store_file;
// used to contact client on which port is server running
int *port_mem;
// release this once server is up
pthread_cond_t *condition_initialized;
bool ktls;
bool no_echo;
bool raw_recv;
/* without TLS options */
bool no_tls;
bool tcp;
};
extern int server_err;
extern void *run_server(void *arg);
#endif // SERVER_H_