interfaces, object paths and activation
Mark McLoughlin
mark@skynet.ie
Sun, 21 Sep 2003 18:15:44 +0100
--=-h63doUAmTz1VM3KZ5Gv3
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hey,
On Wed, 2003-09-17 at 19:19, Havoc Pennington wrote:
> > + Four character header field names are already pretty obtuse and
> > annoying. I don't why its so important for these to be human
> > readable when the rest of the header isn't. Why not just make
> > this a UINT32 and give them each a "Conventional Name" too which
> > you would use to refer to it throughout the rest of the spec?
>
> Yeah, just having an enum would probably work fine. I buy that.
Okay, so here's a patch for this much at least ...
I've made the field name a BYTE so that we can jam the typecode in with
the field name saving ourselves four bytes per field, but perhaps we
should use the other two bytes for the field name too, just to give
ourselves more room for future expansion ?
Cheers,
Mark.
--=-h63doUAmTz1VM3KZ5Gv3
Content-Disposition: attachment; filename=dbus-enum-values-for-named-fields.diff
Content-Type: text/x-patch; name=dbus-enum-values-for-named-fields.diff; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Index: ChangeLog
===================================================================
RCS file: /cvs/dbus/dbus/ChangeLog,v
retrieving revision 1.390.2.35
diff -u -p -r1.390.2.35 ChangeLog
--- ChangeLog 17 Sep 2003 03:52:06 -0000 1.390.2.35
+++ ChangeLog 21 Sep 2003 17:09:59 -0000
@@ -0,0 +1,34 @@
+2003-09-21 Mark McLoughlin <mark@skynet.ie>
+
+ * doc/dbus-specification.sgml: Change the header field name
+ to be an enum and update the rest of the spec to reference
+ the fields using the conventinal name.
+
+ * dbus/dbus-protocol.h: update to reflect the spec.
+
+ * dbus/dbus-message.c: Remove the code to generalise the
+ header/body length and serial number header fields as named
+ header fields so we can reference field names using the
+ protocol values.
+ (append_int_field), (append_uint_field), (append_string_field):
+ Append the field name as a byte rather than four chars.
+ (delete_int_or_uint_field), (delete_string_field): reflect the
+ fact that the field name and typecode now occupy 4 bytes instead
+ of 8.
+ (decode_string_field), (decode_header_data): update to reflect
+ protocol changes and move the field specific encoding from
+ decode_string_field() back into decode_header_data().
+
+ * dbus/dbus-internals.[ch]: (_dbus_header_field_to_string):
+ Add utility to aid debugging.
+
+ * dbus/dbus-message-builder.c:
+ (append_string_field), (_dbus_message_data_load): Update to
+ reflect protocol changes; Change the FIELD_NAME directive
+ to HEADER_FIELD and allow it to take the field's conventional
+ name rather than the actual value.
+
+ * test/data/*/*.message: Update to use HEADER_FIELD instead
+ of FIELD_NAME; Always align the header on an 8 byte boundary
+ *before* updating the header length.
+
Index: dbus/dbus-internals.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-internals.c,v
retrieving revision 1.30.2.3
diff -u -p -r1.30.2.3 dbus-internals.c
--- dbus/dbus-internals.c 7 Sep 2003 23:04:52 -0000 1.30.2.3
+++ dbus/dbus-internals.c 21 Sep 2003 17:09:59 -0000
@@ -389,6 +389,38 @@ _dbus_type_to_string (int type)
}
}
+/**
+ * Returns a string describing the given name.
+ *
+ * @param header_field the field to describe
+ * @returns a constant string describing the field
+ */
+const char *
+_dbus_header_field_to_string (int header_field)
+{
+ switch (header_field)
+ {
+ case DBUS_HEADER_FIELD_INVALID:
+ return "invalid";
+ case DBUS_HEADER_FIELD_PATH:
+ return "path";
+ case DBUS_HEADER_FIELD_INTERFACE:
+ return "interface";
+ case DBUS_HEADER_FIELD_MEMBER:
+ return "member";
+ case DBUS_HEADER_FIELD_ERROR_NAME:
+ return "error-name";
+ case DBUS_HEADER_FIELD_REPLY_SERIAL:
+ return "reply-serial";
+ case DBUS_HEADER_FIELD_SERVICE:
+ return "service";
+ case DBUS_HEADER_FIELD_SENDER_SERVICE:
+ return "sender-service";
+ default:
+ return "unknown";
+ }
+}
+
#ifndef DBUS_DISABLE_CHECKS
/** String used in _dbus_return_if_fail macro */
const char _dbus_return_if_fail_warning_format[] =
Index: dbus/dbus-internals.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-internals.h,v
retrieving revision 1.36.2.6
diff -u -p -r1.36.2.6 dbus-internals.h
--- dbus/dbus-internals.h 17 Sep 2003 03:52:06 -0000 1.36.2.6
+++ dbus/dbus-internals.h 21 Sep 2003 17:09:59 -0000
@@ -184,7 +184,8 @@ void _dbus_verbose_bytes_of_string (cons
int len);
-const char* _dbus_type_to_string (int type);
+const char* _dbus_type_to_string (int type);
+const char* _dbus_header_field_to_string (int header_field);
extern const char _dbus_no_memory_message[];
#define _DBUS_SET_OOM(error) dbus_set_error ((error), DBUS_ERROR_NO_MEMORY, _dbus_no_memory_message)
Index: dbus/dbus-message-builder.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-message-builder.c,v
retrieving revision 1.18.2.5
diff -u -p -r1.18.2.5 dbus-message-builder.c
--- dbus/dbus-message-builder.c 7 Sep 2003 23:04:52 -0000 1.18.2.5
+++ dbus/dbus-message-builder.c 21 Sep 2003 17:09:59 -0000
@@ -294,7 +294,7 @@ message_type_from_string (const DBusStri
static dbus_bool_t
append_string_field (DBusString *dest,
int endian,
- const char *field_name,
+ int field,
int type,
const char *value)
{
@@ -306,9 +306,9 @@ append_string_field (DBusString *dest,
return FALSE;
}
- if (!_dbus_string_append (dest, field_name))
+ if (!_dbus_string_append_byte (dest, field))
{
- _dbus_warn ("couldn't append field name\n");
+ _dbus_warn ("couldn't append field name byte\n");
return FALSE;
}
@@ -363,7 +363,7 @@ append_string_field (DBusString *dest,
* (or if no START_LENGTH, absolute length)
* LENGTH <name> inserts the saved length of the same name
* CHOP <N> chops last N bytes off the data
- * FIELD_NAME <abcd> inserts 4-byte field name
+ * HEADER_FIELD <fieldname> inserts a header field name byte
* TYPE <typename> inserts a typecode byte
* @endcode
*
@@ -679,14 +679,34 @@ _dbus_message_data_load (DBusString
PERFORM_UNALIGN (dest);
}
else if (_dbus_string_starts_with_c_str (&line,
- "FIELD_NAME"))
+ "HEADER_FIELD"))
{
+ int field;
+
_dbus_string_delete_first_word (&line);
- if (_dbus_string_get_length (&line) != 4)
+ if (_dbus_string_starts_with_c_str (&line, "INVALID"))
+ field = DBUS_HEADER_FIELD_INVALID;
+ else if (_dbus_string_starts_with_c_str (&line, "PATH"))
+ field = DBUS_HEADER_FIELD_PATH;
+ else if (_dbus_string_starts_with_c_str (&line, "INTERFACE"))
+ field = DBUS_HEADER_FIELD_INTERFACE;
+ else if (_dbus_string_starts_with_c_str (&line, "MEMBER"))
+ field = DBUS_HEADER_FIELD_MEMBER;
+ else if (_dbus_string_starts_with_c_str (&line, "ERROR_NAME"))
+ field = DBUS_HEADER_FIELD_ERROR_NAME;
+ else if (_dbus_string_starts_with_c_str (&line, "REPLY_SERIAL"))
+ field = DBUS_HEADER_FIELD_REPLY_SERIAL;
+ else if (_dbus_string_starts_with_c_str (&line, "SERVICE"))
+ field = DBUS_HEADER_FIELD_SERVICE;
+ else if (_dbus_string_starts_with_c_str (&line, "SENDER_SERVICE"))
+ field = DBUS_HEADER_FIELD_SENDER_SERVICE;
+ else if (_dbus_string_starts_with_c_str (&line, "UNKNOWN"))
+ field = 22; /* random unknown header field */
+ else
{
- _dbus_warn ("Field name must be four characters not \"%s\"\n",
- _dbus_string_get_const_data (&line));
+ _dbus_warn ("%s is not a valid header field name\n",
+ _dbus_string_get_const_data (&line));
goto parse_failed;
}
@@ -694,10 +714,12 @@ _dbus_message_data_load (DBusString
unalign = FALSE;
else
_dbus_string_align_length (dest, 4);
-
- if (!_dbus_string_copy (&line, 0, dest,
- _dbus_string_get_length (dest)))
- goto parse_failed;
+
+ if (!_dbus_string_append_byte (dest, field))
+ {
+ _dbus_warn ("could not append header field name byte\n");
+ goto parse_failed;
+ }
}
else if (_dbus_string_starts_with_c_str (&line,
"TYPE"))
Index: dbus/dbus-message.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-message.c,v
retrieving revision 1.102.2.10
diff -u -p -r1.102.2.10 dbus-message.c
--- dbus/dbus-message.c 7 Sep 2003 23:04:52 -0000 1.102.2.10
+++ dbus/dbus-message.c 21 Sep 2003 17:09:59 -0000
@@ -42,36 +42,6 @@
* @{
*/
-enum
-{
- FIELD_HEADER_LENGTH,
- FIELD_BODY_LENGTH,
- FIELD_CLIENT_SERIAL,
- FIELD_PATH,
- FIELD_INTERFACE,
- FIELD_MEMBER,
- FIELD_ERROR_NAME,
- FIELD_SERVICE,
- FIELD_SENDER_SERVICE,
- FIELD_REPLY_SERIAL,
-
- FIELD_LAST
-};
-
-static dbus_bool_t field_is_named[FIELD_LAST] =
-{
- FALSE, /* FIELD_HEADER_LENGTH */
- FALSE, /* FIELD_BODY_LENGTH */
- FALSE, /* FIELD_CLIENT_SERIAL */
- TRUE, /* FIELD_PATH */
- TRUE, /* FIELD_INTERFACE */
- TRUE, /* FIELD_MEMBER */
- TRUE, /* FIELD_ERROR_NAME */
- TRUE, /* FIELD_SERVICE */
- TRUE, /* FIELD_SENDER_SERVICE */
- TRUE /* FIELD_REPLY_SERIAL */
-};
-
/**
* Cached information about a header field in the message
*/
@@ -83,13 +53,20 @@ typedef struct
} HeaderField;
/** Offset to byte order from start of header */
-#define BYTE_ORDER_OFFSET 0
+#define BYTE_ORDER_OFFSET 0
/** Offset to type from start of header */
-#define TYPE_OFFSET 1
+#define TYPE_OFFSET 1
/** Offset to flags from start of header */
-#define FLAGS_OFFSET 2
+#define FLAGS_OFFSET 2
/** Offset to version from start of header */
-#define VERSION_OFFSET 3
+#define VERSION_OFFSET 3
+/** Offset to header length from start of header */
+#define HEADER_LENGTH_OFFSET 4
+/** Offset to body length from start of header */
+#define BODY_LENGTH_OFFSET 8
+/** Offset to client serial from start of header */
+#define CLIENT_SERIAL_OFFSET 12
+
/**
* @brief Internals of DBusMessage
@@ -107,9 +84,9 @@ struct DBusMessage
* independently realloc it.
*/
- HeaderField header_fields[FIELD_LAST]; /**< Track the location
- * of each field in "header"
- */
+ HeaderField header_fields[DBUS_HEADER_FIELD_LAST + 1]; /**< Track the location
+ * of each field in "header"
+ */
dbus_uint32_t client_serial; /**< Cached client serial value for speed */
dbus_uint32_t reply_serial; /**< Cached reply serial value for speed */
@@ -217,7 +194,7 @@ adjust_field_offsets (DBusMessage *messa
return;
i = 0;
- while (i < FIELD_LAST)
+ while (i <= DBUS_HEADER_FIELD_LAST)
{
if (message->header_fields[i].offset > offsets_after)
message->header_fields[i].offset += delta;
@@ -234,7 +211,7 @@ get_int_field (DBusMessage *message,
{
int offset;
- _dbus_assert (field < FIELD_LAST);
+ _dbus_assert (field <= DBUS_HEADER_FIELD_LAST);
offset = message->header_fields[field].offset;
@@ -254,7 +231,7 @@ get_uint_field (DBusMessage *message,
{
int offset;
- _dbus_assert (field < FIELD_LAST);
+ _dbus_assert (field <= DBUS_HEADER_FIELD_LAST);
offset = message->header_fields[field].offset;
@@ -277,7 +254,7 @@ get_string_field (DBusMessage *message,
offset = message->header_fields[field].offset;
- _dbus_assert (field < FIELD_LAST);
+ _dbus_assert (field <= DBUS_HEADER_FIELD_LAST);
if (offset < 0)
return NULL;
@@ -308,7 +285,7 @@ get_path_field_decomposed (DBusMessage
offset = message->header_fields[field].offset;
- _dbus_assert (field < FIELD_LAST);
+ _dbus_assert (field <= DBUS_HEADER_FIELD_LAST);
if (offset < 0)
{
@@ -327,7 +304,6 @@ get_path_field_decomposed (DBusMessage
static dbus_bool_t
append_int_field (DBusMessage *message,
int field,
- const char *name,
int value)
{
int orig_len;
@@ -341,7 +317,7 @@ append_int_field (DBusMessage *message,
if (!_dbus_string_align_length (&message->header, 4))
goto failed;
- if (!_dbus_string_append_len (&message->header, name, 4))
+ if (!_dbus_string_append_byte (&message->header, field))
goto failed;
if (!_dbus_string_append_byte (&message->header, DBUS_TYPE_INT32))
@@ -378,8 +354,7 @@ append_int_field (DBusMessage *message,
static dbus_bool_t
append_uint_field (DBusMessage *message,
int field,
- const char *name,
- int value)
+ int value)
{
int orig_len;
@@ -392,7 +367,7 @@ append_uint_field (DBusMessage *message,
if (!_dbus_string_align_length (&message->header, 4))
goto failed;
- if (!_dbus_string_append_len (&message->header, name, 4))
+ if (!_dbus_string_append_byte (&message->header, field))
goto failed;
if (!_dbus_string_append_byte (&message->header, DBUS_TYPE_UINT32))
@@ -429,7 +404,6 @@ static dbus_bool_t
append_string_field (DBusMessage *message,
int field,
int type,
- const char *name,
const char *value)
{
int orig_len;
@@ -443,7 +417,7 @@ append_string_field (DBusMessage *messag
if (!_dbus_string_align_length (&message->header, 4))
goto failed;
- if (!_dbus_string_append_len (&message->header, name, 4))
+ if (!_dbus_string_append_byte (&message->header, field))
goto failed;
if (!_dbus_string_append_byte (&message->header, type))
@@ -488,23 +462,22 @@ delete_int_or_uint_field (DBusMessage *m
int offset = message->header_fields[field].offset;
_dbus_assert (!message->locked);
- _dbus_assert (field_is_named[field]);
if (offset < 0)
return;
clear_header_padding (message);
- /* The field typecode and name take up 8 bytes */
+ /* The field typecode and name take up 4 bytes */
_dbus_string_delete (&message->header,
- offset - 8,
- 12);
+ offset - 4,
+ 8);
message->header_fields[field].offset = -1;
adjust_field_offsets (message,
- offset - 8,
- - 12);
+ offset - 4,
+ - 8);
append_header_padding (message);
}
@@ -519,7 +492,6 @@ delete_string_field (DBusMessage *messag
int delete_len;
_dbus_assert (!message->locked);
- _dbus_assert (field_is_named[field]);
if (offset < 0)
return;
@@ -528,19 +500,19 @@ delete_string_field (DBusMessage *messag
get_string_field (message, field, &len);
- /* The field typecode and name take up 8 bytes, and the nul
+ /* The field typecode and name take up 4 bytes, and the nul
* termination is 1 bytes, string length integer is 4 bytes
*/
- delete_len = 8 + 4 + 1 + len;
+ delete_len = 4 + 4 + 1 + len;
_dbus_string_delete (&message->header,
- offset - 8,
+ offset - 4,
delete_len);
message->header_fields[field].offset = -1;
adjust_field_offsets (message,
- offset - 8,
+ offset - 4,
- delete_len);
append_header_padding (message);
@@ -593,10 +565,9 @@ set_uint_field (DBusMessage *message,
switch (field)
{
- case FIELD_REPLY_SERIAL:
- return append_uint_field (message, field,
- DBUS_HEADER_FIELD_REPLY,
- value);
+ case DBUS_HEADER_FIELD_REPLY_SERIAL:
+ return append_uint_field (message, field, value);
+
default:
_dbus_assert_not_reached ("appending a uint field we don't support appending");
return FALSE;
@@ -629,30 +600,14 @@ set_string_field (DBusMessage *message,
switch (field)
{
- case FIELD_PATH:
- return append_string_field (message, field, type,
- DBUS_HEADER_FIELD_PATH,
- value);
- case FIELD_SENDER_SERVICE:
- return append_string_field (message, field, type,
- DBUS_HEADER_FIELD_SENDER_SERVICE,
- value);
- case FIELD_INTERFACE:
- return append_string_field (message, field, type,
- DBUS_HEADER_FIELD_INTERFACE,
- value);
- case FIELD_MEMBER:
- return append_string_field (message, field, type,
- DBUS_HEADER_FIELD_MEMBER,
- value);
- case FIELD_ERROR_NAME:
- return append_string_field (message, field, type,
- DBUS_HEADER_FIELD_ERROR_NAME,
- value);
- case FIELD_SERVICE:
- return append_string_field (message, field, type,
- DBUS_HEADER_FIELD_SERVICE,
- value);
+ case DBUS_HEADER_FIELD_PATH:
+ case DBUS_HEADER_FIELD_SENDER_SERVICE:
+ case DBUS_HEADER_FIELD_INTERFACE:
+ case DBUS_HEADER_FIELD_MEMBER:
+ case DBUS_HEADER_FIELD_ERROR_NAME:
+ case DBUS_HEADER_FIELD_SERVICE:
+ return append_string_field (message, field, type, value);
+
default:
_dbus_assert_not_reached ("appending a string field we don't support appending");
return FALSE;
@@ -714,9 +669,12 @@ _dbus_message_set_serial (DBusMessage *
{
_dbus_assert (!message->locked);
_dbus_assert (dbus_message_get_serial (message) == 0);
-
- set_uint_field (message, FIELD_CLIENT_SERIAL,
- serial);
+
+ _dbus_marshal_set_uint32 (&message->header,
+ message->byte_order,
+ CLIENT_SERIAL_OFFSET,
+ serial);
+
message->client_serial = serial;
}
@@ -734,7 +692,8 @@ dbus_message_set_reply_serial (DBusMessa
{
_dbus_assert (!message->locked);
- if (set_uint_field (message, FIELD_REPLY_SERIAL,
+ if (set_uint_field (message,
+ DBUS_HEADER_FIELD_REPLY_SERIAL,
reply_serial))
{
message->reply_serial = reply_serial;
@@ -894,15 +853,12 @@ dbus_message_create_header (DBusMessage
if (!_dbus_string_append_byte (&message->header, DBUS_MAJOR_PROTOCOL_VERSION))
return FALSE;
- message->header_fields[FIELD_HEADER_LENGTH].offset = 4;
if (!_dbus_marshal_uint32 (&message->header, message->byte_order, 0))
return FALSE;
- message->header_fields[FIELD_BODY_LENGTH].offset = 8;
if (!_dbus_marshal_uint32 (&message->header, message->byte_order, 0))
return FALSE;
- message->header_fields[FIELD_CLIENT_SERIAL].offset = 12;
if (!_dbus_marshal_int32 (&message->header, message->byte_order, -1))
return FALSE;
@@ -911,8 +867,8 @@ dbus_message_create_header (DBusMessage
if (path != NULL)
{
if (!append_string_field (message,
- FIELD_PATH, DBUS_TYPE_OBJECT_PATH,
DBUS_HEADER_FIELD_PATH,
+ DBUS_TYPE_OBJECT_PATH,
path))
return FALSE;
}
@@ -920,8 +876,8 @@ dbus_message_create_header (DBusMessage
if (service != NULL)
{
if (!append_string_field (message,
- FIELD_SERVICE, DBUS_TYPE_STRING,
DBUS_HEADER_FIELD_SERVICE,
+ DBUS_TYPE_STRING,
service))
return FALSE;
}
@@ -929,8 +885,8 @@ dbus_message_create_header (DBusMessage
if (interface != NULL)
{
if (!append_string_field (message,
- FIELD_INTERFACE, DBUS_TYPE_STRING,
DBUS_HEADER_FIELD_INTERFACE,
+ DBUS_TYPE_STRING,
interface))
return FALSE;
}
@@ -938,8 +894,8 @@ dbus_message_create_header (DBusMessage
if (member != NULL)
{
if (!append_string_field (message,
- FIELD_MEMBER, DBUS_TYPE_STRING,
DBUS_HEADER_FIELD_MEMBER,
+ DBUS_TYPE_STRING,
member))
return FALSE;
}
@@ -947,8 +903,8 @@ dbus_message_create_header (DBusMessage
if (error_name != NULL)
{
if (!append_string_field (message,
- FIELD_ERROR_NAME, DBUS_TYPE_STRING,
DBUS_HEADER_FIELD_ERROR_NAME,
+ DBUS_TYPE_STRING,
error_name))
return FALSE;
}
@@ -971,13 +927,15 @@ _dbus_message_lock (DBusMessage *messag
if (!message->locked)
{
/* Fill in our lengths */
- set_uint_field (message,
- FIELD_HEADER_LENGTH,
- _dbus_string_get_length (&message->header));
-
- set_uint_field (message,
- FIELD_BODY_LENGTH,
- _dbus_string_get_length (&message->body));
+ _dbus_marshal_set_uint32 (&message->header,
+ message->byte_order,
+ HEADER_LENGTH_OFFSET,
+ _dbus_string_get_length (&message->header));
+
+ _dbus_marshal_set_uint32 (&message->header,
+ message->byte_order,
+ BODY_LENGTH_OFFSET,
+ _dbus_string_get_length (&message->body));
message->locked = TRUE;
}
@@ -1023,7 +981,7 @@ dbus_message_new_empty_header (void)
_dbus_data_slot_list_init (&message->slot_list);
i = 0;
- while (i < FIELD_LAST)
+ while (i <= DBUS_HEADER_FIELD_LAST)
{
message->header_fields[i].offset = -1;
++i;
@@ -1136,7 +1094,8 @@ dbus_message_new_method_return (DBusMess
_dbus_return_val_if_fail (method_call != NULL, NULL);
sender = get_string_field (method_call,
- FIELD_SENDER_SERVICE, NULL);
+ DBUS_HEADER_FIELD_SENDER_SERVICE,
+ NULL);
/* sender is allowed to be null here in peer-to-peer case */
@@ -1222,7 +1181,8 @@ dbus_message_new_error (DBusMessage *rep
_dbus_return_val_if_fail (error_name != NULL, NULL);
sender = get_string_field (reply_to,
- FIELD_SENDER_SERVICE, NULL);
+ DBUS_HEADER_FIELD_SENDER_SERVICE,
+ NULL);
/* sender may be NULL for non-message-bus case or
* when the message bus is dealing with an unregistered
@@ -1319,7 +1279,7 @@ dbus_message_copy (const DBusMessage *me
return NULL;
}
- for (i = 0; i < FIELD_LAST; i++)
+ for (i = 0; i <= DBUS_HEADER_FIELD_LAST; i++)
{
retval->header_fields[i].offset = message->header_fields[i].offset;
}
@@ -1430,13 +1390,13 @@ dbus_message_set_path (DBusMessage *me
if (object_path == NULL)
{
- delete_string_field (message, FIELD_PATH);
+ delete_string_field (message, DBUS_HEADER_FIELD_PATH);
return TRUE;
}
else
{
return set_string_field (message,
- FIELD_PATH,
+ DBUS_HEADER_FIELD_PATH,
DBUS_TYPE_OBJECT_PATH,
object_path);
}
@@ -1455,7 +1415,7 @@ dbus_message_get_path (DBusMessage *me
{
_dbus_return_val_if_fail (message != NULL, NULL);
- return get_string_field (message, FIELD_PATH, NULL);
+ return get_string_field (message, DBUS_HEADER_FIELD_PATH, NULL);
}
/**
@@ -1480,7 +1440,8 @@ dbus_message_get_path_decomposed (DBusMe
_dbus_return_val_if_fail (message != NULL, FALSE);
_dbus_return_val_if_fail (path != NULL, FALSE);
- return get_path_field_decomposed (message, FIELD_PATH,
+ return get_path_field_decomposed (message,
+ DBUS_HEADER_FIELD_PATH,
path);
}
@@ -1503,13 +1464,13 @@ dbus_message_set_interface (DBusMessage
if (interface == NULL)
{
- delete_string_field (message, FIELD_INTERFACE);
+ delete_string_field (message, DBUS_HEADER_FIELD_INTERFACE);
return TRUE;
}
else
{
return set_string_field (message,
- FIELD_INTERFACE,
+ DBUS_HEADER_FIELD_INTERFACE,
DBUS_TYPE_STRING,
interface);
}
@@ -1529,7 +1490,7 @@ dbus_message_get_interface (DBusMessage
{
_dbus_return_val_if_fail (message != NULL, NULL);
- return get_string_field (message, FIELD_INTERFACE, NULL);
+ return get_string_field (message, DBUS_HEADER_FIELD_INTERFACE, NULL);
}
/**
@@ -1551,13 +1512,13 @@ dbus_message_set_member (DBusMessage *m
if (member == NULL)
{
- delete_string_field (message, FIELD_MEMBER);
+ delete_string_field (message, DBUS_HEADER_FIELD_MEMBER);
return TRUE;
}
else
{
return set_string_field (message,
- FIELD_MEMBER,
+ DBUS_HEADER_FIELD_MEMBER,
DBUS_TYPE_STRING,
member);
}
@@ -1576,7 +1537,9 @@ dbus_message_get_member (DBusMessage *me
{
_dbus_return_val_if_fail (message != NULL, NULL);
- return get_string_field (message, FIELD_MEMBER, NULL);
+ return get_string_field (message,
+ DBUS_HEADER_FIELD_MEMBER,
+ NULL);
}
/**
@@ -1596,13 +1559,14 @@ dbus_message_set_error_name (DBusMessage
if (error_name == NULL)
{
- delete_string_field (message, FIELD_ERROR_NAME);
+ delete_string_field (message,
+ DBUS_HEADER_FIELD_ERROR_NAME);
return TRUE;
}
else
{
return set_string_field (message,
- FIELD_ERROR_NAME,
+ DBUS_HEADER_FIELD_ERROR_NAME,
DBUS_TYPE_STRING,
error_name);
}
@@ -1619,7 +1583,9 @@ dbus_message_get_error_name (DBusMessage
{
_dbus_return_val_if_fail (message != NULL, NULL);
- return get_string_field (message, FIELD_ERROR_NAME, NULL);
+ return get_string_field (message,
+ DBUS_HEADER_FIELD_ERROR_NAME,
+ NULL);
}
/**
@@ -1638,13 +1604,13 @@ dbus_message_set_destination (DBusMessag
if (destination == NULL)
{
- delete_string_field (message, FIELD_SERVICE);
+ delete_string_field (message, DBUS_HEADER_FIELD_SERVICE);
return TRUE;
}
else
{
return set_string_field (message,
- FIELD_SERVICE,
+ DBUS_HEADER_FIELD_SERVICE,
DBUS_TYPE_STRING,
destination);
}
@@ -1661,7 +1627,9 @@ dbus_message_get_destination (DBusMessag
{
_dbus_return_val_if_fail (message != NULL, NULL);
- return get_string_field (message, FIELD_SERVICE, NULL);
+ return get_string_field (message,
+ DBUS_HEADER_FIELD_SERVICE,
+ NULL);
}
/**
@@ -4113,13 +4081,14 @@ dbus_message_set_sender (DBusMessage *m
if (sender == NULL)
{
- delete_string_field (message, FIELD_SENDER_SERVICE);
+ delete_string_field (message,
+ DBUS_HEADER_FIELD_SENDER_SERVICE);
return TRUE;
}
else
{
return set_string_field (message,
- FIELD_SENDER_SERVICE,
+ DBUS_HEADER_FIELD_SENDER_SERVICE,
DBUS_TYPE_STRING,
sender);
}
@@ -4183,7 +4152,9 @@ dbus_message_get_sender (DBusMessage *me
{
_dbus_return_val_if_fail (message != NULL, NULL);
- return get_string_field (message, FIELD_SENDER_SERVICE, NULL);
+ return get_string_field (message,
+ DBUS_HEADER_FIELD_SENDER_SERVICE,
+ NULL);
}
static dbus_bool_t
@@ -4566,63 +4537,31 @@ _dbus_message_loader_get_buffer (DBusMes
*/
#define DBUS_MINIMUM_HEADER_SIZE 16
-/** Pack four characters as in "abcd" into a uint32 */
-#define FOUR_CHARS_TO_UINT32(a, b, c, d) \
- ((((dbus_uint32_t)a) << 24) | \
- (((dbus_uint32_t)b) << 16) | \
- (((dbus_uint32_t)c) << 8) | \
- ((dbus_uint32_t)d))
-
-/** DBUS_HEADER_FIELD_PATH packed into a dbus_uint32_t */
-#define DBUS_HEADER_FIELD_PATH_AS_UINT32 \
- FOUR_CHARS_TO_UINT32 ('p', 'a', 't', 'h')
-
-/** DBUS_HEADER_FIELD_INTERFACE packed into a dbus_uint32_t */
-#define DBUS_HEADER_FIELD_INTERFACE_AS_UINT32 \
- FOUR_CHARS_TO_UINT32 ('i', 'f', 'c', 'e')
-
-/** DBUS_HEADER_FIELD_MEMBER packed into a dbus_uint32_t */
-#define DBUS_HEADER_FIELD_MEMBER_AS_UINT32 \
- FOUR_CHARS_TO_UINT32 ('m', 'e', 'b', 'r')
-
-/** DBUS_HEADER_FIELD_ERROR_NAME packed into a dbus_uint32_t */
-#define DBUS_HEADER_FIELD_ERROR_NAME_AS_UINT32 \
- FOUR_CHARS_TO_UINT32 ('e', 'r', 'n', 'm')
-
-/** DBUS_HEADER_FIELD_SERVICE packed into a dbus_uint32_t */
-#define DBUS_HEADER_FIELD_SERVICE_AS_UINT32 \
- FOUR_CHARS_TO_UINT32 ('s', 'r', 'v', 'c')
-
-/** DBUS_HEADER_FIELD_REPLY packed into a dbus_uint32_t */
-#define DBUS_HEADER_FIELD_REPLY_AS_UINT32 \
- FOUR_CHARS_TO_UINT32 ('r', 'p', 'l', 'y')
-
-/** DBUS_HEADER_FIELD_SENDER_SERVICE Packed into a dbus_uint32_t */
-#define DBUS_HEADER_FIELD_SENDER_SERVICE_AS_UINT32 \
- FOUR_CHARS_TO_UINT32 ('s', 'd', 'r', 's')
-
static dbus_bool_t
decode_string_field (const DBusString *data,
- HeaderField fields[FIELD_LAST],
+ int field,
+ HeaderField *header_field,
+ DBusString *field_data,
int pos,
- int type,
- int field,
- const char *field_name)
+ int type)
{
- DBusString tmp;
int string_data_pos;
+
+ _dbus_assert (header_field != NULL);
+ _dbus_assert (field_data != NULL);
- if (fields[field].offset >= 0)
+ if (header_field->offset >= 0)
{
_dbus_verbose ("%s field provided twice\n",
- field_name);
+ _dbus_header_field_to_string (field));
return FALSE;
}
if (type != DBUS_TYPE_STRING)
{
_dbus_verbose ("%s field has wrong type %s\n",
- field_name, _dbus_type_to_string (type));
+ _dbus_header_field_to_string (field),
+ _dbus_type_to_string (type));
return FALSE;
}
@@ -4633,63 +4572,15 @@ decode_string_field (const DBusString
string_data_pos = _DBUS_ALIGN_VALUE (pos, 4) + 4;
_dbus_assert (string_data_pos < _dbus_string_get_length (data));
- _dbus_string_init_const (&tmp,
+ _dbus_string_init_const (field_data,
_dbus_string_get_const_data (data) + string_data_pos);
- if (field == FIELD_INTERFACE)
- {
- if (!_dbus_string_validate_interface (&tmp, 0, _dbus_string_get_length (&tmp)))
- {
- _dbus_verbose ("%s field has invalid content \"%s\"\n",
- field_name, _dbus_string_get_const_data (&tmp));
- return FALSE;
- }
-
- if (_dbus_string_equal_c_str (&tmp,
- DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL))
- {
- _dbus_verbose ("Message is on the local interface\n");
- return FALSE;
- }
- }
- else if (field == FIELD_MEMBER)
- {
- if (!_dbus_string_validate_member (&tmp, 0, _dbus_string_get_length (&tmp)))
- {
- _dbus_verbose ("%s field has invalid content \"%s\"\n",
- field_name, _dbus_string_get_const_data (&tmp));
- return FALSE;
- }
- }
- else if (field == FIELD_ERROR_NAME)
- {
- if (!_dbus_string_validate_error_name (&tmp, 0, _dbus_string_get_length (&tmp)))
- {
- _dbus_verbose ("%s field has invalid content \"%s\"\n",
- field_name, _dbus_string_get_const_data (&tmp));
- return FALSE;
- }
- }
- else if (field == FIELD_SERVICE ||
- field == FIELD_SENDER_SERVICE)
- {
- if (!_dbus_string_validate_service (&tmp, 0, _dbus_string_get_length (&tmp)))
- {
- _dbus_verbose ("%s field has invalid content \"%s\"\n",
- field_name, _dbus_string_get_const_data (&tmp));
- return FALSE;
- }
- }
- else
- {
- _dbus_assert_not_reached ("Unknown field\n");
- }
-
- fields[field].offset = _DBUS_ALIGN_VALUE (pos, 4);
+ header_field->offset = _DBUS_ALIGN_VALUE (pos, 4);
#if 0
- _dbus_verbose ("Found field %s name at offset %d\n",
- field_name, fields[field].offset);
+ _dbus_verbose ("Found field %s at offset %d\n",
+ _dbus_header_field_to_string (field),
+ header_field->offset);
#endif
return TRUE;
@@ -4700,12 +4591,13 @@ decode_header_data (const DBusString *
int header_len,
int byte_order,
int message_type,
- HeaderField fields[FIELD_LAST],
+ HeaderField fields[DBUS_HEADER_FIELD_LAST + 1],
int *message_padding)
{
- const char *field;
+ DBusString field_data;
int pos, new_pos;
int i;
+ int field;
int type;
if (header_len < 16)
@@ -4715,38 +4607,32 @@ decode_header_data (const DBusString *
}
i = 0;
- while (i < FIELD_LAST)
+ while (i <= DBUS_HEADER_FIELD_LAST)
{
fields[i].offset = -1;
++i;
}
- fields[FIELD_HEADER_LENGTH].offset = 4;
- fields[FIELD_BODY_LENGTH].offset = 8;
- fields[FIELD_CLIENT_SERIAL].offset = 12;
-
- /* Now handle the named fields. A real named field is at least 4
- * bytes for the name, plus a type code (1 byte) plus padding. So
- * if we have less than 8 bytes left, it must be alignment padding,
- * not a field. While >= 8 bytes can't be entirely alignment
- * padding.
+ /* Now handle the named fields. A real named field is at least 1
+ * byte for the name, plus a type code (1 byte) plus padding, plus
+ * the field value. So if we have less than 8 bytes left, it must
+ * be alignment padding, not a field. While >= 8 bytes can't be
+ * entirely alignment padding.
*/
pos = 16;
while ((pos + 7) < header_len)
{
pos = _DBUS_ALIGN_VALUE (pos, 4);
- if ((pos + 4) > header_len)
+ if ((pos + 1) > header_len)
{
_dbus_verbose ("not enough space remains in header for header field value\n");
return FALSE;
}
- field = _dbus_string_get_const_data_len (data, pos, 4);
- pos += 4;
+ field = _dbus_string_get_byte (data, pos);
+ pos += 1;
- _dbus_assert (_DBUS_ALIGN_ADDRESS (field, 4) == field);
-
if (!_dbus_marshal_validate_type (data, pos, &type, &pos))
{
_dbus_verbose ("Failed to validate type of named header field\n");
@@ -4765,71 +4651,112 @@ decode_header_data (const DBusString *
return FALSE;
}
- switch (DBUS_UINT32_FROM_BE (*(int*)field))
+ switch (field)
{
- case DBUS_HEADER_FIELD_SERVICE_AS_UINT32:
- if (!decode_string_field (data, fields, pos, type,
- FIELD_SERVICE,
- DBUS_HEADER_FIELD_SERVICE))
+ case DBUS_HEADER_FIELD_SERVICE:
+ if (!decode_string_field (data, field, &fields[field],
+ &field_data, pos, type))
return FALSE;
+
+ if (!_dbus_string_validate_service (&field_data, 0,
+ _dbus_string_get_length (&field_data)))
+ {
+ _dbus_verbose ("service field has invalid content \"%s\"\n",
+ _dbus_string_get_const_data (&field_data));
+ return FALSE;
+ }
break;
- case DBUS_HEADER_FIELD_INTERFACE_AS_UINT32:
- if (!decode_string_field (data, fields, pos, type,
- FIELD_INTERFACE,
- DBUS_HEADER_FIELD_INTERFACE))
+ case DBUS_HEADER_FIELD_INTERFACE:
+ if (!decode_string_field (data, field, &fields[field],
+ &field_data, pos, type))
return FALSE;
+
+ if (!_dbus_string_validate_interface (&field_data, 0,
+ _dbus_string_get_length (&field_data)))
+ {
+ _dbus_verbose ("interface field has invalid content \"%s\"\n",
+ _dbus_string_get_const_data (&field_data));
+ return FALSE;
+ }
+
+ if (_dbus_string_equal_c_str (&field_data,
+ DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL))
+ {
+ _dbus_verbose ("Message is on the local interface\n");
+ return FALSE;
+ }
break;
- case DBUS_HEADER_FIELD_MEMBER_AS_UINT32:
- if (!decode_string_field (data, fields, pos, type,
- FIELD_MEMBER,
- DBUS_HEADER_FIELD_MEMBER))
+ case DBUS_HEADER_FIELD_MEMBER:
+ if (!decode_string_field (data, field, &fields[field],
+ &field_data, pos, type))
return FALSE;
+
+ if (!_dbus_string_validate_member (&field_data, 0,
+ _dbus_string_get_length (&field_data)))
+ {
+ _dbus_verbose ("member field has invalid content \"%s\"\n",
+ _dbus_string_get_const_data (&field_data));
+ return FALSE;
+ }
break;
- case DBUS_HEADER_FIELD_ERROR_NAME_AS_UINT32:
- if (!decode_string_field (data, fields, pos, type,
- FIELD_ERROR_NAME,
- DBUS_HEADER_FIELD_ERROR_NAME))
+ case DBUS_HEADER_FIELD_ERROR_NAME:
+ if (!decode_string_field (data, field, &fields[field],
+ &field_data, pos, type))
return FALSE;
+
+ if (!_dbus_string_validate_error_name (&field_data, 0,
+ _dbus_string_get_length (&field_data)))
+ {
+ _dbus_verbose ("error-name field has invalid content \"%s\"\n",
+ _dbus_string_get_const_data (&field_data));
+ return FALSE;
+ }
break;
- case DBUS_HEADER_FIELD_SENDER_SERVICE_AS_UINT32:
- if (!decode_string_field (data, fields, pos, type,
- FIELD_SENDER_SERVICE,
- DBUS_HEADER_FIELD_SENDER_SERVICE))
+ case DBUS_HEADER_FIELD_SENDER_SERVICE:
+ if (!decode_string_field (data, field, &fields[field],
+ &field_data, pos, type))
return FALSE;
+
+ if (!_dbus_string_validate_service (&field_data, 0,
+ _dbus_string_get_length (&field_data)))
+ {
+ _dbus_verbose ("sender-service field has invalid content \"%s\"\n",
+ _dbus_string_get_const_data (&field_data));
+ return FALSE;
+ }
break;
- case DBUS_HEADER_FIELD_PATH_AS_UINT32:
+ case DBUS_HEADER_FIELD_PATH:
/* Path was already validated as part of standard
* type validation, since there's an OBJECT_PATH
* type.
*/
- if (fields[FIELD_PATH].offset >= 0)
+ if (fields[field].offset >= 0)
{
- _dbus_verbose ("%s field provided twice\n",
- DBUS_HEADER_FIELD_PATH);
+ _dbus_verbose ("path field provided twice\n");
return FALSE;
}
if (type != DBUS_TYPE_OBJECT_PATH)
{
- _dbus_verbose ("%s field has wrong type\n", DBUS_HEADER_FIELD_PATH);
+ _dbus_verbose ("path field has wrong type\n");
return FALSE;
}
- fields[FIELD_PATH].offset = _DBUS_ALIGN_VALUE (pos, 4);
+ fields[field].offset = _DBUS_ALIGN_VALUE (pos, 4);
/* No forging signals from the local path */
{
const char *s;
s = _dbus_string_get_const_data_len (data,
- fields[FIELD_PATH].offset,
+ fields[field].offset,
_dbus_string_get_length (data) -
- fields[FIELD_PATH].offset);
+ fields[field].offset);
if (strcmp (s, DBUS_PATH_ORG_FREEDESKTOP_LOCAL) == 0)
{
_dbus_verbose ("Message is on the local path\n");
@@ -4838,31 +4765,30 @@ decode_header_data (const DBusString *
}
_dbus_verbose ("Found path at offset %d\n",
- fields[FIELD_PATH].offset);
+ fields[field].offset);
break;
- case DBUS_HEADER_FIELD_REPLY_AS_UINT32:
- if (fields[FIELD_REPLY_SERIAL].offset >= 0)
+ case DBUS_HEADER_FIELD_REPLY_SERIAL:
+ if (fields[field].offset >= 0)
{
- _dbus_verbose ("%s field provided twice\n",
- DBUS_HEADER_FIELD_REPLY);
+ _dbus_verbose ("reply field provided twice\n");
return FALSE;
}
if (type != DBUS_TYPE_UINT32)
{
- _dbus_verbose ("%s field has wrong type\n", DBUS_HEADER_FIELD_REPLY);
+ _dbus_verbose ("reply field has wrong type\n");
return FALSE;
}
- fields[FIELD_REPLY_SERIAL].offset = _DBUS_ALIGN_VALUE (pos, 4);
+ fields[field].offset = _DBUS_ALIGN_VALUE (pos, 4);
_dbus_verbose ("Found reply serial at offset %d\n",
- fields[FIELD_REPLY_SERIAL].offset);
+ fields[field].offset);
break;
default:
- _dbus_verbose ("Ignoring an unknown header field: %.4s at offset %d\n",
+ _dbus_verbose ("Ignoring an unknown header field: %d at offset %d\n",
field, pos);
}
@@ -4887,31 +4813,27 @@ decode_header_data (const DBusString *
{
case DBUS_MESSAGE_TYPE_SIGNAL:
case DBUS_MESSAGE_TYPE_METHOD_CALL:
- if (fields[FIELD_PATH].offset < 0)
+ if (fields[DBUS_HEADER_FIELD_PATH].offset < 0)
{
- _dbus_verbose ("No %s field provided\n",
- DBUS_HEADER_FIELD_PATH);
+ _dbus_verbose ("No path field provided\n");
return FALSE;
}
/* FIXME make this optional, at least for method calls */
- if (fields[FIELD_INTERFACE].offset < 0)
+ if (fields[DBUS_HEADER_FIELD_INTERFACE].offset < 0)
{
- _dbus_verbose ("No %s field provided\n",
- DBUS_HEADER_FIELD_INTERFACE);
+ _dbus_verbose ("No interface field provided\n");
return FALSE;
}
- if (fields[FIELD_MEMBER].offset < 0)
+ if (fields[DBUS_HEADER_FIELD_MEMBER].offset < 0)
{
- _dbus_verbose ("No %s field provided\n",
- DBUS_HEADER_FIELD_MEMBER);
+ _dbus_verbose ("No member field provided\n");
return FALSE;
}
break;
case DBUS_MESSAGE_TYPE_ERROR:
- if (fields[FIELD_ERROR_NAME].offset < 0)
+ if (fields[DBUS_HEADER_FIELD_ERROR_NAME].offset < 0)
{
- _dbus_verbose ("No %s field provided\n",
- DBUS_HEADER_FIELD_ERROR_NAME);
+ _dbus_verbose ("No error-name field provided\n");
return FALSE;
}
break;
@@ -5056,7 +4978,7 @@ _dbus_message_loader_queue_messages (DBu
if (_dbus_string_get_length (&loader->data) >= (header_len + body_len))
{
- HeaderField fields[FIELD_LAST];
+ HeaderField fields[DBUS_HEADER_FIELD_LAST + 1];
int i;
int next_arg;
@@ -5123,7 +5045,7 @@ _dbus_message_loader_queue_messages (DBu
/* Copy in the offsets we found */
i = 0;
- while (i < FIELD_LAST)
+ while (i <= DBUS_HEADER_FIELD_LAST)
{
message->header_fields[i] = fields[i];
++i;
@@ -5173,9 +5095,12 @@ _dbus_message_loader_queue_messages (DBu
* earlier)
*/
message->reply_serial = get_uint_field (message,
- FIELD_REPLY_SERIAL);
- message->client_serial = get_uint_field (message,
- FIELD_CLIENT_SERIAL);
+ DBUS_HEADER_FIELD_REPLY_SERIAL);
+
+ message->client_serial = _dbus_demarshal_uint32 (&message->header,
+ message->byte_order,
+ CLIENT_SERIAL_OFFSET,
+ NULL);
_dbus_verbose ("Loaded message %p\n", message);
}
@@ -5751,8 +5676,10 @@ check_message_handling (DBusMessage *mes
client_serial = dbus_message_get_serial (message);
/* can't use set_serial due to the assertions at the start of it */
- set_uint_field (message, FIELD_CLIENT_SERIAL,
- client_serial);
+ _dbus_marshal_set_uint32 (&message->header,
+ message->byte_order,
+ CLIENT_SERIAL_OFFSET,
+ client_serial);
if (client_serial != dbus_message_get_serial (message))
{
Index: dbus/dbus-protocol.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-protocol.h,v
retrieving revision 1.20.2.9
diff -u -p -r1.20.2.9 dbus-protocol.h
--- dbus/dbus-protocol.h 3 Sep 2003 02:08:25 -0000 1.20.2.9
+++ dbus/dbus-protocol.h 21 Sep 2003 17:09:59 -0000
@@ -71,14 +71,17 @@ extern "C" {
#define DBUS_HEADER_FLAG_NO_REPLY_EXPECTED 0x1
/* Header fields */
-#define DBUS_HEADER_FIELD_PATH "path"
-#define DBUS_HEADER_FIELD_INTERFACE "ifce"
-#define DBUS_HEADER_FIELD_MEMBER "mebr"
-#define DBUS_HEADER_FIELD_ERROR_NAME "ernm"
-#define DBUS_HEADER_FIELD_SERVICE "srvc"
-#define DBUS_HEADER_FIELD_REPLY "rply"
-#define DBUS_HEADER_FIELD_SENDER_SERVICE "sdrs"
+#define DBUS_HEADER_FIELD_INVALID 0
+#define DBUS_HEADER_FIELD_PATH 1
+#define DBUS_HEADER_FIELD_INTERFACE 2
+#define DBUS_HEADER_FIELD_MEMBER 3
+#define DBUS_HEADER_FIELD_ERROR_NAME 4
+#define DBUS_HEADER_FIELD_REPLY_SERIAL 5
+#define DBUS_HEADER_FIELD_SERVICE 6
+#define DBUS_HEADER_FIELD_SENDER_SERVICE 7
+#define DBUS_HEADER_FIELD_LAST DBUS_HEADER_FIELD_SENDER_SERVICE
+
/* Services */
#define DBUS_SERVICE_ORG_FREEDESKTOP_DBUS "org.freedesktop.DBus"
#define DBUS_SERVICE_ORG_FREEDESKTOP_BROADCAST "org.freedesktop.Broadcast"
Index: doc/dbus-specification.sgml
===================================================================
RCS file: /cvs/dbus/dbus/doc/dbus-specification.sgml,v
retrieving revision 1.39.2.6
diff -u -p -r1.39.2.6 dbus-specification.sgml
--- doc/dbus-specification.sgml 7 Sep 2003 05:01:48 -0000 1.39.2.6
+++ doc/dbus-specification.sgml 21 Sep 2003 17:09:59 -0000
@@ -257,22 +257,22 @@
In addition to the required header information mentioned
in <xref linkend="message-protocol-header-encoding">,
the header may contain zero or more named
- header fields. These fields are named to allow
- future versions of this protocol specification to
- add new fields; implementations must ignore fields
- they do not understand. Implementations must not
- invent their own header fields; only changes to
+ header fields. Future versions of this protocol
+ specification may add new fields. Implementations must
+ ignore fields they do not understand. Implementations
+ must not invent their own header fields; only changes to
this specification may introduce new header fields.
</para>
<para>
- Header field names MUST consist of 4 non-nul bytes. The field name is
- NOT nul terminated; it occupies exactly 4 bytes. Following the name, the
- field MUST have a type code represented as a single unsigned byte, and
- then a properly-aligned value of that type. See <xref
- linkend="message-protocol-arguments"> for a description of how each type
- is encoded. If an implementation sees a header field name that it does
- not understand, it MUST ignore that field.
+ Header fields MUST be aligned to a 4-byte boundary. Header field
+ names MUST consist of a single byte, possible values of which are
+ defined below. Following the name, the field MUST have a type code
+ represented as a single unsigned byte, and then a properly-aligned
+ value of that type. See <xref
+ linkend="message-protocol-arguments"> for a description of how each
+ type is encoded. If an implementation sees a header field name that
+ it does not understand, it MUST ignore that field.
</para>
<para>
@@ -281,51 +281,65 @@
<tgroup cols=3>
<thead>
<row>
- <entry>Name</entry>
+ <entry>Conventional Name</entry>
+ <entry>Decimal Value</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
- <entry>path</entry>
+ <entry>INVALID</entry>
+ <entry>0</entry>
+ <entry>INVALID</entry>
+ <entry>Not a valid field name (error if it appears in a message)</entry>
+ </row>
+ <row>
+ <entry>PATH</entry>
+ <entry>1</entry>
<entry>STRING</entry>
<entry>The object to send the message to; objects are identified by
a path, "/foo/bar"</entry>
</row>
<row>
- <entry>ifce</entry>
+ <entry>INTERFACE</entry>
+ <entry>2</entry>
<entry>STRING</entry>
<entry>The interface to invoke a method call on, or
that a signal is emitted from. e.g. "org.freedesktop.Introspectable"</entry>
</row>
<row>
- <entry>mebr</entry>
+ <entry>MEMBER</entry>
+ <entry>3</entry>
<entry>STRING</entry>
<entry>The member, either the method name or signal name.
e.g. "Frobate"</entry>
</row>
<row>
- <entry>ernm</entry>
+ <entry>ERROR_NAME</entry>
+ <entry>4</entry>
<entry>STRING</entry>
<entry>The name of the error that occurred, for errors</entry>
</row>
<row>
- <entry>rply</entry>
+ <entry>REPLY_SERIAL</entry>
+ <entry>5</entry>
<entry>UINT32</entry>
<entry>The serial number of the message this message is a reply
to. (The serial number is one of the mandatory header fields,
see <xref linkend="message-protocol-header-encoding">.)</entry>
</row>
<row>
- <entry>srvc</entry>
+ <entry>SERVICE</entry>
+ <entry>6</entry>
<entry>STRING</entry>
<entry>The name of the service this message should be routed to.
Only used in combination with the message bus, see
<xref linkend="message-bus">.</entry>
</row>
<row>
- <entry>sdrs</entry>
+ <entry>SENDER_SERVICE</entry>
+ <entry>7</entry>
<entry>STRING</entry>
<entry>Sender service. The name of the base service that sent
this message. The message bus fills in this field; the field is
@@ -595,24 +609,24 @@
messages map naturally to methods on objects in a typical program.
</para>
<para>
- A method call message is expected to have a 'mebr' header field
+ A method call message is expected to have a MEMBER header field
indicating the name of the method. Optionally, the message has an
- 'ifce' field giving the interface the method is a part of. In the
- absence of an 'ifce' field, if two interfaces on the same object have
+ INTERFACE field giving the interface the method is a part of. In the
+ absence of an INTERFACE field, if two interfaces on the same object have
a method with the same name, it is undefined which of the two methods
will be invoked. Implementations may also choose to return an error in
this ambiguous case. However, if a method name is unique
implementations should not require an interface field.
</para>
<para>
- Method call messages also include a 'path' field indicating the
+ Method call messages also include a PATH field indicating the
object to invoke the method on. If the call is passing through
- a message bus, the message will also have a 'srvc' field giving
+ a message bus, the message will also have a SERVICE field giving
the service to receive the message.
</para>
<para>
When an application handles a method call message, it is expected to
- return a reply. The reply is identified by a 'rply' header field
+ return a reply. The reply is identified by a REPLY_SERIAL header field
indicating the serial number of the METHOD_CALL being replied to. The
reply can have one of two types; either METHOD_RETURN or ERROR.
</para>
@@ -673,9 +687,9 @@
<para>
Unlike method calls, signal emissions have no replies.
A signal emission is simply a single message of type SIGNAL.
- It must have three header fields: 'path' giving the object
- the signal was emitted from, plus 'ifce' and 'mebr' giving the
- fully-qualified name of the signal.
+ It must have three header fields: PATH giving the object
+ the signal was emitted from, plus INTERFACE and MEMBER giving
+ the fully-qualified name of the signal.
</para>
</sect3>
@@ -688,9 +702,9 @@
org.freedesktop.DBus.ActivateService (in STRING service_name, in UINT32 flags,
out UINT32 resultcode)
</programlisting>
- This means ifce = org.freedesktop.DBus, mebr = ActivateService,
+ This means INTERFACE = org.freedesktop.DBus, MEMBER = ActivateService,
METHOD_CALL arguments are STRING and UINT32, METHOD_RETURN argument
- is UINT32. Remember that the 'mebr' field can't contain any '.' (period)
+ is UINT32. Remember that the MEMBER field can't contain any '.' (period)
characters so it's known that the last part of the name in
the "IDL" is the member name.
</para>
@@ -1270,18 +1284,18 @@
the new owner of the service.
</para>
<para>
- Messages may have a <literal>srvc</literal> field (see <xref
+ Messages may have a <literal>SERVICE</literal> field (see <xref
linkend="message-protocol-header-fields">). When the message bus
- receives a message, if the <literal>srvc</literal> field is absent, the
+ receives a message, if the <literal>SERVICE</literal> field is absent, the
message is taken to be a standard peer-to-peer message and interpreted
by the message bus itself. For example, sending
an <literal>org.freedesktop.Peer.Ping</literal> message with no
- <literal>srvc</literal> will cause the message bus itself to reply
+ <literal>SERVICE</literal> will cause the message bus itself to reply
to the ping immediately; the message bus would never make
this message visible to other applications.
</para>
<para>
- If the <literal>srvc</literal> field is present, then it indicates a
+ If the <literal>SERVICE</literal> field is present, then it indicates a
request for the message bus to route the message. In the usual case,
messages are routed to the owner of the named service.
Messages may also be <firstterm>broadcast</firstterm>
@@ -1292,7 +1306,7 @@
</para>
<para>
Continuing the <literal>org.freedesktop.Peer.Ping</literal> example, if
- the ping message were sent with a <literal>srvc</literal> name of
+ the ping message were sent with a <literal>SERVICE</literal> name of
<literal>com.yoyodyne.Screensaver</literal>, then the ping would be
forwarded, and the Yoyodyne Corporation screensaver application would be
expected to reply to the ping. If
Index: test/data/incomplete-messages/missing-body.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/incomplete-messages/missing-body.message,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 missing-body.message
--- test/data/incomplete-messages/missing-body.message 18 Aug 2003 22:43:30 -0000 1.2.2.1
+++ test/data/incomplete-messages/missing-body.message 21 Sep 2003 17:09:59 -0000
@@ -1,14 +1,14 @@
## message that's missing an expected body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
## create the body, then chop it off
START_LENGTH Body
Index: test/data/invalid-messages/array-of-nil.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/array-of-nil.message,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 array-of-nil.message
--- test/data/invalid-messages/array-of-nil.message 18 Aug 2003 22:43:30 -0000 1.1.2.1
+++ test/data/invalid-messages/array-of-nil.message 21 Sep 2003 17:09:59 -0000
@@ -2,15 +2,16 @@
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
+
START_LENGTH Body
TYPE ARRAY
TYPE NIL
Index: test/data/invalid-messages/array-with-mixed-types.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/array-with-mixed-types.message,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 array-with-mixed-types.message
--- test/data/invalid-messages/array-with-mixed-types.message 18 Aug 2003 22:43:30 -0000 1.2.2.1
+++ test/data/invalid-messages/array-with-mixed-types.message 21 Sep 2003 17:09:59 -0000
@@ -3,15 +3,16 @@
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
+
START_LENGTH Body
TYPE ARRAY
Index: test/data/invalid-messages/bad-boolean-array.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/bad-boolean-array.message,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 bad-boolean-array.message
--- test/data/invalid-messages/bad-boolean-array.message 18 Aug 2003 22:43:30 -0000 1.2.2.1
+++ test/data/invalid-messages/bad-boolean-array.message 21 Sep 2003 17:09:59 -0000
@@ -3,15 +3,16 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
ALIGN 8
END_LENGTH Header
+
START_LENGTH Body
TYPE ARRAY
TYPE BOOLEAN
Index: test/data/invalid-messages/bad-boolean.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/bad-boolean.message,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 bad-boolean.message
--- test/data/invalid-messages/bad-boolean.message 18 Aug 2003 22:43:30 -0000 1.2.2.1
+++ test/data/invalid-messages/bad-boolean.message 21 Sep 2003 17:09:59 -0000
@@ -3,15 +3,16 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
ALIGN 8
END_LENGTH Header
+
START_LENGTH Body
TYPE BOOLEAN
BYTE 3
Index: test/data/invalid-messages/bad-endian.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/bad-endian.message,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 bad-endian.message
--- test/data/invalid-messages/bad-endian.message 18 Aug 2003 22:43:30 -0000 1.1.2.2
+++ test/data/invalid-messages/bad-endian.message 21 Sep 2003 17:09:59 -0000
@@ -8,15 +8,14 @@ BYTE 0
LENGTH Header
LENGTH Body
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
ALIGN 8
-
END_LENGTH Header
START_LENGTH Body
Index: test/data/invalid-messages/local-namespace.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/local-namespace.message,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 local-namespace.message
--- test/data/invalid-messages/local-namespace.message 18 Aug 2003 22:43:30 -0000 1.1.2.1
+++ test/data/invalid-messages/local-namespace.message 21 Sep 2003 17:09:59 -0000
@@ -4,14 +4,15 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Local'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Disconnected'
ALIGN 8
END_LENGTH Header
+
START_LENGTH Body
END_LENGTH Body
Index: test/data/invalid-messages/no-dot-in-name.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/no-dot-in-name.message,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 no-dot-in-name.message
--- test/data/invalid-messages/no-dot-in-name.message 18 Aug 2003 22:43:30 -0000 1.1.2.1
+++ test/data/invalid-messages/no-dot-in-name.message 21 Sep 2003 17:09:59 -0000
@@ -3,10 +3,10 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'NoDotInHere'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
Index: test/data/invalid-messages/not-nul-header-padding.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/not-nul-header-padding.message,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 not-nul-header-padding.message
--- test/data/invalid-messages/not-nul-header-padding.message 18 Aug 2003 22:43:30 -0000 1.1.2.1
+++ test/data/invalid-messages/not-nul-header-padding.message 21 Sep 2003 17:09:59 -0000
@@ -3,14 +3,14 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
Index: test/data/invalid-messages/overlong-name.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/overlong-name.message,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 overlong-name.message
--- test/data/invalid-messages/overlong-name.message 18 Aug 2003 22:43:30 -0000 1.1.2.1
+++ test/data/invalid-messages/overlong-name.message 21 Sep 2003 17:09:59 -0000
@@ -2,11 +2,11 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.foo.bar.this.is.really.long 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
Index: test/data/invalid-messages/too-little-header-padding.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/too-little-header-padding.message,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 too-little-header-padding.message
--- test/data/invalid-messages/too-little-header-padding.message 18 Aug 2003 22:43:30 -0000 1.1.2.1
+++ test/data/invalid-messages/too-little-header-padding.message 21 Sep 2003 17:09:59 -0000
@@ -3,14 +3,14 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
Index: test/data/invalid-messages/too-much-header-padding-by-far.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/too-much-header-padding-by-far.message,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 too-much-header-padding-by-far.message
--- test/data/invalid-messages/too-much-header-padding-by-far.message 18 Aug 2003 22:43:30 -0000 1.1.2.1
+++ test/data/invalid-messages/too-much-header-padding-by-far.message 21 Sep 2003 17:09:59 -0000
@@ -3,14 +3,14 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
Index: test/data/invalid-messages/too-much-header-padding.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/too-much-header-padding.message,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 too-much-header-padding.message
--- test/data/invalid-messages/too-much-header-padding.message 18 Aug 2003 22:43:30 -0000 1.1.2.1
+++ test/data/invalid-messages/too-much-header-padding.message 21 Sep 2003 17:09:59 -0000
@@ -3,14 +3,14 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
Index: test/data/invalid-messages/too-short-dict.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/invalid-messages/too-short-dict.message,v
retrieving revision 1.3.2.1
diff -u -p -r1.3.2.1 too-short-dict.message
--- test/data/invalid-messages/too-short-dict.message 18 Aug 2003 22:43:30 -0000 1.3.2.1
+++ test/data/invalid-messages/too-short-dict.message 21 Sep 2003 17:09:59 -0000
@@ -2,10 +2,10 @@
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
Index: test/data/valid-messages/array-of-array-of-uint32.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/array-of-array-of-uint32.message,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 array-of-array-of-uint32.message
--- test/data/valid-messages/array-of-array-of-uint32.message 31 Aug 2003 01:51:44 -0000 1.2.2.2
+++ test/data/valid-messages/array-of-array-of-uint32.message 21 Sep 2003 17:09:59 -0000
@@ -2,8 +2,8 @@
VALID_HEADER method_call
REQUIRED_FIELDS
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
START_LENGTH Body
TYPE ARRAY
Index: test/data/valid-messages/dict-simple.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/dict-simple.message,v
retrieving revision 1.3.2.2
diff -u -p -r1.3.2.2 dict-simple.message
--- test/data/valid-messages/dict-simple.message 31 Aug 2003 01:51:44 -0000 1.3.2.2
+++ test/data/valid-messages/dict-simple.message 21 Sep 2003 17:09:59 -0000
@@ -2,8 +2,8 @@
VALID_HEADER method_call
REQUIRED_FIELDS
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
START_LENGTH Body
TYPE DICT
LENGTH Dict
Index: test/data/valid-messages/emptiness.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/emptiness.message,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 emptiness.message
--- test/data/valid-messages/emptiness.message 31 Aug 2003 01:51:44 -0000 1.2.2.2
+++ test/data/valid-messages/emptiness.message 21 Sep 2003 17:09:59 -0000
@@ -2,8 +2,8 @@
VALID_HEADER method_call
REQUIRED_FIELDS
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
START_LENGTH Body
TYPE STRING
INT32 0
Index: test/data/valid-messages/lots-of-arguments.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/lots-of-arguments.message,v
retrieving revision 1.4.2.2
diff -u -p -r1.4.2.2 lots-of-arguments.message
--- test/data/valid-messages/lots-of-arguments.message 31 Aug 2003 01:51:44 -0000 1.4.2.2
+++ test/data/valid-messages/lots-of-arguments.message 21 Sep 2003 17:09:59 -0000
@@ -2,8 +2,8 @@
VALID_HEADER method_call
REQUIRED_FIELDS
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
START_LENGTH Body
TYPE NIL
TYPE BYTE
Index: test/data/valid-messages/no-padding.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/no-padding.message,v
retrieving revision 1.3.2.2
diff -u -p -r1.3.2.2 no-padding.message
--- test/data/valid-messages/no-padding.message 31 Aug 2003 01:51:44 -0000 1.3.2.2
+++ test/data/valid-messages/no-padding.message 21 Sep 2003 17:09:59 -0000
@@ -7,7 +7,7 @@ REQUIRED_FIELDS
## this byte array is filled with zeros to the natural length
## of the header
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE ARRAY
TYPE BYTE
ALIGN 4
Index: test/data/valid-messages/opposite-endian.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/opposite-endian.message,v
retrieving revision 1.4.2.2
diff -u -p -r1.4.2.2 opposite-endian.message
--- test/data/valid-messages/opposite-endian.message 31 Aug 2003 01:51:44 -0000 1.4.2.2
+++ test/data/valid-messages/opposite-endian.message 21 Sep 2003 17:09:59 -0000
@@ -7,7 +7,7 @@ VALID_HEADER method_call
REQUIRED_FIELDS
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE INT32
INT32 0xfeeb
Index: test/data/valid-messages/recursive-types.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/recursive-types.message,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 recursive-types.message
--- test/data/valid-messages/recursive-types.message 31 Aug 2003 01:51:44 -0000 1.2.2.2
+++ test/data/valid-messages/recursive-types.message 21 Sep 2003 17:09:59 -0000
@@ -5,6 +5,7 @@ VALID_HEADER method_call
REQUIRED_FIELDS
+ALIGN 8
END_LENGTH Header
START_LENGTH Body
Index: test/data/valid-messages/simplest-manual.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/simplest-manual.message,v
retrieving revision 1.4.2.3
diff -u -p -r1.4.2.3 simplest-manual.message
--- test/data/valid-messages/simplest-manual.message 31 Aug 2003 01:51:44 -0000 1.4.2.3
+++ test/data/valid-messages/simplest-manual.message 21 Sep 2003 17:09:59 -0000
@@ -11,13 +11,13 @@ LENGTH Body
## client serial
INT32 7
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
Index: test/data/valid-messages/standard-acquire-service.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/standard-acquire-service.message,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 standard-acquire-service.message
--- test/data/valid-messages/standard-acquire-service.message 31 Aug 2003 01:51:44 -0000 1.1.2.2
+++ test/data/valid-messages/standard-acquire-service.message 21 Sep 2003 17:09:59 -0000
@@ -1,16 +1,16 @@
# Standard org.freedesktop.DBus.AcquireService message
VALID_HEADER method_call
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/org/freedesktop/DBus'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.DBus'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'AcquireService'
-FIELD_NAME srvc
+HEADER_FIELD SERVICE
TYPE STRING
STRING 'org.freedesktop.DBus'
ALIGN 8
Index: test/data/valid-messages/standard-hello.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/standard-hello.message,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 standard-hello.message
--- test/data/valid-messages/standard-hello.message 31 Aug 2003 01:51:44 -0000 1.1.2.2
+++ test/data/valid-messages/standard-hello.message 21 Sep 2003 17:09:59 -0000
@@ -1,16 +1,16 @@
# Standard org.freedesktop.DBus.Hello message
VALID_HEADER method_call
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/org/freedesktop/DBus'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.DBus'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Hello'
-FIELD_NAME srvc
+HEADER_FIELD SERVICE
TYPE STRING
STRING 'org.freedesktop.DBus'
ALIGN 8
Index: test/data/valid-messages/standard-list-services.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/standard-list-services.message,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 standard-list-services.message
--- test/data/valid-messages/standard-list-services.message 31 Aug 2003 01:51:44 -0000 1.1.2.2
+++ test/data/valid-messages/standard-list-services.message 21 Sep 2003 17:09:59 -0000
@@ -1,16 +1,16 @@
# Standard org.freedesktop.DBus.ListServices message
VALID_HEADER method_call
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/org/freedesktop/DBus'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.DBus'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'ListServices'
-FIELD_NAME srvc
+HEADER_FIELD SERVICES
TYPE STRING
STRING 'org.freedesktop.DBus'
ALIGN 8
Index: test/data/valid-messages/standard-service-exists.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/standard-service-exists.message,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 standard-service-exists.message
--- test/data/valid-messages/standard-service-exists.message 31 Aug 2003 01:51:44 -0000 1.1.2.2
+++ test/data/valid-messages/standard-service-exists.message 21 Sep 2003 17:09:59 -0000
@@ -1,16 +1,16 @@
# Standard org.freedesktop.DBus.ServiceExists message
VALID_HEADER method_call
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/org/freedesktop/DBus'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.DBus'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'ServiceExists'
-FIELD_NAME srvc
+HEADER_FIELD SERVICE
TYPE STRING
STRING 'org.freedesktop.DBus'
ALIGN 8
Index: test/data/valid-messages/unknown-header-field.message
===================================================================
RCS file: /cvs/dbus/dbus/test/data/valid-messages/unknown-header-field.message,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 unknown-header-field.message
--- test/data/valid-messages/unknown-header-field.message 31 Aug 2003 01:51:44 -0000 1.1.2.2
+++ test/data/valid-messages/unknown-header-field.message 21 Sep 2003 17:09:59 -0000
@@ -3,7 +3,7 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
REQUIRED_FIELDS
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE INT32
INT32 0xfeeb
ALIGN 8
--=-h63doUAmTz1VM3KZ5Gv3--