25 #include "dbus-internals.h"    26 #include "dbus-marshal-validate.h"    27 #include "dbus-marshal-recursive.h"    28 #include "dbus-marshal-basic.h"    29 #include "dbus-signature.h"    30 #include "dbus-string.h"    55   const unsigned char *p;
    56   const unsigned char *end;
    67   element_count_stack = 
NULL;
    82       result = DBUS_INVALID_SIGNATURE_TOO_LONG;
    86   p = _dbus_string_get_const_udata_len (type_str, type_pos, 0);
    88   end = _dbus_string_get_const_udata_len (type_str, type_pos + len, 0);
   118               result = DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION;
   128               result = DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION;
   142           if (struct_depth == 0)
   144               result = DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED;
   150               result = DBUS_INVALID_STRUCT_HAS_NO_FIELDS;
   162               result = DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY;
   166           dict_entry_depth += 1;
   170               result = DBUS_INVALID_EXCEEDED_MAXIMUM_DICT_ENTRY_RECURSION;
   184           if (dict_entry_depth == 0)
   186               result = DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED;
   190           dict_entry_depth -= 1;
   195           if (element_count != 2)
   197               if (element_count == 0)
   198                 result = DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS;
   199               else if (element_count == 1)
   200                 result = DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD;
   202                 result = DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS;
   211           result = DBUS_INVALID_UNKNOWN_TYPECODE;
   236                const unsigned char *p1;
   241                    result = DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE;
   255               result = DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE;
   267       result = DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE;
   271   if (struct_depth > 0)
   273        result = DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED;
   277   if (dict_entry_depth > 0)
   279       result =  DBUS_INVALID_DICT_ENTRY_STARTED_BUT_NOT_ENDED;
   302                       const unsigned char  *p,
   303                       const unsigned char  *end,
   304                       const unsigned char **new_p)
   315       return DBUS_INVALID_NESTED_TOO_DEEPLY;
   320       const unsigned char *a;
   324       _dbus_verbose (
"   validating value of type %s type reader %p type_pos %d p %p end %p %d remain\n",
   331         return DBUS_INVALID_NOT_ENOUGH_DATA;
   333       switch (current_type)
   349           a = _DBUS_ALIGN_ADDRESS (p, alignment);
   351             return DBUS_INVALID_NOT_ENOUGH_DATA;
   355                 return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
   364                 return DBUS_INVALID_NOT_ENOUGH_DATA;
   368               if (!(v == 0 || v == 1))
   369                 return DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE;
   381             a = _DBUS_ALIGN_ADDRESS (p, 4);
   383               return DBUS_INVALID_NOT_ENOUGH_DATA;
   387                   return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
   403                     return DBUS_INVALID_UNKNOWN_TYPECODE;
   408                 a = _DBUS_ALIGN_ADDRESS (p, alignment);
   412                   return DBUS_INVALID_NOT_ENOUGH_DATA;
   417                       return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
   422             if (claimed_len > (
unsigned long) (end - p))
   423               return DBUS_INVALID_LENGTH_OUT_OF_BOUNDS;
   430                                           _dbus_string_get_length (&str)))
   431                   return DBUS_INVALID_BAD_PATH;
   440                                                  _dbus_string_get_length (&str)))
   441                   return DBUS_INVALID_BAD_UTF8_IN_STRING;
   449                 const unsigned char *array_end;
   453                   return DBUS_INVALID_ARRAY_LENGTH_EXCEEDS_MAXIMUM;
   461                 array_end = p + claimed_len;
   478                         while (p < array_end)
   482                             if (!(v == 0 || v == 1))
   483                               return DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE;
   497                     while (p < array_end)
   499                         validity = validate_body_helper (&sub, byte_order, 
FALSE,
   508                   return DBUS_INVALID_ARRAY_LENGTH_INCORRECT;
   515                   return DBUS_INVALID_NOT_ENOUGH_DATA;
   518                   return DBUS_INVALID_STRING_MISSING_NUL;
   534             if (claimed_len + 1 > (
unsigned long) (end - p))
   535               return DBUS_INVALID_SIGNATURE_LENGTH_OUT_OF_BOUNDS;
   540                                                     _dbus_string_get_length (&str));
   549               return DBUS_INVALID_SIGNATURE_MISSING_NUL;
   553             _dbus_verbose (
"p = %p end = %p claimed_len %u\n", p, end, claimed_len);
   570             int contained_alignment;
   578             if (claimed_len + 1 > (
unsigned long) (end - p))
   579               return DBUS_INVALID_VARIANT_SIGNATURE_LENGTH_OUT_OF_BOUNDS;
   583                                            _dbus_string_get_length (&sig));
   589                   return DBUS_INVALID_VARIANT_SIGNATURE_BAD;
   595               return DBUS_INVALID_VARIANT_SIGNATURE_MISSING_NUL;
   600               return DBUS_INVALID_VARIANT_SIGNATURE_EMPTY;
   604             a = _DBUS_ALIGN_ADDRESS (p, contained_alignment);
   606               return DBUS_INVALID_NOT_ENOUGH_DATA;
   610                   return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
   618             validity = validate_body_helper (&sub, byte_order, 
FALSE,
   625               return DBUS_INVALID_VARIANT_SIGNATURE_SPECIFIES_MULTIPLE_VALUES;
   637             a = _DBUS_ALIGN_ADDRESS (p, 8);
   639               return DBUS_INVALID_NOT_ENOUGH_DATA;
   643                   return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
   649             validity = validate_body_helper (&sub, byte_order, 
TRUE,
   663       _dbus_verbose (
"   validated value of type %s type reader %p type_pos %d p %p end %p %d remain\n",
   670           _dbus_verbose (
"not enough data!!! p = %p end = %p end-p = %d\n",
   671                          p, end, (
int) (end - p));
   672           return DBUS_INVALID_NOT_ENOUGH_DATA;
   675       if (walk_reader_to_end)
   709                                  int               expected_signature_start,
   711                                  int              *bytes_remaining,
   717   const unsigned char *p;
   718   const unsigned char *end;
   723   _dbus_assert (value_pos <= _dbus_string_get_length (value_str) - len);
   725   _dbus_verbose (
"validating body from pos %d len %d sig '%s'\n",
   726                  value_pos, len, _dbus_string_get_const_data_len (expected_signature,
   727                                                                   expected_signature_start,
   731                                      expected_signature, expected_signature_start);
   733   p = _dbus_string_get_const_udata_len (value_str, value_pos, len);
   736   validity = validate_body_helper (&reader, byte_order, 
TRUE, 0, p, end, &p);
   742       *bytes_remaining = end - p;
   758 #define VALID_INITIAL_NAME_CHARACTER(c)         \   759   ( ((c) >= 'A' && (c) <= 'Z') ||               \   760     ((c) >= 'a' && (c) <= 'z') ||               \   767 #define VALID_NAME_CHARACTER(c)                 \   768   ( ((c) >= '0' && (c) <= '9') ||               \   769     ((c) >= 'A' && (c) <= 'Z') ||               \   770     ((c) >= 'a' && (c) <= 'z') ||               \   794   const unsigned char *s;
   795   const unsigned char *end;
   796   const unsigned char *last_slash;
   802   if (len > _dbus_string_get_length (str) - start)
   808   s = _dbus_string_get_const_udata (str) + start;
   820           if ((s - last_slash) < 2)
   834   if ((end - last_slash) < 2 &&
   847     case DBUS_INVALID_FOR_UNKNOWN_REASON:                          
return "Unknown reason";
   848     case DBUS_VALID_BUT_INCOMPLETE:                                
return "Valid but incomplete";
   849     case DBUS_VALIDITY_UNKNOWN:                                    
return "Validity unknown";
   851     case DBUS_INVALID_UNKNOWN_TYPECODE:                            
return "Unknown typecode";
   852     case DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE:                  
return "Missing array element type";
   853     case DBUS_INVALID_SIGNATURE_TOO_LONG:                          
return "Signature is too long";
   854     case DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION:            
return "Exceeded maximum array recursion";
   855     case DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION:           
return "Exceeded maximum struct recursion";
   856     case DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED:                
return "Struct ended but not started";
   857     case DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED:                
return "Struct started but not ended";
   858     case DBUS_INVALID_STRUCT_HAS_NO_FIELDS:                        
return "Struct has no fields";
   859     case DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL:                   
return "Alignment padding not null";
   860     case DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE:                     
return "Boolean is not zero or one";
   861     case DBUS_INVALID_NOT_ENOUGH_DATA:                             
return "Not enough data";
   863     case DBUS_INVALID_BAD_BYTE_ORDER:                              
return "Bad byte order";
   864     case DBUS_INVALID_BAD_PROTOCOL_VERSION:                        
return "Bad protocol version";
   865     case DBUS_INVALID_BAD_MESSAGE_TYPE:                            
return "Bad message type";
   866     case DBUS_INVALID_BAD_SERIAL:                                  
return "Bad serial";
   867     case DBUS_INVALID_INSANE_FIELDS_ARRAY_LENGTH:                  
return "Insane fields array length";
   868     case DBUS_INVALID_INSANE_BODY_LENGTH:                          
return "Insane body length";
   869     case DBUS_INVALID_MESSAGE_TOO_LONG:                            
return "Message too long";
   870     case DBUS_INVALID_HEADER_FIELD_CODE:                           
return "Header field code";
   871     case DBUS_INVALID_HEADER_FIELD_HAS_WRONG_TYPE:                 
return "Header field has wrong type";
   872     case DBUS_INVALID_USES_LOCAL_INTERFACE:                        
return "Uses local interface";
   873     case DBUS_INVALID_USES_LOCAL_PATH:                             
return "Uses local path";
   874     case DBUS_INVALID_HEADER_FIELD_APPEARS_TWICE:                  
return "Header field appears twice";
   875     case DBUS_INVALID_BAD_DESTINATION:                             
return "Bad destination";
   876     case DBUS_INVALID_BAD_INTERFACE:                               
return "Bad interface";
   877     case DBUS_INVALID_BAD_MEMBER:                                  
return "Bad member";
   878     case DBUS_INVALID_BAD_ERROR_NAME:                              
return "Bad error name";
   879     case DBUS_INVALID_BAD_SENDER:                                  
return "Bad sender";
   880     case DBUS_INVALID_MISSING_PATH:                                
return "Missing path";
   881     case DBUS_INVALID_MISSING_INTERFACE:                           
return "Missing interface";
   882     case DBUS_INVALID_MISSING_MEMBER:                              
return "Missing member";
   883     case DBUS_INVALID_MISSING_ERROR_NAME:                          
return "Missing error name";
   884     case DBUS_INVALID_MISSING_REPLY_SERIAL:                        
return "Missing reply serial";
   885     case DBUS_INVALID_LENGTH_OUT_OF_BOUNDS:                        
return "Length out of bounds";
   886     case DBUS_INVALID_ARRAY_LENGTH_EXCEEDS_MAXIMUM:                
return "Array length exceeds maximum";
   887     case DBUS_INVALID_BAD_PATH:                                    
return "Bad path";
   888     case DBUS_INVALID_SIGNATURE_LENGTH_OUT_OF_BOUNDS:              
return "Signature length out of bounds";
   889     case DBUS_INVALID_BAD_UTF8_IN_STRING:                          
return "Bad utf8 in string";
   890     case DBUS_INVALID_ARRAY_LENGTH_INCORRECT:                      
return "Array length incorrect";
   891     case DBUS_INVALID_VARIANT_SIGNATURE_LENGTH_OUT_OF_BOUNDS:      
return "Variant signature length out of bounds";
   892     case DBUS_INVALID_VARIANT_SIGNATURE_BAD:                       
return "Variant signature bad";
   893     case DBUS_INVALID_VARIANT_SIGNATURE_EMPTY:                     
return "Variant signature empty";
   894     case DBUS_INVALID_VARIANT_SIGNATURE_SPECIFIES_MULTIPLE_VALUES: 
return "Variant signature specifies multiple values";
   895     case DBUS_INVALID_VARIANT_SIGNATURE_MISSING_NUL:               
return "Variant signature missing nul";
   896     case DBUS_INVALID_STRING_MISSING_NUL:                          
return "String missing nul";
   897     case DBUS_INVALID_SIGNATURE_MISSING_NUL:                       
return "Signature missing nul";
   898     case DBUS_INVALID_EXCEEDED_MAXIMUM_DICT_ENTRY_RECURSION:       
return "Exceeded maximum dict entry recursion";
   899     case DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED:            
return "Dict entry ended but not started";
   900     case DBUS_INVALID_DICT_ENTRY_STARTED_BUT_NOT_ENDED:            
return "Dict entry started but not ended";
   901     case DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS:                    
return "Dict entry has no fields";
   902     case DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD:               
return "Dict entry has only one field";
   903     case DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS:              
return "Dict entry has too many fields";
   904     case DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY:                 
return "Dict entry not inside array";
   905     case DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE:                 
return "Dict key must be basic type";
   906     case DBUS_INVALID_MISSING_UNIX_FDS:                            
return "Unix file descriptor missing";
   907     case DBUS_INVALID_NESTED_TOO_DEEPLY:                           
return "Variants cannot be used to create a hugely recursive tree of values";
   908     case DBUS_VALIDITY_LAST:
   932   const unsigned char *s;
   933   const unsigned char *end;
   934   const unsigned char *iface;
   935   const unsigned char *last_dot;
   941   if (len > _dbus_string_get_length (str) - start)
   951   iface = _dbus_string_get_const_udata (str) + start;
   958   if (_DBUS_UNLIKELY (*s == 
'.')) 
   969           if (_DBUS_UNLIKELY ((s + 1) == end))
   984   if (_DBUS_UNLIKELY (last_dot == 
NULL))
  1008   const unsigned char *s;
  1009   const unsigned char *end;
  1010   const unsigned char *member;
  1016   if (len > _dbus_string_get_length (str) - start)
  1025   member = _dbus_string_get_const_udata (str) + start;
  1077 #define VALID_INITIAL_BUS_NAME_CHARACTER(c)         \  1078   ( ((c) >= 'A' && (c) <= 'Z') ||               \  1079     ((c) >= 'a' && (c) <= 'z') ||               \  1080     ((c) == '_') || ((c) == '-'))  1086 #define VALID_BUS_NAME_CHARACTER(c)                 \  1087   ( ((c) >= '0' && (c) <= '9') ||               \  1088     ((c) >= 'A' && (c) <= 'Z') ||               \  1089     ((c) >= 'a' && (c) <= 'z') ||               \  1090     ((c) == '_') || ((c) == '-'))  1093 _dbus_validate_bus_name_full (
const DBusString  *str,
  1098   const unsigned char *s;
  1099   const unsigned char *end;
  1100   const unsigned char *iface;
  1101   const unsigned char *last_dot;
  1107   if (len > _dbus_string_get_length (str) - start)
  1117   iface = _dbus_string_get_const_udata (str) + start;
  1132             if (_DBUS_UNLIKELY ((s + 1) == end))
  1148   else if (_DBUS_UNLIKELY (*s == 
'.')) 
  1159           if (_DBUS_UNLIKELY ((s + 1) == end))
  1174   if (!is_namespace && _DBUS_UNLIKELY (last_dot == 
NULL))
  1198   return _dbus_validate_bus_name_full (str, start, len, 
FALSE);
  1219   return _dbus_validate_bus_name_full (str, start, len, 
TRUE);
 dbus_bool_t dbus_type_is_fixed(int typecode)
Tells you whether values of this type can change length if you set them to some other value...
DBusValidity _dbus_validate_body_with_reason(const DBusString *expected_signature, int expected_signature_start, int byte_order, int *bytes_remaining, const DBusString *value_str, int value_pos, int len)
Verifies that the range of value_str from value_pos to value_end is a legitimate value of type expect...
unsigned int dbus_uint32_t
A 32-bit unsigned integer on all platforms. 
#define DBUS_TYPE_UINT16
Type code marking a 16-bit unsigned integer. 
#define NULL
A null pointer, defined appropriately for C or C++. 
#define DBUS_MAXIMUM_NAME_LENGTH
Max length in bytes of a bus name, interface, or member (not object path, paths are unlimited)...
trailing junk makes it invalid 
void * _dbus_list_pop_last(DBusList **list)
Removes the last value in the list and returns it. 
int _dbus_first_type_in_signature(const DBusString *str, int pos)
Get the first type in the signature. 
void _dbus_type_reader_recurse(DBusTypeReader *reader, DBusTypeReader *sub)
Initialize a new reader pointing to the first type and corresponding value that's a child of the curr...
#define DBUS_TYPE_STRUCT
STRUCT and DICT_ENTRY are sort of special since their codes can't appear in a type string...
#define DBUS_MAXIMUM_TYPE_RECURSION_DEPTH
Depth of recursion in the type tree. 
#define DBUS_TYPE_DICT_ENTRY
Type code used to represent a dict entry; however, this type code does not appear in type signatures...
#define DBUS_TYPE_STRING
Type code marking a UTF-8 encoded, nul-terminated Unicode string. 
#define _dbus_assert(condition)
Aborts with an error message if the condition is false. 
int type_pos
current position in signature 
#define _DBUS_INT_TO_POINTER(integer)
Safely stuffs an integer into a pointer, to be extracted later with _DBUS_POINTER_TO_INT. 
#define DBUS_TYPE_BYTE
Type code marking an 8-bit unsigned integer. 
dbus_bool_t _dbus_validate_interface(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid interface name in the D-Bus protocol. 
void _dbus_type_reader_init_types_only(DBusTypeReader *reader, const DBusString *type_str, int type_pos)
Like _dbus_type_reader_init() but the iteration is over the signature, not over values. 
#define DBUS_DICT_ENTRY_BEGIN_CHAR
Code marking the start of a dict entry type in a type signature. 
DBusValidity
This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...
#define DBUS_STRUCT_END_CHAR
Code marking the end of a struct type in a type signature. 
#define DBUS_TYPE_DOUBLE
Type code marking an 8-byte double in IEEE 754 format. 
dbus_bool_t _dbus_validate_member(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid member name in the D-Bus protocol. 
#define DBUS_TYPE_ARRAY
Type code marking a D-Bus array type. 
#define DBUS_TYPE_INT64
Type code marking a 64-bit signed integer. 
dbus_bool_t _dbus_validate_path(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid object path name in the D-Bus protocol...
dbus_bool_t _dbus_validate_error_name(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid error name in the D-Bus protocol. 
dbus_uint32_t _dbus_unpack_uint32(int byte_order, const unsigned char *data)
Unpacks a 32 bit unsigned integer from a data pointer. 
dbus_bool_t dbus_type_is_basic(int typecode)
A "basic type" is a somewhat arbitrary concept, but the intent is to include those types that are ful...
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE. 
can't determine validity due to OOM 
#define VALID_BUS_NAME_CHARACTER(c)
Determine wether the given character is valid as a second or later character in a bus name...
dbus_bool_t _dbus_list_append(DBusList **list, void *data)
Appends a value to the list. 
#define DBUS_TYPE_INT32
Type code marking a 32-bit signed integer. 
#define DBUS_MAXIMUM_SIGNATURE_LENGTH
This one is 255 so it fits in a byte. 
dbus_bool_t _dbus_type_reader_next(DBusTypeReader *reader)
Skip to the next value on this "level". 
dbus_bool_t _dbus_validate_bus_namespace(const DBusString *str, int start, int len)
Checks that the given range of the string is a prefix of a valid bus name in the D-Bus protocol...
dbus_bool_t _dbus_string_validate_utf8(const DBusString *str, int start, int len)
Checks that the given range of the string is valid UTF-8. 
#define _DBUS_POINTER_TO_INT(pointer)
Safely casts a void* to an integer; should only be used on void* that actually contain integers...
#define DBUS_TYPE_SIGNATURE
Type code marking a D-Bus type signature. 
dbus_bool_t _dbus_validate_bus_name(const DBusString *str, int start, int len)
Checks that the given range of the string is a valid bus name in the D-Bus protocol. 
#define DBUS_TYPE_UINT64
Type code marking a 64-bit unsigned integer. 
#define DBUS_STRUCT_BEGIN_CHAR
Code marking the start of a struct type in a type signature. 
#define DBUS_TYPE_VARIANT
Type code marking a D-Bus variant type. 
#define DEFINE_DBUS_NAME_CHECK(what)
Define a name check to be used in _dbus_return_if_fail() statements. 
#define DBUS_TYPE_UINT32
Type code marking a 32-bit unsigned integer. 
#define VALID_INITIAL_NAME_CHARACTER(c)
Determine wether the given character is valid as the first character in a name. 
#define VALID_NAME_CHARACTER(c)
Determine wether the given character is valid as a second or later character in a name...
The type reader is an iterator for reading values from a block of values. 
#define TRUE
Expands to "1". 
#define _dbus_assert_not_reached(explanation)
Aborts with an error message if called. 
#define DBUS_TYPE_OBJECT_PATH
Type code marking a D-Bus object path. 
#define DBUS_TYPE_UNIX_FD
Type code marking a unix file descriptor. 
#define DBUS_TYPE_INVALID
Type code that is never equal to a legitimate type code. 
DBusValidity _dbus_validate_signature_with_reason(const DBusString *type_str, int type_pos, int len)
Verifies that the range of type_str from type_pos to type_end is a valid signature. 
#define DBUS_MAXIMUM_ARRAY_LENGTH
Max length of a marshaled array in bytes (64M, 2^26) We use signed int for lengths so must be INT_MAX...
#define DBUS_TYPE_INT16
Type code marking a 16-bit signed integer. 
#define DBUS_TYPE_BOOLEAN
Type code marking a boolean. 
int _dbus_type_reader_get_element_type(const DBusTypeReader *reader)
Gets the type of an element of the array the reader is currently pointing to. 
#define _DBUS_INT32_MAX
Maximum value of type "int32". 
int _dbus_type_reader_get_current_type(const DBusTypeReader *reader)
Gets the type of the value the reader is currently pointing to; or for a types-only reader gets the t...
#define FALSE
Expands to "0". 
#define DBUS_DICT_ENTRY_END_CHAR
Code marking the end of a dict entry type in a type signature. 
const char * _dbus_type_to_string(int typecode)
Returns a string describing the given type. 
int _dbus_type_get_alignment(int typecode)
Gets the alignment requirement for the given type; will be 1, 4, or 8. 
void _dbus_string_init_const_len(DBusString *str, const char *value, int len)
Initializes a constant string with a length. 
#define VALID_INITIAL_BUS_NAME_CHARACTER(c)
Determine wether the given character is valid as the first character in a bus name. 
dbus_bool_t dbus_type_is_valid(int typecode)
Return TRUE if the argument is a valid typecode. 
void _dbus_list_clear(DBusList **list)
Frees all links in the list and sets the list head to NULL.