forked from free5gc/gtp5g
-
Notifications
You must be signed in to change notification settings - Fork 0
/
net.c
31 lines (24 loc) · 710 Bytes
/
net.c
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
#include <linux/rculist.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include "dev.h"
#include "net.h"
#include "link.h"
static unsigned int gtp5g_net_id __read_mostly;
static int __net_init gtp5g_net_init(struct net *net)
{
struct gtp5g_net *gn = net_generic(net, gtp5g_net_id);
INIT_LIST_HEAD(&gn->gtp5g_dev_list);
return 0;
}
static void __net_exit gtp5g_net_exit(struct net *net)
{
struct gtp5g_net *gn = net_generic(net, gtp5g_net_id);
gtp5g_link_all_del(&gn->gtp5g_dev_list);
}
struct pernet_operations gtp5g_net_ops = {
.init = gtp5g_net_init,
.exit = gtp5g_net_exit,
.id = >p5g_net_id,
.size = sizeof(struct gtp5g_net),
};