-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsocks5_auth_manager.h
33 lines (25 loc) · 1.08 KB
/
socks5_auth_manager.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
#ifndef SOCKS5_AUTH_MANAGER_H
#define SOCKS5_AUTH_MANAGER_H
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <event2/bufferevent.h>
#include "logging.h"
#include "socks5_authenticator.h"
#include "socks5_no_auth_authenticator.h"
#include "socks5_protocol.h"
#include "socks5_username_password_authenticator.h"
struct s5auth_manager {
int no_auth_authenticator_enabled;
int username_password_authenticator_enabled;
struct identity *identities;
size_t identities_size;
};
struct s5auth_manager *s5auth_manager_new();
void s5auth_manager_free(struct s5auth_manager *s5auth_manager);
int s5auth_manager_register_no_auth_authenticator(struct s5auth_manager *auth_manager);
int s5auth_manager_register_username_password_authenticator(struct s5auth_manager *auth_manager,
struct identity *identities, size_t n);
struct authenticator *s5auth_manager_choose_authenticator(struct s5auth_manager *auth_manager,
long tunnel_id, const struct s5_auth_negotiation_request *req, struct bufferevent *underlying_bev);
#endif /* ifndef SOCKS5_AUTH_MANAGER_H */