summaryrefslogtreecommitdiff
path: root/pflocal
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-07-03 19:09:12 +0000
committerMiles Bader <miles@gnu.org>1995-07-03 19:09:12 +0000
commitf5a90e2d7e8f6059bfe0f528ca7fc1e19574aca7 (patch)
tree6b840c6b020bb159196bec46bc9b15f191db1e24 /pflocal
parentbac2914ea4d0fe0247ddf0bddad9d64bb930c96e (diff)
Formerly pf.c.~4~
Diffstat (limited to 'pflocal')
-rw-r--r--pflocal/pf.c47
1 files changed, 41 insertions, 6 deletions
diff --git a/pflocal/pf.c b/pflocal/pf.c
index bb29c03f..b77f557e 100644
--- a/pflocal/pf.c
+++ b/pflocal/pf.c
@@ -20,30 +20,30 @@
/* Create a new socket. Sock type is, for example, SOCK_STREAM,
SOCK_DGRAM, or some such. */
-S_socket_create (struct trivfs_protid *cred,
+S_socket_create (mach_port_t pf,
int sock_type, int protocol,
mach_port_t *port, mach_msg_type_name_t *port_type)
{
error_t err;
- struct pipe_ops *pipe_ops;
struct sock *sock;
struct sock_user *user;
-
- if (!cred)
- return EOPNOTSUPP;
+ struct pipe_class *pipe_class;
if (protocol != 0)
return EPROTONOSUPPORT;
+
switch (sock_type)
{
case SOCK_STREAM:
pipe_class = stream_pipe_class; break;
case SOCK_DGRAM:
pipe_class = dgram_pipe_class; break;
+ case SOCK_SEQPACKET:
+ pipe_class = seqpacket_pipe_class; break;
default:
return ESOCKTNOSUPPORT;
}
-
+
err = sock_create (pipe_class, &sock);
if (!err)
err = sock_create_port (sock, port);
@@ -51,3 +51,38 @@ S_socket_create (struct trivfs_protid *cred,
return err;
}
+
+S_socket_create_address (mach_port_t pf,
+ int sockaddr_type,
+ char *data, unsigned data_len,
+ mach_port_t *addr_port,
+ mach_msg_type_name_t *addr_port_type)
+{
+ return EOPNOTSUPP;
+}
+
+S_socket_fabricate_address (mach_port_t pf,
+ int sockaddr_type,
+ mach_port_t *addr_port,
+ mach_msg_type_name_t *addr_port_type)
+{
+ error_t err;
+
+ if (sockaddr_type != AF_LOCAL)
+ return EAFNOSUPPORT;
+
+ err = addr_create (&addr);
+ if (err)
+ return err;
+
+ *addr_port = ports_get_right (addr);
+ *addr_port_type = MACH_MSG_TYPE_MAKE_SEND;
+ return 0;
+}
+
+S_socket_whatis_address (mach_port_t pf,
+ int *sockaddr_type,
+ char **sockaddr, unsigned *sockaddr_len)
+{
+ return EOPNOTSUPP;
+}