__thread uword __vcl_worker_index = ~0;
-
static int
vcl_wait_for_segment (u64 segment_handle)
{
if (PREDICT_FALSE (session->session_state & CLIENT_STATE_OPEN))
{
- VDBG (0, "VCL<%d>: vpp handle 0x%llx, sid %u: session already "
+ VDBG (0, "session handle %u [0x%llx]: session already "
"connected to %s %U port %d proto %s, state 0x%x (%s)",
- getpid (), session->vpp_handle, session_handle,
+ session_handle, session->vpp_handle,
session->transport.is_ip4 ? "IPv4" : "IPv6",
format_ip46_address,
&session->transport.rmt_ip, session->transport.is_ip4 ?
sizeof (ip6_address_t));
session->transport.rmt_port = server_ep->port;
- VDBG (0, "VCL<%d>: vpp handle 0x%llx, sid %u: connecting to server %s %U "
- "port %d proto %s",
- getpid (), session->vpp_handle, session_handle,
+ VDBG (0, "session handle %u [0x%llx]: connecting to server %s %U "
+ "port %d proto %s", session_handle, session->vpp_handle,
session->transport.is_ip4 ? "IPv4" : "IPv6",
format_ip46_address,
&session->transport.rmt_ip, session->transport.is_ip4 ?
vcl_worker_t *wrk = vcl_worker_get_current ();
vcl_session_t *session;
int rv = VPPCOM_OK;
- u32 *flags = buffer;
+ u32 *flags = buffer, tmp_flags = 0;
vppcom_endpt_t *ep = buffer;
session = vcl_session_get_w_handle (wrk, session_handle);
{
case VPPCOM_ATTR_GET_NREAD:
rv = vppcom_session_read_ready (session);
- VDBG (2, "VCL<%d>: VPPCOM_ATTR_GET_NREAD: sid %u, nread = %d",
- getpid (), rv);
+ VDBG (2, "VPPCOM_ATTR_GET_NREAD: sid %u, nread = %d", rv);
break;
case VPPCOM_ATTR_GET_NWRITE:
rv = vcl_session_get_refcnt (session);
break;
+ case VPPCOM_ATTR_SET_SHUT:
+ if (*flags == SHUT_RD || *flags == SHUT_RDWR)
+ VCL_SESS_ATTR_SET (session->attr, VCL_SESS_ATTR_SHUT_RD);
+ if (*flags == SHUT_WR || *flags == SHUT_RDWR)
+ VCL_SESS_ATTR_SET (session->attr, VCL_SESS_ATTR_SHUT_WR);
+ break;
+
+ case VPPCOM_ATTR_GET_SHUT:
+ if (VCL_SESS_ATTR_TEST (session->attr, VCL_SESS_ATTR_SHUT_RD))
+ tmp_flags = 1;
+ if (VCL_SESS_ATTR_TEST (session->attr, VCL_SESS_ATTR_SHUT_WR))
+ tmp_flags |= 2;
+ if (tmp_flags == 1)
+ *(int *) buffer = SHUT_RD;
+ else if (tmp_flags == 2)
+ *(int *) buffer = SHUT_WR;
+ else if (tmp_flags == 3)
+ *(int *) buffer = SHUT_RDWR;
+ *buflen = sizeof (int);
+ break;
default:
rv = VPPCOM_EINVAL;
break;
for (i = 0; i < n_sids; i++)
{
- session = vcl_session_get (wrk, vp[i].sid);
+ session = vcl_session_get (wrk, vp[i].sh);
if (!session)
{
vp[i].revents = POLLHUP;
for (i = 0; i < n_sids; i++)
{
clib_warning ("VCL<%d>: vp[%d].sid %d (0x%x), .events 0x%x, "
- ".revents 0x%x", getpid (), i, vp[i].sid, vp[i].sid,
+ ".revents 0x%x", getpid (), i, vp[i].sh, vp[i].sh,
vp[i].events, vp[i].revents);
}
}