summaryrefslogtreecommitdiffstats
path: root/include/linux/if_pppox.h
diff options
context:
space:
mode:
authorJames Chapman <jchapman@katalix.com>2007-06-27 15:43:43 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-10 22:15:58 -0700
commitcf14a4d06742d59ecb2d837a3f53bb24d1ff9acb (patch)
tree78b8058dd7bd8b1cfba243d7d478495e0ba9281b /include/linux/if_pppox.h
parent342f0234c71b40da785dd6a7ce1dd481ecbfdb81 (diff)
downloadblackbird-op-linux-cf14a4d06742d59ecb2d837a3f53bb24d1ff9acb.tar.gz
blackbird-op-linux-cf14a4d06742d59ecb2d837a3f53bb24d1ff9acb.zip
[L2TP]: Changes to existing ppp and socket kernel headers for L2TP
Add struct sockaddr_pppol2tp to carry L2TP-specific address information for the PPPoX (PPPoL2TP) socket. Unfortunately we can't use the union inside struct sockaddr_pppox because the L2TP-specific data is larger than the current size of the union and we must preserve the size of struct sockaddr_pppox for binary compatibility. Also add a PPPIOCGL2TPSTATS ioctl to allow userspace to obtain L2TP counters and state from the kernel. Add new if_pppol2tp.h header. [ Modified to use aligned_u64 in statistics structure -DaveM ] Signed-off-by: James Chapman <jchapman@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/if_pppox.h')
-rw-r--r--include/linux/if_pppox.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 6f987be60fe2..25652545ba6e 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -27,6 +27,7 @@
#include <asm/semaphore.h>
#include <linux/ppp_channel.h>
#endif /* __KERNEL__ */
+#include <linux/if_pppol2tp.h>
/* For user-space programs to pick up these definitions
* which they wouldn't get otherwise without defining __KERNEL__
@@ -50,8 +51,9 @@ struct pppoe_addr{
* Protocols supported by AF_PPPOX
*/
#define PX_PROTO_OE 0 /* Currently just PPPoE */
-#define PX_MAX_PROTO 1
-
+#define PX_PROTO_OL2TP 1 /* Now L2TP also */
+#define PX_MAX_PROTO 2
+
struct sockaddr_pppox {
sa_family_t sa_family; /* address family, AF_PPPOX */
unsigned int sa_protocol; /* protocol identifier */
@@ -60,6 +62,16 @@ struct sockaddr_pppox {
}sa_addr;
}__attribute__ ((packed));
+/* The use of the above union isn't viable because the size of this
+ * struct must stay fixed over time -- applications use sizeof(struct
+ * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
+ * type instead.
+ */
+struct sockaddr_pppol2tp {
+ sa_family_t sa_family; /* address family, AF_PPPOX */
+ unsigned int sa_protocol; /* protocol identifier */
+ struct pppol2tp_addr pppol2tp;
+}__attribute__ ((packed));
/*********************************************************************
*
OpenPOWER on IntegriCloud