00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <config.h>
00026 #include "dbus-internals.h"
00027 #include "dbus-connection-internal.h"
00028 #include "dbus-transport-socket.h"
00029 #include "dbus-transport-protected.h"
00030 #include "dbus-watch.h"
00031 #include "dbus-sysdeps-win.h"
00032
00049 DBusTransportOpenResult
00050 _dbus_transport_open_platform_specific (DBusAddressEntry *entry,
00051 DBusTransport **transport_p,
00052 DBusError *error)
00053 {
00054 const char *method;
00055
00056 const char *host = dbus_address_entry_get_value (entry, "host");
00057 const char *port = dbus_address_entry_get_value (entry, "port");
00058 const char *family = dbus_address_entry_get_value (entry, "family");
00059 const char *noncefile = dbus_address_entry_get_value (entry, "noncefile");
00060
00061 method = dbus_address_entry_get_method (entry);
00062 _dbus_assert (method != NULL);
00063
00064 if (strcmp (method, "nonce-tcp") != 0)
00065 {
00066 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00067 return DBUS_TRANSPORT_OPEN_NOT_HANDLED;
00068 }
00069
00070 if (port == NULL)
00071 {
00072 _dbus_set_bad_address (error, "nonce-tcp", "port", NULL);
00073 return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
00074 }
00075
00076 *transport_p = _dbus_transport_new_for_tcp_socket (host, port, family, noncefile, error);
00077 if (*transport_p == NULL)
00078 {
00079 _DBUS_ASSERT_ERROR_IS_SET (error);
00080 return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
00081 }
00082 else
00083 {
00084 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00085 return DBUS_TRANSPORT_OPEN_OK;
00086 }
00087 }
00088