D-Bus 1.6.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 
00031 DBUS_BEGIN_DECLS
00032 
00033 typedef struct DBusNonceFile DBusNonceFile;
00034 
00035 struct DBusNonceFile
00036 {
00037   DBusString path;
00038   DBusString dir;
00039 };
00040 
00041 // server
00042 
00043 dbus_bool_t _dbus_noncefile_create (DBusNonceFile *noncefile,
00044                                     DBusError *error);
00045 
00046 dbus_bool_t _dbus_noncefile_delete (DBusNonceFile *noncefile,
00047                                     DBusError *error);
00048 
00049 dbus_bool_t _dbus_noncefile_check_nonce (int fd,
00050                                          const DBusNonceFile *noncefile,
00051                                          DBusError *error);
00052 
00053 const DBusString* _dbus_noncefile_get_path (const DBusNonceFile *noncefile);
00054 
00055 int _dbus_accept_with_noncefile (int listen_fd,
00056                                  const DBusNonceFile *noncefile);
00057 
00058 // shared
00059 
00060 dbus_bool_t _dbus_read_nonce (const DBusString *fname,
00061                               DBusString *nonce,
00062                               DBusError *error);
00063 
00064 // client
00065 
00066 dbus_bool_t _dbus_send_nonce (int fd,
00067                               const DBusString *noncefile,
00068                               DBusError *error);
00069 
00070 DBUS_END_DECLS
00071 
00072 #endif /* DBUS_NONCE_H */