D-Bus  1.13.7
dbus-transport-protected.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-transport-protected.h Used by subclasses of DBusTransport object (internal to D-Bus implementation)
3  *
4  * Copyright (C) 2002, 2004 Red Hat Inc.
5  *
6  * Licensed under the Academic Free License version 2.1
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23 #ifndef DBUS_TRANSPORT_PROTECTED_H
24 #define DBUS_TRANSPORT_PROTECTED_H
25 
26 #include <dbus/dbus-internals.h>
27 #include <dbus/dbus-errors.h>
28 #include <dbus/dbus-transport.h>
29 #include <dbus/dbus-message-internal.h>
30 #include <dbus/dbus-auth.h>
31 #include <dbus/dbus-resources.h>
32 
34 
36 
42 {
43  void (* finalize) (DBusTransport *transport);
47  DBusWatch *watch,
48  unsigned int flags);
53  void (* disconnect) (DBusTransport *transport);
59  void (* do_iteration) (DBusTransport *transport,
60  unsigned int flags,
61  int timeout_milliseconds);
66  void (* live_messages_changed) (DBusTransport *transport);
70  DBusSocket *fd_p);
72 };
73 
81 {
82  int refcount;
99  char *address;
113  unsigned int disconnected : 1;
114  unsigned int authenticated : 1;
115  unsigned int send_credentials_pending : 1;
116  unsigned int receive_credentials_pending : 1;
117  unsigned int is_server : 1;
118  unsigned int unused_bytes_recovered : 1;
119  unsigned int allow_anonymous : 1;
120 };
121 
123  const DBusTransportVTable *vtable,
124  const DBusString *server_guid,
125  const DBusString *address);
127 
128 
129 typedef enum
130 {
131  DBUS_TRANSPORT_OPEN_NOT_HANDLED,
132  DBUS_TRANSPORT_OPEN_OK,
133  DBUS_TRANSPORT_OPEN_BAD_ADDRESS,
134  DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT
135 } DBusTransportOpenResult;
136 
137 DBusTransportOpenResult _dbus_transport_open_platform_specific (DBusAddressEntry *entry,
138  DBusTransport **transport_p,
139  DBusError *error);
140 
141 #define DBUS_TRANSPORT_CAN_SEND_UNIX_FD(x) \
142  _dbus_auth_get_unix_fd_negotiated((x)->auth)
143 
145 
146 #endif /* DBUS_TRANSPORT_PROTECTED_H */
dbus_bool_t(* handle_watch)(DBusTransport *transport, DBusWatch *watch, unsigned int flags)
The handle_watch method handles reading/writing data as indicated by the flags.
long max_live_messages_unix_fds
Max total unix fds of received messages.
Implementation of DBusWatch.
Definition: dbus-watch.c:40
void(* DBusFreeFunction)(void *memory)
The type of a function which frees a block of memory.
Definition: dbus-memory.h:63
DBusTransportOpenResult _dbus_transport_open_platform_specific(DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error)
Opens platform specific transport types.
dbus_bool_t(* connection_set)(DBusTransport *transport)
Called when transport->connection has been filled in.
DBusAuth * auth
Authentication conversation.
unsigned int disconnected
TRUE if we are disconnected.
#define DBUS_BEGIN_DECLS
Macro used prior to declaring functions in the D-Bus header files.
long max_live_messages_size
Max total size of received messages.
DBusFreeFunction free_windows_user_data
Function to free windows_user_data.
char * expected_guid
GUID we expect the server to have, NULL on server side or if we don&#39;t have an expectation.
void(* live_messages_changed)(DBusTransport *transport)
Outstanding messages counter changed.
Internals of DBusCounter.
unsigned int authenticated
Cache of auth state; use _dbus_transport_peek_is_authenticated() to query value.
DBusConnection * connection
Connection owning this transport.
int refcount
Reference count.
Implementation details of DBusConnection.
unsigned int send_credentials_pending
TRUE if we need to send credentials
dbus_bool_t _dbus_transport_init_base(DBusTransport *transport, const DBusTransportVTable *vtable, const DBusString *server_guid, const DBusString *address)
Initializes the base class members of DBusTransport.
Socket interface.
Definition: dbus-sysdeps.h:178
dbus_bool_t(* get_socket_fd)(DBusTransport *transport, DBusSocket *fd_p)
Get socket file descriptor.
unsigned int receive_credentials_pending
TRUE if we need to receive credentials
DBusCounter * live_messages
Counter for size/unix fds of all live messages.
Internal members of DBusAuth.
Definition: dbus-auth.c:153
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
Definition: dbus-types.h:35
void * unix_user_data
Data for unix_user_function.
DBusAllowWindowsUserFunction windows_user_function
Function for checking whether a user is authorized.
unsigned int allow_anonymous
TRUE if an anonymous client can connect
dbus_bool_t(* DBusAllowUnixUserFunction)(DBusConnection *connection, unsigned long uid, void *data)
Called during authentication to check whether the given UNIX user ID is allowed to connect...
Internals of DBusAddressEntry.
Definition: dbus-address.c:44
Object representing an exception.
Definition: dbus-errors.h:48
unsigned int unused_bytes_recovered
TRUE if we&#39;ve recovered unused bytes from auth
The virtual table that must be implemented to create a new kind of transport.
char * address
Address of the server we are connecting to (NULL for the server side of a transport) ...
dbus_bool_t(* DBusAllowWindowsUserFunction)(DBusConnection *connection, const char *user_sid, void *data)
Called during authentication to check whether the given Windows user ID is allowed to connect...
DBusMessageLoader * loader
Message-loading buffer.
unsigned int is_server
TRUE if on the server side
Object representing a transport such as a socket.
void(* do_iteration)(DBusTransport *transport, unsigned int flags, int timeout_milliseconds)
Called to do a single "iteration" (block on select/poll followed by reading or writing data)...
DBusAllowUnixUserFunction unix_user_function
Function for checking whether a user is authorized.
DBusCredentials * credentials
Credentials of other end read from the socket.
void(* disconnect)(DBusTransport *transport)
Disconnect this transport.
void _dbus_transport_finalize_base(DBusTransport *transport)
Finalizes base class members of DBusTransport.
const DBusTransportVTable * vtable
Virtual methods for this instance.
Implementation details of DBusMessageLoader.
void * windows_user_data
Data for windows_user_function.
DBusFreeFunction free_unix_user_data
Function to free unix_user_data.
void(* finalize)(DBusTransport *transport)
The finalize method must free the transport.
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.