summaryrefslogtreecommitdiff
path: root/accel-pppd/include
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/include')
-rw-r--r--accel-pppd/include/ap_net.h20
-rw-r--r--accel-pppd/include/ap_session.h12
-rw-r--r--accel-pppd/include/events.h2
l---------accel-pppd/include/luasupp.h1
l---------[-rw-r--r--]accel-pppd/include/ppp_auth.h38
5 files changed, 31 insertions, 42 deletions
diff --git a/accel-pppd/include/ap_net.h b/accel-pppd/include/ap_net.h
index 0872e22..25121d9 100644
--- a/accel-pppd/include/ap_net.h
+++ b/accel-pppd/include/ap_net.h
@@ -1,7 +1,12 @@
#ifndef __AP_NET_H
#define __AP_NET_H
+struct rtnl_handle;
+
struct ap_net {
+ struct list_head entry;
+ int refs;
+ char *name;
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);
@@ -13,8 +18,23 @@ struct ap_net {
int (*set_nonblocking)(int sock, int f);
int (*setsockopt)(int sockfd, int level, int optname, const void *optval, socklen_t optlen);
int (*sock_ioctl)(unsigned long request, void *arg);
+ int (*sock6_ioctl)(unsigned long request, void *arg);
int (*ppp_open)();
int (*ppp_ioctl)(int fd, unsigned long request, void *arg);
+ void (*enter_ns)();
+ void (*exit_ns)();
+ struct rtnl_handle *(*rtnl_get)();
+ void (*rtnl_put)(struct rtnl_handle *);
+ int (*rtnl_open)(struct rtnl_handle *h, int proto);
+ int (*move_link)(struct ap_net *net, int ifindex);
+ void (*release)(struct ap_net *net);
};
+extern __thread struct ap_net *net;
+extern struct ap_net *def_net;
+
+int ap_net_register(struct ap_net *net);
+struct ap_net *ap_net_find(const char *name);
+struct ap_net *ap_net_open_ns(const char *name);
+
#endif
diff --git a/accel-pppd/include/ap_session.h b/accel-pppd/include/ap_session.h
index 0baaab2..b2d0532 100644
--- a/accel-pppd/include/ap_session.h
+++ b/accel-pppd/include/ap_session.h
@@ -1,6 +1,9 @@
#ifndef __AP_SESSION_H__
#define __AP_SESSION_H__
+#include <sys/socket.h>
+
+#include "triton.h"
#include "ap_net.h"
//#define AP_SESSIONID_LEN 16
@@ -81,6 +84,7 @@ struct ap_session
struct ipv6db_prefix_t *ipv6_dp;
char *ipv4_pool_name;
char *ipv6_pool_name;
+ struct ap_net *net;
const struct ap_ctrl *ctrl;
@@ -125,13 +129,11 @@ struct ap_session_stat
extern pthread_rwlock_t ses_lock;
extern struct list_head ses_list;
extern int ap_shutdown;
-extern int sock_fd; // internet socket for ioctls
-extern int sock6_fd; // internet socket for ioctls
+extern int sock_fd;
+extern int sock6_fd;
extern int urandom_fd;
extern struct ap_session_stat ap_session_stat;
-
-extern __thread const struct ap_net *net;
-extern const struct ap_net def_net;
+extern int conf_max_sessions;
void ap_session_init(struct ap_session *ses);
void ap_session_set_ifindex(struct ap_session *ses);
diff --git a/accel-pppd/include/events.h b/accel-pppd/include/events.h
index 37dfa82..bafb876 100644
--- a/accel-pppd/include/events.h
+++ b/accel-pppd/include/events.h
@@ -17,11 +17,13 @@
#define EV_CONFIG_RELOAD 11
#define EV_SES_AUTH_FAILED 12
#define EV_SES_PRE_FINISHED 13
+#define EV_SES_POST_STARTED 14
#define EV_IP_CHANGED 100
#define EV_SHAPER 101
#define EV_MPPE_KEYS 102
#define EV_DNS 103
#define EV_WINS 104
+#define EV_FORCE_INTERIM_UPDATE 105
#define EV_RADIUS_ACCESS_ACCEPT 200
#define EV_RADIUS_COA 201
diff --git a/accel-pppd/include/luasupp.h b/accel-pppd/include/luasupp.h
new file mode 120000
index 0000000..2bdd30a
--- /dev/null
+++ b/accel-pppd/include/luasupp.h
@@ -0,0 +1 @@
+../lua/luasupp.h \ No newline at end of file
diff --git a/accel-pppd/include/ppp_auth.h b/accel-pppd/include/ppp_auth.h
index 839a881..527c853 100644..120000
--- a/accel-pppd/include/ppp_auth.h
+++ b/accel-pppd/include/ppp_auth.h
@@ -1,37 +1 @@
-#ifndef PPP_AUTH_H
-#define PPP_AUTH_H
-
-#include "list.h"
-
-struct ppp_auth_handler_t;
-
-struct auth_data_t
-{
- struct list_head entry;
- int proto;
- int state;
- struct ppp_auth_handler_t *h;
-};
-
-struct ppp_auth_handler_t
-{
- struct list_head entry;
- const char *name;
- struct auth_data_t* (*init)(struct ppp_t*);
- int (*send_conf_req)(struct ppp_t*, struct auth_data_t*, uint8_t*);
- int (*recv_conf_req)(struct ppp_t*, struct auth_data_t*, uint8_t*);
- int (*start)(struct ppp_t*, struct auth_data_t*);
- int (*finish)(struct ppp_t*, struct auth_data_t*);
- void (*free)(struct ppp_t*,struct auth_data_t*);
- int (*check)(uint8_t *);
- int (*restart)(struct ppp_t*,struct auth_data_t*);
-};
-
-int ppp_auth_register_handler(struct ppp_auth_handler_t*);
-
-int ppp_auth_succeeded(struct ppp_t *ppp, char *username);
-void ppp_auth_failed(struct ppp_t *ppp, char *username);
-int ppp_auth_restart(struct ppp_t *ppp);
-
-#endif
-
+../ppp/ppp_auth.h \ No newline at end of file