librpc
Macros | Typedefs | Functions
rpcd.h File Reference
#include <rpc/client.h>
Include dependency graph for rpcd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RPCD_SOCKET_ENV   "RPCD_SOCKET_LOCATION"
 
#define RPCD_SOCKET_LOCATION   "unix:///var/run/rpcd.sock"
 
#define RPCD_MANAGER_INTERFACE   "com.twoporeguys.rpcd.ServiceManager"
 
#define RPCD_SERVICE_INTERFACE   "com.twoporeguys.rpcd.Service"
 

Typedefs

typedef void(^ rpcd_service_applier_t) (const char *_Nonnull name, const char *_Nullable description)
 

Functions

_Nullable rpc_client_t rpcd_connect_to (const char *_Nullable rpcd_uri, const char *_Nonnull service_name)
 
int rpcd_services_apply (const char *_Nullable rpcd_uri, _Nonnull rpcd_service_applier_t applier)
 
int rpcd_register (const char *_Nonnull uri, const char *_Nonnull name, const char *_Nullable description)
 
int rpcd_unregister (const char *_Nonnull name)
 

Function Documentation

◆ rpcd_connect_to()

_Nullable rpc_client_t rpcd_connect_to ( const char *_Nullable  rpcd_uri,
const char *_Nonnull  service_name 
)

Looks up a service with given name and connects to it.

Parameters
rpcd_uriURI of the rpcd server
service_nameFQDN name of the service
Returns
RPC client handle or NULL in case of an error

◆ rpcd_register()

int rpcd_register ( const char *_Nonnull  uri,
const char *_Nonnull  name,
const char *_Nullable  description 
)
Parameters
uri
name
description
Returns

◆ rpcd_services_apply()

int rpcd_services_apply ( const char *_Nullable  rpcd_uri,
_Nonnull rpcd_service_applier_t  applier 
)

Iterates through services found on a rpcd server at rpcd_uri.

Parameters
rpcd_uriURI of the rpcd server
applierCallback block called for every service count
Returns
0 on success, -1 on error

◆ rpcd_unregister()

int rpcd_unregister ( const char *_Nonnull  name)
Parameters
name
Returns