-
Notifications
You must be signed in to change notification settings - Fork 5
/
tunnel.h
executable file
·78 lines (68 loc) · 1.65 KB
/
tunnel.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef __TUNNEL_H__
#define __TUNNEL_H__ 1
#include "pfm.h"
#include "cuup.h"
typedef enum
{
TUNNEL_TYPE_PDUS,
TUNNEL_TYPE_DRB,
} tunnel_type_t;
typedef enum
{
FLOW_TYPE_UNUSED,
FLOW_TYPE_DL,
FLOW_TYPE_UL,
FLOW_TYPE_UL_DL,
} flow_type_t;
typedef struct
{
unsigned int drb_id:5;
unsigned int is_default:1;
unsigned int is_dl_sdap_hdr_enabled:1;
unsigned int is_ul_sdap_hdr_enabled:1;
uint32_t mapped_flow_idx; // valid only if is_ul_sdap_hdr_enabled is not enabled
uint32_t mapped_pdus_idx;
} drb_info_t;
typedef struct
{
flow_type_t flow_type:2;
unsigned int r_qos_status:2;
uint32_t mapped_drb_idx;
} flow_info_t;
typedef struct
{
unsigned int pdus_id:8;
unsigned int flow_count:6;
uint64_t ul_new_flow_detected_bit_map;
flow_info_t flow_list[MAX_FLOWS_PER_PDUS];
} pdus_info_t;
typedef struct
{
uint32_t ip_addr;
uint32_t te_id;
} tunnel_key_t;
typedef struct
{
tunnel_key_t key;
pfm_ip_addr_t remote_ip;
uint32_t remote_te_id;
tunnel_type_t tunnel_type:2;
pfm_bool_t is_row_used:1;
union
{
pdus_info_t pdus_info;
drb_info_t drb_info;
};
} tunnel_t;
const tunnel_t* tunnel_get(tunnel_key_t *key);
const tunnel_t* tunnel_get_with_idx(uint32_t tunnel_idx);
tunnel_t * tunnel_add(tunnel_key_t *key);
pfm_retval_t tunnel_remove(tunnel_key_t *key);
tunnel_t * tunnel_modify(tunnel_key_t *key);
pfm_retval_t tunnel_commit(tunnel_t* nt);
void tunnel_print_show(FILE *fp, tunnel_key_t *key);
void tunnel_print_list(FILE *fp, tunnel_type_t ttype);
pfm_retval_t tunnel_key_alloc(pfm_ip_addr_t ip,tunnel_type_t ttype,tunnel_key_t *key);
pfm_retval_t tunnel_remove(tunnel_key_t *key);
pfm_retval_t tunnel_rollback(tunnel_t *nt);
#endif