-
Notifications
You must be signed in to change notification settings - Fork 4
/
pgwc.h
61 lines (52 loc) · 1.22 KB
/
pgwc.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
53
54
55
56
57
58
59
60
61
#ifndef PGWC_H
#define PGWC_H
#include "utils.h"
#include "packet.h"
#include "thread_pool.h"
#include "server.h"
#include "client.h"
#define MAX_IPS 200
struct TunCdata {
uint16_t sgw_cteid;
TunCdata();
TunCdata(const TunCdata&);
friend void swap(TunCdata&, TunCdata&);
TunCdata& operator=(TunCdata);
TunCdata(TunCdata&&);
~TunCdata();
};
struct PGWc {
Packet pkt;
int ue_num;
int bearer_id;
uint16_t cteid;
TunCdata tun_cdata;
char *reply;
PGWc();
PGWc(const PGWc&);
friend void swap(PGWc&, PGWc&);
PGWc& operator=(PGWc);
PGWc(PGWc&&);
void create_session_request_from_sgw(Server&, uint16_t&);
void copy_to_pkt(Packet&);
void set_ue_num();
void set_bearer_id();
void add_bearer_id();
void set_tun_cdata();
void set_cteid();
uint16_t generate_cteid(int&);
void create_session_response_to_sgw(Server&, uint16_t&);
void fill_tun_ctable();
void delete_session_req_from_sgw(Server&);
void delete_session_res_to_sgw(Server&);
void erase_bearer_table();
void erase_tun_ctable();
~PGWc();
};
extern vector<string> g_ip_table;
extern unordered_map<int, int> g_bearer_table;
extern unordered_map<string, TunCdata> g_tun_ctable;
void setup_ip_table();
void set_ip_table_size();
void fill_ip_table();
#endif //PGWC_H