Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

dbus-transport-protected.h

00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* dbus-transport-protected.h Used by subclasses of DBusTransport object (internal to D-BUS implementation)
00003  *
00004  * Copyright (C) 2002  Red Hat Inc.
00005  *
00006  * Licensed under the Academic Free License version 2.0
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        (* messages_pending)      (DBusTransport *transport,
00060                                          int            queue_length);
00065   void        (* do_iteration)          (DBusTransport *transport,
00066                                          unsigned int   flags,
00067                                          int            timeout_milliseconds);
00072   void        (* live_messages_changed) (DBusTransport *transport);
00074 };
00075 
00082 struct DBusTransport
00083 {
00084   int refcount;                               
00086   const DBusTransportVTable *vtable;          
00088   DBusConnection *connection;                 
00090   DBusMessageLoader *loader;                  
00092   DBusAuth *auth;                             
00094   DBusCredentials credentials;                
00096   long max_live_messages_size;                
00098   DBusCounter *live_messages_size;            
00101   char *address;                              
00103   DBusAllowUnixUserFunction unix_user_function; 
00104   void *unix_user_data;                         
00105   DBusFreeFunction free_unix_user_data;         
00107   unsigned int disconnected : 1;              
00108   unsigned int authenticated : 1;             
00109   unsigned int messages_need_sending : 1;     
00110   unsigned int send_credentials_pending : 1;  
00111   unsigned int receive_credentials_pending : 1; 
00112   unsigned int is_server : 1;                 
00113   unsigned int unused_bytes_recovered : 1;    
00114 };
00115 
00116 dbus_bool_t _dbus_transport_init_base     (DBusTransport             *transport,
00117                                            const DBusTransportVTable *vtable,
00118                                            dbus_bool_t                server,
00119                                            const DBusString          *address);
00120 void        _dbus_transport_finalize_base (DBusTransport             *transport);
00121 
00122 
00123 
00124 DBUS_END_DECLS;
00125 
00126 #endif /* DBUS_TRANSPORT_PROTECTED_H */

Generated on Sun Mar 21 03:52:06 2004 for D-BUS by doxygen 1.3.6-20040222