#include <sys/types.h>
#include <stdbool.h>
#include <event.h>
#include <glib.h>
#include <cld_msg.h>
Data Structures | |
struct | cldc_call_opts |
per-operation application options More... | |
struct | cldc_pkt_info |
struct | cldc_msg |
an outgoing message, from client to server More... | |
struct | cldc_fh |
an open file handle associated with a session More... | |
struct | cldc_ops |
application-supplied facilities More... | |
struct | cldc_session |
a single CLD client session More... | |
struct | cldc_host |
Information for a single CLD server host. More... | |
struct | cldc_udp |
A UDP implementation of the CLD client protocol. More... | |
struct | cld_dirent_cur |
Functions | |
int | cldc_receive_pkt (struct cldc_session *sess, const void *net_addr, size_t net_addrlen, const void *buf, size_t buflen) |
Packet received from remote host. | |
void | cldc_init (void) |
int | cldc_new_sess (const struct cldc_ops *ops, const struct cldc_call_opts *copts, const void *addr, size_t addr_len, const char *user, const char *secret_key, void *private, struct cldc_session **sess_out) |
void | cldc_kill_sess (struct cldc_session *sess) |
int | cldc_end_sess (struct cldc_session *sess, const struct cldc_call_opts *copts) |
int | cldc_nop (struct cldc_session *sess, const struct cldc_call_opts *copts) |
int | cldc_del (struct cldc_session *sess, const struct cldc_call_opts *copts, const char *pathname) |
int | cldc_open (struct cldc_session *sess, const struct cldc_call_opts *copts, const char *pathname, uint32_t open_mode, uint32_t events, struct cldc_fh **fh_out) |
int | cldc_close (struct cldc_fh *fh, const struct cldc_call_opts *copts) |
int | cldc_unlock (struct cldc_fh *fh, const struct cldc_call_opts *copts) |
int | cldc_lock (struct cldc_fh *fh, const struct cldc_call_opts *copts, uint32_t lock_flags, bool wait_for_lock) |
int | cldc_put (struct cldc_fh *fh, const struct cldc_call_opts *copts, const void *data, size_t data_len) |
int | cldc_get (struct cldc_fh *fh, const struct cldc_call_opts *copts, bool metadata_only) |
int | cldc_dirent_count (const void *data, size_t data_len) |
int | cldc_dirent_first (struct cld_dirent_cur *dc) |
int | cldc_dirent_next (struct cld_dirent_cur *dc) |
void | cldc_dirent_cur_init (struct cld_dirent_cur *dc, const void *buf, size_t buflen) |
void | cldc_dirent_cur_fini (struct cld_dirent_cur *dc) |
char * | cldc_dirent_name (struct cld_dirent_cur *dc) |
void | cldc_udp_free (struct cldc_udp *udp) |
int | cldc_udp_new (const char *hostname, int port, struct cldc_udp **udp_out) |
int | cldc_udp_receive_pkt (struct cldc_udp *udp) |
int | cldc_udp_pkt_send (void *private, const void *addr, size_t addrlen, const void *buf, size_t buflen) |
bool | cldc_levent_timer (void *private, bool add, int(*cb)(struct cldc_session *, void *), void *cb_private, time_t secs) |
int | cldc_getaddr (GList **host_list, const char *thishost, bool verbose, void(*act_log)(int prio, const char *fmt,...)) |
int | cldc_saveaddr (struct cldc_host *hp, unsigned int priority, unsigned int weight, unsigned int port, unsigned int nlen, const char *name, bool verbose, void(*act_log)(int prio, const char *fmt,...)) |
int cldc_close | ( | struct cldc_fh * | fh, | |
const struct cldc_call_opts * | copts | |||
) |
int cldc_del | ( | struct cldc_session * | sess, | |
const struct cldc_call_opts * | copts, | |||
const char * | pathname | |||
) |
int cldc_dirent_count | ( | const void * | data, | |
size_t | data_len | |||
) |
void cldc_dirent_cur_fini | ( | struct cld_dirent_cur * | dc | ) |
void cldc_dirent_cur_init | ( | struct cld_dirent_cur * | dc, | |
const void * | buf, | |||
size_t | buflen | |||
) |
int cldc_dirent_first | ( | struct cld_dirent_cur * | dc | ) |
char* cldc_dirent_name | ( | struct cld_dirent_cur * | dc | ) |
int cldc_dirent_next | ( | struct cld_dirent_cur * | dc | ) |
int cldc_end_sess | ( | struct cldc_session * | sess, | |
const struct cldc_call_opts * | copts | |||
) |
int cldc_get | ( | struct cldc_fh * | fh, | |
const struct cldc_call_opts * | copts, | |||
bool | metadata_only | |||
) |
int cldc_getaddr | ( | GList ** | host_list, | |
const char * | thishost, | |||
bool | verbose, | |||
void(*)(int prio, const char *fmt,...) | act_log | |||
) |
void cldc_init | ( | void | ) |
void cldc_kill_sess | ( | struct cldc_session * | sess | ) |
bool cldc_levent_timer | ( | void * | private, | |
bool | add, | |||
int(*)(struct cldc_session *, void *) | cb, | |||
void * | cb_private, | |||
time_t | secs | |||
) |
int cldc_lock | ( | struct cldc_fh * | fh, | |
const struct cldc_call_opts * | copts, | |||
uint32_t | lock_flags, | |||
bool | wait_for_lock | |||
) |
int cldc_new_sess | ( | const struct cldc_ops * | ops, | |
const struct cldc_call_opts * | copts, | |||
const void * | addr, | |||
size_t | addr_len, | |||
const char * | user, | |||
const char * | secret_key, | |||
void * | private, | |||
struct cldc_session ** | sess_out | |||
) |
int cldc_nop | ( | struct cldc_session * | sess, | |
const struct cldc_call_opts * | copts | |||
) |
int cldc_open | ( | struct cldc_session * | sess, | |
const struct cldc_call_opts * | copts, | |||
const char * | pathname, | |||
uint32_t | open_mode, | |||
uint32_t | events, | |||
struct cldc_fh ** | fh_out | |||
) |
int cldc_put | ( | struct cldc_fh * | fh, | |
const struct cldc_call_opts * | copts, | |||
const void * | data, | |||
size_t | data_len | |||
) |
int cldc_receive_pkt | ( | struct cldc_session * | sess, | |
const void * | net_addr, | |||
size_t | net_addrlen, | |||
const void * | buf, | |||
size_t | buflen | |||
) |
Packet received from remote host.
Called by app when a packet is received from a remote host over the network.
sess | Session associated with received packet | |
net_addr | Opaque network address | |
net_addrlen | Size of opaque network address | |
buf | Pointer to data buffer containing packet | |
buflen | Length of received packet |
int cldc_saveaddr | ( | struct cldc_host * | hp, | |
unsigned int | priority, | |||
unsigned int | weight, | |||
unsigned int | port, | |||
unsigned int | nlen, | |||
const char * | name, | |||
bool | verbose, | |||
void(*)(int prio, const char *fmt,...) | act_log | |||
) |
void cldc_udp_free | ( | struct cldc_udp * | udp | ) |
int cldc_udp_new | ( | const char * | hostname, | |
int | port, | |||
struct cldc_udp ** | udp_out | |||
) |
int cldc_udp_pkt_send | ( | void * | private, | |
const void * | addr, | |||
size_t | addrlen, | |||
const void * | buf, | |||
size_t | buflen | |||
) |
int cldc_udp_receive_pkt | ( | struct cldc_udp * | udp | ) |
int cldc_unlock | ( | struct cldc_fh * | fh, | |
const struct cldc_call_opts * | copts | |||
) |