summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_ksocket.h
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-07 07:12:51 +0000
committerjulian <julian@FreeBSD.org>2001-09-07 07:12:51 +0000
commitf307b418db18dcf0791a53a9429ff162625fbd9c (patch)
treed8b77b4786265ddc9ad5cabcb4db3ed65b6ad9a4 /sys/netgraph/ng_ksocket.h
parentc5b125fd9c470012cdddcf6fc1488f62fccd8069 (diff)
downloadFreeBSD-src-f307b418db18dcf0791a53a9429ff162625fbd9c.zip
FreeBSD-src-f307b418db18dcf0791a53a9429ff162625fbd9c.tar.gz
First pass at porting John's "accept" changes to
allow an in-kernel webserver (or similar) to accept and handle incoming connections using netgraph without ever leaving the kernel. (allows incoming tunnel requests to be handled totally within the kernel for example) Needs work, but shouldn't break existing functionality. Submitted by: John Polstra <jdp@polstra.com> MFC after: 2 weeks
Diffstat (limited to 'sys/netgraph/ng_ksocket.h')
-rw-r--r--sys/netgraph/ng_ksocket.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/netgraph/ng_ksocket.h b/sys/netgraph/ng_ksocket.h
index fd6a579..efb65aa 100644
--- a/sys/netgraph/ng_ksocket.h
+++ b/sys/netgraph/ng_ksocket.h
@@ -43,6 +43,8 @@
#ifndef _NETGRAPH_KSOCKET_H_
#define _NETGRAPH_KSOCKET_H_
+#include <sys/socket.h>
+
/* Node type name and magic cookie */
#define NG_KSOCKET_NODE_TYPE "ksocket"
#define NGM_KSOCKET_COOKIE 942710669
@@ -69,6 +71,21 @@ struct ng_ksocket_sockopt {
} \
}
+/* For NGM_KSOCKET_ACCEPT control message responses */
+struct ng_ksocket_accept {
+ u_int32_t nodeid; /* node ID of connected ksocket */
+ struct sockaddr addr; /* peer's address (variable length) */
+};
+
+/* Keep this in sync with the above structure definition */
+#define NGM_KSOCKET_ACCEPT_INFO { \
+ { \
+ { "nodeid", &ng_parse_hint32_type }, \
+ { "addr", &ng_ksocket_generic_sockaddr_type }, \
+ { NULL } \
+ } \
+}
+
/* Netgraph commands */
enum {
NGM_KSOCKET_BIND = 1,
OpenPOWER on IntegriCloud