D-Bus  1.10.12
dbus-nonce.h
00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
00002 /* dbus-nonce.h  Nonce handling functions used by nonce-tcp (internal to D-Bus implementation)
00003  *
00004  * Copyright (C) 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
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_NONCE_H
00024 #define DBUS_NONCE_H
00025 
00026 #include <dbus/dbus-macros.h>
00027 #include <dbus/dbus-types.h>
00028 #include <dbus/dbus-errors.h>
00029 #include <dbus/dbus-string.h>
00030 #include <dbus/dbus-sysdeps.h>
00031 
00032 DBUS_BEGIN_DECLS
00033 
00034 typedef struct DBusNonceFile DBusNonceFile;
00035 
00036 struct DBusNonceFile
00037 {
00038   DBusString path;
00039   DBusString dir;
00040 };
00041 
00042 // server
00043 
00044 dbus_bool_t _dbus_noncefile_create (DBusNonceFile *noncefile,
00045                                     DBusError *error);
00046 
00047 dbus_bool_t _dbus_noncefile_delete (DBusNonceFile *noncefile,
00048                                     DBusError *error);
00049 
00050 dbus_bool_t _dbus_noncefile_check_nonce (DBusSocket fd,
00051                                          const DBusNonceFile *noncefile,
00052                                          DBusError *error);
00053 
00054 const DBusString* _dbus_noncefile_get_path (const DBusNonceFile *noncefile);
00055 
00056 DBusSocket _dbus_accept_with_noncefile(DBusSocket listen_fd,
00057                                  const DBusNonceFile *noncefile);
00058 
00059 // shared
00060 
00061 dbus_bool_t _dbus_read_nonce (const DBusString *fname,
00062                               DBusString *nonce,
00063                               DBusError *error);
00064 
00065 // client
00066 
00067 dbus_bool_t _dbus_send_nonce (DBusSocket fd,
00068                               const DBusString *noncefile,
00069                               DBusError *error);
00070 
00071 DBUS_END_DECLS
00072 
00073 #endif /* DBUS_NONCE_H */