D-Bus: Address parsing

D-Bus 1.14.6

Data Structures | Macros | Functions
Address parsing
D-Bus secret internal implementation details

Implementation of parsing addresses of D-Bus servers. More...

## Data Structures
struct | DBusAddressEntry
| Internals of DBusAddressEntry. More...

## Macros
#define | _DBUS_ADDRESS_OPTIONALLY_ESCAPED_BYTE(b)
| TRUE if the byte need not be escaped when found in a dbus address.

## Functions
void | _dbus_set_bad_address (DBusError *error, const char *address_problem_type, const char *address_problem_field, const char *address_problem_other)
| Sets DBUS_ERROR_BAD_ADDRESS.
dbus_bool_t | _dbus_address_append_escaped (DBusString *escaped, const DBusString *unescaped)
| Appends an escaped version of one string to another string, using the D-Bus address escaping mechanism.

## Detailed Description

Implementation of parsing addresses of D-Bus servers.

## Macro Definition Documentation

## ◆ _DBUS_ADDRESS_OPTIONALLY_ESCAPED_BYTE

#define _DBUS_ADDRESS_OPTIONALLY_ESCAPED_BYTE | ( |  | b | ) |

Value:
(((b) >= 'a' && (b) <= 'z') || \
((b) >= 'A' && (b) <= 'Z') || \
((b) >= '0' && (b) <= '9') || \
(b) == '-' || \
(b) == '_' || \
(b) == '/' || \
(b) == '\\' || \
(b) == '*' || \
(b) == '.')

TRUE if the byte need not be escaped when found in a dbus address.

All other bytes are required to be escaped in a valid address.

Definition at line 87 of file dbus-address.c.

## Function Documentation

## ◆ _dbus_address_append_escaped()

dbus_bool_t _dbus_address_append_escaped | ( | DBusString * | escaped,
|  | const DBusString * | unescaped
| ) |  |

Appends an escaped version of one string to another string, using the D-Bus address escaping mechanism.

Parameters

  escaped | the string to append to
  unescaped | the string to escape

Returns
  FALSE if no memory

Definition at line 107 of file dbus-address.c.

References _DBUS_ADDRESS_OPTIONALLY_ESCAPED_BYTE, _dbus_string_append_byte(), _dbus_string_append_byte_as_hex(), _dbus_string_set_length(), FALSE, and TRUE.

Referenced by _dbus_append_address_from_socket(), _dbus_server_new_for_domain_socket(), _dbus_server_new_for_tcp_socket(), and dbus_address_escape_value().

## ◆ _dbus_set_bad_address()

void _dbus_set_bad_address | ( | DBusError * | error,
|  | const char * | address_problem_type,
|  | const char * | address_problem_field,
|  | const char * | address_problem_other
| ) |  |

Sets DBUS_ERROR_BAD_ADDRESS.

If address_problem_type and address_problem_field are not NULL, sets an error message about how the field is no good. Otherwise, sets address_problem_other as the error message.

Parameters

  error | the error to set
  address_problem_type | the address type of the bad address or NULL
  address_problem_field | the missing field of the bad address or NULL
  address_problem_other | any other error message or NULL

Definition at line 68 of file dbus-address.c.

References DBUS_ERROR_BAD_ADDRESS, dbus_set_error(), and NULL.

Referenced by _dbus_server_listen_platform_specific(), _dbus_transport_open(), _dbus_transport_open_platform_specific(), and _dbus_transport_open_socket().