/* Receive and process the header of a message.  */
static int rpcap_process_msg_header(SOCKET sock, uint8 ver, uint8 request_type, struct rpcap_header *header, char *errbuf)
/* Receive and process the header of a message.  */
static int rpcap_process_msg_header(SOCKET sock, uint8 ver, uint8 request_type, struct rpcap_header *header, char *errbuf)
{
	uint16 errcode;
	if (rpcap_recv_msg_header(sock, header, errbuf) == -1)
	{
		return -1;
	}
	if (rpcap_check_msg_ver(sock, expected_ver, header, errbuf) == -1)
		return -1;
	return rpcap_check_msg_type(sock, request_type, header,
	    &errcode, errbuf);
}