Lines Matching defs:sockctrl
96 PCAP_SOCKET sockctrl; //!< PCAP_SOCKET ID of the control connection
111 PCAP_SOCKET sockctrl;
113 SSL *ctrl_ssl, *data_ssl; // optional SSL handlers for sockctrl and sockdata.
126 static int daemon_msg_err(PCAP_SOCKET sockctrl, SSL *, uint32 plen);
143 static int daemon_unpackapplyfilter(PCAP_SOCKET sockctrl, SSL *, struct session *session, uint32 *plenp, char *errbuf);
212 daemon_serviceloop(PCAP_SOCKET sockctrl, int isactive, char *passiveClients,
261 nrecv = sock_recv(sockctrl, NULL, (char *)&first_octet, 1,
301 nrecv = rpcapd_recv_msg_header(sockctrl, NULL, &header);
315 if (rpcapd_discard(sockctrl, NULL, plen) == -1)
325 if (rpcap_senderror(sockctrl, NULL, header.ver,
337 ssl = ssl_promotion(1, sockctrl, errbuf, PCAP_ERRBUF_SIZE);
362 nrecv = sock_recv(sockctrl, ssl, (char *) &tls_header,
379 if (rpcapd_discard(sockctrl, NULL, plen) == -1)
393 if (sock_send(sockctrl, NULL, (char *) &tls_header,
403 if (sock_send(sockctrl, NULL, (char *) &tls_alert,
418 pars.sockctrl = sockctrl;
447 if (getpeername(pars.sockctrl, (struct sockaddr *)&from,
452 if (rpcap_senderror(pars.sockctrl, pars.ssl, 0, PCAP_ERR_NETW, errmsgbuf, errbuf) == -1)
475 if (rpcap_senderror(pars.sockctrl, pars.ssl, 0, PCAP_ERR_HOSTNOAUTH, errmsgbuf, errbuf) == -1)
520 FD_SET(pars.sockctrl, &rfds);
522 retval = select((int)pars.sockctrl + 1, &rfds, NULL, NULL, &tv);
527 if (rpcap_senderror(pars.sockctrl, pars.ssl, 0, PCAP_ERR_NETW, errmsgbuf, errbuf) == -1)
536 if (rpcap_senderror(pars.sockctrl, pars.ssl, 0, PCAP_ERR_INITTIMEOUT, "The RPCAP initial timeout has expired", errbuf) == -1)
545 nrecv = rpcapd_recv_msg_header(pars.sockctrl, pars.ssl, &header);
568 if (rpcap_senderror(pars.sockctrl, pars.ssl, header.ver,
580 (void)rpcapd_discard(pars.sockctrl, pars.ssl, plen);
613 (void)rpcapd_discard(pars.sockctrl, pars.ssl, plen);
625 (void)daemon_msg_err(pars.sockctrl, pars.ssl, plen);
648 if (rpcap_senderror(pars.sockctrl, pars.ssl,
656 if (rpcapd_discard(pars.sockctrl, pars.ssl, plen) == -1)
684 if (rpcap_senderror(pars.sockctrl, pars.ssl,
692 if (rpcapd_discard(pars.sockctrl, pars.ssl, plen) == -1)
704 if (rpcap_senderror(pars.sockctrl, pars.ssl,
712 if (rpcapd_discard(pars.sockctrl, pars.ssl, plen) == -1)
758 FD_SET(pars.sockctrl, &rfds);
762 retval = select((int)pars.sockctrl + 1, &rfds, NULL, NULL, &tv);
768 if (rpcap_senderror(pars.sockctrl, pars.ssl,
779 if (rpcap_senderror(pars.sockctrl, pars.ssl,
791 nrecv = rpcapd_recv_msg_header(pars.sockctrl, pars.ssl, &header);
817 if (rpcap_senderror(pars.sockctrl, pars.ssl,
828 (void)rpcapd_discard(pars.sockctrl, pars.ssl, plen);
837 (void)daemon_msg_err(pars.sockctrl, pars.ssl, plen);
883 if (rpcap_senderror(pars.sockctrl, pars.ssl,
894 if (rpcapd_discard(pars.sockctrl, pars.ssl, plen) == -1)
926 if (rpcap_senderror(pars.sockctrl, pars.ssl,
995 rpcap_senderror(pars.sockctrl, pars.ssl,
1023 if (rpcap_senderror(pars.sockctrl, pars.ssl,
1033 if (rpcapd_discard(pars.sockctrl, pars.ssl, plen) == -1)
1063 if (rpcap_senderror(pars.sockctrl, pars.ssl,
1071 if (rpcapd_discard(pars.sockctrl, pars.ssl, plen) == -1)
1084 if (rpcap_senderror(pars.sockctrl, pars.ssl,
1092 if (rpcapd_discard(pars.sockctrl, pars.ssl, plen) == -1)
1127 sock_close(sockctrl, NULL, 0);
1139 daemon_msg_err(PCAP_SOCKET sockctrl, SSL *ssl, uint32 plen)
1150 if (sock_recv(sockctrl, ssl, remote_errbuf, PCAP_ERRBUF_SIZE - 1,
1158 if (rpcapd_discard(sockctrl, ssl, plen - (PCAP_ERRBUF_SIZE - 1)) == -1)
1176 if (sock_recv(sockctrl, ssl, remote_errbuf, plen,
1204 * \param sockctrl: the socket for the control connection.
1228 status = rpcapd_recv(pars->sockctrl, pars->ssl, (char *) &auth, sizeof(struct rpcap_auth), &plen, errmsgbuf);
1247 if (rpcap_senderror(pars->sockctrl, pars->ssl,
1272 status = rpcapd_recv(pars->sockctrl, pars->ssl, username, usernamelen, &plen, errmsgbuf);
1294 status = rpcapd_recv(pars->sockctrl, pars->ssl, passwd, passwdlen, &plen, errmsgbuf);
1317 if (rpcap_senderror(pars->sockctrl, pars->ssl,
1347 if (rpcap_senderror(pars->sockctrl, pars->ssl,
1384 if (sock_send(pars->sockctrl, pars->ssl, sendbuf, sendbufidx, errbuf, PCAP_ERRBUF_SIZE) == -1)
1392 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
1400 if (rpcap_senderror(pars->sockctrl, pars->ssl, 0, PCAP_ERR_AUTH,
1410 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
1615 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
1627 if (rpcap_senderror(pars->sockctrl, pars->ssl, ver,
1826 if (sock_send(pars->sockctrl, pars->ssl, sendbuf, sendbufidx, errbuf, PCAP_ERRBUF_SIZE) == -1)
1838 if (rpcap_senderror(pars->sockctrl, pars->ssl, ver,
1869 nread = sock_recv(pars->sockctrl, pars->ssl, source, plen,
1925 if (sock_send(pars->sockctrl, pars->ssl, sendbuf, sendbufidx, errbuf, PCAP_ERRBUF_SIZE) == -1)
1933 if (rpcap_senderror(pars->sockctrl, pars->ssl, ver, PCAP_ERR_OPEN,
1942 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
1981 status = rpcapd_recv(pars->sockctrl, pars->ssl, (char *) &startcapreq,
2061 if (getpeername(pars->sockctrl, (struct sockaddr *) &saddr, &saddrlen) == -1)
2131 session->sockctrl = pars->sockctrl;
2136 ret = daemon_unpackapplyfilter(pars->sockctrl, pars->ssl, session, &plen, errmsgbuf);
2171 if (sock_send(pars->sockctrl, pars->ssl, sendbuf, sendbufidx, errbuf, PCAP_ERRBUF_SIZE) == -1)
2240 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
2262 if (rpcap_senderror(pars->sockctrl, pars->ssl, ver,
2271 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
2306 if (sock_send(pars->sockctrl, pars->ssl, (char *) &header, sizeof(struct rpcap_header), errbuf, PCAP_ERRBUF_SIZE) == -1)
2334 daemon_unpackapplyfilter(PCAP_SOCKET sockctrl, SSL *ctrl_ssl, struct session *session, uint32 *plenp, char *errmsgbuf)
2343 status = rpcapd_recv(sockctrl, ctrl_ssl, (char *) &filter,
2381 status = rpcapd_recv(sockctrl, ctrl_ssl, (char *) &insn,
2427 ret = daemon_unpackapplyfilter(pars->sockctrl, pars->ssl, session, &plen, errmsgbuf);
2440 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
2449 if (sock_send(pars->sockctrl, pars->ssl, (char *) &header, sizeof (struct rpcap_header), errbuf, PCAP_ERRBUF_SIZE))
2459 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
2463 rpcap_senderror(pars->sockctrl, pars->ssl, ver, PCAP_ERR_UPDATEFILTER,
2482 status = rpcapd_recv(pars->sockctrl, pars->ssl, (char *) &rpcap_samp, sizeof(struct rpcap_sampling), &plen, errmsgbuf);
2499 if (sock_send(pars->sockctrl, pars->ssl, (char *) &header, sizeof (struct rpcap_header), errbuf, PCAP_ERRBUF_SIZE) == -1)
2506 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
2514 if (rpcap_senderror(pars->sockctrl, pars->ssl, ver, PCAP_ERR_SETSAMPLING,
2523 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
2543 if (rpcapd_discard(pars->sockctrl, pars->ssl, plen) == -1)
2587 if (sock_send(pars->sockctrl, pars->ssl, sendbuf, sendbufidx, errbuf, PCAP_ERRBUF_SIZE) == -1)
2596 rpcap_senderror(pars->sockctrl, pars->ssl, ver, PCAP_ERR_GETSTATS,
2798 rpcap_senderror(session->sockctrl, session->ctrl_ssl, session->protocol_version,