Open SCAP Library
oval_dbus.h
1 /*
2  * Copyright 2023 Red Hat Inc., Durham, North Carolina.
3  * All Rights Reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * Authors:
20  * Evgenii Kolesnikov <ekolesni@redhat.com>
21  */
22 
23 #ifndef OPENSCAP_OVAL_DBUS_H_
24 #define OPENSCAP_OVAL_DBUS_H_
25 
26 #include <dbus/dbus.h>
27 
28 
29 // Old versions of libdbus API don't have DBusBasicValue and DBus8ByteStruct
30 // as a public typedefs.
31 // These two typedefs were copied from libdbus 1.8 branch, see
32 // http://cgit.freedesktop.org/dbus/dbus/tree/dbus/dbus-types.h?h=dbus-1.8#n137
33 typedef struct
34 {
35  dbus_uint32_t first32;
36  dbus_uint32_t second32;
38 
39 typedef union
40 {
41  unsigned char bytes[8];
42  dbus_int16_t i16;
43  dbus_uint16_t u16;
44  dbus_int32_t i32;
45  dbus_uint32_t u32;
46  dbus_bool_t bool_val;
47 #ifdef DBUS_HAVE_INT64
48  dbus_int64_t i64;
49  dbus_uint64_t u64;
50 #endif
52  double dbl;
53  unsigned char byt;
54  char *str;
55  int fd;
57 
58 
59 char *oval_dbus_value_to_string(DBusMessageIter *iter);
60 
61 DBusConnection *oval_connect_dbus(void);
62 
63 void oval_disconnect_dbus(DBusConnection *conn);
64 
65 #endif
Definition: oval_dbus.h:34
Definition: oval_dbus.h:40
dbus_uint16_t u16
as int16
Definition: oval_dbus.h:43
dbus_int16_t i16
as int16
Definition: oval_dbus.h:42
double dbl
as double
Definition: oval_dbus.h:52
_DBus8ByteStruct eight
as 8-byte struct
Definition: oval_dbus.h:51
char * str
as char* (string, object path or signature)
Definition: oval_dbus.h:54
int fd
as Unix file descriptor
Definition: oval_dbus.h:55
dbus_uint32_t u32
as int32
Definition: oval_dbus.h:45
dbus_bool_t bool_val
as boolean
Definition: oval_dbus.h:46
unsigned char byt
as byte
Definition: oval_dbus.h:53
dbus_int32_t i32
as int32
Definition: oval_dbus.h:44