-/* -*- mode: C; c-file-style: "gnu" -*- */
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-transport-protected.h Used by subclasses of DBusTransport object (internal to D-Bus implementation)
*
* Copyright (C) 2002, 2004 Red Hat Inc.
#ifndef DBUS_TRANSPORT_PROTECTED_H
#define DBUS_TRANSPORT_PROTECTED_H
+#include <config.h>
+
#include <dbus/dbus-internals.h>
#include <dbus/dbus-errors.h>
#include <dbus/dbus-transport.h>
/**< Get socket file descriptor */
};
+/** How many unix file descriptors may be queued up before they are
+ handed off to messages */
+#define DBUS_MAX_QUEUED_FDS 1024
+
/**
* Object representing a transport such as a socket.
* A transport can shuttle messages from point A to point B,
DBusAuth *auth; /**< Authentication conversation */
- DBusCredentials credentials; /**< Credentials of other end */
+ DBusCredentials *credentials; /**< Credentials of other end read from the socket */
long max_live_messages_size; /**< Max total size of received messages. */
void *unix_user_data; /**< Data for unix_user_function */
DBusFreeFunction free_unix_user_data; /**< Function to free unix_user_data */
+
+ DBusAllowWindowsUserFunction windows_user_function; /**< Function for checking whether a user is authorized. */
+ void *windows_user_data; /**< Data for windows_user_function */
+
+ DBusFreeFunction free_windows_user_data; /**< Function to free windows_user_data */
unsigned int disconnected : 1; /**< #TRUE if we are disconnected. */
unsigned int authenticated : 1; /**< Cache of auth state; use _dbus_transport_get_is_authenticated() to query value */
unsigned int receive_credentials_pending : 1; /**< #TRUE if we need to receive credentials */
unsigned int is_server : 1; /**< #TRUE if on the server side */
unsigned int unused_bytes_recovered : 1; /**< #TRUE if we've recovered unused bytes from auth */
+ unsigned int allow_anonymous : 1; /**< #TRUE if an anonymous client can connect */
};
dbus_bool_t _dbus_transport_init_base (DBusTransport *transport,
void _dbus_transport_finalize_base (DBusTransport *transport);
+typedef enum
+{
+ DBUS_TRANSPORT_OPEN_NOT_HANDLED, /**< we aren't in charge of this address type */
+ DBUS_TRANSPORT_OPEN_OK, /**< we set up the listen */
+ DBUS_TRANSPORT_OPEN_BAD_ADDRESS, /**< malformed address */
+ DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT /**< well-formed address but failed to set it up */
+} DBusTransportOpenResult;
+
+DBusTransportOpenResult _dbus_transport_open_platform_specific (DBusAddressEntry *entry,
+ DBusTransport **transport_p,
+ DBusError *error);
+
+#define DBUS_TRANSPORT_CAN_SEND_UNIX_FD(x) \
+ _dbus_auth_get_unix_fd_negotiated((x)->auth)
DBUS_END_DECLS