summaryrefslogtreecommitdiff
path: root/drivers/ppposeq/ppposeq.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ppposeq/ppposeq.h')
-rw-r--r--drivers/ppposeq/ppposeq.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/ppposeq/ppposeq.h b/drivers/ppposeq/ppposeq.h
new file mode 100644
index 00000000..ecdbdfb1
--- /dev/null
+++ b/drivers/ppposeq/ppposeq.h
@@ -0,0 +1,34 @@
+#ifndef __PPPOSEQ_H
+#define __PPPOSEQ_H
+
+#include <linux/if_pppox.h>
+
+/*
+ * ppposeq - PPP over a SEQPACKET AF_PPPOX socket.
+ *
+ * Replaces the pty + ppp_async transport for userspace PPP terminators
+ * such as sstp. A pty is a byte stream, so frame boundaries are lost in
+ * the tty flip buffer and have to be rebuilt with HDLC escape+FCS framing.
+ * Here the socket itself is the ppp endpoint and each datagram carries
+ * exactly one ppp frame, so no framing is needed on either side.
+ *
+ * fd = socket(AF_PPPOX, SOCK_SEQPACKET, PX_PROTO_OSEQ);
+ * connect(fd, &sa, sizeof(sa)); // registers the channel
+ * ioctl(fd, PPPIOCGCHAN, &idx);
+ * chan = open("/dev/ppp"); ioctl(chan, PPPIOCATTCHAN, &idx);
+ * // frames flow over fd with send()/recv()
+ *
+ * Only the protocol number is new; everything else uses the common
+ * AF_PPPOX and PPPIOC* interfaces.
+ */
+
+#ifndef PX_PROTO_OSEQ
+#define PX_PROTO_OSEQ 3
+#endif
+
+struct sockaddr_ppposeq {
+ __kernel_sa_family_t sa_family; /* AF_PPPOX */
+ unsigned int sa_protocol; /* PX_PROTO_OSEQ */
+} __attribute__((packed));
+
+#endif