forked from free5gc/gtp5g
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdr.h
116 lines (98 loc) · 2.67 KB
/
pdr.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef __PDR_H__
#define __PDR_H__
#include <linux/kernel.h>
#include <linux/net.h>
#include <linux/rculist.h>
#include <linux/range.h>
#include <linux/skbuff.h>
#include <linux/un.h>
#include <net/ip.h>
#include "far.h"
#include "qer.h"
#include "urr.h"
#define SEID_U32ID_HEX_STR_LEN 24
enum addr_type {
AT_MPTCP_ADDR_3GPP = 1,
AT_MPTCP_ADDR_NON3GPP,
AT_DN_ADDR,
AT_UL_IGNORE_ADDR,
};
struct local_f_teid {
u32 teid;
struct in_addr gtpu_addr_ipv4;
};
struct ip_filter_rule {
uint8_t action;
uint8_t direction;
uint8_t proto;
struct in_addr src;
struct in_addr smask;
struct in_addr dest;
struct in_addr dmask;
int sport_num;
struct range *sport;
int dport_num;
struct range *dport;
};
struct sdf_filter {
struct ip_filter_rule *rule;
uint16_t *tos_traffic_class;
u32 *security_param_idx;
u32 *flow_label;
u32 *bi_id;
};
struct pdi {
struct in_addr *ue_addr_ipv4;
struct local_f_teid *f_teid;
struct sdf_filter *sdf;
};
struct pdr {
struct hlist_node hlist_id;
struct hlist_node hlist_i_teid;
struct hlist_node hlist_addr;
struct hlist_node hlist_related_far;
struct hlist_node hlist_related_qer;
struct hlist_node hlist_related_urr;
u64 seid;
u16 id;
u32 precedence;
u8 *outer_header_removal;
struct pdi *pdi;
u32 *far_id[2];
struct far *far[2];
u32 *qer_id;
struct qer *qer;
u32 *urr_id;
u16 *mar_id;
struct urr *urr;
/* deprecated: AF_UNIX socket for buffer */
struct sockaddr_un addr_unix;
struct socket *sock_for_buf;
u16 af;
struct in_addr role_addr_ipv4;
/* For ATSSS */
struct in_addr *mptcp_ue_addr_3gpp, *mptcp_ue_addr_non_3gpp;
struct sock *sk;
struct net_device *dev;
struct rcu_head rcu_head;
/* Drop Counter */
u64 ul_drop_cnt;
u64 dl_drop_cnt;
/* Packet Statistics */
u64 ul_pkt_cnt;
u64 dl_pkt_cnt;
u64 ul_byte_cnt;
u64 dl_byte_cnt;
};
extern void pdr_context_delete(struct pdr *);
extern struct pdr *find_pdr_by_id(struct gtp5g_dev *, u64, u16);
extern struct pdr *pdr_find_by_gtp1u(struct gtp5g_dev *, struct sk_buff *,
unsigned int, u32);
extern struct pdr *pdr_find_by_ipv4(struct gtp5g_dev *, struct sk_buff *,
unsigned int, __be32, int *);
extern void pdr_append(u64, u16, struct pdr *, struct gtp5g_dev *);
extern void pdr_update_hlist_table(struct pdr *, struct gtp5g_dev *);
extern void unix_sock_client_delete(struct pdr *);
extern int unix_sock_client_new(struct pdr *);
extern int unix_sock_client_update(struct pdr *, bool);
#endif // __PDR_H__