dbus-message-private.h
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-message-private.h header shared between dbus-message.c and dbus-message-util.c
*
* Copyright (C) 2005 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef DBUS_MESSAGE_PRIVATE_H
#define DBUS_MESSAGE_PRIVATE_H
#include <dbus/dbus-message.h>
#include <dbus/dbus-message-internal.h>
#include <dbus/dbus-string.h>
#include <dbus/dbus-dataslot.h>
#include <dbus/dbus-marshal-header.h>
DBUS_BEGIN_DECLS
struct DBusMessageLoader
{
int refcount;
DBusString data;
DBusList *messages;
long max_message_size;
long max_message_unix_fds;
DBusValidity corruption_reason;
unsigned int corrupted : 1;
unsigned int buffer_outstanding : 1;
#ifdef HAVE_UNIX_FD_PASSING
unsigned int unix_fds_outstanding : 1;
int *unix_fds;
unsigned n_unix_fds_allocated;
unsigned n_unix_fds;
void (* unix_fds_change) (void *);
void *unix_fds_change_data;
#endif
};
#define CHANGED_STAMP_BITS 21
struct DBusMessage
{
DBusAtomic refcount;
DBusHeader header;
DBusString body;
unsigned int locked : 1;
#ifndef DBUS_DISABLE_CHECKS
unsigned int in_cache : 1;
#endif
DBusList *counters;
long size_counter_delta;
dbus_uint32_t changed_stamp : CHANGED_STAMP_BITS;
DBusDataSlotList slot_list;
#ifndef DBUS_DISABLE_CHECKS
int generation;
#endif
#ifdef HAVE_UNIX_FD_PASSING
int *unix_fds;
unsigned n_unix_fds;
unsigned n_unix_fds_allocated;
long unix_fd_counter_delta;
#endif
};
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_message_iter_get_args_valist (DBusMessageIter *iter,
DBusError *error,
int first_arg_type,
va_list var_args);
DBUS_END_DECLS
#endif /* DBUS_MESSAGE_H */
DBUS_BEGIN_DECLS
#define DBUS_BEGIN_DECLS
Macro used prior to declaring functions in the D-Bus header files.
Definition dbus-macros.h:36
DBUS_END_DECLS
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.
Definition dbus-macros.h:37
DBusValidity
DBusValidity
This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...
Definition dbus-marshal-validate.h:54
_dbus_message_iter_get_args_valist
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_message_iter_get_args_valist(DBusMessageIter *iter, DBusError *error, int first_arg_type, va_list var_args)
Implementation of the varargs arg-getting functions.
Definition dbus-message.c:838
CHANGED_STAMP_BITS
#define CHANGED_STAMP_BITS
How many bits are in the changed_stamp used to validate iterators.
Definition dbus-message-private.h:92
dbus_uint32_t
unsigned int dbus_uint32_t
A 32-bit unsigned integer on all platforms.
Definition dbus-arch-deps.h:45
dbus_bool_t
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
Definition dbus-types.h:37
DBusAtomic
An atomic integer safe to increment or decrement from multiple threads.
Definition dbus-sysdeps.h:340
DBusDataSlotList
Data structure that stores the actual user data set at a given slot.
Definition dbus-dataslot.h:72
DBusError
Object representing an exception.
Definition dbus-errors.h:51
DBusHeader
Message header data and some cached details of it.
Definition dbus-marshal-header.h:90
DBusList
A node in a linked list.
Definition dbus-list.h:37
DBusMessageIter
DBusMessageIter struct; contains no public fields.
Definition dbus-message.h:64
DBusMessageLoader
Implementation details of DBusMessageLoader.
Definition dbus-message-private.h:63
DBusMessageLoader::max_message_size
long max_message_size
Maximum size of a message.
Definition dbus-message-private.h:70
DBusMessageLoader::max_message_unix_fds
long max_message_unix_fds
Maximum unix fds in a message.
Definition dbus-message-private.h:71
DBusMessageLoader::data
DBusString data
Buffered data.
Definition dbus-message-private.h:66
DBusMessageLoader::messages
DBusList * messages
Complete messages.
Definition dbus-message-private.h:68
DBusMessageLoader::corrupted
unsigned int corrupted
We got broken data, and are no longer working.
Definition dbus-message-private.h:75
DBusMessageLoader::buffer_outstanding
unsigned int buffer_outstanding
Someone is using the buffer to read.
Definition dbus-message-private.h:77
DBusMessageLoader::corruption_reason
DBusValidity corruption_reason
why we were corrupted
Definition dbus-message-private.h:73
DBusMessageLoader::refcount
int refcount
Reference count.
Definition dbus-message-private.h:64
DBusMessage
Internals of DBusMessage.
Definition dbus-message-private.h:102
DBusMessage::header
DBusHeader header
Header network data and associated cache.
Definition dbus-message-private.h:105
DBusMessage::body
DBusString body
Body network data.
Definition dbus-message-private.h:107
DBusMessage::slot_list
DBusDataSlotList slot_list
Data stored by allocated integer ID.
Definition dbus-message-private.h:120
DBusMessage::refcount
DBusAtomic refcount
Reference count.
Definition dbus-message-private.h:103
DBusMessage::changed_stamp
dbus_uint32_t changed_stamp
Incremented when iterators are invalidated.
Definition dbus-message-private.h:118
DBusMessage::generation
int generation
_dbus_current_generation when message was created
Definition dbus-message-private.h:123
DBusMessage::size_counter_delta
long size_counter_delta
Size we incremented the size counters by.
Definition dbus-message-private.h:116
DBusMessage::counters
DBusList * counters
0-N DBusCounter used to track message size/unix fds.
Definition dbus-message-private.h:115
DBusMessage::in_cache
unsigned int in_cache
Has been "freed" since it's in the cache (this is a debug feature).
Definition dbus-message-private.h:112
DBusMessage::locked
unsigned int locked
Message being sent, no modifications allowed.
Definition dbus-message-private.h:109
DBusString
Definition dbus-string.h:47