zhangmeng
2020-08-03 fc639da8d408be5dbff96c008ec3936ef683f565
libcsoftbus.h
@@ -10,6 +10,7 @@
// shm manipulate
static tfn_shm_init             fn_shm_init = NULL;
static tfn_shm_alloc_key        fn_shm_alloc_key = NULL;
static tfn_shm_destroy          fn_shm_destroy = NULL;
static tfn_shm_rm_dead_queue    fn_shm_rm_dead_queue = NULL;
@@ -45,11 +46,36 @@
static tfn_socket_buf_free      fn_socket_buf_free = NULL;
static tfn_socket_port          fn_socket_port = NULL;
// dgram mode socket
static tfn_dgram_socket_open    fn_dgram_socket_open = NULL;
static tfn_dgram_socket_close   fn_dgram_socket_close = NULL;
static tfn_dgram_socket_bind    fn_dgram_socket_bind = NULL;
static tfn_dgram_socket_force_bind    fn_dgram_socket_force_bind = NULL;
static tfn_dgram_socket_sendto  fn_dgram_socket_sendto = NULL;
static tfn_dgram_socket_sendto_timeout  fn_dgram_socket_sendto_timeout = NULL;
static tfn_dgram_socket_sendto_nowait  fn_dgram_socket_sendto_nowait = NULL;
static tfn_dgram_socket_recvfrom      fn_dgram_socket_recvfrom = NULL;
static tfn_dgram_socket_recvfrom_timeout      fn_dgram_socket_recvfrom_timeout = NULL;
static tfn_dgram_socket_recvfrom_nowait      fn_dgram_socket_recvfrom_nowait = NULL;
static tfn_dgram_socket_sendandrecv   fn_dgram_socket_sendandrecv = NULL;
static tfn_dgram_socket_sendandrecv_timeout   fn_dgram_socket_sendandrecv_timeout = NULL;
static tfn_dgram_socket_sendandrecv_nowait   fn_dgram_socket_sendandrecv_nowait = NULL;
static tfn_dgram_socket_start_bus     fn_dgram_socket_start_bus = NULL;
static tfn_dgram_socket_sub     fn_dgram_socket_sub = NULL;
static tfn_dgram_socket_sub_timeout     fn_dgram_socket_sub_timeout = NULL;
static tfn_dgram_socket_sub_nowait     fn_dgram_socket_sub_nowait = NULL;
static tfn_dgram_socket_pub     fn_dgram_socket_pub = NULL;
static tfn_dgram_socket_pub_timeout     fn_dgram_socket_pub_timeout = NULL;
static tfn_dgram_socket_pub_nowait     fn_dgram_socket_pub_nowait = NULL;
static tfn_dgram_socket_port    fn_dgram_socket_port = NULL;
static tfn_dgram_socket_free    fn_dgram_socket_free = NULL;
//////////////////////////////////////////////////////////////////////
// labels
// shm
const static char l_shm_init[] = "shm_init";
const static char l_shm_alloc_key[] = "shm_alloc_key";
const static char l_shm_destroy[] = "shm_destroy";
const static char l_shm_rm_dead_queue[] = "shm_remove_queues_exclude";
@@ -85,6 +111,29 @@
const static char l_socket_free[] = "mod_free";
const static char l_socket_port[] = "mod_get_socket_port";
// dgram mode socket
const static char l_dgram_socket_open[] = "dgram_mod_open_socket";
const static char l_dgram_socket_close[] = "dgram_mod_close_socket";
const static char l_dgram_socket_bind[] = "dgram_mod_bind";
const static char l_dgram_socket_force_bind[] = "dgram_mod_force_bind";
const static char l_dgram_socket_sendto[] = "dgram_mod_sendto";
const static char l_dgram_socket_sendto_timeout[] = "dgram_mod_sendto_timeout";
const static char l_dgram_socket_sendto_nowait[] = "dgram_mod_sendto_nowait";
const static char l_dgram_socket_recvfrom[] = "dgram_mod_recvfrom";
const static char l_dgram_socket_recvfrom_timeout[] = "dgram_mod_recvfrom_timeout";
const static char l_dgram_socket_recvfrom_nowait[] = "dgram_mod_recvfrom_nowait";
const static char l_dgram_socket_sendandrecv[] = "dgram_mod_sendandrecv";
const static char l_dgram_socket_sendandrecv_timeout[] = "dgram_mod_sendandrecv_timeout";
const static char l_dgram_socket_sendandrecv_nowait[] = "dgram_mod_sendandrecv_nowait";
const static char l_dgram_socket_start_bus[] = "dgram_mod_start_bus";
const static char l_dgram_socket_sub[] = "dgram_mod_sub";
const static char l_dgram_socket_sub_timeout[] = "dgram_mod_sub_timeout";
const static char l_dgram_socket_sub_nowait[] = "dgram_mod_sub_nowait";
const static char l_dgram_socket_pub[] = "dgram_mod_pub";
const static char l_dgram_socket_pub_timeout[] = "dgram_mod_pub_timeout";
const static char l_dgram_socket_pub_nowait[] = "dgram_mod_pub_nowait";
const static char l_dgram_socket_port[] = "dgram_mod_get_port";
const static char l_dgram_socket_free[] = "dgram_mod_free";
//////////////////////////////////////////////////////////////////////
@@ -95,6 +144,7 @@
// shm manipulate
void wrap_fn_shm_init(hcsoftbus lib, int size);
int wrap_fn_shm_alloc_key(hcsoftbus lib);
void wrap_fn_shm_destroy(hcsoftbus lib);
void wrap_fn_shm_rm_dead_queue(hcsoftbus lib, void *array, int len);
@@ -131,7 +181,30 @@
void wrap_fn_socket_buf_free(hcsoftbus lib, void *buf);
int wrap_fn_socket_port(hcsoftbus lib, void *s);
/////////////////////////////////////////////////////////
// dgram socket mode
void *wrap_fn_dgram_socket_open(hcsoftbus lib);
int wrap_fn_dgram_socket_close(hcsoftbus lib, void *s);
int wrap_fn_dgram_socket_bind(hcsoftbus lib, void *s, int port);
int wrap_fn_dgram_socket_force_bind(hcsoftbus lib, void *s, int port);
int wrap_fn_dgram_socket_sendto(hcsoftbus lib, void *s, const void *buf, const int size, const int port);
int wrap_fn_dgram_socket_sendto_timeout(hcsoftbus lib, void *s, const void *buf, const int size, const int port, int sec, int usec);
int wrap_fn_dgram_socket_sendto_nowait(hcsoftbus lib, void *s, const void *buf, const int size, const int port);
int wrap_fn_dgram_socket_recvfrom(hcsoftbus lib, void *s, void **buf, int *size, int *port);
int wrap_fn_dgram_socket_recvfrom_timeout(hcsoftbus lib, void *s, void **buf, int *size, int *port, int sec, int usec);
int wrap_fn_dgram_socket_recvfrom_nowait(hcsoftbus lib, void *s, void **buf, int *size, int *port);
int wrap_fn_dgram_socket_sendandrecv(hcsoftbus lib, void *s, const void *sbuf, const int ssize, const int port, void **rbuf, int *rsize);
int wrap_fn_dgram_socket_sendandrecv_timeout(hcsoftbus lib, void *s, const void *sbuf, const int ssize, const int port, void **rbuf, int *rsize, int sec, int usec);
int wrap_fn_dgram_socket_sendandrecv_nowait(hcsoftbus lib, void *s, const void *sbuf, const int ssize, const int port, void **rbuf, int *rsize);
int wrap_fn_dgram_socket_start_bus(hcsoftbus lib, void *s);
int wrap_fn_dgram_socket_sub(hcsoftbus lib, void *s, void *topic, int size, int port);
int wrap_fn_dgram_socket_sub_timeout(hcsoftbus lib, void *s, void *topic, int size, int port, int sec, int usec);
int wrap_fn_dgram_socket_sub_nowait(hcsoftbus lib, void *s, void *topic, int size, int port);
int wrap_fn_dgram_socket_pub(hcsoftbus lib, void *s, void *topic, int tsize, void *content, int csize, int port);
int wrap_fn_dgram_socket_pub_timeout(hcsoftbus lib, void *s, void *topic, int tsize, void *content, int csize, int port, int sec, int usec);
int wrap_fn_dgram_socket_pub_nowait(hcsoftbus lib, void *s, void *topic, int tsize, void *content, int csize, int port);
int wrap_fn_dgram_socket_port(hcsoftbus lib, void *s);
void wrap_fn_dgram_socket_free(hcsoftbus lib, void *buf);
#ifdef __cplusplus
}