Blame pcap-rpcap-int.h

Packit 209cc3
/*
Packit 209cc3
 * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy)
Packit 209cc3
 * Copyright (c) 2005 - 2008 CACE Technologies, Davis (California)
Packit 209cc3
 * All rights reserved.
Packit 209cc3
 *
Packit 209cc3
 * Redistribution and use in source and binary forms, with or without
Packit 209cc3
 * modification, are permitted provided that the following conditions
Packit 209cc3
 * are met:
Packit 209cc3
 *
Packit 209cc3
 * 1. Redistributions of source code must retain the above copyright
Packit 209cc3
 * notice, this list of conditions and the following disclaimer.
Packit 209cc3
 * 2. Redistributions in binary form must reproduce the above copyright
Packit 209cc3
 * notice, this list of conditions and the following disclaimer in the
Packit 209cc3
 * documentation and/or other materials provided with the distribution.
Packit 209cc3
 * 3. Neither the name of the Politecnico di Torino, CACE Technologies
Packit 209cc3
 * nor the names of its contributors may be used to endorse or promote
Packit 209cc3
 * products derived from this software without specific prior written
Packit 209cc3
 * permission.
Packit 209cc3
 *
Packit 209cc3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit 209cc3
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit 209cc3
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Packit 209cc3
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Packit 209cc3
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Packit 209cc3
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Packit 209cc3
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Packit 209cc3
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Packit 209cc3
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit 209cc3
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 209cc3
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 209cc3
 *
Packit 209cc3
 */
Packit 209cc3
Packit 209cc3
#ifndef __PCAP_RPCAP_INT_H__
Packit 209cc3
#define __PCAP_RPCAP_INT_H__
Packit 209cc3
Packit 209cc3
#include "pcap.h"
Packit 209cc3
#include "sockutils.h"	/* Needed for some structures (like SOCKET, sockaddr_in) which are used here */
Packit 209cc3
Packit 209cc3
/*
Packit 209cc3
 * \file pcap-rpcap-int.h
Packit 209cc3
 *
Packit 209cc3
 * This file keeps all the definitions used by the RPCAP client and server,
Packit 209cc3
 * other than the protocol definitions.
Packit 209cc3
 *
Packit 209cc3
 * \warning All the RPCAP functions that are allowed to return a buffer containing
Packit 209cc3
 * the error description can return max PCAP_ERRBUF_SIZE characters.
Packit 209cc3
 * However there is no guarantees that the string will be zero-terminated.
Packit 209cc3
 * Best practice is to define the errbuf variable as a char of size 'PCAP_ERRBUF_SIZE+1'
Packit 209cc3
 * and to insert manually the termination char at the end of the buffer. This will
Packit 209cc3
 * guarantee that no buffer overflows occur even if we use the printf() to show
Packit 209cc3
 * the error on the screen.
Packit 209cc3
 */
Packit 209cc3
Packit 209cc3
/*********************************************************
Packit 209cc3
 *                                                       *
Packit 209cc3
 * General definitions / typedefs for the RPCAP protocol *
Packit 209cc3
 *                                                       *
Packit 209cc3
 *********************************************************/
Packit 209cc3
Packit 209cc3
/*
Packit 209cc3
 * \brief Buffer used by socket functions to send-receive packets.
Packit 209cc3
 * In case you plan to have messages larger than this value, you have to increase it.
Packit 209cc3
 */
Packit 209cc3
#define RPCAP_NETBUF_SIZE 64000
Packit 209cc3
Packit 209cc3
/*********************************************************
Packit 209cc3
 *                                                       *
Packit 209cc3
 * Exported function prototypes                          *
Packit 209cc3
 *                                                       *
Packit 209cc3
 *********************************************************/
Packit 209cc3
void rpcap_createhdr(struct rpcap_header *header, uint8 type, uint16 value, uint32 length);
Packit 209cc3
int rpcap_senderror(SOCKET sock, char *error, unsigned short errcode, char *errbuf);
Packit 209cc3
Packit 209cc3
#endif