dbus-transport-protected.h

00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
00002 /* dbus-transport-protected.h Used by subclasses of DBusTransport object (internal to D-Bus implementation)
00003  *
00004  * Copyright (C) 2002, 2004  Red Hat Inc.
00005  *
00006  * Licensed under the Academic Free License version 2.1
00007  * 
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 #ifndef DBUS_TRANSPORT_PROTECTED_H
00024 #define DBUS_TRANSPORT_PROTECTED_H
00025 
00026 #include <dbus/dbus-internals.h>
00027 #include <dbus/dbus-errors.h>
00028 #include <dbus/dbus-transport.h>
00029 #include <dbus/dbus-message-internal.h>
00030 #include <dbus/dbus-auth.h>
00031 #include <dbus/dbus-resources.h>
00032 
00033 DBUS_BEGIN_DECLS
00034 
00035 typedef struct DBusTransportVTable DBusTransportVTable;
00036 
00041 struct DBusTransportVTable
00042 {
00043   void        (* finalize)              (DBusTransport *transport);
00046   dbus_bool_t (* handle_watch)          (DBusTransport *transport,
00047                                          DBusWatch     *watch,
00048                                          unsigned int   flags);
00053   void        (* disconnect)            (DBusTransport *transport);
00056   dbus_bool_t (* connection_set)        (DBusTransport *transport);
00059   void        (* do_iteration)          (DBusTransport *transport,
00060                                          unsigned int   flags,
00061                                          int            timeout_milliseconds);
00066   void        (* live_messages_changed) (DBusTransport *transport);
00069   dbus_bool_t (* get_socket_fd) (DBusTransport *transport,
00070                                  int           *fd_p);
00072 };
00073 
00080 struct DBusTransport
00081 {
00082   int refcount;                               
00084   const DBusTransportVTable *vtable;          
00086   DBusConnection *connection;                 
00088   DBusMessageLoader *loader;                  
00090   DBusAuth *auth;                             
00092   DBusCredentials *credentials;               
00094   long max_live_messages_size;                
00096   DBusCounter *live_messages_size;            
00099   char *address;                              
00101   char *expected_guid;                        
00103   DBusAllowUnixUserFunction unix_user_function; 
00104   void *unix_user_data;                         
00106   DBusFreeFunction free_unix_user_data;         
00108   DBusAllowWindowsUserFunction windows_user_function; 
00109   void *windows_user_data;                            
00111   DBusFreeFunction free_windows_user_data;            
00113   unsigned int disconnected : 1;              
00114   unsigned int authenticated : 1;             
00115   unsigned int send_credentials_pending : 1;  
00116   unsigned int receive_credentials_pending : 1; 
00117   unsigned int is_server : 1;                 
00118   unsigned int unused_bytes_recovered : 1;    
00119   unsigned int allow_anonymous : 1;           
00120 };
00121 
00122 dbus_bool_t _dbus_transport_init_base     (DBusTransport             *transport,
00123                                            const DBusTransportVTable *vtable,
00124                                            const DBusString          *server_guid,
00125                                            const DBusString          *address);
00126 void        _dbus_transport_finalize_base (DBusTransport             *transport);
00127 
00128 
00129 typedef enum
00130 {
00131   DBUS_TRANSPORT_OPEN_NOT_HANDLED,    
00132   DBUS_TRANSPORT_OPEN_OK,             
00133   DBUS_TRANSPORT_OPEN_BAD_ADDRESS,    
00134   DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT 
00135 } DBusTransportOpenResult;
00136 
00137 DBusTransportOpenResult _dbus_transport_open_platform_specific (DBusAddressEntry  *entry,
00138                                                                 DBusTransport    **transport_p,
00139                                                                 DBusError         *error);
00140 
00141 DBUS_END_DECLS
00142 
00143 #endif /* DBUS_TRANSPORT_PROTECTED_H */

Generated on Sat Dec 6 19:43:44 2008 for D-Bus by  doxygen 1.5.1