1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ofdbus/dbus/bus/bus.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,126 @@
1.4 +/* -*- mode: C; c-file-style: "gnu" -*- */
1.5 +/* bus.h message bus context object
1.6 + *
1.7 + * Copyright (C) 2003 Red Hat, Inc.
1.8 + * Portion Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.9 + * Licensed under the Academic Free License version 2.1
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + *
1.21 + * You should have received a copy of the GNU General Public License
1.22 + * along with this program; if not, write to the Free Software
1.23 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.24 + *
1.25 + */
1.26 +
1.27 +#ifndef BUS_BUS_H
1.28 +#define BUS_BUS_H
1.29 +
1.30 +#ifndef __SYMBIAN32__
1.31 +#include <config.h>
1.32 +#else
1.33 +#include "config.h"
1.34 +#endif //__SYMBAIN32__
1.35 +
1.36 +#include <dbus/dbus.h>
1.37 +#ifndef __SYMBIAN32__
1.38 +#include <dbus/dbus-string.h>
1.39 +#include <dbus/dbus-mainloop.h>
1.40 +#include <dbus/dbus-userdb.h>
1.41 +#else
1.42 +#include "dbus-string.h"
1.43 +#include "dbus-mainloop.h"
1.44 +#include "dbus-userdb.h"
1.45 +#endif //__SYMBAIN32__
1.46 +
1.47 +typedef struct BusActivation BusActivation;
1.48 +typedef struct BusConnections BusConnections;
1.49 +typedef struct BusContext BusContext;
1.50 +typedef struct BusPolicy BusPolicy;
1.51 +typedef struct BusClientPolicy BusClientPolicy;
1.52 +typedef struct BusPolicyRule BusPolicyRule;
1.53 +typedef struct BusRegistry BusRegistry;
1.54 +typedef struct BusSELinuxID BusSELinuxID;
1.55 +typedef struct BusService BusService;
1.56 +typedef struct BusOwner BusOwner;
1.57 +typedef struct BusTransaction BusTransaction;
1.58 +typedef struct BusMatchmaker BusMatchmaker;
1.59 +typedef struct BusMatchRule BusMatchRule;
1.60 +
1.61 +typedef struct
1.62 +{
1.63 + long max_incoming_bytes; /**< How many incoming message bytes for a single connection */
1.64 + long max_outgoing_bytes; /**< How many outgoing bytes can be queued for a single connection */
1.65 + long max_message_size; /**< Max size of a single message in bytes */
1.66 + int activation_timeout; /**< How long to wait for an activation to time out */
1.67 + int auth_timeout; /**< How long to wait for an authentication to time out */
1.68 + int max_completed_connections; /**< Max number of authorized connections */
1.69 + int max_incomplete_connections; /**< Max number of incomplete connections */
1.70 + int max_connections_per_user; /**< Max number of connections auth'd as same user */
1.71 + int max_pending_activations; /**< Max number of pending activations for the entire bus */
1.72 + int max_services_per_connection; /**< Max number of owned services for a single connection */
1.73 + int max_match_rules_per_connection; /**< Max number of match rules for a single connection */
1.74 + int max_replies_per_connection; /**< Max number of replies that can be pending for each connection */
1.75 + int reply_timeout; /**< How long to wait before timing out a reply */
1.76 +} BusLimits;
1.77 +
1.78 +typedef enum
1.79 +{
1.80 + FORK_FOLLOW_CONFIG_FILE,
1.81 + FORK_ALWAYS,
1.82 + FORK_NEVER
1.83 +} ForceForkSetting;
1.84 +
1.85 +BusContext* bus_context_new (const DBusString *config_file,
1.86 + ForceForkSetting force_fork,
1.87 + int print_addr_fd,
1.88 + int print_pid_fd,
1.89 + DBusError *error);
1.90 +dbus_bool_t bus_context_reload_config (BusContext *context,
1.91 + DBusError *error);
1.92 +void bus_context_shutdown (BusContext *context);
1.93 +BusContext* bus_context_ref (BusContext *context);
1.94 +void bus_context_unref (BusContext *context);
1.95 +const char* bus_context_get_type (BusContext *context);
1.96 +const char* bus_context_get_address (BusContext *context);
1.97 +BusRegistry* bus_context_get_registry (BusContext *context);
1.98 +BusConnections* bus_context_get_connections (BusContext *context);
1.99 +BusActivation* bus_context_get_activation (BusContext *context);
1.100 +BusMatchmaker* bus_context_get_matchmaker (BusContext *context);
1.101 +DBusLoop* bus_context_get_loop (BusContext *context);
1.102 +DBusUserDatabase* bus_context_get_user_database (BusContext *context);
1.103 +
1.104 +dbus_bool_t bus_context_allow_user (BusContext *context,
1.105 + unsigned long uid);
1.106 +BusPolicy* bus_context_get_policy (BusContext *context);
1.107 +
1.108 +BusClientPolicy* bus_context_create_client_policy (BusContext *context,
1.109 + DBusConnection *connection,
1.110 + DBusError *error);
1.111 +int bus_context_get_activation_timeout (BusContext *context);
1.112 +int bus_context_get_auth_timeout (BusContext *context);
1.113 +int bus_context_get_max_completed_connections (BusContext *context);
1.114 +int bus_context_get_max_incomplete_connections (BusContext *context);
1.115 +int bus_context_get_max_connections_per_user (BusContext *context);
1.116 +int bus_context_get_max_pending_activations (BusContext *context);
1.117 +int bus_context_get_max_services_per_connection (BusContext *context);
1.118 +int bus_context_get_max_match_rules_per_connection (BusContext *context);
1.119 +int bus_context_get_max_replies_per_connection (BusContext *context);
1.120 +int bus_context_get_reply_timeout (BusContext *context);
1.121 +dbus_bool_t bus_context_check_security_policy (BusContext *context,
1.122 + BusTransaction *transaction,
1.123 + DBusConnection *sender,
1.124 + DBusConnection *addressed_recipient,
1.125 + DBusConnection *proposed_recipient,
1.126 + DBusMessage *message,
1.127 + DBusError *error);
1.128 +
1.129 +#endif /* BUS_BUS_H */