+ switch (level)
+ {
+ case SOL_TCP:
+ switch (optname)
+ {
+ case TCP_NODELAY:
+ func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_NODELAY]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_TCP_NODELAY,
+ optval, optlen);
+ break;
+ case TCP_MAXSEG:
+ func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_USER_MSS]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_TCP_USER_MSS,
+ optval, optlen);
+ break;
+ case TCP_KEEPIDLE:
+ func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_KEEPIDLE]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_TCP_KEEPIDLE,
+ optval, optlen);
+ break;
+ case TCP_KEEPINTVL:
+ func_str = "vppcom_session_attr[SOL_TCP,GET_TCP_KEEPINTVL]";
+ if (VCOM_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);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_TCP_KEEPINTVL,
+ optval, optlen);
+ break;
+ case TCP_INFO:
+ if (optval && optlen && (*optlen == sizeof (struct tcp_info)))
+ {
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): sid %u (0x%x), "
+ "SOL_TCP, TCP_INFO, optval %p, "
+ "optlen %d: #LDP-NOP#",
+ getpid (), fd, fd, sid, sid,
+ optval, *optlen);
+ memset (optval, 0, *optlen);
+ rv = VPPCOM_OK;
+ }
+ else
+ rv = -EFAULT;
+ break;
+ default:
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
+ "sid %u (0x%x), SOL_TCP, "
+ "optname %d unsupported!",
+ getpid (), fd, fd, func_str, sid, sid, optname);
+ break;
+ }
+ break;
+ case SOL_IPV6:
+ switch (optname)
+ {
+ case IPV6_V6ONLY:
+ func_str = "vppcom_session_attr[SOL_IPV6,GET_V6ONLY]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_V6ONLY,
+ optval, optlen);
+ break;
+ default:
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
+ "sid %u (0x%x), SOL_IPV6, "
+ "optname %d unsupported!",
+ getpid (), fd, fd, func_str, sid, sid, optname);
+ break;
+ }
+ break;
+ case SOL_SOCKET:
+ switch (optname)
+ {
+ case SO_ACCEPTCONN:
+ func_str = "vppcom_session_attr[SOL_SOCKET,GET_ACCEPTCONN]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_LISTEN,
+ optval, optlen);
+ break;
+ case SO_KEEPALIVE:
+ func_str = "vppcom_session_attr[SOL_SOCKET,GET_KEEPALIVE]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_KEEPALIVE,
+ optval, optlen);
+ break;
+ case SO_PROTOCOL:
+ func_str = "vppcom_session_attr[SOL_SOCKET,GET_PROTOCOL]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_PROTOCOL,
+ optval, optlen);
+ *(int *) optval = *(int *) optval ? SOCK_DGRAM : SOCK_STREAM;
+ break;
+ case SO_SNDBUF:
+ func_str = "vppcom_session_attr[SOL_SOCKET,GET_TX_FIFO_LEN]";
+ if (VCOM_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);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_TX_FIFO_LEN,
+ optval, optlen);
+ break;
+ case SO_RCVBUF:
+ func_str = "vppcom_session_attr[SOL_SOCKET,GET_RX_FIFO_LEN]";
+ if (VCOM_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);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_RX_FIFO_LEN,
+ optval, optlen);
+ break;
+ case SO_REUSEADDR:
+ func_str = "vppcom_session_attr[SOL_SOCKET,GET_REUSEADDR]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_REUSEADDR,
+ optval, optlen);
+ break;
+ case SO_BROADCAST:
+ func_str = "vppcom_session_attr[SOL_SOCKET,GET_BROADCAST]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_BROADCAST,
+ optval, optlen);
+ break;
+ case SO_ERROR:
+ func_str = "vppcom_session_attr[SOL_SOCKET,GET_ERROR]";
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: fd %d (0x%x): calling %s(): "
+ "sid %u (0x%x)",
+ getpid (), fd, fd, func_str, sid, sid);
+ rv = vppcom_session_attr (sid, VPPCOM_ATTR_GET_ERROR,
+ optval, optlen);
+ break;
+ default:
+ if (VCOM_DEBUG > 1)
+ clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s(): "
+ "sid %u (0x%x), SOL_SOCKET, "
+ "optname %d unsupported!",
+ getpid (), fd, fd, func_str, sid, sid, optname);
+ break;
+ }
+ break;
+ default:
+ break;
+ }