aboutsummaryrefslogtreecommitdiffstats
path: root/include/libgtpnl/gtpnl.h
blob: e27dec4607dc7eced48443ad2b48b0951cfb5e60 (plain)
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
#ifndef _LIBGTPNL_H_
#define _LIBGTPNL_H_

#include <stdint.h>

struct mnl_socket;
struct nlmsghdr;

struct mnl_socket *genl_socket_open(void);
struct nlmsghdr *genl_nlmsg_build_hdr(char *buf, uint16_t type, uint16_t flags,
				      uint32_t seq, uint8_t cmd);
int genl_socket_talk(struct mnl_socket *nl, struct nlmsghdr *nlh, uint32_t seq,
		     int (*cb)(const struct nlmsghdr *nlh, void *data),
		     void *data);
int genl_lookup_family(struct mnl_socket *nl, const char *family);

int gtp_dev_create(const char *gtp_ifname, const char *real_ifname,
		   int fd0, int fd1);
int gtp_dev_destroy(const char *gtp_ifname);

struct gtp_tunnel;

int gtp_add_tunnel(int genl_id, struct mnl_socket *nl, struct gtp_tunnel *t);
int gtp_del_tunnel(int genl_id, struct mnl_socket *nl, struct gtp_tunnel *t);
int gtp_list_tunnel(int genl_id, struct mnl_socket *nl);

#endif