From 86b151891a2f11c863e9d31e132deb8eab2cf30f Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Mon, 23 Nov 2015 00:52:22 +0300 Subject: preparation for DPDK intergation (part 4) --- accel-pppd/include/ap_net.h | 20 ++++++++++++++++++++ accel-pppd/include/ap_session.h | 18 ++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 accel-pppd/include/ap_net.h (limited to 'accel-pppd/include') diff --git a/accel-pppd/include/ap_net.h b/accel-pppd/include/ap_net.h new file mode 100644 index 00000000..8ed8536d --- /dev/null +++ b/accel-pppd/include/ap_net.h @@ -0,0 +1,20 @@ +#ifndef __AP_NET_H +#define __AP_NET_H + +struct ap_net { + int (*socket)(int domain, int type, int proto); + int (*connect)(int sock, const struct sockaddr *, socklen_t len); + int (*bind)(int sock, const struct sockaddr *, socklen_t len); + int (*listen)(int sock, int backlog); + ssize_t (*recv)(int sock, void *buf, size_t len, int flags); + ssize_t (*recvfrom)(int sock, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen); + ssize_t (*send)(int sock, const void *buf, size_t len, int flags); + ssize_t (*sendto)(int sock, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); + int (*set_nonblocking)(int sock, int f); + int (*setsockopt)(int sockfd, int level, int optname, const void *optval, socklen_t optlen); + int (*ppp_open)(); + int (*ppp_ioctl)(int fd, unsigned long request, void *arg); + int (*sock_ioctl)(unsigned long request, void *arg); +}; + +#endif diff --git a/accel-pppd/include/ap_session.h b/accel-pppd/include/ap_session.h index f2298330..7a8db12b 100644 --- a/accel-pppd/include/ap_session.h +++ b/accel-pppd/include/ap_session.h @@ -1,6 +1,8 @@ #ifndef __AP_SESSION_H__ #define __AP_SESSION_H__ +#include "ap_net.h" + //#define AP_SESSIONID_LEN 16 #define AP_IFNAME_LEN 16 @@ -36,22 +38,6 @@ struct ap_session; struct backup_data; struct rtnl_link_stats; -struct sockaddr; - -struct ap_net { - int (*socket)(int domain, int type, int proto); - int (*connect)(int sock, const struct sockaddr *, socklen_t len); - int (*bind)(int sock, const struct sockaddr *, socklen_t len); - int (*listen)(int sock, int backlog); - ssize_t (*recv)(int sock, void *buf, size_t len, int flags); - ssize_t (*recvfrom)(int sock, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen); - ssize_t (*send)(int sock, const void *buf, size_t len, int flags); - ssize_t (*sendto)(int sock, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); - int (*set_nonblocking)(int sock, int f); - int (*ppp_open)(); - int (*ppp_ioctl)(int fd, unsigned long request, void *arg); - int (*sock_ioctl)(unsigned long request, void *arg); -}; struct ap_ctrl { struct triton_context_t *ctx; -- cgit v1.2.3