Change-Id: Id3891fe2873b631f8f69c1ca2905968130678561
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
libvcl_ldpreload_la_LIBADD = $(libvppcom_la_DEPENDENCIES) -lpthread -lrt -ldl
libvcl_ldpreload_la_SOURCES += \
libvcl_ldpreload_la_LIBADD = $(libvppcom_la_DEPENDENCIES) -lpthread -lrt -ldl
libvcl_ldpreload_la_SOURCES += \
- vcl/vcom_socket_wrapper.c \
- vcl/vcom.c \
+ vcl/ldp_socket_wrapper.c \
+ vcl/ldp.c \
$(libvppcom_la_SOURCES)
nobase_include_HEADERS += \
$(libvppcom_la_SOURCES)
nobase_include_HEADERS += \
- vcl/vcom_socket_wrapper.h \
- vcl/vcom_glibc_socket.h \
- vcl/vcom.h
+ vcl/ldp_socket_wrapper.h \
+ vcl/ldp_glibc_socket.h \
+ vcl/ldp.h
noinst_PROGRAMS += \
vcl_test_server \
noinst_PROGRAMS += \
vcl_test_server \
#include <sys/resource.h>
#include <netinet/tcp.h>
#include <sys/resource.h>
#include <netinet/tcp.h>
-#include <vcl/vcom_socket_wrapper.h>
-#include <vcl/vcom.h>
+#include <vcl/ldp_socket_wrapper.h>
+#include <vcl/ldp.h>
#include <sys/time.h>
#include <vcl/vppcom.h>
#include <sys/time.h>
#include <vcl/vppcom.h>
typedef struct
{
int init;
typedef struct
{
int init;
- char app_name[VCOM_APP_NAME_MAX];
+ char app_name[LDP_APP_NAME_MAX];
u32 sid_bit_val;
u32 sid_bit_mask;
u32 debug;
u32 sid_bit_val;
u32 sid_bit_mask;
u32 debug;
vcl_poll_t *vcl_poll;
u8 select_vcl;
u8 epoll_wait_vcl;
vcl_poll_t *vcl_poll;
u8 select_vcl;
u8 epoll_wait_vcl;
-} vcom_main_t;
-#define VCOM_DEBUG vcom->debug
+} ldp_main_t;
+#define LDP_DEBUG ldp->debug
-static vcom_main_t vcom_main = {
- .sid_bit_val = (1 << VCOM_SID_BIT_MIN),
- .sid_bit_mask = (1 << VCOM_SID_BIT_MIN) - 1,
- .debug = VCOM_DEBUG_INIT,
+static ldp_main_t ldp_main = {
+ .sid_bit_val = (1 << LDP_SID_BIT_MIN),
+ .sid_bit_mask = (1 << LDP_SID_BIT_MIN) - 1,
+ .debug = LDP_DEBUG_INIT,
-static vcom_main_t *vcom = &vcom_main;
+static ldp_main_t *ldp = &ldp_main;
/*
* RETURN: 0 on success or -1 on error.
* */
static inline void
/*
* RETURN: 0 on success or -1 on error.
* */
static inline void
-vcom_set_app_name (char *app_name)
+ldp_set_app_name (char *app_name)
- int rv = snprintf (vcom->app_name, VCOM_APP_NAME_MAX,
- "vcom-%d-%s", getpid (), app_name);
+ int rv = snprintf (ldp->app_name, LDP_APP_NAME_MAX,
+ "ldp-%d-%s", getpid (), app_name);
- if (rv >= VCOM_APP_NAME_MAX)
- app_name[VCOM_APP_NAME_MAX - 1] = 0;
+ if (rv >= LDP_APP_NAME_MAX)
+ app_name[LDP_APP_NAME_MAX - 1] = 0;
- if (vcom->app_name[0] == '\0')
- vcom_set_app_name ("app");
+ if (ldp->app_name[0] == '\0')
+ ldp_set_app_name ("app");
-vcom_fd_from_sid (u32 sid)
+ldp_fd_from_sid (u32 sid)
- if (PREDICT_FALSE (sid >= vcom->sid_bit_val))
+ if (PREDICT_FALSE (sid >= ldp->sid_bit_val))
- return (sid | vcom->sid_bit_val);
+ return (sid | ldp->sid_bit_val);
- return ((u32) fd & vcom->sid_bit_val) ? 1 : 0;
+ return ((u32) fd & ldp->sid_bit_val) ? 1 : 0;
-vcom_sid_from_fd (int fd)
+ldp_sid_from_fd (int fd)
- return (vcom_fd_is_sid (fd) ? ((u32) fd & vcom->sid_bit_mask) :
+ return (ldp_fd_is_sid (fd) ? ((u32) fd & ldp->sid_bit_mask) :
INVALID_SESSION_ID);
}
static inline int
INVALID_SESSION_ID);
}
static inline int
- if (PREDICT_FALSE (!vcom->init))
+ if (PREDICT_FALSE (!ldp->init))
- vcom->init = 1;
- rv = vppcom_app_create (vcom_get_app_name ());
+ ldp->init = 1;
+ rv = vppcom_app_create (ldp_get_app_name ());
- char *env_var_str = getenv (VCOM_ENV_DEBUG);
+ char *env_var_str = getenv (LDP_ENV_DEBUG);
if (env_var_str)
{
u32 tmp;
if (sscanf (env_var_str, "%u", &tmp) != 1)
if (env_var_str)
{
u32 tmp;
if (sscanf (env_var_str, "%u", &tmp) != 1)
- clib_warning ("LDP<%d>: WARNING: Invalid VCOM debug level "
- "specified in the env var " VCOM_ENV_DEBUG
+ clib_warning ("LDP<%d>: WARNING: Invalid LDP debug level "
+ "specified in the env var " LDP_ENV_DEBUG
" (%s)!", getpid (), env_var_str);
else
{
" (%s)!", getpid (), env_var_str);
else
{
- vcom->debug = tmp;
- clib_warning ("LDP<%d>: configured VCOM debug level (%u) "
- "from the env var " VCOM_ENV_DEBUG "!",
- getpid (), vcom->debug);
+ ldp->debug = tmp;
+ clib_warning ("LDP<%d>: configured LDP debug level (%u) "
+ "from the env var " LDP_ENV_DEBUG "!",
+ getpid (), ldp->debug);
- env_var_str = getenv (VCOM_ENV_APP_NAME);
+ env_var_str = getenv (LDP_ENV_APP_NAME);
- vcom_set_app_name (env_var_str);
- clib_warning ("LDP<%d>: configured VCOM app name (%s) "
- "from the env var " VCOM_ENV_APP_NAME "!",
- getpid (), vcom->app_name);
+ ldp_set_app_name (env_var_str);
+ clib_warning ("LDP<%d>: configured LDP app name (%s) "
+ "from the env var " LDP_ENV_APP_NAME "!",
+ getpid (), ldp->app_name);
- env_var_str = getenv (VCOM_ENV_SID_BIT);
+ env_var_str = getenv (LDP_ENV_SID_BIT);
if (env_var_str)
{
u32 sb;
if (sscanf (env_var_str, "%u", &sb) != 1)
{
if (env_var_str)
{
u32 sb;
if (sscanf (env_var_str, "%u", &sb) != 1)
{
- clib_warning ("LDP<%d>: WARNING: Invalid VCOM sid bit "
+ clib_warning ("LDP<%d>: WARNING: Invalid LDP sid bit "
"specified in the env var "
"specified in the env var "
- VCOM_ENV_SID_BIT " (%s)!"
+ LDP_ENV_SID_BIT " (%s)!"
"sid bit value %d (0x%x)",
getpid (), env_var_str,
"sid bit value %d (0x%x)",
getpid (), env_var_str,
- vcom->sid_bit_val, vcom->sid_bit_val);
+ ldp->sid_bit_val, ldp->sid_bit_val);
- else if (sb < VCOM_SID_BIT_MIN)
+ else if (sb < LDP_SID_BIT_MIN)
- vcom->sid_bit_val = (1 << VCOM_SID_BIT_MIN);
- vcom->sid_bit_mask = vcom->sid_bit_val - 1;
+ ldp->sid_bit_val = (1 << LDP_SID_BIT_MIN);
+ ldp->sid_bit_mask = ldp->sid_bit_val - 1;
- clib_warning ("LDP<%d>: WARNING: VCOM sid bit (%u) "
+ clib_warning ("LDP<%d>: WARNING: LDP sid bit (%u) "
"specified in the env var "
"specified in the env var "
- VCOM_ENV_SID_BIT " (%s) is too small. "
- "Using VCOM_SID_BIT_MIN (%d)! "
+ LDP_ENV_SID_BIT " (%s) is too small. "
+ "Using LDP_SID_BIT_MIN (%d)! "
"sid bit value %d (0x%x)",
"sid bit value %d (0x%x)",
- getpid (), sb, env_var_str, VCOM_SID_BIT_MIN,
- vcom->sid_bit_val, vcom->sid_bit_val);
+ getpid (), sb, env_var_str, LDP_SID_BIT_MIN,
+ ldp->sid_bit_val, ldp->sid_bit_val);
- else if (sb > VCOM_SID_BIT_MAX)
+ else if (sb > LDP_SID_BIT_MAX)
- vcom->sid_bit_val = (1 << VCOM_SID_BIT_MAX);
- vcom->sid_bit_mask = vcom->sid_bit_val - 1;
+ ldp->sid_bit_val = (1 << LDP_SID_BIT_MAX);
+ ldp->sid_bit_mask = ldp->sid_bit_val - 1;
- clib_warning ("LDP<%d>: WARNING: VCOM sid bit (%u) "
+ clib_warning ("LDP<%d>: WARNING: LDP sid bit (%u) "
"specified in the env var "
"specified in the env var "
- VCOM_ENV_SID_BIT " (%s) is too big. "
- "Using VCOM_SID_BIT_MAX (%d)! "
+ LDP_ENV_SID_BIT " (%s) is too big. "
+ "Using LDP_SID_BIT_MAX (%d)! "
"sid bit value %d (0x%x)",
"sid bit value %d (0x%x)",
- getpid (), sb, env_var_str, VCOM_SID_BIT_MAX,
- vcom->sid_bit_val, vcom->sid_bit_val);
+ getpid (), sb, env_var_str, LDP_SID_BIT_MAX,
+ ldp->sid_bit_val, ldp->sid_bit_val);
- vcom->sid_bit_val = (1 << sb);
- vcom->sid_bit_mask = vcom->sid_bit_val - 1;
+ ldp->sid_bit_val = (1 << sb);
+ ldp->sid_bit_mask = ldp->sid_bit_val - 1;
- clib_warning ("LDP<%d>: configured VCOM sid bit (%u) "
- "from " VCOM_ENV_SID_BIT
+ clib_warning ("LDP<%d>: configured LDP sid bit (%u) "
+ "from " LDP_ENV_SID_BIT
"! sid bit value %d (0x%x)", getpid (),
"! sid bit value %d (0x%x)", getpid (),
- sb, vcom->sid_bit_val, vcom->sid_bit_val);
+ sb, ldp->sid_bit_val, ldp->sid_bit_val);
- clib_time_init (&vcom->clib_time);
- clib_warning ("LDP<%d>: VCOM initialization: done!", getpid ());
+ clib_time_init (&ldp->clib_time);
+ clib_warning ("LDP<%d>: LDP initialization: done!", getpid ());
- fprintf (stderr, "\nLDP<%d>: ERROR: vcom_init: vppcom_app_create()"
+ fprintf (stderr, "\nLDP<%d>: ERROR: ldp_init: vppcom_app_create()"
" failed! rv = %d (%s)\n",
getpid (), rv, vppcom_retval_str (rv));
" failed! rv = %d (%s)\n",
getpid (), rv, vppcom_retval_str (rv));
{
int rv;
const char *func_str;
{
int rv;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "libc_close";
{
func_str = "libc_close";
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): epfd %u (0x%x)",
getpid (), fd, fd, func_str, epfd, epfd);
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): epfd %u (0x%x)",
getpid (), fd, fd, func_str, epfd, epfd);
func_str = "vppcom_session_close";
func_str = "vppcom_session_close";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
{
func_str = "libc_close";
{
func_str = "libc_close";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s()",
getpid (), fd, fd, func_str);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s()",
getpid (), fd, fd, func_str);
{
ssize_t size;
const char *func_str;
{
ssize_t size;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_session_read";
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_session_read";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, nbytes %u", getpid (),
fd, fd, func_str, sid, sid, buf, nbytes);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, nbytes %u", getpid (),
fd, fd, func_str, sid, sid, buf, nbytes);
{
func_str = "libc_read";
{
func_str = "libc_read";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, nbytes %u", getpid (),
fd, fd, func_str, buf, nbytes);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, nbytes %u", getpid (),
fd, fd, func_str, buf, nbytes);
size = libc_read (fd, buf, nbytes);
}
size = libc_read (fd, buf, nbytes);
}
{
const char *func_str;
ssize_t size = 0;
{
const char *func_str;
ssize_t size = 0;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
int rv = 0, i, total = 0;
int rv = 0, i, total = 0;
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
for (i = 0; i < iovcnt; ++i)
{
{
for (i = 0; i < iovcnt; ++i)
{
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s() [%d]: "
"sid %u (0x%x), iov %p, iovcnt %d, total %d",
getpid (), fd, fd, func_str, i, sid, sid,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s() [%d]: "
"sid %u (0x%x), iov %p, iovcnt %d, total %d",
getpid (), fd, fd, func_str, i, sid, sid,
total += rv;
if (rv < iov[i].iov_len)
{
total += rv;
if (rv < iov[i].iov_len)
{
clib_warning ("LDP<%d>: fd %d (0x%x): "
"rv (%d) < iov[%d].iov_len (%d)",
getpid (), fd, fd, rv, i,
clib_warning ("LDP<%d>: fd %d (0x%x): "
"rv (%d) < iov[%d].iov_len (%d)",
getpid (), fd, fd, rv, i,
{
func_str = "libc_readv";
{
func_str = "libc_readv";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"iov %p, iovcnt %d", getpid (), fd, fd, iov, iovcnt);
size = libc_readv (fd, iov, iovcnt);
}
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"iov %p, iovcnt %d", getpid (), fd, fd, iov, iovcnt);
size = libc_readv (fd, iov, iovcnt);
}
{
const char *func_str;
ssize_t size = 0;
{
const char *func_str;
ssize_t size = 0;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_session_write";
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_session_write";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, nbytes %u", getpid (),
fd, fd, func_str, sid, sid, buf, nbytes);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, nbytes %u", getpid (),
fd, fd, func_str, sid, sid, buf, nbytes);
{
func_str = "libc_write";
{
func_str = "libc_write";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, nbytes %u", getpid (),
fd, fd, func_str, buf, nbytes);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, nbytes %u", getpid (),
fd, fd, func_str, buf, nbytes);
size = libc_write (fd, buf, nbytes);
}
size = libc_write (fd, buf, nbytes);
}
{
const char *func_str;
ssize_t size = 0, total = 0;
{
const char *func_str;
ssize_t size = 0, total = 0;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
int i, rv = 0;
/*
* Use [f]printf() instead of clib_warning() to prevent recursion SIGSEGV.
*/
int i, rv = 0;
/*
* Use [f]printf() instead of clib_warning() to prevent recursion SIGSEGV.
*/
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
for (i = 0; i < iovcnt; ++i)
{
{
for (i = 0; i < iovcnt; ++i)
{
printf ("%s:%d: LDP<%d>: fd %d (0x%x): calling %s() [%d]: "
"sid %u (0x%x), buf %p, nbytes %ld, total %ld",
__func__, __LINE__, getpid (), fd, fd, func_str,
printf ("%s:%d: LDP<%d>: fd %d (0x%x): calling %s() [%d]: "
"sid %u (0x%x), buf %p, nbytes %ld, total %ld",
__func__, __LINE__, getpid (), fd, fd, func_str,
total += rv;
if (rv < iov[i].iov_len)
{
total += rv;
if (rv < iov[i].iov_len)
{
printf ("%s:%d: LDP<%d>: fd %d (0x%x): "
"rv (%d) < iov[%d].iov_len (%ld)",
__func__, __LINE__, getpid (), fd, fd,
printf ("%s:%d: LDP<%d>: fd %d (0x%x): "
"rv (%d) < iov[%d].iov_len (%ld)",
__func__, __LINE__, getpid (), fd, fd,
{
func_str = "libc_writev";
{
func_str = "libc_writev";
printf ("%s:%d: LDP<%d>: fd %d (0x%x): calling %s(): "
"iov %p, iovcnt %d\n", __func__, __LINE__, getpid (),
fd, fd, func_str, iov, iovcnt);
printf ("%s:%d: LDP<%d>: fd %d (0x%x): calling %s(): "
"iov %p, iovcnt %d\n", __func__, __LINE__, getpid (),
fd, fd, func_str, iov, iovcnt);
size = libc_writev (fd, iov, iovcnt);
}
size = libc_writev (fd, iov, iovcnt);
}
const char *func_str = __func__;
int rv = 0;
va_list ap;
const char *func_str = __func__;
int rv = 0;
va_list ap;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
va_start (ap, cmd);
return -1;
va_start (ap, cmd);
{
case F_SETFL:
func_str = "vppcom_session_attr[SET_FLAGS]";
{
case F_SETFL:
func_str = "vppcom_session_attr[SET_FLAGS]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x) flags %d (0x%x), size %d",
getpid (), fd, fd, func_str, sid, sid,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x) flags %d (0x%x), size %d",
getpid (), fd, fd, func_str, sid, sid,
case F_GETFL:
func_str = "vppcom_session_attr[GET_FLAGS]";
case F_GETFL:
func_str = "vppcom_session_attr[GET_FLAGS]";
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"flags %d (0x%x), size %d", getpid (), fd, fd, func_str, sid,
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"flags %d (0x%x), size %d", getpid (), fd, fd, func_str, sid,
vppcom_session_attr (sid, VPPCOM_ATTR_GET_FLAGS, &flags, &size);
if (rv == VPPCOM_OK)
{
vppcom_session_attr (sid, VPPCOM_ATTR_GET_FLAGS, &flags, &size);
if (rv == VPPCOM_OK)
{
clib_warning ("LDP<%d>: fd %d (0x%x), cmd %d (F_GETFL): "
"%s() returned flags %d (0x%x)",
getpid (), fd, fd, cmd, func_str, flags, flags);
clib_warning ("LDP<%d>: fd %d (0x%x), cmd %d (F_GETFL): "
"%s() returned flags %d (0x%x)",
getpid (), fd, fd, cmd, func_str, flags, flags);
{
func_str = "libc_vfcntl";
{
func_str = "libc_vfcntl";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): cmd %d",
getpid (), fd, fd, func_str, cmd);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): cmd %d",
getpid (), fd, fd, func_str, cmd);
const char *func_str;
int rv;
va_list ap;
const char *func_str;
int rv;
va_list ap;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
va_start (ap, cmd);
return -1;
va_start (ap, cmd);
switch (cmd)
{
case FIONREAD:
switch (cmd)
{
case FIONREAD:
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
* non-blocking, the flags should be read here and merged
* with O_NONBLOCK.
*/
* non-blocking, the flags should be read here and merged
* with O_NONBLOCK.
*/
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), flags %d (0x%x), size %d",
getpid (), fd, fd, func_str, sid, sid,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), flags %d (0x%x), size %d",
getpid (), fd, fd, func_str, sid, sid,
{
func_str = "libc_vioctl";
{
func_str = "libc_vioctl";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): cmd %d",
getpid (), fd, fd, func_str, cmd);
rv = libc_vioctl (fd, cmd, ap);
}
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): cmd %d",
getpid (), fd, fd, func_str, cmd);
rv = libc_vioctl (fd, cmd, ap);
}
-vcom_pselect (int nfds, fd_set * __restrict readfds,
- fd_set * __restrict writefds,
- fd_set * __restrict exceptfds,
- const struct timespec *__restrict timeout,
- const __sigset_t * __restrict sigmask)
+ldp_pselect (int nfds, fd_set * __restrict readfds,
+ fd_set * __restrict writefds,
+ fd_set * __restrict exceptfds,
+ const struct timespec *__restrict timeout,
+ const __sigset_t * __restrict sigmask)
{
int rv;
char *func_str = "##";
{
int rv;
char *func_str = "##";
- if (nfds <= vcom->sid_bit_val)
+ if (nfds <= ldp->sid_bit_val)
{
func_str = "libc_pselect";
{
func_str = "libc_pselect";
clib_warning
("LDP<%d>: calling %s(): nfds %d, readfds %p, writefds %p, "
"exceptfds %p, timeout %p, sigmask %p", getpid (), func_str, nfds,
clib_warning
("LDP<%d>: calling %s(): nfds %d, readfds %p, writefds %p, "
"exceptfds %p, timeout %p, sigmask %p", getpid (), func_str, nfds,
- if (PREDICT_FALSE (vcom->sid_bit_val > FD_SETSIZE / 2))
+ if (PREDICT_FALSE (ldp->sid_bit_val > FD_SETSIZE / 2))
- clib_warning ("LDP<%d>: ERROR: VCOM sid bit value %d (0x%x) > "
+ clib_warning ("LDP<%d>: ERROR: LDP sid bit value %d (0x%x) > "
"FD_SETSIZE/2 %d (0x%x)!", getpid (),
"FD_SETSIZE/2 %d (0x%x)!", getpid (),
- vcom->sid_bit_val, vcom->sid_bit_val,
+ ldp->sid_bit_val, ldp->sid_bit_val,
FD_SETSIZE / 2, FD_SETSIZE / 2);
errno = EOVERFLOW;
return -1;
FD_SETSIZE / 2, FD_SETSIZE / 2);
errno = EOVERFLOW;
return -1;
/* select as fine grained sleep */
if (!nfds)
{
/* select as fine grained sleep */
if (!nfds)
{
clib_warning ("LDP<%d>: sleeping for %f seconds",
getpid (), time_out);
clib_warning ("LDP<%d>: sleeping for %f seconds",
getpid (), time_out);
- time_out += clib_time_now (&vcom->clib_time);
- while (clib_time_now (&vcom->clib_time) < time_out)
+ time_out += clib_time_now (&ldp->clib_time);
+ while (clib_time_now (&ldp->clib_time) < time_out)
sid_bits = libc_bits = 0;
if (readfds)
{
sid_bits = libc_bits = 0;
if (readfds)
{
- clib_bitmap_validate (vcom->sid_rd_bitmap, minbits);
- clib_bitmap_validate (vcom->libc_rd_bitmap, minbits);
- clib_bitmap_validate (vcom->rd_bitmap, minbits);
- clib_memcpy (vcom->rd_bitmap, readfds,
- vec_len (vcom->rd_bitmap) * sizeof (clib_bitmap_t));
+ clib_bitmap_validate (ldp->sid_rd_bitmap, minbits);
+ clib_bitmap_validate (ldp->libc_rd_bitmap, minbits);
+ clib_bitmap_validate (ldp->rd_bitmap, minbits);
+ clib_memcpy (ldp->rd_bitmap, readfds,
+ vec_len (ldp->rd_bitmap) * sizeof (clib_bitmap_t));
FD_ZERO (readfds);
/* *INDENT-OFF* */
FD_ZERO (readfds);
/* *INDENT-OFF* */
- clib_bitmap_foreach (fd, vcom->rd_bitmap,
+ clib_bitmap_foreach (fd, ldp->rd_bitmap,
- sid = vcom_sid_from_fd (fd);
- if (VCOM_DEBUG > 3)
+ sid = ldp_sid_from_fd (fd);
+ if (LDP_DEBUG > 3)
clib_warning ("LDP<%d>: readfds: fd %d (0x%x), sid %u (0x%x)",
getpid (), fd, fd, sid, sid);
if (sid == INVALID_SESSION_ID)
clib_warning ("LDP<%d>: readfds: fd %d (0x%x), sid %u (0x%x)",
getpid (), fd, fd, sid, sid);
if (sid == INVALID_SESSION_ID)
- clib_bitmap_set_no_check (vcom->libc_rd_bitmap, fd, 1);
+ clib_bitmap_set_no_check (ldp->libc_rd_bitmap, fd, 1);
- clib_bitmap_set_no_check (vcom->sid_rd_bitmap, sid, 1);
+ clib_bitmap_set_no_check (ldp->sid_rd_bitmap, sid, 1);
- sid_bits_set = clib_bitmap_last_set (vcom->sid_rd_bitmap) + 1;
+ sid_bits_set = clib_bitmap_last_set (ldp->sid_rd_bitmap) + 1;
sid_bits = (sid_bits_set > sid_bits) ? sid_bits_set : sid_bits;
sid_bits = (sid_bits_set > sid_bits) ? sid_bits_set : sid_bits;
- libc_bits_set = clib_bitmap_last_set (vcom->libc_rd_bitmap) + 1;
+ libc_bits_set = clib_bitmap_last_set (ldp->libc_rd_bitmap) + 1;
libc_bits = (libc_bits_set > libc_bits) ? libc_bits_set : libc_bits;
libc_bits = (libc_bits_set > libc_bits) ? libc_bits_set : libc_bits;
clib_warning ("LDP<%d>: readfds: sid_bits_set %d, sid_bits %d, "
"libc_bits_set %d, libc_bits %d", getpid (),
sid_bits_set, sid_bits, libc_bits_set, libc_bits);
}
if (writefds)
{
clib_warning ("LDP<%d>: readfds: sid_bits_set %d, sid_bits %d, "
"libc_bits_set %d, libc_bits %d", getpid (),
sid_bits_set, sid_bits, libc_bits_set, libc_bits);
}
if (writefds)
{
- clib_bitmap_validate (vcom->sid_wr_bitmap, minbits);
- clib_bitmap_validate (vcom->libc_wr_bitmap, minbits);
- clib_bitmap_validate (vcom->wr_bitmap, minbits);
- clib_memcpy (vcom->wr_bitmap, writefds,
- vec_len (vcom->wr_bitmap) * sizeof (clib_bitmap_t));
+ clib_bitmap_validate (ldp->sid_wr_bitmap, minbits);
+ clib_bitmap_validate (ldp->libc_wr_bitmap, minbits);
+ clib_bitmap_validate (ldp->wr_bitmap, minbits);
+ clib_memcpy (ldp->wr_bitmap, writefds,
+ vec_len (ldp->wr_bitmap) * sizeof (clib_bitmap_t));
FD_ZERO (writefds);
/* *INDENT-OFF* */
FD_ZERO (writefds);
/* *INDENT-OFF* */
- clib_bitmap_foreach (fd, vcom->wr_bitmap,
+ clib_bitmap_foreach (fd, ldp->wr_bitmap,
- sid = vcom_sid_from_fd (fd);
- if (VCOM_DEBUG > 3)
+ sid = ldp_sid_from_fd (fd);
+ if (LDP_DEBUG > 3)
clib_warning ("LDP<%d>: writefds: fd %d (0x%x), sid %u (0x%x)",
getpid (), fd, fd, sid, sid);
if (sid == INVALID_SESSION_ID)
clib_warning ("LDP<%d>: writefds: fd %d (0x%x), sid %u (0x%x)",
getpid (), fd, fd, sid, sid);
if (sid == INVALID_SESSION_ID)
- clib_bitmap_set_no_check (vcom->libc_wr_bitmap, fd, 1);
+ clib_bitmap_set_no_check (ldp->libc_wr_bitmap, fd, 1);
- clib_bitmap_set_no_check (vcom->sid_wr_bitmap, sid, 1);
+ clib_bitmap_set_no_check (ldp->sid_wr_bitmap, sid, 1);
- sid_bits_set = clib_bitmap_last_set (vcom->sid_wr_bitmap) + 1;
+ sid_bits_set = clib_bitmap_last_set (ldp->sid_wr_bitmap) + 1;
sid_bits = (sid_bits_set > sid_bits) ? sid_bits_set : sid_bits;
sid_bits = (sid_bits_set > sid_bits) ? sid_bits_set : sid_bits;
- libc_bits_set = clib_bitmap_last_set (vcom->libc_wr_bitmap) + 1;
+ libc_bits_set = clib_bitmap_last_set (ldp->libc_wr_bitmap) + 1;
libc_bits = (libc_bits_set > libc_bits) ? libc_bits_set : libc_bits;
libc_bits = (libc_bits_set > libc_bits) ? libc_bits_set : libc_bits;
clib_warning ("LDP<%d>: writefds: sid_bits_set %d, sid_bits %d, "
"libc_bits_set %d, libc_bits %d", getpid (),
sid_bits_set, sid_bits, libc_bits_set, libc_bits);
}
if (exceptfds)
{
clib_warning ("LDP<%d>: writefds: sid_bits_set %d, sid_bits %d, "
"libc_bits_set %d, libc_bits %d", getpid (),
sid_bits_set, sid_bits, libc_bits_set, libc_bits);
}
if (exceptfds)
{
- clib_bitmap_validate (vcom->sid_ex_bitmap, minbits);
- clib_bitmap_validate (vcom->libc_ex_bitmap, minbits);
- clib_bitmap_validate (vcom->ex_bitmap, minbits);
- clib_memcpy (vcom->ex_bitmap, exceptfds,
- vec_len (vcom->ex_bitmap) * sizeof (clib_bitmap_t));
+ clib_bitmap_validate (ldp->sid_ex_bitmap, minbits);
+ clib_bitmap_validate (ldp->libc_ex_bitmap, minbits);
+ clib_bitmap_validate (ldp->ex_bitmap, minbits);
+ clib_memcpy (ldp->ex_bitmap, exceptfds,
+ vec_len (ldp->ex_bitmap) * sizeof (clib_bitmap_t));
FD_ZERO (exceptfds);
/* *INDENT-OFF* */
FD_ZERO (exceptfds);
/* *INDENT-OFF* */
- clib_bitmap_foreach (fd, vcom->ex_bitmap,
+ clib_bitmap_foreach (fd, ldp->ex_bitmap,
- sid = vcom_sid_from_fd (fd);
- if (VCOM_DEBUG > 3)
+ sid = ldp_sid_from_fd (fd);
+ if (LDP_DEBUG > 3)
clib_warning ("LDP<%d>: exceptfds: fd %d (0x%x), sid %u (0x%x)",
getpid (), fd, fd, sid, sid);
if (sid == INVALID_SESSION_ID)
clib_warning ("LDP<%d>: exceptfds: fd %d (0x%x), sid %u (0x%x)",
getpid (), fd, fd, sid, sid);
if (sid == INVALID_SESSION_ID)
- clib_bitmap_set_no_check (vcom->libc_ex_bitmap, fd, 1);
+ clib_bitmap_set_no_check (ldp->libc_ex_bitmap, fd, 1);
- clib_bitmap_set_no_check (vcom->sid_ex_bitmap, sid, 1);
+ clib_bitmap_set_no_check (ldp->sid_ex_bitmap, sid, 1);
- sid_bits_set = clib_bitmap_last_set (vcom->sid_ex_bitmap) + 1;
+ sid_bits_set = clib_bitmap_last_set (ldp->sid_ex_bitmap) + 1;
sid_bits = (sid_bits_set > sid_bits) ? sid_bits_set : sid_bits;
sid_bits = (sid_bits_set > sid_bits) ? sid_bits_set : sid_bits;
- libc_bits_set = clib_bitmap_last_set (vcom->libc_ex_bitmap) + 1;
+ libc_bits_set = clib_bitmap_last_set (ldp->libc_ex_bitmap) + 1;
libc_bits = (libc_bits_set > libc_bits) ? libc_bits_set : libc_bits;
libc_bits = (libc_bits_set > libc_bits) ? libc_bits_set : libc_bits;
clib_warning ("LDP<%d>: exceptfds: sid_bits_set %d, sid_bits %d, "
"libc_bits_set %d, libc_bits %d", getpid (),
sid_bits_set, sid_bits, libc_bits_set, libc_bits);
clib_warning ("LDP<%d>: exceptfds: sid_bits_set %d, sid_bits %d, "
"libc_bits_set %d, libc_bits %d", getpid (),
sid_bits_set, sid_bits, libc_bits_set, libc_bits);
{
func_str = "vppcom_select";
if (readfds)
{
func_str = "vppcom_select";
if (readfds)
- clib_memcpy (vcom->rd_bitmap, vcom->sid_rd_bitmap,
- vec_len (vcom->rd_bitmap) *
+ clib_memcpy (ldp->rd_bitmap, ldp->sid_rd_bitmap,
+ vec_len (ldp->rd_bitmap) *
sizeof (clib_bitmap_t));
if (writefds)
sizeof (clib_bitmap_t));
if (writefds)
- clib_memcpy (vcom->wr_bitmap, vcom->sid_wr_bitmap,
- vec_len (vcom->wr_bitmap) *
+ clib_memcpy (ldp->wr_bitmap, ldp->sid_wr_bitmap,
+ vec_len (ldp->wr_bitmap) *
sizeof (clib_bitmap_t));
if (exceptfds)
sizeof (clib_bitmap_t));
if (exceptfds)
- clib_memcpy (vcom->ex_bitmap, vcom->sid_ex_bitmap,
- vec_len (vcom->ex_bitmap) *
+ clib_memcpy (ldp->ex_bitmap, ldp->sid_ex_bitmap,
+ vec_len (ldp->ex_bitmap) *
sizeof (clib_bitmap_t));
rv = vppcom_select (sid_bits,
sizeof (clib_bitmap_t));
rv = vppcom_select (sid_bits,
- readfds ? vcom->rd_bitmap : NULL,
- writefds ? vcom->wr_bitmap : NULL,
- exceptfds ? vcom->ex_bitmap : NULL, 0);
+ readfds ? ldp->rd_bitmap : NULL,
+ writefds ? ldp->wr_bitmap : NULL,
+ exceptfds ? ldp->ex_bitmap : NULL, 0);
if (rv < 0)
{
errno = -rv;
if (rv < 0)
{
errno = -rv;
if (readfds)
{
/* *INDENT-OFF* */
if (readfds)
{
/* *INDENT-OFF* */
- clib_bitmap_foreach (sid, vcom->rd_bitmap,
+ clib_bitmap_foreach (sid, ldp->rd_bitmap,
- fd = vcom_fd_from_sid (sid);
+ fd = ldp_fd_from_sid (sid);
if (PREDICT_FALSE (fd < 0))
{
errno = EBADFD;
if (PREDICT_FALSE (fd < 0))
{
errno = EBADFD;
if (writefds)
{
/* *INDENT-OFF* */
if (writefds)
{
/* *INDENT-OFF* */
- clib_bitmap_foreach (sid, vcom->wr_bitmap,
+ clib_bitmap_foreach (sid, ldp->wr_bitmap,
- fd = vcom_fd_from_sid (sid);
+ fd = ldp_fd_from_sid (sid);
if (PREDICT_FALSE (fd < 0))
{
errno = EBADFD;
if (PREDICT_FALSE (fd < 0))
{
errno = EBADFD;
if (exceptfds)
{
/* *INDENT-OFF* */
if (exceptfds)
{
/* *INDENT-OFF* */
- clib_bitmap_foreach (sid, vcom->ex_bitmap,
+ clib_bitmap_foreach (sid, ldp->ex_bitmap,
- fd = vcom_fd_from_sid (sid);
+ fd = ldp_fd_from_sid (sid);
if (PREDICT_FALSE (fd < 0))
{
errno = EBADFD;
if (PREDICT_FALSE (fd < 0))
{
errno = EBADFD;
func_str = "libc_pselect";
if (readfds)
func_str = "libc_pselect";
if (readfds)
- clib_memcpy (readfds, vcom->libc_rd_bitmap,
- vec_len (vcom->rd_bitmap) * sizeof (clib_bitmap_t));
+ clib_memcpy (readfds, ldp->libc_rd_bitmap,
+ vec_len (ldp->rd_bitmap) * sizeof (clib_bitmap_t));
- clib_memcpy (writefds, vcom->libc_wr_bitmap,
- vec_len (vcom->wr_bitmap) * sizeof (clib_bitmap_t));
+ clib_memcpy (writefds, ldp->libc_wr_bitmap,
+ vec_len (ldp->wr_bitmap) * sizeof (clib_bitmap_t));
- clib_memcpy (exceptfds, vcom->libc_ex_bitmap,
- vec_len (vcom->ex_bitmap) * sizeof (clib_bitmap_t));
+ clib_memcpy (exceptfds, ldp->libc_ex_bitmap,
+ vec_len (ldp->ex_bitmap) * sizeof (clib_bitmap_t));
tspec.tv_sec = tspec.tv_nsec = 0;
rv = libc_pselect (libc_bits,
readfds ? readfds : NULL,
tspec.tv_sec = tspec.tv_nsec = 0;
rv = libc_pselect (libc_bits,
readfds ? readfds : NULL,
- while ((time_out == -1) || (clib_time_now (&vcom->clib_time) < time_out));
+ while ((time_out == -1) || (clib_time_now (&ldp->clib_time) < time_out));
rv = 0;
done:
/* TBD: set timeout to amount of time left */
rv = 0;
done:
/* TBD: set timeout to amount of time left */
- vec_reset_length (vcom->rd_bitmap);
- vec_reset_length (vcom->sid_rd_bitmap);
- vec_reset_length (vcom->libc_rd_bitmap);
- vec_reset_length (vcom->wr_bitmap);
- vec_reset_length (vcom->sid_wr_bitmap);
- vec_reset_length (vcom->libc_wr_bitmap);
- vec_reset_length (vcom->ex_bitmap);
- vec_reset_length (vcom->sid_ex_bitmap);
- vec_reset_length (vcom->libc_ex_bitmap);
-
- if (VCOM_DEBUG > 3)
+ vec_reset_length (ldp->rd_bitmap);
+ vec_reset_length (ldp->sid_rd_bitmap);
+ vec_reset_length (ldp->libc_rd_bitmap);
+ vec_reset_length (ldp->wr_bitmap);
+ vec_reset_length (ldp->sid_wr_bitmap);
+ vec_reset_length (ldp->libc_wr_bitmap);
+ vec_reset_length (ldp->ex_bitmap);
+ vec_reset_length (ldp->sid_ex_bitmap);
+ vec_reset_length (ldp->libc_ex_bitmap);
+
+ if (LDP_DEBUG > 3)
tspec.tv_sec = timeout->tv_sec;
tspec.tv_nsec = timeout->tv_usec * 1000;
}
tspec.tv_sec = timeout->tv_sec;
tspec.tv_nsec = timeout->tv_usec * 1000;
}
- return vcom_pselect (nfds, readfds, writefds, exceptfds,
- timeout ? &tspec : NULL, NULL);
+ return ldp_pselect (nfds, readfds, writefds, exceptfds,
+ timeout ? &tspec : NULL, NULL);
const struct timespec *__restrict timeout,
const __sigset_t * __restrict sigmask)
{
const struct timespec *__restrict timeout,
const __sigset_t * __restrict sigmask)
{
- return vcom_pselect (nfds, readfds, writefds, exceptfds, timeout, 0);
+ return ldp_pselect (nfds, readfds, writefds, exceptfds, timeout, 0);
u8 is_nonblocking = type & SOCK_NONBLOCK ? 1 : 0;
int sock_type = type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK);
u8 is_nonblocking = type & SOCK_NONBLOCK ? 1 : 0;
int sock_type = type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (((domain == AF_INET) || (domain == AF_INET6)) &&
return -1;
if (((domain == AF_INET) || (domain == AF_INET6)) &&
func_str = "vppcom_session_create";
func_str = "vppcom_session_create";
clib_warning ("LDP<%d>: : calling %s(): "
"proto %u (%s), is_nonblocking %u",
getpid (), func_str, proto,
clib_warning ("LDP<%d>: : calling %s(): "
"proto %u (%s), is_nonblocking %u",
getpid (), func_str, proto,
- func_str = "vcom_fd_from_sid";
- rv = vcom_fd_from_sid (sid);
+ func_str = "ldp_fd_from_sid";
+ rv = ldp_fd_from_sid (sid);
if (rv < 0)
{
(void) vppcom_session_close (sid);
if (rv < 0)
{
(void) vppcom_session_close (sid);
{
func_str = "libc_socket";
{
func_str = "libc_socket";
clib_warning ("LDP<%d>: : calling %s()", getpid (), func_str);
rv = libc_socket (domain, type, protocol);
}
clib_warning ("LDP<%d>: : calling %s()", getpid (), func_str);
rv = libc_socket (domain, type, protocol);
}
int rv;
int sock_type = type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK);
int rv;
int sock_type = type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (((domain == AF_INET) || (domain == AF_INET6)) &&
return -1;
if (((domain == AF_INET) || (domain == AF_INET6)) &&
{
func_str = "libc_socket";
{
func_str = "libc_socket";
clib_warning ("LDP<%d>: : calling %s()", getpid (), func_str);
rv = libc_socket (domain, type, protocol);
}
clib_warning ("LDP<%d>: : calling %s()", getpid (), func_str);
rv = libc_socket (domain, type, protocol);
}
{
int rv;
const char *func_str;
{
int rv;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"addr %p, len %u",
getpid (), fd, fd, func_str, sid, sid, addr, len);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"addr %p, len %u",
getpid (), fd, fd, func_str, sid, sid, addr, len);
{
func_str = "libc_bind";
{
func_str = "libc_bind";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"addr %p, len %u",
getpid (), fd, fd, func_str, addr, len);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"addr %p, len %u",
getpid (), fd, fd, func_str, addr, len);
-vcom_copy_ep_to_sockaddr (__SOCKADDR_ARG addr, socklen_t * __restrict len,
- vppcom_endpt_t * ep)
+ldp_copy_ep_to_sockaddr (__SOCKADDR_ARG addr, socklen_t * __restrict len,
+ vppcom_endpt_t * ep)
{
int rv = 0;
int sa_len, copy_len;
{
int rv = 0;
int sa_len, copy_len;
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (addr && len && ep)
return -1;
if (addr && len && ep)
{
int rv;
const char *func_str;
{
int rv;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
ep.ip = addr_buf;
func_str = "vppcom_session_attr[GET_LCL_ADDR]";
ep.ip = addr_buf;
func_str = "vppcom_session_attr[GET_LCL_ADDR]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"addr %p, len %u",
getpid (), fd, fd, func_str, sid, sid, addr, len);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"addr %p, len %u",
getpid (), fd, fd, func_str, sid, sid, addr, len);
- rv = vcom_copy_ep_to_sockaddr (addr, len, &ep);
+ rv = ldp_copy_ep_to_sockaddr (addr, len, &ep);
if (rv != VPPCOM_OK)
{
errno = -rv;
if (rv != VPPCOM_OK)
{
errno = -rv;
{
func_str = "libc_getsockname";
{
func_str = "libc_getsockname";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"addr %p, len %u",
getpid (), fd, fd, func_str, addr, len);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"addr %p, len %u",
getpid (), fd, fd, func_str, addr, len);
rv = libc_getsockname (fd, addr, len);
}
rv = libc_getsockname (fd, addr, len);
}
{
int rv;
const char *func_str = __func__;
{
int rv;
const char *func_str = __func__;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x) "
"addr %p len %u",
getpid (), fd, fd, func_str, sid, sid, addr, len);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x) "
"addr %p len %u",
getpid (), fd, fd, func_str, sid, sid, addr, len);
{
func_str = "libc_connect";
{
func_str = "libc_connect";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"addr %p, len %u",
getpid (), fd, fd, func_str, addr, len);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"addr %p, len %u",
getpid (), fd, fd, func_str, addr, len);
{
int rv;
const char *func_str;
{
int rv;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
ep.ip = addr_buf;
func_str = "vppcom_session_attr[GET_PEER_ADDR]";
ep.ip = addr_buf;
func_str = "vppcom_session_attr[GET_PEER_ADDR]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"addr %p, len %u",
getpid (), fd, fd, func_str, sid, sid, addr, len);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"addr %p, len %u",
getpid (), fd, fd, func_str, sid, sid, addr, len);
- rv = vcom_copy_ep_to_sockaddr (addr, len, &ep);
+ rv = ldp_copy_ep_to_sockaddr (addr, len, &ep);
if (rv != VPPCOM_OK)
{
errno = -rv;
if (rv != VPPCOM_OK)
{
errno = -rv;
{
func_str = "libc_getpeername";
{
func_str = "libc_getpeername";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"addr %p, len %u",
getpid (), fd, fd, func_str, addr, len);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"addr %p, len %u",
getpid (), fd, fd, func_str, addr, len);
rv = libc_getpeername (fd, addr, len);
}
rv = libc_getpeername (fd, addr, len);
}
{
ssize_t size;
const char *func_str;
{
ssize_t size;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
func_str = "vppcom_session_sendto";
func_str = "vppcom_session_sendto";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"buf %p, n %u, flags 0x%x",
getpid (), fd, fd, func_str, sid, sid, buf, n, flags);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"buf %p, n %u, flags 0x%x",
getpid (), fd, fd, func_str, sid, sid, buf, n, flags);
{
func_str = "libc_send";
{
func_str = "libc_send";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, n %u, flags 0x%x",
getpid (), fd, fd, func_str, buf, n, flags);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, n %u, flags 0x%x",
getpid (), fd, fd, func_str, buf, n, flags);
size = libc_send (fd, buf, n, flags);
}
size = libc_send (fd, buf, n, flags);
}
{
ssize_t size = 0;
const char *func_str;
{
ssize_t size = 0;
const char *func_str;
- u32 sid = vcom_sid_from_fd (out_fd);
+ u32 sid = ldp_sid_from_fd (out_fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
out_fd, out_fd, func_str, sid, sid, rv,
vppcom_retval_str (rv));
out_fd, out_fd, func_str, sid, sid, rv,
vppcom_retval_str (rv));
- vec_reset_length (vcom->io_buffer);
+ vec_reset_length (ldp->io_buffer);
errno = -rv;
size = -1;
goto done;
errno = -rv;
size = -1;
goto done;
("LDP<%d>: ERROR: fd %d (0x%x): %s(): sid %u (0x%x), "
"returned %d (%s)!", getpid (), out_fd, out_fd, func_str,
sid, sid, size, vppcom_retval_str (size));
("LDP<%d>: ERROR: fd %d (0x%x): %s(): sid %u (0x%x), "
"returned %d (%s)!", getpid (), out_fd, out_fd, func_str,
sid, sid, size, vppcom_retval_str (size));
- vec_reset_length (vcom->io_buffer);
+ vec_reset_length (ldp->io_buffer);
errno = -size;
size = -1;
goto done;
}
bytes_to_read = size;
errno = -size;
size = -1;
goto done;
}
bytes_to_read = size;
clib_warning
("LDP<%d>: fd %d (0x%x): called %s(): sid %u (0x%x), "
"results %ld, n_bytes_left %lu, bytes_to_read %lu", getpid (),
clib_warning
("LDP<%d>: fd %d (0x%x): called %s(): sid %u (0x%x), "
"results %ld, n_bytes_left %lu, bytes_to_read %lu", getpid (),
clib_warning ("LDP<%d>: fd %d (0x%x): sid %u (0x%x): "
"EAGAIN",
getpid (), out_fd, out_fd, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): sid %u (0x%x): "
"EAGAIN",
getpid (), out_fd, out_fd, sid, sid);
continue;
}
bytes_to_read = clib_min (n_bytes_left, bytes_to_read);
continue;
}
bytes_to_read = clib_min (n_bytes_left, bytes_to_read);
- vec_validate (vcom->io_buffer, bytes_to_read);
- nbytes = libc_read (in_fd, vcom->io_buffer, bytes_to_read);
+ vec_validate (ldp->io_buffer, bytes_to_read);
+ nbytes = libc_read (in_fd, ldp->io_buffer, bytes_to_read);
if (nbytes < 0)
{
func_str = "libc_read";
if (nbytes < 0)
{
func_str = "libc_read";
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): in_fd (%d), "
"io_buffer %p, bytes_to_read %lu, rv %d, "
"errno %d", getpid (), out_fd, out_fd, func_str,
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): in_fd (%d), "
"io_buffer %p, bytes_to_read %lu, rv %d, "
"errno %d", getpid (), out_fd, out_fd, func_str,
- in_fd, vcom->io_buffer, bytes_to_read, nbytes,
+ in_fd, ldp->io_buffer, bytes_to_read, nbytes,
errno_val);
errno = errno_val;
if (results == 0)
{
errno_val);
errno = errno_val;
if (results == 0)
{
- vec_reset_length (vcom->io_buffer);
+ vec_reset_length (ldp->io_buffer);
size = -1;
goto done;
}
goto update_offset;
}
func_str = "vppcom_session_write";
size = -1;
goto done;
}
goto update_offset;
}
func_str = "vppcom_session_write";
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"buf %p, nbytes %u: results %d, n_bytes_left %d", getpid (),
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), "
"buf %p, nbytes %u: results %d, n_bytes_left %d", getpid (),
- out_fd, out_fd, func_str, sid, sid, vcom->io_buffer, nbytes,
+ out_fd, out_fd, func_str, sid, sid, ldp->io_buffer, nbytes,
- size = vppcom_session_write (sid, vcom->io_buffer, nbytes);
+ size = vppcom_session_write (sid, ldp->io_buffer, nbytes);
if (size < 0)
{
if (size == VPPCOM_EAGAIN)
if (size < 0)
{
if (size == VPPCOM_EAGAIN)
clib_warning
("LDP<%d>: fd %d (0x%x): sid %u (0x%x): "
"EAGAIN", getpid (), out_fd, out_fd, sid, sid);
clib_warning
("LDP<%d>: fd %d (0x%x): sid %u (0x%x): "
"EAGAIN", getpid (), out_fd, out_fd, sid, sid);
"sid %u, io_buffer %p, nbytes %u "
"returned %d (%s)",
getpid (), out_fd, out_fd, func_str,
"sid %u, io_buffer %p, nbytes %u "
"returned %d (%s)",
getpid (), out_fd, out_fd, func_str,
- sid, vcom->io_buffer, nbytes,
+ sid, ldp->io_buffer, nbytes,
size, vppcom_retval_str (size));
}
if (results == 0)
{
size, vppcom_retval_str (size));
}
if (results == 0)
{
- vec_reset_length (vcom->io_buffer);
+ vec_reset_length (ldp->io_buffer);
errno = -size;
size = -1;
goto done;
errno = -size;
size = -1;
goto done;
while (n_bytes_left > 0);
update_offset:
while (n_bytes_left > 0);
update_offset:
- vec_reset_length (vcom->io_buffer);
+ vec_reset_length (ldp->io_buffer);
if (offset)
{
off_t off = lseek (in_fd, *offset, SEEK_SET);
if (offset)
{
off_t off = lseek (in_fd, *offset, SEEK_SET);
{
func_str = "libc_send";
{
func_str = "libc_send";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"in_fd %d, offset %p, len %u",
getpid (), out_fd, out_fd, func_str,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"in_fd %d, offset %p, len %u",
getpid (), out_fd, out_fd, func_str,
{
ssize_t size;
const char *func_str;
{
ssize_t size;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_session_recvfrom";
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_session_recvfrom";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, n %u, flags 0x%x", getpid (),
fd, fd, func_str, sid, sid, buf, n, flags);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, n %u, flags 0x%x", getpid (),
fd, fd, func_str, sid, sid, buf, n, flags);
{
func_str = "libc_recv";
{
func_str = "libc_recv";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, n %u, flags 0x%x", getpid (),
fd, fd, func_str, buf, n, flags);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, n %u, flags 0x%x", getpid (),
fd, fd, func_str, buf, n, flags);
size = libc_recv (fd, buf, n, flags);
}
size = libc_recv (fd, buf, n, flags);
}
{
ssize_t size;
const char *func_str = __func__;
{
ssize_t size;
const char *func_str = __func__;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
func_str = "vppcom_session_sendto";
func_str = "vppcom_session_sendto";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, n %u, flags 0x%x, ep %p",
getpid (), fd, fd, func_str, sid, sid, buf, n,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, n %u, flags 0x%x, ep %p",
getpid (), fd, fd, func_str, sid, sid, buf, n,
{
func_str = "libc_sendto";
{
func_str = "libc_sendto";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, n %u, flags 0x%x, addr %p, addr_len %d",
getpid (), fd, fd, func_str, buf, n, flags,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, n %u, flags 0x%x, addr %p, addr_len %d",
getpid (), fd, fd, func_str, buf, n, flags,
{
ssize_t size;
const char *func_str;
{
ssize_t size;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
func_str = "vppcom_session_recvfrom";
func_str = "vppcom_session_recvfrom";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, n %u, flags 0x%x, ep %p",
getpid (), fd, fd, func_str, sid, sid, buf, n,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), buf %p, n %u, flags 0x%x, ep %p",
getpid (), fd, fd, func_str, sid, sid, buf, n,
size = vppcom_session_recvfrom (sid, buf, n, flags, &ep);
if (size > 0)
size = vppcom_session_recvfrom (sid, buf, n, flags, &ep);
if (size > 0)
- size = vcom_copy_ep_to_sockaddr (addr, addr_len, &ep);
+ size = ldp_copy_ep_to_sockaddr (addr, addr_len, &ep);
}
else
size = vppcom_session_recvfrom (sid, buf, n, flags, NULL);
}
else
size = vppcom_session_recvfrom (sid, buf, n, flags, NULL);
{
func_str = "libc_recvfrom";
{
func_str = "libc_recvfrom";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, n %u, flags 0x%x, addr %p, addr_len %d",
getpid (), fd, fd, func_str, buf, n, flags,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"buf %p, n %u, flags 0x%x, addr %p, addr_len %d",
getpid (), fd, fd, func_str, buf, n, flags,
size = libc_recvfrom (fd, buf, n, flags, addr, addr_len);
}
size = libc_recvfrom (fd, buf, n, flags, addr, addr_len);
}
{
ssize_t size;
const char *func_str;
{
ssize_t size;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "libc_sendmsg";
{
func_str = "libc_sendmsg";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"message %p, flags 0x%x",
getpid (), fd, fd, func_str, message, flags);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"message %p, flags 0x%x",
getpid (), fd, fd, func_str, message, flags);
size = libc_sendmsg (fd, message, flags);
}
size = libc_sendmsg (fd, message, flags);
}
{
ssize_t size;
const char *func_str;
{
ssize_t size;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "libc_sendmmsg";
{
func_str = "libc_sendmmsg";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"vmessages %p, vlen %u, flags 0x%x",
getpid (), fd, fd, func_str, vmessages, vlen, flags);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"vmessages %p, vlen %u, flags 0x%x",
getpid (), fd, fd, func_str, vmessages, vlen, flags);
size = libc_sendmmsg (fd, vmessages, vlen, flags);
}
size = libc_sendmmsg (fd, vmessages, vlen, flags);
}
{
ssize_t size;
const char *func_str;
{
ssize_t size;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "libc_recvmsg";
{
func_str = "libc_recvmsg";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"message %p, flags 0x%x",
getpid (), fd, fd, func_str, message, flags);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"message %p, flags 0x%x",
getpid (), fd, fd, func_str, message, flags);
size = libc_recvmsg (fd, message, flags);
}
size = libc_recvmsg (fd, message, flags);
}
{
ssize_t size;
const char *func_str;
{
ssize_t size;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "libc_recvmmsg";
{
func_str = "libc_recvmmsg";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"vmessages %p, vlen %u, flags 0x%x, tmo %p",
getpid (), fd, fd, func_str, vmessages, vlen,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"vmessages %p, vlen %u, flags 0x%x, tmo %p",
getpid (), fd, fd, func_str, vmessages, vlen,
size = libc_recvmmsg (fd, vmessages, vlen, flags, tmo);
}
size = libc_recvmmsg (fd, vmessages, vlen, flags, tmo);
}
{
int rv;
const char *func_str = __func__;
{
int rv;
const char *func_str = __func__;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
u32 buflen = optlen ? (u32) * optlen : 0;
u32 buflen = optlen ? (u32) * optlen : 0;
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
case TCP_NODELAY:
func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_NODELAY]";
{
case TCP_NODELAY:
func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_NODELAY]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case TCP_MAXSEG:
func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_USER_MSS]";
break;
case TCP_MAXSEG:
func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_USER_MSS]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case TCP_KEEPIDLE:
func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_KEEPIDLE]";
break;
case TCP_KEEPIDLE:
func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_KEEPIDLE]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case TCP_KEEPINTVL:
func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_KEEPINTVL]";
break;
case TCP_KEEPINTVL:
func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_KEEPINTVL]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), SOL_TCP",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), SOL_TCP",
getpid (), fd, fd, func_str, sid, sid);
case TCP_INFO:
if (optval && optlen && (*optlen == sizeof (struct tcp_info)))
{
case TCP_INFO:
if (optval && optlen && (*optlen == sizeof (struct tcp_info)))
{
clib_warning ("LDP<%d>: fd %d (0x%x): sid %u (0x%x), "
"SOL_TCP, TCP_INFO, optval %p, "
"optlen %d: #LDP-NOP#",
clib_warning ("LDP<%d>: fd %d (0x%x): sid %u (0x%x), "
"SOL_TCP, TCP_INFO, optval %p, "
"optlen %d: #LDP-NOP#",
rv = -EFAULT;
break;
default:
rv = -EFAULT;
break;
default:
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_TCP, "
"optname %d unsupported!",
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_TCP, "
"optname %d unsupported!",
{
case IPV6_V6ONLY:
func_str = "vppcom_session_attr[SOL_IPV6,GET_V6ONLY]";
{
case IPV6_V6ONLY:
func_str = "vppcom_session_attr[SOL_IPV6,GET_V6ONLY]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
optval, optlen);
break;
default:
optval, optlen);
break;
default:
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_IPV6, "
"optname %d unsupported!",
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_IPV6, "
"optname %d unsupported!",
{
case SO_ACCEPTCONN:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_ACCEPTCONN]";
{
case SO_ACCEPTCONN:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_ACCEPTCONN]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case SO_KEEPALIVE:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_KEEPALIVE]";
break;
case SO_KEEPALIVE:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_KEEPALIVE]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case SO_PROTOCOL:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_PROTOCOL]";
break;
case SO_PROTOCOL:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_PROTOCOL]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case SO_SNDBUF:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_TX_FIFO_LEN]";
break;
case SO_SNDBUF:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_TX_FIFO_LEN]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), optlen %d",
getpid (), fd, fd, func_str, sid, sid, buflen);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), optlen %d",
getpid (), fd, fd, func_str, sid, sid, buflen);
break;
case SO_RCVBUF:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_RX_FIFO_LEN]";
break;
case SO_RCVBUF:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_RX_FIFO_LEN]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), optlen %d",
getpid (), fd, fd, func_str, sid, sid, buflen);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), optlen %d",
getpid (), fd, fd, func_str, sid, sid, buflen);
break;
case SO_REUSEADDR:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_REUSEADDR]";
break;
case SO_REUSEADDR:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_REUSEADDR]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case SO_BROADCAST:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_BROADCAST]";
break;
case SO_BROADCAST:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_BROADCAST]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case SO_ERROR:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_ERROR]";
break;
case SO_ERROR:
func_str = "vppcom_session_attr[SOL_SOCKET,GET_ERROR]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
optval, optlen);
break;
default:
optval, optlen);
break;
default:
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_SOCKET, "
"optname %d unsupported!",
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_SOCKET, "
"optname %d unsupported!",
{
func_str = "libc_getsockopt";
{
func_str = "libc_getsockopt";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): level %d, "
"optname %d, optval %p, optlen %d",
getpid (), fd, fd, func_str, level, optname,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): level %d, "
"optname %d, optval %p, optlen %d",
getpid (), fd, fd, func_str, level, optname,
rv = libc_getsockopt (fd, level, optname, optval, optlen);
}
rv = libc_getsockopt (fd, level, optname, optval, optlen);
}
{
int rv;
const char *func_str = __func__;
{
int rv;
const char *func_str = __func__;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
case TCP_NODELAY:
func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_NODELAY]";
{
case TCP_NODELAY:
func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_NODELAY]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case TCP_MAXSEG:
func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_USER_MSS]";
break;
case TCP_MAXSEG:
func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_USER_MSS]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case TCP_KEEPIDLE:
func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_KEEPIDLE]";
break;
case TCP_KEEPIDLE:
func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_KEEPIDLE]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case TCP_KEEPINTVL:
func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_KEEPINTVL]";
break;
case TCP_KEEPINTVL:
func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_KEEPINTVL]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), SOL_TCP",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x), SOL_TCP",
getpid (), fd, fd, func_str, sid, sid);
(void *) optval, &optlen);
break;
default:
(void *) optval, &optlen);
break;
default:
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_TCP, "
"optname %d unsupported!",
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_TCP, "
"optname %d unsupported!",
{
case IPV6_V6ONLY:
func_str = "vppcom_session_attr[SOL_IPV6,SET_V6ONLY]";
{
case IPV6_V6ONLY:
func_str = "vppcom_session_attr[SOL_IPV6,SET_V6ONLY]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
(void *) optval, &optlen);
break;
default:
(void *) optval, &optlen);
break;
default:
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_IPV6, "
"optname %d unsupported!",
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_IPV6, "
"optname %d unsupported!",
{
case SO_KEEPALIVE:
func_str = "vppcom_session_attr[SOL_SOCKET,SET_KEEPALIVE]";
{
case SO_KEEPALIVE:
func_str = "vppcom_session_attr[SOL_SOCKET,SET_KEEPALIVE]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case SO_REUSEADDR:
func_str = "vppcom_session_attr[SOL_SOCKET,SET_REUSEADDR]";
break;
case SO_REUSEADDR:
func_str = "vppcom_session_attr[SOL_SOCKET,SET_REUSEADDR]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
break;
case SO_BROADCAST:
func_str = "vppcom_session_attr[SOL_SOCKET,SET_BROADCAST]";
break;
case SO_BROADCAST:
func_str = "vppcom_session_attr[SOL_SOCKET,SET_BROADCAST]";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
"sid %u (0x%x)",
getpid (), fd, fd, func_str, sid, sid);
(void *) optval, &optlen);
break;
default:
(void *) optval, &optlen);
break;
default:
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_SOCKET, "
"optname %d unsupported!",
clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
"sid %u (0x%x), SOL_SOCKET, "
"optname %d unsupported!",
{
func_str = "libc_setsockopt";
{
func_str = "libc_setsockopt";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): level %d, "
"optname %d, optval %p, optlen %d",
getpid (), fd, fd, func_str, level, optname,
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): level %d, "
"optname %d, optval %p, optlen %d",
getpid (), fd, fd, func_str, level, optname,
rv = libc_setsockopt (fd, level, optname, optval, optlen);
}
rv = libc_setsockopt (fd, level, optname, optval, optlen);
}
{
int rv;
const char *func_str;
{
int rv;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_session_listen";
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_session_listen";
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), n %d",
getpid (), fd, fd, func_str, sid, sid, n);
clib_warning
("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), n %d",
getpid (), fd, fd, func_str, sid, sid, n);
{
func_str = "libc_listen";
{
func_str = "libc_listen";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): n %d",
getpid (), fd, fd, func_str, n);
rv = libc_listen (fd, n);
}
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): n %d",
getpid (), fd, fd, func_str, n);
rv = libc_listen (fd, n);
}
-vcom_accept4 (int listen_fd, __SOCKADDR_ARG addr,
- socklen_t * __restrict addr_len, int flags)
+ldp_accept4 (int listen_fd, __SOCKADDR_ARG addr,
+ socklen_t * __restrict addr_len, int flags)
{
int rv;
const char *func_str;
{
int rv;
const char *func_str;
- u32 listen_sid = vcom_sid_from_fd (listen_fd);
+ u32 listen_sid = ldp_sid_from_fd (listen_fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (listen_sid != INVALID_SESSION_ID)
return -1;
if (listen_sid != INVALID_SESSION_ID)
func_str = "vppcom_session_accept";
func_str = "vppcom_session_accept";
clib_warning ("LDP<%d>: listen fd %d (0x%x): calling %s(): "
"listen sid %u (0x%x), ep %p, flags 0x%x",
getpid (), listen_fd, listen_fd, func_str,
clib_warning ("LDP<%d>: listen fd %d (0x%x): calling %s(): "
"listen sid %u (0x%x), ep %p, flags 0x%x",
getpid (), listen_fd, listen_fd, func_str,
- rv = vcom_copy_ep_to_sockaddr (addr, addr_len, &ep);
+ rv = ldp_copy_ep_to_sockaddr (addr, addr_len, &ep);
if (rv != VPPCOM_OK)
{
(void) vppcom_session_close ((u32) accept_sid);
if (rv != VPPCOM_OK)
{
(void) vppcom_session_close ((u32) accept_sid);
- func_str = "vcom_fd_from_sid";
- if (VCOM_DEBUG > 0)
+ func_str = "ldp_fd_from_sid";
+ if (LDP_DEBUG > 0)
clib_warning ("LDP<%d>: listen fd %d (0x%x): calling %s(): "
"accept sid %u (0x%x), ep %p, flags 0x%x",
getpid (), listen_fd, listen_fd,
func_str, accept_sid, accept_sid, ep, flags);
clib_warning ("LDP<%d>: listen fd %d (0x%x): calling %s(): "
"accept sid %u (0x%x), ep %p, flags 0x%x",
getpid (), listen_fd, listen_fd,
func_str, accept_sid, accept_sid, ep, flags);
- rv = vcom_fd_from_sid ((u32) accept_sid);
+ rv = ldp_fd_from_sid ((u32) accept_sid);
if (rv < 0)
{
(void) vppcom_session_close ((u32) accept_sid);
if (rv < 0)
{
(void) vppcom_session_close ((u32) accept_sid);
{
func_str = "libc_accept4";
{
func_str = "libc_accept4";
clib_warning ("LDP<%d>: listen fd %d (0x%x): calling %s(): "
"addr %p, addr_len %p, flags 0x%x",
getpid (), listen_fd, listen_fd, func_str,
clib_warning ("LDP<%d>: listen fd %d (0x%x): calling %s(): "
"addr %p, addr_len %p, flags 0x%x",
getpid (), listen_fd, listen_fd, func_str,
rv = libc_accept4 (listen_fd, addr, addr_len, flags);
}
rv = libc_accept4 (listen_fd, addr, addr_len, flags);
}
accept4 (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict addr_len,
int flags)
{
accept4 (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict addr_len,
int flags)
{
- return vcom_accept4 (fd, addr, addr_len, flags);
+ return ldp_accept4 (fd, addr, addr_len, flags);
}
int
accept (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict addr_len)
{
}
int
accept (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict addr_len)
{
- return vcom_accept4 (fd, addr, addr_len, 0);
+ return ldp_accept4 (fd, addr, addr_len, 0);
{
int rv;
const char *func_str;
{
int rv;
const char *func_str;
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (sid != INVALID_SESSION_ID)
return -1;
if (sid != INVALID_SESSION_ID)
{
func_str = "libc_shutdown";
{
func_str = "libc_shutdown";
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): how %d",
getpid (), fd, fd, func_str, how);
rv = libc_shutdown (fd, how);
}
clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): how %d",
getpid (), fd, fd, func_str, how);
rv = libc_shutdown (fd, how);
}
const char *func_str;
int rv;
const char *func_str;
int rv;
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
func_str = "vppcom_epoll_create";
return -1;
func_str = "vppcom_epoll_create";
clib_warning ("LDP<%d>: calling %s()", getpid (), func_str);
rv = vppcom_epoll_create ();
clib_warning ("LDP<%d>: calling %s()", getpid (), func_str);
rv = vppcom_epoll_create ();
- rv = vcom_fd_from_sid ((u32) rv);
+ rv = ldp_fd_from_sid ((u32) rv);
{
int rv;
const char *func_str;
{
int rv;
const char *func_str;
- u32 vep_idx = vcom_sid_from_fd (epfd);
+ u32 vep_idx = ldp_sid_from_fd (epfd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (vep_idx != INVALID_SESSION_ID)
{
return -1;
if (vep_idx != INVALID_SESSION_ID)
{
- u32 sid = vcom_sid_from_fd (fd);
+ u32 sid = ldp_sid_from_fd (fd);
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_epoll_create";
if (sid != INVALID_SESSION_ID)
{
func_str = "vppcom_epoll_create";
clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): "
"vep_idx %d (0x%x), op %d, sid %u (0x%x), event %p",
getpid (), epfd, epfd, func_str, vep_idx, vep_idx,
clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): "
"vep_idx %d (0x%x), op %d, sid %u (0x%x), event %p",
getpid (), epfd, epfd, func_str, vep_idx, vep_idx,
{
func_str = "libc_epoll_create1";
{
func_str = "libc_epoll_create1";
clib_warning ("LDP<%d>: calling %s(): EPOLL_CLOEXEC",
getpid (), func_str);
clib_warning ("LDP<%d>: calling %s(): EPOLL_CLOEXEC",
getpid (), func_str);
{
func_str = "libc_epoll_ctl";
{
func_str = "libc_epoll_ctl";
clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): "
"op %d, fd %d (0x%x), event %p",
getpid (), epfd, epfd, func_str, op, fd, fd, event);
clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): "
"op %d, fd %d (0x%x), event %p",
getpid (), epfd, epfd, func_str, op, fd, fd, event);
-vcom_epoll_pwait (int epfd, struct epoll_event *events,
- int maxevents, int timeout, const sigset_t * sigmask)
+ldp_epoll_pwait (int epfd, struct epoll_event *events,
+ int maxevents, int timeout, const sigset_t * sigmask)
{
const char *func_str;
int rv = 0;
double time_to_wait = (double) 0;
double time_out, now = 0;
{
const char *func_str;
int rv = 0;
double time_to_wait = (double) 0;
double time_out, now = 0;
- u32 vep_idx = vcom_sid_from_fd (epfd);
+ u32 vep_idx = ldp_sid_from_fd (epfd);
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
if (PREDICT_FALSE (!events || (timeout < -1)))
return -1;
if (PREDICT_FALSE (!events || (timeout < -1)))
}
time_to_wait = ((timeout >= 0) ? (double) timeout / (double) 1000 : 0);
}
time_to_wait = ((timeout >= 0) ? (double) timeout / (double) 1000 : 0);
- time_out = clib_time_now (&vcom->clib_time) + time_to_wait;
+ time_out = clib_time_now (&ldp->clib_time) + time_to_wait;
func_str = "vppcom_session_attr[GET_LIBC_EPFD]";
libc_epfd = vppcom_session_attr (vep_idx, VPPCOM_ATTR_GET_LIBC_EPFD, 0, 0);
func_str = "vppcom_session_attr[GET_LIBC_EPFD]";
libc_epfd = vppcom_session_attr (vep_idx, VPPCOM_ATTR_GET_LIBC_EPFD, 0, 0);
clib_warning ("LDP<%d>: epfd %d (0x%x): vep_idx %d (0x%x), "
"libc_epfd %d (0x%x), events %p, maxevents %d, "
"timeout %d, sigmask %p", getpid (), epfd, epfd,
clib_warning ("LDP<%d>: epfd %d (0x%x): vep_idx %d (0x%x), "
"libc_epfd %d (0x%x), events %p, maxevents %d, "
"timeout %d, sigmask %p", getpid (), epfd, epfd,
maxevents, timeout, sigmask);
do
{
maxevents, timeout, sigmask);
do
{
- if (!vcom->epoll_wait_vcl)
+ if (!ldp->epoll_wait_vcl)
{
func_str = "vppcom_epoll_wait";
{
func_str = "vppcom_epoll_wait";
clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): "
"vep_idx %d (0x%x), events %p, maxevents %d",
getpid (), epfd, epfd, func_str,
clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): "
"vep_idx %d (0x%x), events %p, maxevents %d",
getpid (), epfd, epfd, func_str,
rv = vppcom_epoll_wait (vep_idx, events, maxevents, 0);
if (rv > 0)
{
rv = vppcom_epoll_wait (vep_idx, events, maxevents, 0);
if (rv > 0)
{
- vcom->epoll_wait_vcl = 1;
+ ldp->epoll_wait_vcl = 1;
goto done;
}
else if (rv < 0)
goto done;
}
else if (rv < 0)
- vcom->epoll_wait_vcl = 0;
+ ldp->epoll_wait_vcl = 0;
if (libc_epfd > 0)
{
func_str = "libc_epoll_pwait";
if (libc_epfd > 0)
{
func_str = "libc_epoll_pwait";
clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): "
"libc_epfd %d (0x%x), events %p, "
"maxevents %d, sigmask %p",
clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): "
"libc_epfd %d (0x%x), events %p, "
"maxevents %d, sigmask %p",
- now = clib_time_now (&vcom->clib_time);
+ now = clib_time_now (&ldp->clib_time);
}
while (now < time_out);
done:
}
while (now < time_out);
done:
{
if (libc_epfd > 0)
epfd = libc_epfd;
{
if (libc_epfd > 0)
epfd = libc_epfd;
epoll_pwait (int epfd, struct epoll_event *events,
int maxevents, int timeout, const sigset_t * sigmask)
{
epoll_pwait (int epfd, struct epoll_event *events,
int maxevents, int timeout, const sigset_t * sigmask)
{
- return vcom_epoll_pwait (epfd, events, maxevents, timeout, sigmask);
+ return ldp_epoll_pwait (epfd, events, maxevents, timeout, sigmask);
}
int
epoll_wait (int epfd, struct epoll_event *events, int maxevents, int timeout)
{
}
int
epoll_wait (int epfd, struct epoll_event *events, int maxevents, int timeout)
{
- return vcom_epoll_pwait (epfd, events, maxevents, timeout, NULL);
+ return ldp_epoll_pwait (epfd, events, maxevents, timeout, NULL);
vcl_poll_t *vp;
double wait_for_time;
vcl_poll_t *vp;
double wait_for_time;
clib_warning ("LDP<%d>: fds %p, nfds %d, timeout %d",
getpid (), fds, nfds, timeout);
clib_warning ("LDP<%d>: fds %p, nfds %d, timeout %d",
getpid (), fds, nfds, timeout);
clib_warning ("LDP<%d>: fds[%d].fd %d (0x%0x), .events = 0x%x, "
".revents = 0x%x", getpid (), i, fds[i].fd,
fds[i].fd, fds[i].events, fds[i].revents);
clib_warning ("LDP<%d>: fds[%d].fd %d (0x%0x), .events = 0x%x, "
".revents = 0x%x", getpid (), i, fds[i].fd,
fds[i].fd, fds[i].events, fds[i].revents);
- sid = vcom_sid_from_fd (fds[i].fd);
+ sid = ldp_sid_from_fd (fds[i].fd);
if (sid != INVALID_SESSION_ID)
{
fds[i].fd = -fds[i].fd;
if (sid != INVALID_SESSION_ID)
{
fds[i].fd = -fds[i].fd;
- vec_add2 (vcom->vcl_poll, vp, 1);
+ vec_add2 (ldp->vcl_poll, vp, 1);
vp->fds_ndx = i;
vp->sid = sid;
vp->events = fds[i].events;
vp->fds_ndx = i;
vp->sid = sid;
vp->events = fds[i].events;
- if (vec_len (vcom->vcl_poll))
+ if (vec_len (ldp->vcl_poll))
{
func_str = "vppcom_poll";
{
func_str = "vppcom_poll";
clib_warning ("LDP<%d>: calling %s(): "
"vcl_poll %p, n_sids %u (0x%x): "
"n_libc_fds %u",
clib_warning ("LDP<%d>: calling %s(): "
"vcl_poll %p, n_sids %u (0x%x): "
"n_libc_fds %u",
- getpid (), func_str, vcom->vcl_poll,
- vec_len (vcom->vcl_poll), vec_len (vcom->vcl_poll),
+ getpid (), func_str, ldp->vcl_poll,
+ vec_len (ldp->vcl_poll), vec_len (ldp->vcl_poll),
- rv = vppcom_poll (vcom->vcl_poll, vec_len (vcom->vcl_poll), 0);
+ rv = vppcom_poll (ldp->vcl_poll, vec_len (ldp->vcl_poll), 0);
if (rv < 0)
{
errno = -rv;
if (rv < 0)
{
errno = -rv;
{
func_str = "libc_poll";
{
func_str = "libc_poll";
clib_warning ("LDP<%d>: calling %s(): fds %p, nfds %u: n_sids %u",
clib_warning ("LDP<%d>: calling %s(): fds %p, nfds %u: n_sids %u",
- getpid (), fds, nfds, vec_len (vcom->vcl_poll));
+ getpid (), fds, nfds, vec_len (ldp->vcl_poll));
rv = libc_poll (fds, nfds, 0);
if (rv < 0)
rv = libc_poll (fds, nfds, 0);
if (rv < 0)
}
}
while ((wait_for_time == -1) ||
}
}
while ((wait_for_time == -1) ||
- (clib_time_now (&vcom->clib_time) < wait_for_time));
+ (clib_time_now (&ldp->clib_time) < wait_for_time));
- vec_foreach (vp, vcom->vcl_poll)
+ vec_foreach (vp, ldp->vcl_poll)
{
fds[vp->fds_ndx].fd = -fds[vp->fds_ndx].fd;
#ifdef __USE_XOPEN2K
{
fds[vp->fds_ndx].fd = -fds[vp->fds_ndx].fd;
#ifdef __USE_XOPEN2K
fds[vp->fds_ndx].revents |= POLLWRNORM;
#endif
}
fds[vp->fds_ndx].revents |= POLLWRNORM;
#endif
}
- vec_reset_length (vcom->vcl_poll);
+ vec_reset_length (ldp->vcl_poll);
{
clib_warning ("LDP<%d>: returning %d (0x%x): n_sids %u, "
"n_libc_fds %d", getpid (), rv, rv,
{
clib_warning ("LDP<%d>: returning %d (0x%x): n_sids %u, "
"n_libc_fds %d", getpid (), rv, rv,
- vec_len (vcom->vcl_poll), n_libc_fds);
+ vec_len (ldp->vcl_poll), n_libc_fds);
for (i = 0; i < nfds; i++)
{
if (fds[i].fd >= 0)
{
for (i = 0; i < nfds; i++)
{
if (fds[i].fd >= 0)
{
clib_warning ("LDP<%d>: fds[%d].fd %d (0x%0x), "
".events = 0x%x, .revents = 0x%x",
getpid (), i, fds[i].fd, fds[i].fd,
clib_warning ("LDP<%d>: fds[%d].fd %d (0x%0x), "
".events = 0x%x, .revents = 0x%x",
getpid (), i, fds[i].fd, fds[i].fd,
ppoll (struct pollfd *fds, nfds_t nfds,
const struct timespec *timeout, const sigset_t * sigmask)
{
ppoll (struct pollfd *fds, nfds_t nfds,
const struct timespec *timeout, const sigset_t * sigmask)
{
- if ((errno = -vcom_init ()))
+ if ((errno = -ldp_init ()))
return -1;
clib_warning ("LDP<%d>: LDP-TBD", getpid ());
return -1;
clib_warning ("LDP<%d>: LDP-TBD", getpid ());
-void CONSTRUCTOR_ATTRIBUTE vcom_constructor (void);
+void CONSTRUCTOR_ATTRIBUTE ldp_constructor (void);
-void DESTRUCTOR_ATTRIBUTE vcom_destructor (void);
+void DESTRUCTOR_ATTRIBUTE ldp_destructor (void);
/*
* This function is called when the library is loaded
*/
void
/*
* This function is called when the library is loaded
*/
void
- if (vcom_init () != 0)
- fprintf (stderr, "\nLDP<%d>: ERROR: vcom_constructor: failed!\n",
+ if (ldp_init () != 0)
+ fprintf (stderr, "\nLDP<%d>: ERROR: ldp_constructor: failed!\n",
- clib_warning ("LDP<%d>: VCOM constructor: done!\n", getpid ());
+ clib_warning ("LDP<%d>: LDP constructor: done!\n", getpid ());
}
/*
* This function is called when the library is unloaded
*/
void
}
/*
* This function is called when the library is unloaded
*/
void
}
/* Don't use clib_warning() here because that calls writev()
}
/* Don't use clib_warning() here because that calls writev()
- * which will call vcom_init().
+ * which will call ldp_init().
- printf ("%s:%d: LDP<%d>: VCOM destructor: done!\n",
+ printf ("%s:%d: LDP<%d>: LDP destructor: done!\n",
__func__, __LINE__, getpid ());
}
__func__, __LINE__, getpid ());
}
* limitations under the License.
*/
* limitations under the License.
*/
-#ifndef included_vcom_h
-#define included_vcom_h
+#ifndef included_ldp_h
+#define included_ldp_h
-/* Set VCOM_DEBUG 2 for connection debug, 3 for read/write debug output */
-#define VCOM_DEBUG_INIT 1
+/* Set LDP_DEBUG 2 for connection debug, 3 for read/write debug output */
+#define LDP_DEBUG_INIT 1
-#define VCOM_DEBUG_INIT 0
+#define LDP_DEBUG_INIT 0
#endif
#include <vppinfra/error.h>
#include <vppinfra/types.h>
#endif
#include <vppinfra/error.h>
#include <vppinfra/types.h>
-#include <vcl/vcom_glibc_socket.h>
+#include <vcl/ldp_glibc_socket.h>
-#define VCOM_ENV_DEBUG "VCOM_DEBUG"
-#define VCOM_ENV_APP_NAME "VCOM_APP_NAME"
-#define VCOM_ENV_SID_BIT "VCOM_SID_BIT"
+#define LDP_ENV_DEBUG "LDP_DEBUG"
+#define LDP_ENV_APP_NAME "LDP_APP_NAME"
+#define LDP_ENV_SID_BIT "LDP_SID_BIT"
-#define VCOM_SID_BIT_MIN 9
-#define VCOM_SID_BIT_MAX 30
+#define LDP_SID_BIT_MIN 9
+#define LDP_SID_BIT_MAX 30
-#define VCOM_APP_NAME_MAX 256
+#define LDP_APP_NAME_MAX 256
-#endif /* included_vcom_h */
+#endif /* included_ldp_h */
/*
* fd.io coding-style-patch-verification: ON
/*
* fd.io coding-style-patch-verification: ON
* limitations under the License.
*/
* limitations under the License.
*/
-#ifndef included_vcom_glibc_socket_h
-#define included_vcom_glibc_socket_h
+#ifndef included_ldp_glibc_socket_h
+#define included_ldp_glibc_socket_h
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
-#endif /* included_vcom_glibc_socket_h */
+#endif /* included_ldp_glibc_socket_h */
/*
* fd.io coding-style-patch-verification: ON
/*
* fd.io coding-style-patch-verification: ON
#include <unistd.h>
#include <pthread.h>
#include <unistd.h>
#include <pthread.h>
-#include <vcl/vcom_socket_wrapper.h>
+#include <vcl/ldp_socket_wrapper.h>
-#ifndef included_vcom_socket_wrapper_h
-#define included_vcom_socket_wrapper_h
+#ifndef included_ldp_socket_wrapper_h
+#define included_ldp_socket_wrapper_h
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <poll.h>
#include <sys/uio.h>
#include <stdlib.h>
#include <poll.h>
#include <sys/uio.h>
#include <stdlib.h>
/* GCC have printf type attribute check. */
/* GCC have printf type attribute check. */
void swrap_destructor (void);
void swrap_destructor (void);
-#endif /* included_vcom_socket_wrapper_h */
+#endif /* included_ldp_socket_wrapper_h */
/*
* fd.io coding-style-patch-verification: ON
/*
* fd.io coding-style-patch-verification: ON