mdp_client.c File Reference

minimal Serval MDP client functionality, used in the commotion_serval-sas library More...

#include <sys/stat.h>
#include <sys/time.h>
#include <serval.h>
#include <serval/conf.h>
#include <serval/str.h>
#include <serval/strbuf.h>
#include <serval/overlay_buffer.h>
#include <serval/overlay_address.h>
#include <serval/overlay_packet.h>
#include "mdp_client.h"
#include "net.h"
#include "debug.h"

Macros

#define WHY(J)   (ERROR("%s",J), -1)
 
#define WHY_perror(J)   (ERROR("%s",J), -1)
 
#define WHYF(F,...)   (ERROR(F, ##__VA_ARGS__), -1)
 
#define DEBUGF(F,...)   DEBUG(F, ##__VA_ARGS__)
 
#define WARNF(F,...)   (WARN(F, ##__VA_ARGS__), -1)
 
#define FATALF(F,...)   do { ERROR(F, ##__VA_ARGS__); abort(); exit(-1); } while (1)
 
#define WARN_perror(X)   WARNF("%s", (X))
 
#define INFOF(F,...)   INFO(F, ##__VA_ARGS__)
 
#define FORM_SERVAL_INSTANCE_PATH(A, B)   ({ strcpy(A,"/var/serval-node/"); strcat(A,B); A; })
 

Functions

time_ms_t __gettime_ms ()
 
int __overlay_mdp_send (overlay_mdp_frame *mdp, int flags, int timeout_ms)
 
int __overlay_mdp_client_init ()
 
int __overlay_mdp_client_done ()
 
int __overlay_mdp_client_poll (time_ms_t timeout_ms)
 
int __overlay_mdp_recv (overlay_mdp_frame *mdp, int port, int *ttl)
 
int __overlay_mdp_bind (const sid_t *localaddr, int port)
 
int __overlay_mdp_getmyaddr (unsigned index, sid_t *sid)
 
int __overlay_mdp_relevant_bytes (overlay_mdp_frame *mdp)
 

Variables

int __mdp_client_socket =-1
 
char __overlay_mdp_client_socket_path [1024]
 
int __overlay_mdp_client_socket_path_len =-1
 

Detailed Description

minimal Serval MDP client functionality, used in the commotion_serval-sas library

Author
Dan Staples (dismantl), danst.nosp@m.aple.nosp@m.s@ope.nosp@m.ntec.nosp@m.hinst.nosp@m.itut.nosp@m.e.org