forked from ccp-project/ccp-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathccp_nl.h
32 lines (26 loc) · 736 Bytes
/
ccp_nl.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
/*
* CCP Datapath Netlink Socket Interface
*
* Wrapper around kernel-side netlink sockets for communication with userspace CCP.
*/
#ifndef CCP_NL_H
#define CCP_NL_H
#include "libccp/ccp.h"
typedef int (*ccp_nl_recv_handler)(char *msg, int msg_size);
/* Create a netlink kernel socket
* A global (struct sock*), ccp_nl_sk, will get set so we can use the socket
* There is *only one* netlink socket active *per datapath*
*/
int ccp_nl_sk(ccp_nl_recv_handler msg);
/* Wrap netlink_kernel_release of (struct sock *ccp_nl_sk).
*/
void free_ccp_nl_sk(void);
/* Send serialized message to userspace CCP
*/
int nl_sendmsg(
struct ccp_datapath *dp,
struct ccp_connection *conn,
char *msg,
int msg_size
);
#endif