D-Bus 1.15.8
Data Structures | Typedefs | Functions
DBusTransport implementations for sockets

Implementation details of DBusTransport on sockets. More...

Data Structures

struct  DBusTransportSocket
 Implementation details of DBusTransportSocket. More...
 

Typedefs

typedef struct DBusTransportSocket DBusTransportSocket
 Opaque object representing a socket file descriptor transport. More...
 

Functions

DBusTransport_dbus_transport_new_for_socket (DBusSocket fd, const DBusString *server_guid, const DBusString *address)
 Creates a new transport for the given socket file descriptor. More...
 
DBusTransport_dbus_transport_new_for_tcp_socket (const char *host, const char *port, const char *family, const char *noncefile, DBusError *error)
 Creates a new transport for the given hostname and port. More...
 
DBusTransportOpenResult _dbus_transport_open_socket (DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error)
 Opens a TCP socket transport. More...
 
DBusTransport_dbus_transport_new_for_domain_socket (const char *path, dbus_bool_t abstract, DBusError *error)
 Creates a new transport for the given Unix domain socket path. More...
 
DBusTransportOpenResult _dbus_transport_open_unix_socket (DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error)
 Opens a UNIX socket transport. More...
 

Detailed Description

Implementation details of DBusTransport on sockets.

Typedef Documentation

◆ DBusTransportSocket

Opaque object representing a socket file descriptor transport.

Definition at line 49 of file dbus-transport-socket.c.

Function Documentation

◆ _dbus_transport_new_for_domain_socket()

DBusTransport * _dbus_transport_new_for_domain_socket ( const char *  path,
dbus_bool_t  abstract,
DBusError error 
)

Creates a new transport for the given Unix domain socket path.

This creates a client-side of a transport.

Parameters
paththe path to the domain socket.
abstractTRUE to use abstract socket namespace
erroraddress where an error can be returned.
Returns
a new transport, or NULL on failure.

Definition at line 1518 of file dbus-transport-socket.c.

Referenced by _dbus_transport_open_platform_specific(), and _dbus_transport_open_unix_socket().

◆ _dbus_transport_new_for_socket()

DBusTransport * _dbus_transport_new_for_socket ( DBusSocket  fd,
const DBusString server_guid,
const DBusString address 
)

Creates a new transport for the given socket file descriptor.

The file descriptor must be nonblocking (use _dbus_set_fd_nonblocking() to make it so). This function is shared by various transports that boil down to a full duplex file descriptor.

Parameters
fdthe file descriptor.
server_guidnon-NULL if this transport is on the server side of a connection
addressthe transport's address
Returns
the new transport, or NULL if no memory.

Definition at line 1295 of file dbus-transport-socket.c.

References _dbus_string_init(), _dbus_watch_new(), dbus_new0, encoded_incoming, encoded_outgoing, NULL, and write_watch.

◆ _dbus_transport_new_for_tcp_socket()

DBusTransport * _dbus_transport_new_for_tcp_socket ( const char *  host,
const char *  port,
const char *  family,
const char *  noncefile,
DBusError error 
)

Creates a new transport for the given hostname and port.

If host is NULL, it will default to localhost

Parameters
hostthe host to connect to
portthe port to connect to
familythe address family to connect to
noncefilepath to nonce file
errorlocation to store reason for failure.
Returns
a new transport, or NULL on failure.

Definition at line 1379 of file dbus-transport-socket.c.

References _dbus_string_append(), _dbus_string_init(), DBUS_ERROR_NO_MEMORY, dbus_set_error(), and NULL.

Referenced by _dbus_transport_open_socket().

◆ _dbus_transport_open_socket()

DBusTransportOpenResult _dbus_transport_open_socket ( DBusAddressEntry entry,
DBusTransport **  transport_p,
DBusError error 
)

Opens a TCP socket transport.

Parameters
entrythe address entry to try opening as a tcp transport.
transport_preturn location for the opened transport
errorerror to be set
Returns
result of the attempt

Definition at line 1457 of file dbus-transport-socket.c.

References _dbus_assert, _dbus_set_bad_address(), _dbus_transport_new_for_tcp_socket(), dbus_address_entry_get_method(), dbus_address_entry_get_value(), NULL, and TRUE.

◆ _dbus_transport_open_unix_socket()

DBusTransportOpenResult _dbus_transport_open_unix_socket ( DBusAddressEntry entry,
DBusTransport **  transport_p,
DBusError error 
)

Opens a UNIX socket transport.

Parameters
entrythe address entry to try opening as a unix transport.
transport_preturn location for the opened transport
errorerror to be set
Returns
result of the attempt

Definition at line 1584 of file dbus-transport-socket.c.

References _dbus_assert, _dbus_set_bad_address(), _dbus_transport_new_for_domain_socket(), dbus_address_entry_get_method(), dbus_address_entry_get_value(), FALSE, NULL, and TRUE.