CLD  0.1git
Data Structures | Macros | Functions
cld_common.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
#include <glib.h>
#include <openssl/sha.h>
#include <cld_msg_rpc.h>

Data Structures

struct  cld_timer
 
struct  cld_timer_list
 

Macros

#define CLD_ALIGN8(n)   ((8 - ((n) & 7)) & 7)
 
#define SIDFMT   "%016llX"
 
#define SIDARG(sid)   cld_sid2llu(sid)
 
#define CLD_PKT_FTR_LEN   sizeof(struct cld_pkt_ftr)
 Length of the packet footer. More...
 
#define PKT_HDR_TO_STR_SCRATCH_LEN   128
 

Functions

void cld_timer_add (struct cld_timer_list *tlist, struct cld_timer *timer, time_t expires)
 
void cld_timer_del (struct cld_timer_list *tlist, struct cld_timer *timer)
 
time_t cld_timers_run (struct cld_timer_list *tlist)
 
unsigned long long cld_sid2llu (const uint8_t *sid)
 
void cld_rand64 (void *p)
 
const char * cld_errstr (enum cle_err_codes ecode)
 
int cld_readport (const char *fname)
 
int cld_authcheck (struct hail_log *log, const char *key, const void *buf, size_t buf_len, const void *sha)
 
int cld_authsign (struct hail_log *log, const char *key, const void *buf, size_t buf_len, void *sha)
 
const char * cld_opstr (enum cld_msg_op)
 
const char * cld_pkt_hdr_to_str (char *scratch, const char *pkt_hdr, size_t pkt_len)
 
void __cld_dump_buf (const void *buf, size_t len)
 
struct __attribute__ ((packed)) cld_pkt_ftr
 Footer that appears at the end of each packet. More...
 

Macro Definition Documentation

#define CLD_ALIGN8 (   n)    ((8 - ((n) & 7)) & 7)
#define CLD_PKT_FTR_LEN   sizeof(struct cld_pkt_ftr)

Length of the packet footer.

This size is fixed

#define PKT_HDR_TO_STR_SCRATCH_LEN   128
#define SIDARG (   sid)    cld_sid2llu(sid)
#define SIDFMT   "%016llX"

Function Documentation

struct __attribute__ ( (packed)  )

Footer that appears at the end of each packet.

< packet sequence ID

< packet signature

void __cld_dump_buf ( const void *  buf,
size_t  len 
)
int cld_authcheck ( struct hail_log log,
const char *  key,
const void *  buf,
size_t  buf_len,
const void *  sha 
)
int cld_authsign ( struct hail_log log,
const char *  key,
const void *  buf,
size_t  buf_len,
void *  sha 
)
const char* cld_errstr ( enum cle_err_codes  ecode)
const char* cld_opstr ( enum  cld_msg_op)
const char* cld_pkt_hdr_to_str ( char *  scratch,
const char *  pkt_hdr,
size_t  pkt_len 
)
void cld_rand64 ( void *  p)
int cld_readport ( const char *  fname)
unsigned long long cld_sid2llu ( const uint8_t *  sid)
void cld_timer_add ( struct cld_timer_list tlist,
struct cld_timer timer,
time_t  expires 
)
void cld_timer_del ( struct cld_timer_list tlist,
struct cld_timer timer 
)
time_t cld_timers_run ( struct cld_timer_list tlist)