summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/backup/backup.h5
-rw-r--r--accel-pppd/cli/cli.h3
-rw-r--r--accel-pppd/cli/show_sessions.c8
-rw-r--r--accel-pppd/extra/pppd_compat.c2
-rw-r--r--accel-pppd/include/ap_net.h6
-rw-r--r--accel-pppd/include/ap_session_backup.h3
-rw-r--r--accel-pppd/include/connlimit.h3
-rw-r--r--accel-pppd/include/vlan_mon.h2
-rw-r--r--accel-pppd/ipv6/dhcpv6.c2
-rw-r--r--accel-pppd/libnetlink/ipset.h2
-rw-r--r--accel-pppd/libnetlink/iputils.h2
-rw-r--r--accel-pppd/libnetlink/libnetlink.h1
-rw-r--r--accel-pppd/lua/luasupp.h2
-rw-r--r--accel-pppd/lua/session.c2
-rw-r--r--accel-pppd/memdebug.h5
-rw-r--r--accel-pppd/ppp/ppp_auth.h3
-rw-r--r--accel-pppd/ppp/ppp_fsm.h7
-rw-r--r--accel-pppd/ppp/ppp_lcp.h2
-rw-r--r--accel-pppd/radius/radius.h6
-rw-r--r--accel-pppd/triton/mempool.h2
20 files changed, 56 insertions, 12 deletions
diff --git a/accel-pppd/backup/backup.h b/accel-pppd/backup/backup.h
index d36f70b..106303e 100644
--- a/accel-pppd/backup/backup.h
+++ b/accel-pppd/backup/backup.h
@@ -2,6 +2,9 @@
#define __BACKUP_H
#include <stdint.h>
+#include <sys/types.h>
+
+#include "ap_session.h"
#include "list.h"
#define MODID_COMMON 1
@@ -12,8 +15,6 @@
#define MODID_L2TP 6
#define MODID_IPPOOL 7
-
-struct ap_session;
struct backup_storage;
struct backup_data;
diff --git a/accel-pppd/cli/cli.h b/accel-pppd/cli/cli.h
index ef74d33..6eda5d3 100644
--- a/accel-pppd/cli/cli.h
+++ b/accel-pppd/cli/cli.h
@@ -2,7 +2,8 @@
#define __CLI_H
#include <pcre.h>
-#include <list.h>
+
+#include "list.h"
#define CLI_CMD_OK 0
#define CLI_CMD_FAILED -1
diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c
index 443b186..0ea3c94 100644
--- a/accel-pppd/cli/show_sessions.c
+++ b/accel-pppd/cli/show_sessions.c
@@ -379,6 +379,11 @@ early_out:
goto out;
}
+static void print_netns(struct ap_session *ses, char *buf)
+{
+ snprintf(buf, CELL_SIZE, "%s", ses->net->name);
+}
+
static void print_ifname(struct ap_session *ses, char *buf)
{
snprintf(buf, CELL_SIZE, "%s", ses->ifname);
@@ -414,7 +419,7 @@ static void print_ip6(struct ap_session *ses, char *buf)
struct in6_addr addr;
char *ptr;
- if (!ses->ipv6) {
+ if (!ses->ipv6 || list_empty(&ses->ipv6->addr_list)) {
*buf = 0;
return;
}
@@ -633,6 +638,7 @@ static void init(void)
cli_register_simple_cmd2(show_ses_exec, show_ses_help, 2, "show", "sessions");
+ cli_show_ses_register("netns", "network namespace name", print_netns);
cli_show_ses_register("ifname", "interface name", print_ifname);
cli_show_ses_register("username", "user name", print_username);
cli_show_ses_register("ip", "IP address", print_ip);
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index 318327e..7c23eca 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -622,7 +622,7 @@ static void fill_env(char **env, char *mem, struct pppd_compat_pd *pd)
mem += write_sz + 1;
++n;
- if (ses->ipv6) {
+ if (ses->ipv6 && !list_empty(&ses->ipv6->addr_list)) {
///FIXME only first address is passed to env
struct ipv6db_addr_t *a = list_first_entry(&ses->ipv6->addr_list,
typeof(*a), entry);
diff --git a/accel-pppd/include/ap_net.h b/accel-pppd/include/ap_net.h
index 25121d9..91ebdd5 100644
--- a/accel-pppd/include/ap_net.h
+++ b/accel-pppd/include/ap_net.h
@@ -1,7 +1,11 @@
#ifndef __AP_NET_H
#define __AP_NET_H
-struct rtnl_handle;
+#include <sys/socket.h>
+#include <sys/types.h>
+
+#include "libnetlink.h"
+#include "list.h"
struct ap_net {
struct list_head entry;
diff --git a/accel-pppd/include/ap_session_backup.h b/accel-pppd/include/ap_session_backup.h
index e6382ff..9e175c8 100644
--- a/accel-pppd/include/ap_session_backup.h
+++ b/accel-pppd/include/ap_session_backup.h
@@ -1,6 +1,9 @@
#ifndef __AP_SESSION_BACKUP_H
#define __AP_SESSION_BACKUP_H
+#include <netinet/in.h>
+#include <stdint.h>
+
#define SES_TAG_USERNAME 1
#define SES_TAG_SESSIONID 2
#define SES_TAG_START_TIME 3
diff --git a/accel-pppd/include/connlimit.h b/accel-pppd/include/connlimit.h
index 8711cf8..2b2f0f4 100644
--- a/accel-pppd/include/connlimit.h
+++ b/accel-pppd/include/connlimit.h
@@ -1,6 +1,9 @@
#ifndef __CONNLIMIT_H
#define __CONNLIMIT_H
+#include <stdint.h>
+#include <string.h>
+
static inline uint64_t cl_key_from_ipv4(uint32_t ip)
{
return ip;
diff --git a/accel-pppd/include/vlan_mon.h b/accel-pppd/include/vlan_mon.h
index 23d5e60..673150b 100644
--- a/accel-pppd/include/vlan_mon.h
+++ b/accel-pppd/include/vlan_mon.h
@@ -1,6 +1,8 @@
#ifndef __VLAN_MON_H
#define __VLAN_MON_H
+#include <stdint.h>
+
typedef void (*vlan_mon_notify)(int ifindex, int vid, int vlan_ifindex);
void vlan_mon_register_proto(uint16_t proto, vlan_mon_notify cb);
diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c
index 84d36ca..36a5f15 100644
--- a/accel-pppd/ipv6/dhcpv6.c
+++ b/accel-pppd/ipv6/dhcpv6.c
@@ -69,7 +69,7 @@ static void ev_ses_started(struct ap_session *ses)
int sock;
int f = 1;
- if (!ses->ipv6)
+ if (!ses->ipv6 || list_empty(&ses->ipv6->addr_list))
return;
a = list_entry(ses->ipv6->addr_list.next, typeof(*a), entry);
diff --git a/accel-pppd/libnetlink/ipset.h b/accel-pppd/libnetlink/ipset.h
index cd5523d..7121eaa 100644
--- a/accel-pppd/libnetlink/ipset.h
+++ b/accel-pppd/libnetlink/ipset.h
@@ -1,6 +1,8 @@
#ifndef __IPSET_H
#define __IPSET_H
+#include <netinet/in.h>
+
int ipset_add(const char *name, in_addr_t addr);
int ipset_del(const char *name, in_addr_t addr);
int ipset_flush(const char *name);
diff --git a/accel-pppd/libnetlink/iputils.h b/accel-pppd/libnetlink/iputils.h
index 66aa974..6c1d387 100644
--- a/accel-pppd/libnetlink/iputils.h
+++ b/accel-pppd/libnetlink/iputils.h
@@ -2,6 +2,8 @@
#define __IPLINK_H
#include <linux/if_link.h>
+#include <netinet/in.h>
+#include <stdint.h>
typedef int (*iplink_list_func)(int index, int flags, const char *name, int iflink, int vid, void *arg);
diff --git a/accel-pppd/libnetlink/libnetlink.h b/accel-pppd/libnetlink/libnetlink.h
index 5089c46..aeab3ef 100644
--- a/accel-pppd/libnetlink/libnetlink.h
+++ b/accel-pppd/libnetlink/libnetlink.h
@@ -7,6 +7,7 @@
#include <linux/if_link.h>
#include <linux/if_addr.h>
#include <linux/neighbour.h>
+#include <sys/types.h>
#define TCA_BUF_MAX 64*1024
#define MAX_MSG 16384
diff --git a/accel-pppd/lua/luasupp.h b/accel-pppd/lua/luasupp.h
index f7efab8..0a29dfd 100644
--- a/accel-pppd/lua/luasupp.h
+++ b/accel-pppd/lua/luasupp.h
@@ -3,6 +3,8 @@
#include <lua.h>
+#include "ap_session.h"
+
int luaopen_lpack(lua_State *L);
int luaopen_bit(lua_State *L);
diff --git a/accel-pppd/lua/session.c b/accel-pppd/lua/session.c
index 277b299..bd98911 100644
--- a/accel-pppd/lua/session.c
+++ b/accel-pppd/lua/session.c
@@ -197,7 +197,7 @@ static int session_ipv6(lua_State *L)
if (!ses)
return 0;
- if (ses->ipv6) {
+ if (ses->ipv6 && !list_empty(&ses->ipv6->addr_list)) {
a = list_entry(ses->ipv6->addr_list.next, typeof(*a), entry);
if (a->prefix_len) {
build_ip6_addr(a, ses->ipv6->peer_intf_id, &addr);
diff --git a/accel-pppd/memdebug.h b/accel-pppd/memdebug.h
index 09978f4..501b882 100644
--- a/accel-pppd/memdebug.h
+++ b/accel-pppd/memdebug.h
@@ -21,6 +21,11 @@ int md_asprintf(const char *fname, int line, char **strp, const char *fmt, ...)
void md_check(void *ptr);
#else
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#define _malloc(size) malloc(size)
#define _realloc(ptr, size) realloc(ptr, size)
#define _free(ptr) free(ptr)
diff --git a/accel-pppd/ppp/ppp_auth.h b/accel-pppd/ppp/ppp_auth.h
index 5049fd5..c8df9fc 100644
--- a/accel-pppd/ppp/ppp_auth.h
+++ b/accel-pppd/ppp/ppp_auth.h
@@ -1,7 +1,10 @@
#ifndef PPP_AUTH_H
#define PPP_AUTH_H
+#include <stdint.h>
+
#include "list.h"
+#include "ppp.h"
struct ppp_auth_handler_t;
diff --git a/accel-pppd/ppp/ppp_fsm.h b/accel-pppd/ppp/ppp_fsm.h
index 57abb86..6208d9a 100644
--- a/accel-pppd/ppp/ppp_fsm.h
+++ b/accel-pppd/ppp/ppp_fsm.h
@@ -1,6 +1,11 @@
#ifndef PPP_FSM_H
#define PPP_FSM_H
+#include <stdint.h>
+
+#include "ppp.h"
+#include "triton.h"
+
typedef enum {FSM_Initial=0,FSM_Starting,FSM_Closed,FSM_Stopped,FSM_Closing,FSM_Stopping,FSM_Req_Sent,FSM_Ack_Rcvd,FSM_Ack_Sent,FSM_Opened} FSM_STATE;
/*
* CP (LCP, IPCP, etc.) codes.
@@ -18,8 +23,6 @@ typedef enum {FSM_Initial=0,FSM_Starting,FSM_Closed,FSM_Stopped,FSM_Closing,FSM_
#define DISCARDREQ 11 /* Discard Request */
#define IDENT 12 /* Identification */
-struct ppp_t;
-
struct ppp_fsm_t
{
struct ppp_t *ppp;
diff --git a/accel-pppd/ppp/ppp_lcp.h b/accel-pppd/ppp/ppp_lcp.h
index cfc8122..10c55b0 100644
--- a/accel-pppd/ppp/ppp_lcp.h
+++ b/accel-pppd/ppp/ppp_lcp.h
@@ -4,7 +4,9 @@
#include <stdint.h>
#include "triton.h"
+#include "ppp.h"
#include "ppp_fsm.h"
+
/*
* Options.
*/
diff --git a/accel-pppd/radius/radius.h b/accel-pppd/radius/radius.h
index 6428bb1..9fc8869 100644
--- a/accel-pppd/radius/radius.h
+++ b/accel-pppd/radius/radius.h
@@ -1,9 +1,13 @@
#ifndef __RADIUS_H
#define __RADIUS_H
+#include <netinet/in.h>
#include <stdint.h>
#include <sys/time.h>
+#include "ap_session.h"
+#include "list.h"
+
#define REQ_LENGTH_MAX 4096
#define ATTR_TYPE_INTEGER 0
@@ -112,8 +116,6 @@ struct rad_plugin_t
int (*send_accounting_request)(struct rad_plugin_t *, struct rad_packet_t *pack);
};
-struct ap_session;
-
void rad_register_plugin(struct ap_session *, struct rad_plugin_t *);
struct rad_dict_attr_t *rad_dict_find_attr(const char *name);
diff --git a/accel-pppd/triton/mempool.h b/accel-pppd/triton/mempool.h
index 9b95af0..9ad2c37 100644
--- a/accel-pppd/triton/mempool.h
+++ b/accel-pppd/triton/mempool.h
@@ -15,6 +15,8 @@ mempool_t *mempool_create2(int size);
struct mempool_stat_t mempool_get_stat(void);
#ifdef MEMDEBUG
+#include "memdebug.h"
+
void *md_mempool_alloc(mempool_t*, const char *fname, int line);
#define mempool_alloc(pool) md_mempool_alloc(pool, __FILE__, __LINE__)
#define mempool_free(ptr) md_free(ptr, __FILE__, __LINE__)