]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/pppd.h
Merge pull request #354 from pali/register-with-name
[ppp.git] / pppd / pppd.h
index c5f9b6d5e4c41c19937a79648d1ba2bb94faa8ac..bd9faf0f993396742e87862d076b86e9be672b5b 100644 (file)
  * $Id: pppd.h,v 1.96 2008/06/23 11:47:18 paulus Exp $
  */
 
-#include "pppdconf.h"
-
-/*
- * TODO:
- */
+#ifndef PPP_PPPD_H
+#define PPP_PPPD_H
 
-#ifndef __PPPD_H__
-#define __PPPD_H__
+#include "pppdconf.h"
 
 #include <stdio.h>             /* for FILE */
 #include <stdlib.h>            /* for encrypt */
 #include <stdarg.h>
 #include <stdint.h>
 #include <sys/types.h>         /* for u_int32_t, if defined */
+#if defined(SOL2)
 #include <net/ppp_defs.h>
+#else
+#include <linux/ppp_defs.h>
+#endif
 
 #ifdef PPP_WITH_IPV6CP
-#include "eui64.h"
+#if defined(SOL2)
+#include <netinet/in.h>
+
+typedef union {
+    uint8_t    e8[8];          /* lower 64-bit IPv6 address */
+    uint32_t   e32[2];         /* lower 64-bit IPv6 address */
+} eui64_t;
+
+/*
+ * Declare the two below, since in.h only defines them when _KERNEL
+ * is declared - which shouldn't be true when dealing with user-land programs
+ */
+#define        s6_addr8        _S6_un._S6_u8
+#define        s6_addr32       _S6_un._S6_u32
+
+#else /* else if not defined(SOL2) */
+
+/*
+ * TODO:
+ *
+ * Maybe this should be done by processing struct in6_addr directly...
+ */
+typedef union
+{
+    u_int8_t e8[8];
+    u_int16_t e16[4];
+    u_int32_t e32[2];
+} eui64_t;
+
+#endif /* defined(SOL2) */
 #endif
 
 /*
@@ -357,7 +386,6 @@ extern char *tls_verify_method;
 extern char *pkcs12_file;
 #endif /* PPP_WITH_EAPTLS */
 
-#ifdef PPP_WITH_MAXOCTETS
 extern unsigned int maxoctets;      /* Maximum octetes per session (in bytes) */
 extern int       maxoctets_dir;      /* Direction :
                                      0 - in+out (default)
@@ -371,7 +399,6 @@ extern int       maxoctets_timeout;  /* Timeout for check of octets limit */
 #define PPP_OCTETS_DIRECTION_MAXOVERAL  3
 /* same as previos, but little different on RADIUS side */
 #define PPP_OCTETS_DIRECTION_MAXSESSION 4
-#endif
 
 #ifdef PPP_WITH_FILTER
 extern struct  bpf_program pass_filter;   /* Filter for pkts to pass */
@@ -866,9 +893,7 @@ extern void (*snoop_send_hook)(unsigned char *p, int len);
 #define EXIT_LOOPBACK          17
 #define EXIT_INIT_FAILED       18
 #define EXIT_AUTH_TOPEER_FAILED        19
-#ifdef PPP_WITH_MAXOCTETS
 #define EXIT_TRAFFIC_LIMIT     20
-#endif
 #define EXIT_CNID_AUTH_FAILED  21
 
 /*
@@ -962,4 +987,4 @@ extern void (*snoop_send_hook)(unsigned char *p, int len);
 #define offsetof(type, member) ((size_t) &((type *)0)->member)
 #endif
 
-#endif /* __PPP_H__ */
+#endif /* PPP_PPPD_H */