-
Notifications
You must be signed in to change notification settings - Fork 4
/
pgwu.h
50 lines (43 loc) · 993 Bytes
/
pgwu.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
#ifndef PGWU_H
#define PGWU_H
#include "utils.h"
#include "packet.h"
#include "thread_pool.h"
#include "server.h"
#include "raw_socket.h"
struct TunUdata {
uint16_t sgw_uteid;
TunUdata();
TunUdata(const TunUdata&);
friend void swap(TunUdata&, TunUdata&);
TunUdata& operator=(TunUdata);
TunUdata(TunUdata&&);
~TunUdata();
};
struct PGWu {
RawSocket raw_client;
Server for_sink;
char *ue_ip;
TunUdata tun_udata;
PGWu();
PGWu(const PGWu&);
friend void swap(PGWu&, PGWu&);
PGWu& operator=(PGWu);
PGWu(PGWu&&);
uint16_t generate_uteid(int&);
void configure_raw_client();
void configure_server_for_sink();
void set_ue_ip();
void set_tun_udata(bool&);
void recv_sgw(Server&);
void copy_to_rawpkt(Packet&);
void send_sgw(Server&);
void copy_sinkpkt_to_pgwpkt(Packet&);
void send_raw_socket();
void recv_sink();
void fill_tun_utable(string, TunUdata&);
void erase_tun_utable(string);
~PGWu();
};
extern unordered_map<string, TunUdata> g_tun_utable;
#endif //PGWU_H