diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-19 03:20:20 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2005-01-19 03:20:20 +0000 |
commit | 8dfc0d79bee79da7be79d1512ae48171701cf0de (patch) | |
tree | e096efd9eb2c05c507edb40fdc3012ee552fdc35 /source/lib/socket/socket_unix.c | |
parent | a8aa5ef0a4376dedf9057ed32a09f60c4423c1ba (diff) | |
download | samba-8dfc0d79bee79da7be79d1512ae48171701cf0de.tar.gz samba-8dfc0d79bee79da7be79d1512ae48171701cf0de.tar.xz samba-8dfc0d79bee79da7be79d1512ae48171701cf0de.zip |
r4831: added udp support to our generic sockets library.
I decided to incorporate the udp support into the socket_ipv4.c
backend (and later in socket_ipv6.c) rather than doing a separate
backend, as so much of the code is shareable. Basically this adds a
socket_sendto() and a socket_recvfrom() call and not much all.
For udp servers, I decided to keep the call as socket_listen(), even
though dgram servers don't actually call listen(). This keeps the API
consistent.
I also added a simple local sockets testsuite in smbtorture,
LOCAL-SOCKET
Diffstat (limited to 'source/lib/socket/socket_unix.c')
-rw-r--r-- | source/lib/socket/socket_unix.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/lib/socket/socket_unix.c b/source/lib/socket/socket_unix.c index 60a4b9ec481..bdd68f9d9d9 100644 --- a/source/lib/socket/socket_unix.c +++ b/source/lib/socket/socket_unix.c @@ -4,7 +4,7 @@ unix domain socket functions Copyright (C) Stefan Metzmacher 2004 - Copyright (C) Andrew Tridgell 2004 + Copyright (C) Andrew Tridgell 2004-2005 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -266,8 +266,6 @@ static int unixdom_get_fd(struct socket_context *sock) static const struct socket_ops unixdom_ops = { .name = "unix", - .type = SOCKET_TYPE_STREAM, - .fn_init = unixdom_init, .fn_connect = unixdom_connect, .fn_connect_complete = unixdom_connect_complete, @@ -288,7 +286,10 @@ static const struct socket_ops unixdom_ops = { .fn_get_fd = unixdom_get_fd }; -const struct socket_ops *socket_unixdom_ops(void) +const struct socket_ops *socket_unixdom_ops(enum socket_type type) { + if (type != SOCKET_TYPE_STREAM) { + return NULL; + } return &unixdom_ops; } |