diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2018-02-07 21:00:42 -0500 |
---|---|---|
committer | Keith Burns <alagalah@gmail.com> | 2018-02-09 18:25:11 +0000 |
commit | 2a8652701d0ce7185c60cc05e407950e87a6c150 (patch) | |
tree | 0ae1ebe40d52ce581e45937edf6682133546fa28 | |
parent | 9fa881ff875b21d6eadbb7cdcf5d448abcdae292 (diff) |
LD_PRELOAD: Refactor nomenclature (vcom -> ldp).
Change-Id: Id3891fe2873b631f8f69c1ca2905968130678561
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
-rw-r--r-- | src/vcl.am | 10 | ||||
-rw-r--r-- | src/vcl/ldp.c (renamed from src/vcl/vcom.c) | 812 | ||||
-rw-r--r-- | src/vcl/ldp.h (renamed from src/vcl/vcom.h) | 26 | ||||
-rw-r--r-- | src/vcl/ldp_glibc_socket.h (renamed from src/vcl/vcom_glibc_socket.h) | 6 | ||||
-rw-r--r-- | src/vcl/ldp_socket_wrapper.c (renamed from src/vcl/vcom_socket_wrapper.c) | 2 | ||||
-rw-r--r-- | src/vcl/ldp_socket_wrapper.h (renamed from src/vcl/vcom_socket_wrapper.h) | 8 |
6 files changed, 432 insertions, 432 deletions
diff --git a/src/vcl.am b/src/vcl.am index eac3d7e48cb..f090041b884 100644 --- a/src/vcl.am +++ b/src/vcl.am @@ -34,14 +34,14 @@ nobase_include_HEADERS += \ 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 += \ - 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 \ diff --git a/src/vcl/vcom.c b/src/vcl/ldp.c index 82c65e854e0..1cf2445f4fc 100644 --- a/src/vcl/vcom.c +++ b/src/vcl/ldp.c @@ -22,8 +22,8 @@ #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> @@ -49,7 +49,7 @@ 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; @@ -67,158 +67,158 @@ typedef struct 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 -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; } static inline char * -vcom_get_app_name () +ldp_get_app_name () { - if (vcom->app_name[0] == '\0') - vcom_set_app_name ("app"); + if (ldp->app_name[0] == '\0') + ldp_set_app_name ("app"); - return vcom->app_name; + return ldp->app_name; } static inline int -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 -EMFILE; else - return (sid | vcom->sid_bit_val); + return (sid | ldp->sid_bit_val); } static inline int -vcom_fd_is_sid (int fd) +ldp_fd_is_sid (int fd) { - return ((u32) fd & vcom->sid_bit_val) ? 1 : 0; + return ((u32) fd & ldp->sid_bit_val) ? 1 : 0; } static inline u32 -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 -vcom_init (void) +ldp_init (void) { int rv = 0; - 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 ()); if (rv == VPPCOM_OK) { - 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) - 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 { - 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); if (env_var_str) { - 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) { - clib_warning ("LDP<%d>: WARNING: Invalid VCOM sid bit " + clib_warning ("LDP<%d>: WARNING: Invalid LDP sid bit " "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, - 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 " - 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)", - 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 " - 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)", - 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); } else { - 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 (), - 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 ()); } else { - 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)); - vcom->init = 0; + ldp->init = 0; } } return rv; @@ -229,9 +229,9 @@ close (int fd) { 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) @@ -244,7 +244,7 @@ close (int fd) { func_str = "libc_close"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): epfd %u (0x%x)", getpid (), fd, fd, func_str, epfd, epfd); @@ -268,7 +268,7 @@ close (int fd) func_str = "vppcom_session_close"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -283,7 +283,7 @@ close (int fd) { func_str = "libc_close"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s()", getpid (), fd, fd, func_str); @@ -291,7 +291,7 @@ close (int fd) } done: - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) { if (rv < 0) { @@ -314,16 +314,16 @@ read (int fd, void *buf, size_t nbytes) { 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"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -339,7 +339,7 @@ read (int fd, void *buf, size_t nbytes) { func_str = "libc_read"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "buf %p, nbytes %u", getpid (), fd, fd, func_str, buf, nbytes); @@ -347,7 +347,7 @@ read (int fd, void *buf, size_t nbytes) size = libc_read (fd, buf, nbytes); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -370,10 +370,10 @@ readv (int fd, const struct iovec * iov, int iovcnt) { 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; - if ((errno = -vcom_init ())) + if ((errno = -ldp_init ())) return -1; if (sid != INVALID_SESSION_ID) @@ -383,7 +383,7 @@ readv (int fd, const struct iovec * iov, int iovcnt) { for (i = 0; i < iovcnt; ++i) { - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -397,7 +397,7 @@ readv (int fd, const struct iovec * iov, int iovcnt) total += rv; if (rv < iov[i].iov_len) { - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): " "rv (%d) < iov[%d].iov_len (%d)", getpid (), fd, fd, rv, i, @@ -421,14 +421,14 @@ readv (int fd, const struct iovec * iov, int iovcnt) { func_str = "libc_readv"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -451,16 +451,16 @@ write (int fd, const void *buf, size_t nbytes) { 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"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -476,7 +476,7 @@ write (int fd, const void *buf, size_t nbytes) { func_str = "libc_write"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "buf %p, nbytes %u", getpid (), fd, fd, func_str, buf, nbytes); @@ -484,7 +484,7 @@ write (int fd, const void *buf, size_t nbytes) size = libc_write (fd, buf, nbytes); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -507,14 +507,14 @@ writev (int fd, const struct iovec * iov, int iovcnt) { 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. */ - if ((errno = -vcom_init ())) + if ((errno = -ldp_init ())) return -1; if (sid != INVALID_SESSION_ID) @@ -524,7 +524,7 @@ writev (int fd, const struct iovec * iov, int iovcnt) { for (i = 0; i < iovcnt; ++i) { - if (VCOM_DEBUG > 4) + if (LDP_DEBUG > 4) 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, @@ -539,7 +539,7 @@ writev (int fd, const struct iovec * iov, int iovcnt) total += rv; if (rv < iov[i].iov_len) { - if (VCOM_DEBUG > 4) + if (LDP_DEBUG > 4) printf ("%s:%d: LDP<%d>: fd %d (0x%x): " "rv (%d) < iov[%d].iov_len (%ld)", __func__, __LINE__, getpid (), fd, fd, @@ -563,7 +563,7 @@ writev (int fd, const struct iovec * iov, int iovcnt) { func_str = "libc_writev"; - if (VCOM_DEBUG > 4) + if (LDP_DEBUG > 4) 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); @@ -571,7 +571,7 @@ writev (int fd, const struct iovec * iov, int iovcnt) size = libc_writev (fd, iov, iovcnt); } - if (VCOM_DEBUG > 4) + if (LDP_DEBUG > 4) { if (size < 0) { @@ -596,9 +596,9 @@ fcntl (int fd, int cmd, ...) 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); @@ -613,7 +613,7 @@ fcntl (int fd, int cmd, ...) { case F_SETFL: func_str = "vppcom_session_attr[SET_FLAGS]"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -625,7 +625,7 @@ fcntl (int fd, int cmd, ...) case F_GETFL: func_str = "vppcom_session_attr[GET_FLAGS]"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -635,7 +635,7 @@ fcntl (int fd, int cmd, ...) vppcom_session_attr (sid, VPPCOM_ATTR_GET_FLAGS, &flags, &size); if (rv == VPPCOM_OK) { - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -657,7 +657,7 @@ fcntl (int fd, int cmd, ...) { func_str = "libc_vfcntl"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): cmd %d", getpid (), fd, fd, func_str, cmd); @@ -666,7 +666,7 @@ fcntl (int fd, int cmd, ...) va_end (ap); - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (rv < 0) { @@ -690,9 +690,9 @@ ioctl (int fd, unsigned long int cmd, ...) 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); @@ -703,7 +703,7 @@ ioctl (int fd, unsigned long int cmd, ...) switch (cmd) { case FIONREAD: - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -720,7 +720,7 @@ ioctl (int fd, unsigned long int cmd, ...) * non-blocking, the flags should be read here and merged * with O_NONBLOCK. */ - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -745,14 +745,14 @@ ioctl (int fd, unsigned long int cmd, ...) { func_str = "libc_vioctl"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): cmd %d", getpid (), fd, fd, func_str, cmd); rv = libc_vioctl (fd, cmd, ap); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (rv < 0) { @@ -772,11 +772,11 @@ ioctl (int fd, unsigned long int cmd, ...) } int -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 = "##"; @@ -792,11 +792,11 @@ vcom_pselect (int nfds, fd_set * __restrict readfds, return -1; } - if (nfds <= vcom->sid_bit_val) + if (nfds <= ldp->sid_bit_val) { func_str = "libc_pselect"; - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) clib_warning ("LDP<%d>: calling %s(): nfds %d, readfds %p, writefds %p, " "exceptfds %p, timeout %p, sigmask %p", getpid (), func_str, nfds, @@ -807,11 +807,11 @@ vcom_pselect (int nfds, fd_set * __restrict readfds, goto done; } - 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 (), - 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; @@ -827,12 +827,12 @@ vcom_pselect (int nfds, fd_set * __restrict readfds, /* select as fine grained sleep */ if (!nfds) { - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) 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) ; return 0; } @@ -848,102 +848,102 @@ vcom_pselect (int nfds, fd_set * __restrict 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* */ - 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_bitmap_set_no_check (vcom->libc_rd_bitmap, fd, 1); + clib_bitmap_set_no_check (ldp->libc_rd_bitmap, fd, 1); else - clib_bitmap_set_no_check (vcom->sid_rd_bitmap, sid, 1); + clib_bitmap_set_no_check (ldp->sid_rd_bitmap, sid, 1); })); /* *INDENT-ON* */ - 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; - 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; - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) 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* */ - 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_bitmap_set_no_check (vcom->libc_wr_bitmap, fd, 1); + clib_bitmap_set_no_check (ldp->libc_wr_bitmap, fd, 1); else - clib_bitmap_set_no_check (vcom->sid_wr_bitmap, sid, 1); + clib_bitmap_set_no_check (ldp->sid_wr_bitmap, sid, 1); })); /* *INDENT-ON* */ - 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; - 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; - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) 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* */ - 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_bitmap_set_no_check (vcom->libc_ex_bitmap, fd, 1); + clib_bitmap_set_no_check (ldp->libc_ex_bitmap, fd, 1); else - clib_bitmap_set_no_check (vcom->sid_ex_bitmap, sid, 1); + clib_bitmap_set_no_check (ldp->sid_ex_bitmap, sid, 1); })); /* *INDENT-ON* */ - 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; - 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; - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) 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); @@ -960,27 +960,27 @@ vcom_pselect (int nfds, fd_set * __restrict readfds, { if (sid_bits) { - if (!vcom->select_vcl) + if (!ldp->select_vcl) { 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) - 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) - 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, - 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; @@ -991,9 +991,9 @@ vcom_pselect (int nfds, fd_set * __restrict readfds, 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; @@ -1007,9 +1007,9 @@ vcom_pselect (int nfds, fd_set * __restrict readfds, 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; @@ -1023,9 +1023,9 @@ vcom_pselect (int nfds, fd_set * __restrict readfds, 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; @@ -1036,12 +1036,12 @@ vcom_pselect (int nfds, fd_set * __restrict readfds, })); /* *INDENT-ON* */ } - vcom->select_vcl = 1; + ldp->select_vcl = 1; goto done; } } else - vcom->select_vcl = 0; + ldp->select_vcl = 0; } if (libc_bits) { @@ -1050,14 +1050,14 @@ vcom_pselect (int nfds, fd_set * __restrict 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)); if (writefds) - 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)); if (exceptfds) - 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, @@ -1067,22 +1067,22 @@ vcom_pselect (int nfds, fd_set * __restrict readfds, goto done; } } - 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 */ - 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) { if (rv < 0) { @@ -1111,8 +1111,8 @@ select (int nfds, fd_set * __restrict readfds, 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); } #ifdef __USE_XOPEN2K @@ -1123,7 +1123,7 @@ pselect (int nfds, fd_set * __restrict readfds, 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); } #endif @@ -1135,7 +1135,7 @@ socket (int domain, int type, int protocol) 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)) && @@ -1147,7 +1147,7 @@ socket (int domain, int type, int protocol) func_str = "vppcom_session_create"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) clib_warning ("LDP<%d>: : calling %s(): " "proto %u (%s), is_nonblocking %u", getpid (), func_str, proto, @@ -1161,8 +1161,8 @@ socket (int domain, int type, int protocol) } else { - 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); @@ -1175,13 +1175,13 @@ socket (int domain, int type, int protocol) { func_str = "libc_socket"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) clib_warning ("LDP<%d>: : calling %s()", getpid (), func_str); rv = libc_socket (domain, type, protocol); } - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) { if (rv < 0) { @@ -1212,7 +1212,7 @@ socketpair (int domain, int type, int protocol, int fds[2]) 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)) && @@ -1228,13 +1228,13 @@ socketpair (int domain, int type, int protocol, int fds[2]) { func_str = "libc_socket"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: : calling %s()", getpid (), func_str); rv = libc_socket (domain, type, protocol); } - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) { if (rv < 0) { @@ -1256,9 +1256,9 @@ bind (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) { 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) @@ -1307,7 +1307,7 @@ bind (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) rv = -1; goto done; } - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) 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); @@ -1323,7 +1323,7 @@ bind (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) { func_str = "libc_bind"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "addr %p, len %u", getpid (), fd, fd, func_str, addr, len); @@ -1332,7 +1332,7 @@ bind (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) } done: - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) { if (rv < 0) { @@ -1351,13 +1351,13 @@ done: } static inline int -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; - if ((errno = -vcom_init ())) + if ((errno = -ldp_init ())) return -1; if (addr && len && ep) @@ -1401,9 +1401,9 @@ getsockname (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) { 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) @@ -1415,7 +1415,7 @@ getsockname (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) ep.ip = addr_buf; func_str = "vppcom_session_attr[GET_LCL_ADDR]"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -1428,7 +1428,7 @@ getsockname (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) } else { - rv = vcom_copy_ep_to_sockaddr (addr, len, &ep); + rv = ldp_copy_ep_to_sockaddr (addr, len, &ep); if (rv != VPPCOM_OK) { errno = -rv; @@ -1440,7 +1440,7 @@ getsockname (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) { func_str = "libc_getsockname"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "addr %p, len %u", getpid (), fd, fd, func_str, addr, len); @@ -1448,7 +1448,7 @@ getsockname (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) rv = libc_getsockname (fd, addr, len); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (rv < 0) { @@ -1471,9 +1471,9 @@ connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) { 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 (!addr) @@ -1531,7 +1531,7 @@ connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) rv = -1; goto done; } - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) 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); @@ -1547,7 +1547,7 @@ connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) { func_str = "libc_connect"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "addr %p, len %u", getpid (), fd, fd, func_str, addr, len); @@ -1556,7 +1556,7 @@ connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) } done: - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) { if (rv < 0) { @@ -1579,9 +1579,9 @@ getpeername (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) { 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) @@ -1593,7 +1593,7 @@ getpeername (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) ep.ip = addr_buf; func_str = "vppcom_session_attr[GET_PEER_ADDR]"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -1606,7 +1606,7 @@ getpeername (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) } else { - rv = vcom_copy_ep_to_sockaddr (addr, len, &ep); + rv = ldp_copy_ep_to_sockaddr (addr, len, &ep); if (rv != VPPCOM_OK) { errno = -rv; @@ -1618,7 +1618,7 @@ getpeername (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) { func_str = "libc_getpeername"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "addr %p, len %u", getpid (), fd, fd, func_str, addr, len); @@ -1626,7 +1626,7 @@ getpeername (int fd, __SOCKADDR_ARG addr, socklen_t * __restrict len) rv = libc_getpeername (fd, addr, len); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (rv < 0) { @@ -1649,9 +1649,9 @@ send (int fd, const void *buf, size_t n, int flags) { 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) @@ -1659,7 +1659,7 @@ send (int fd, const void *buf, size_t n, int flags) func_str = "vppcom_session_sendto"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -1675,7 +1675,7 @@ send (int fd, const void *buf, size_t n, int flags) { func_str = "libc_send"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -1683,7 +1683,7 @@ send (int fd, const void *buf, size_t n, int flags) size = libc_send (fd, buf, n, flags); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -1706,9 +1706,9 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) { 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) @@ -1732,7 +1732,7 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) 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; @@ -1768,14 +1768,14 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) ("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; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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 (), @@ -1788,7 +1788,7 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) { if (!results) { - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): sid %u (0x%x): " "EAGAIN", getpid (), out_fd, out_fd, sid, sid); @@ -1800,8 +1800,8 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) 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"; @@ -1809,27 +1809,27 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) 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) { - vec_reset_length (vcom->io_buffer); + vec_reset_length (ldp->io_buffer); size = -1; goto done; } goto update_offset; } func_str = "vppcom_session_write"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, results, n_bytes_left); - 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) @@ -1838,7 +1838,7 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) { if (!results) { - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): sid %u (0x%x): " "EAGAIN", getpid (), out_fd, out_fd, sid, sid); @@ -1855,12 +1855,12 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) "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) { - vec_reset_length (vcom->io_buffer); + vec_reset_length (ldp->io_buffer); errno = -size; size = -1; goto done; @@ -1875,7 +1875,7 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) 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); @@ -1907,7 +1907,7 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) { func_str = "libc_send"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "in_fd %d, offset %p, len %u", getpid (), out_fd, out_fd, func_str, @@ -1917,7 +1917,7 @@ sendfile (int out_fd, int in_fd, off_t * offset, size_t len) } done: - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -1946,16 +1946,16 @@ recv (int fd, void *buf, size_t n, int flags) { 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"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -1971,7 +1971,7 @@ recv (int fd, void *buf, size_t n, int flags) { func_str = "libc_recv"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -1979,7 +1979,7 @@ recv (int fd, void *buf, size_t n, int flags) size = libc_recv (fd, buf, n, flags); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -2003,9 +2003,9 @@ sendto (int fd, const void *buf, size_t n, int flags, { 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) @@ -2043,7 +2043,7 @@ sendto (int fd, const void *buf, size_t n, int flags, func_str = "vppcom_session_sendto"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -2060,7 +2060,7 @@ sendto (int fd, const void *buf, size_t n, int flags, { func_str = "libc_sendto"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -2070,7 +2070,7 @@ sendto (int fd, const void *buf, size_t n, int flags, } done: - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -2094,9 +2094,9 @@ recvfrom (int fd, void *__restrict buf, size_t n, int flags, { 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) @@ -2106,7 +2106,7 @@ recvfrom (int fd, void *__restrict buf, size_t n, int flags, func_str = "vppcom_session_recvfrom"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -2117,7 +2117,7 @@ recvfrom (int fd, void *__restrict buf, size_t n, int flags, 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); @@ -2132,7 +2132,7 @@ recvfrom (int fd, void *__restrict buf, size_t n, int flags, { func_str = "libc_recvfrom"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -2141,7 +2141,7 @@ recvfrom (int fd, void *__restrict buf, size_t n, int flags, size = libc_recvfrom (fd, buf, n, flags, addr, addr_len); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -2164,9 +2164,9 @@ sendmsg (int fd, const struct msghdr * message, int flags) { 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) @@ -2181,7 +2181,7 @@ sendmsg (int fd, const struct msghdr * message, int flags) { func_str = "libc_sendmsg"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "message %p, flags 0x%x", getpid (), fd, fd, func_str, message, flags); @@ -2189,7 +2189,7 @@ sendmsg (int fd, const struct msghdr * message, int flags) size = libc_sendmsg (fd, message, flags); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -2213,9 +2213,9 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) { 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) @@ -2228,7 +2228,7 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) { func_str = "libc_sendmmsg"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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); @@ -2236,7 +2236,7 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) size = libc_sendmmsg (fd, vmessages, vlen, flags); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -2260,9 +2260,9 @@ recvmsg (int fd, struct msghdr * message, int flags) { 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) @@ -2277,7 +2277,7 @@ recvmsg (int fd, struct msghdr * message, int flags) { func_str = "libc_recvmsg"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "message %p, flags 0x%x", getpid (), fd, fd, func_str, message, flags); @@ -2285,7 +2285,7 @@ recvmsg (int fd, struct msghdr * message, int flags) size = libc_recvmsg (fd, message, flags); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -2310,9 +2310,9 @@ recvmmsg (int fd, struct mmsghdr *vmessages, { 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) @@ -2325,7 +2325,7 @@ recvmmsg (int fd, struct mmsghdr *vmessages, { func_str = "libc_recvmmsg"; - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -2334,7 +2334,7 @@ recvmmsg (int fd, struct mmsghdr *vmessages, size = libc_recvmmsg (fd, vmessages, vlen, flags, tmo); } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) { if (size < 0) { @@ -2359,10 +2359,10 @@ getsockopt (int fd, int level, int optname, { 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; - if ((errno = -vcom_init ())) + if ((errno = -ldp_init ())) return -1; if (sid != INVALID_SESSION_ID) @@ -2376,7 +2376,7 @@ getsockopt (int fd, int level, int optname, { case TCP_NODELAY: func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_NODELAY]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2385,7 +2385,7 @@ getsockopt (int fd, int level, int optname, break; case TCP_MAXSEG: func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_USER_MSS]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2394,7 +2394,7 @@ getsockopt (int fd, int level, int optname, break; case TCP_KEEPIDLE: func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_KEEPIDLE]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2403,7 +2403,7 @@ getsockopt (int fd, int level, int optname, break; case TCP_KEEPINTVL: func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_KEEPINTVL]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x), SOL_TCP", getpid (), fd, fd, func_str, sid, sid); @@ -2413,7 +2413,7 @@ getsockopt (int fd, int level, int optname, case TCP_INFO: if (optval && optlen && (*optlen == sizeof (struct tcp_info))) { - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): sid %u (0x%x), " "SOL_TCP, TCP_INFO, optval %p, " "optlen %d: #LDP-NOP#", @@ -2426,7 +2426,7 @@ getsockopt (int fd, int level, int optname, rv = -EFAULT; break; default: - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): " "sid %u (0x%x), SOL_TCP, " "optname %d unsupported!", @@ -2439,7 +2439,7 @@ getsockopt (int fd, int level, int optname, { case IPV6_V6ONLY: func_str = "vppcom_session_attr[SOL_IPV6,GET_V6ONLY]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2447,7 +2447,7 @@ getsockopt (int fd, int level, int optname, optval, optlen); break; default: - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): " "sid %u (0x%x), SOL_IPV6, " "optname %d unsupported!", @@ -2460,7 +2460,7 @@ getsockopt (int fd, int level, int optname, { case SO_ACCEPTCONN: func_str = "vppcom_session_attr[SOL_SOCKET,GET_ACCEPTCONN]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2469,7 +2469,7 @@ getsockopt (int fd, int level, int optname, break; case SO_KEEPALIVE: func_str = "vppcom_session_attr[SOL_SOCKET,GET_KEEPALIVE]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2478,7 +2478,7 @@ getsockopt (int fd, int level, int optname, break; case SO_PROTOCOL: func_str = "vppcom_session_attr[SOL_SOCKET,GET_PROTOCOL]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2488,7 +2488,7 @@ getsockopt (int fd, int level, int optname, break; case SO_SNDBUF: func_str = "vppcom_session_attr[SOL_SOCKET,GET_TX_FIFO_LEN]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x), optlen %d", getpid (), fd, fd, func_str, sid, sid, buflen); @@ -2497,7 +2497,7 @@ getsockopt (int fd, int level, int optname, break; case SO_RCVBUF: func_str = "vppcom_session_attr[SOL_SOCKET,GET_RX_FIFO_LEN]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x), optlen %d", getpid (), fd, fd, func_str, sid, sid, buflen); @@ -2506,7 +2506,7 @@ getsockopt (int fd, int level, int optname, break; case SO_REUSEADDR: func_str = "vppcom_session_attr[SOL_SOCKET,GET_REUSEADDR]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2515,7 +2515,7 @@ getsockopt (int fd, int level, int optname, break; case SO_BROADCAST: func_str = "vppcom_session_attr[SOL_SOCKET,GET_BROADCAST]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2524,7 +2524,7 @@ getsockopt (int fd, int level, int optname, break; case SO_ERROR: func_str = "vppcom_session_attr[SOL_SOCKET,GET_ERROR]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2532,7 +2532,7 @@ getsockopt (int fd, int level, int optname, optval, optlen); break; default: - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): " "sid %u (0x%x), SOL_SOCKET, " "optname %d unsupported!", @@ -2554,7 +2554,7 @@ getsockopt (int fd, int level, int optname, { func_str = "libc_getsockopt"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) 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, @@ -2563,7 +2563,7 @@ getsockopt (int fd, int level, int optname, rv = libc_getsockopt (fd, level, optname, optval, optlen); } - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) { if (rv < 0) { @@ -2587,9 +2587,9 @@ setsockopt (int fd, int level, int optname, { 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) @@ -2603,7 +2603,7 @@ setsockopt (int fd, int level, int optname, { case TCP_NODELAY: func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_NODELAY]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2612,7 +2612,7 @@ setsockopt (int fd, int level, int optname, break; case TCP_MAXSEG: func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_USER_MSS]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2621,7 +2621,7 @@ setsockopt (int fd, int level, int optname, break; case TCP_KEEPIDLE: func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_KEEPIDLE]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2630,7 +2630,7 @@ setsockopt (int fd, int level, int optname, break; case TCP_KEEPINTVL: func_str = "vppcom_session_attr[SOL_TCP,SET_TCP_KEEPINTVL]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x), SOL_TCP", getpid (), fd, fd, func_str, sid, sid); @@ -2638,7 +2638,7 @@ setsockopt (int fd, int level, int optname, (void *) optval, &optlen); break; default: - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): " "sid %u (0x%x), SOL_TCP, " "optname %d unsupported!", @@ -2651,7 +2651,7 @@ setsockopt (int fd, int level, int optname, { case IPV6_V6ONLY: func_str = "vppcom_session_attr[SOL_IPV6,SET_V6ONLY]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2659,7 +2659,7 @@ setsockopt (int fd, int level, int optname, (void *) optval, &optlen); break; default: - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): " "sid %u (0x%x), SOL_IPV6, " "optname %d unsupported!", @@ -2672,7 +2672,7 @@ setsockopt (int fd, int level, int optname, { case SO_KEEPALIVE: func_str = "vppcom_session_attr[SOL_SOCKET,SET_KEEPALIVE]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2681,7 +2681,7 @@ setsockopt (int fd, int level, int optname, break; case SO_REUSEADDR: func_str = "vppcom_session_attr[SOL_SOCKET,SET_REUSEADDR]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2690,7 +2690,7 @@ setsockopt (int fd, int level, int optname, break; case SO_BROADCAST: func_str = "vppcom_session_attr[SOL_SOCKET,SET_BROADCAST]"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): " "sid %u (0x%x)", getpid (), fd, fd, func_str, sid, sid); @@ -2698,7 +2698,7 @@ setsockopt (int fd, int level, int optname, (void *) optval, &optlen); break; default: - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): " "sid %u (0x%x), SOL_SOCKET, " "optname %d unsupported!", @@ -2720,7 +2720,7 @@ setsockopt (int fd, int level, int optname, { func_str = "libc_setsockopt"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) 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, @@ -2729,7 +2729,7 @@ setsockopt (int fd, int level, int optname, rv = libc_setsockopt (fd, level, optname, optval, optlen); } - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) { if (rv < 0) { @@ -2752,16 +2752,16 @@ listen (int fd, int n) { 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"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): sid %u (0x%x), n %d", getpid (), fd, fd, func_str, sid, sid, n); @@ -2777,14 +2777,14 @@ listen (int fd, int n) { func_str = "libc_listen"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): n %d", getpid (), fd, fd, func_str, n); rv = libc_listen (fd, n); } - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) { if (rv < 0) { @@ -2803,15 +2803,15 @@ listen (int fd, int n) } static inline int -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; - u32 listen_sid = vcom_sid_from_fd (listen_fd); + u32 listen_sid = ldp_sid_from_fd (listen_fd); int accept_sid; - if ((errno = -vcom_init ())) + if ((errno = -ldp_init ())) return -1; if (listen_sid != INVALID_SESSION_ID) @@ -2823,7 +2823,7 @@ vcom_accept4 (int listen_fd, __SOCKADDR_ARG addr, func_str = "vppcom_session_accept"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) 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, @@ -2837,7 +2837,7 @@ vcom_accept4 (int listen_fd, __SOCKADDR_ARG addr, } else { - 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); @@ -2846,13 +2846,13 @@ vcom_accept4 (int listen_fd, __SOCKADDR_ARG addr, } else { - 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); - 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); @@ -2866,7 +2866,7 @@ vcom_accept4 (int listen_fd, __SOCKADDR_ARG addr, { func_str = "libc_accept4"; - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) 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, @@ -2875,7 +2875,7 @@ vcom_accept4 (int listen_fd, __SOCKADDR_ARG addr, rv = libc_accept4 (listen_fd, addr, addr_len, flags); } - if (VCOM_DEBUG > 0) + if (LDP_DEBUG > 0) { if (rv < 0) { @@ -2897,13 +2897,13 @@ int 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) { - return vcom_accept4 (fd, addr, addr_len, 0); + return ldp_accept4 (fd, addr, addr_len, 0); } int @@ -2911,9 +2911,9 @@ shutdown (int fd, int how) { 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) @@ -2928,14 +2928,14 @@ shutdown (int fd, int how) { func_str = "libc_shutdown"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): how %d", getpid (), fd, fd, func_str, how); rv = libc_shutdown (fd, how); } - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) { if (rv < 0) { @@ -2959,12 +2959,12 @@ epoll_create1 (int flags) const char *func_str; int rv; - if ((errno = -vcom_init ())) + if ((errno = -ldp_init ())) return -1; func_str = "vppcom_epoll_create"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: calling %s()", getpid (), func_str); rv = vppcom_epoll_create (); @@ -2975,9 +2975,9 @@ epoll_create1 (int flags) rv = -1; } else - rv = vcom_fd_from_sid ((u32) rv); + rv = ldp_fd_from_sid ((u32) rv); - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) { if (rv < 0) { @@ -3005,20 +3005,20 @@ epoll_ctl (int epfd, int op, int fd, struct epoll_event *event) { 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) { - 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 (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) 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, @@ -3043,7 +3043,7 @@ epoll_ctl (int epfd, int op, int fd, struct epoll_event *event) { func_str = "libc_epoll_create1"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) clib_warning ("LDP<%d>: calling %s(): EPOLL_CLOEXEC", getpid (), func_str); @@ -3078,7 +3078,7 @@ epoll_ctl (int epfd, int op, int fd, struct epoll_event *event) { func_str = "libc_epoll_ctl"; - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) 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); @@ -3087,7 +3087,7 @@ epoll_ctl (int epfd, int op, int fd, struct epoll_event *event) } done: - if (VCOM_DEBUG > 1) + if (LDP_DEBUG > 1) { if (rv < 0) { @@ -3106,17 +3106,17 @@ done: } static inline int -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; - u32 vep_idx = vcom_sid_from_fd (epfd); + u32 vep_idx = ldp_sid_from_fd (epfd); int libc_epfd; - if ((errno = -vcom_init ())) + if ((errno = -ldp_init ())) return -1; if (PREDICT_FALSE (!events || (timeout < -1))) @@ -3134,7 +3134,7 @@ vcom_epoll_pwait (int epfd, struct epoll_event *events, } 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); @@ -3145,7 +3145,7 @@ vcom_epoll_pwait (int epfd, struct epoll_event *events, goto done; } - if (VCOM_DEBUG > 2) + if (LDP_DEBUG > 2) 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, @@ -3153,11 +3153,11 @@ vcom_epoll_pwait (int epfd, struct epoll_event *events, maxevents, timeout, sigmask); do { - if (!vcom->epoll_wait_vcl) + if (!ldp->epoll_wait_vcl) { func_str = "vppcom_epoll_wait"; - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): " "vep_idx %d (0x%x), events %p, maxevents %d", getpid (), epfd, epfd, func_str, @@ -3166,7 +3166,7 @@ vcom_epoll_pwait (int epfd, struct epoll_event *events, 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) @@ -3177,13 +3177,13 @@ vcom_epoll_pwait (int epfd, struct epoll_event *events, } } else - vcom->epoll_wait_vcl = 0; + ldp->epoll_wait_vcl = 0; if (libc_epfd > 0) { func_str = "libc_epoll_pwait"; - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) clib_warning ("LDP<%d>: epfd %d (0x%x): calling %s(): " "libc_epfd %d (0x%x), events %p, " "maxevents %d, sigmask %p", @@ -3196,12 +3196,12 @@ vcom_epoll_pwait (int epfd, struct epoll_event *events, } if (timeout != -1) - now = clib_time_now (&vcom->clib_time); + now = clib_time_now (&ldp->clib_time); } while (now < time_out); done: - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) { if (libc_epfd > 0) epfd = libc_epfd; @@ -3225,13 +3225,13 @@ int 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) { - return vcom_epoll_pwait (epfd, events, maxevents, timeout, NULL); + return ldp_epoll_pwait (epfd, events, maxevents, timeout, NULL); } int @@ -3243,7 +3243,7 @@ poll (struct pollfd *fds, nfds_t nfds, int timeout) vcl_poll_t *vp; double wait_for_time; - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) clib_warning ("LDP<%d>: fds %p, nfds %d, timeout %d", getpid (), fds, nfds, timeout); @@ -3257,16 +3257,16 @@ poll (struct pollfd *fds, nfds_t nfds, int timeout) { if (fds[i].fd >= 0) { - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) 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; - 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; @@ -3286,19 +3286,19 @@ poll (struct pollfd *fds, nfds_t nfds, int timeout) n_revents = 0; do { - if (vec_len (vcom->vcl_poll)) + if (vec_len (ldp->vcl_poll)) { func_str = "vppcom_poll"; - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) 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), n_libc_fds); - 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; @@ -3313,9 +3313,9 @@ poll (struct pollfd *fds, nfds_t nfds, int timeout) { func_str = "libc_poll"; - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) 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) @@ -3331,11 +3331,11 @@ poll (struct pollfd *fds, nfds_t nfds, int timeout) } } while ((wait_for_time == -1) || - (clib_time_now (&vcom->clib_time) < wait_for_time)); + (clib_time_now (&ldp->clib_time) < wait_for_time)); rv = 0; done: - 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 @@ -3347,9 +3347,9 @@ done: fds[vp->fds_ndx].revents |= POLLWRNORM; #endif } - vec_reset_length (vcom->vcl_poll); + vec_reset_length (ldp->vcl_poll); - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) { if (rv < 0) { @@ -3364,13 +3364,13 @@ done: { 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) { - if (VCOM_DEBUG > 3) + if (LDP_DEBUG > 3) clib_warning ("LDP<%d>: fds[%d].fd %d (0x%0x), " ".events = 0x%x, .revents = 0x%x", getpid (), i, fds[i].fd, fds[i].fd, @@ -3388,7 +3388,7 @@ int 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 ()); @@ -3399,41 +3399,41 @@ ppoll (struct pollfd *fds, nfds_t nfds, } #endif -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 -vcom_constructor (void) +ldp_constructor (void) { swrap_constructor (); - 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", getpid ()); else - 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 -vcom_destructor (void) +ldp_destructor (void) { swrap_destructor (); - if (vcom->init) + if (ldp->init) { vppcom_app_destroy (); - vcom->init = 0; + ldp->init = 0; } /* 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 ()); } diff --git a/src/vcl/vcom.h b/src/vcl/ldp.h index 0dd86c1c000..f96219f753b 100644 --- a/src/vcl/vcom.h +++ b/src/vcl/ldp.h @@ -13,30 +13,30 @@ * limitations under the License. */ -#ifndef included_vcom_h -#define included_vcom_h +#ifndef included_ldp_h +#define included_ldp_h #if (CLIB_DEBUG > 0) -/* 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 #else -#define VCOM_DEBUG_INIT 0 +#define LDP_DEBUG_INIT 0 #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 diff --git a/src/vcl/vcom_glibc_socket.h b/src/vcl/ldp_glibc_socket.h index bf18473de85..a9e5dbe04e0 100644 --- a/src/vcl/vcom_glibc_socket.h +++ b/src/vcl/ldp_glibc_socket.h @@ -13,8 +13,8 @@ * 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> @@ -341,7 +341,7 @@ extern int ppoll (struct pollfd *__fds, nfds_t __nfds, #endif -#endif /* included_vcom_glibc_socket_h */ +#endif /* included_ldp_glibc_socket_h */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/vcl/vcom_socket_wrapper.c b/src/vcl/ldp_socket_wrapper.c index de633d1cc7b..981125850ff 100644 --- a/src/vcl/vcom_socket_wrapper.c +++ b/src/vcl/ldp_socket_wrapper.c @@ -63,7 +63,7 @@ #include <unistd.h> #include <pthread.h> -#include <vcl/vcom_socket_wrapper.h> +#include <vcl/ldp_socket_wrapper.h> enum swrap_dbglvl_e diff --git a/src/vcl/vcom_socket_wrapper.h b/src/vcl/ldp_socket_wrapper.h index ce03ebe83da..59e4eaef394 100644 --- a/src/vcl/vcom_socket_wrapper.h +++ b/src/vcl/ldp_socket_wrapper.h @@ -55,8 +55,8 @@ is set. */ -#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> @@ -66,7 +66,7 @@ #include <poll.h> #include <sys/uio.h> #include <stdlib.h> -#include <vcl/vcom.h> +#include <vcl/ldp.h> /* GCC have printf type attribute check. */ @@ -224,7 +224,7 @@ void swrap_constructor (void); void swrap_destructor (void); -#endif /* included_vcom_socket_wrapper_h */ +#endif /* included_ldp_socket_wrapper_h */ /* * fd.io coding-style-patch-verification: ON |