Summary for 1.2.1 libpcap release
Update README file.
- Fix typoes in README.linux file.
+ Fix typos in README.linux file.
Clean up some compiler warnings.
Fix Linux compile problems and tests for ethtool.h.
Treat Debian/kFreeBSD and GNU/Hurd as systems with GNU
dnl set, and don't add the flag to the first argument if the compile
dnl fails; this is for warning options cause problems that can't be
dnl worked around. If a third argument is supplied, a fourth argument
-dnl should also be supplied; it's a message desribing what the test
+dnl should also be supplied; it's a message describing what the test
dnl program is checking.
dnl
AC_DEFUN(AC_LBL_CHECK_COMPILER_OPT,
#
V_SONAME_OPT="-Wl,+h,"
#
- # By default, directories specifed with -L
+ # By default, directories specified with -L
# are added to the run-time search path, so
# we don't add them in pcap-config.
#
V_SHLIB_OPT="-b"
V_SONAME_OPT="+h "
#
- # By default, directories specifed with -L
+ # By default, directories specified with -L
# are added to the run-time search path, so
# we don't add them in pcap-config.
#
#define PROTO_POS 0 /* offset of protocol discriminator */
#define CALL_REF_POS 2 /* offset of call reference value */
#define MSG_TYPE_POS 5 /* offset of message type */
-#define MSG_LEN_POS 7 /* offset of mesage length */
+#define MSG_LEN_POS 7 /* offset of message length */
#define IE_BEGIN_POS 9 /* offset of first information element */
/* format of signalling messages */
#
V_SONAME_OPT="-Wl,+h,"
#
- # By default, directories specifed with -L
+ # By default, directories specified with -L
# are added to the run-time search path, so
# we don't add them in pcap-config.
#
V_SHLIB_OPT="-b"
V_SONAME_OPT="+h "
#
- # By default, directories specifed with -L
+ # By default, directories specified with -L
# are added to the run-time search path, so
# we don't add them in pcap-config.
#
case BPF_LDX:
/*
* As there are fewer than 2^31 memory locations,
- * s->k should be convertable to int without problems.
+ * s->k should be convertible to int without problems.
*/
return (BPF_MODE(c) == BPF_IND) ? X_ATOM :
(BPF_MODE(c) == BPF_MEM) ? (int)s->k : -1;
* As there is a header on the front size of the mmap'd buffer, only
* some of the buffer is exposed to libpcap as a whole via bufsize;
* zbufsize is the true size. zbuffer tracks the current zbuf
- * assocated with buffer so that it can be used to decide which the
+ * associated with buffer so that it can be used to decide which the
* next buffer to read will be.
*/
u_char *zbuf1, *zbuf2, *zbuffer;
}
if (nl[NL_IFNET].n_value == 0) {
snprintf(ebuf, PCAP_ERRBUF_SIZE,
- "could't find %s kernel symbol",
+ "couldn't find %s kernel symbol",
nl[NL_IFNET].n_name);
return (PCAP_ERROR);
}
Limitations:
1. DPDK support will be on if DPDK is available. Please set DIR for --with-dpdk[=DIR] with ./configure or -DDPDK_DIR[=DIR] with cmake if DPDK is installed manually.
-2. Only support link libdpdk.so dynamicly, because the libdpdk.a will not work correctly.
+2. Only support link libdpdk.so dynamically, because the libdpdk.a will not work correctly.
3. Only support read operation, and packet injection has not been supported yet.
Usage:
3. Compile libpcap with dpdk options.
-If DPDK has not been found automatically, you shall export DPDK envionment variable which are used for compiling DPDK. And then pass $RTE_SDK/$RTE_TARGET to --with-dpdk or -DDPDK_DIR
+If DPDK has not been found automatically, you shall export DPDK environment variable which are used for compiling DPDK. And then pass $RTE_SDK/$RTE_TARGET to --with-dpdk or -DDPDK_DIR
export RTE_SDK={your DPDK base directory}
export RTE_TARGET={your target name}
// In non-blocking mode, just read once, no matter how many packets are captured.
nb_rx = (int)rte_eth_rx_burst(pd->portid, 0, pkts_burst, burst_cnt);
}else{
- // In blocking mode, read many times until packets are captured or timeout or break_loop is setted.
+ // In blocking mode, read many times until packets are captured or timeout or break_loop is set.
// if timeout_ms == 0, it may be blocked forever.
while (timeout_ms == 0 || sleep_ms < timeout_ms){
nb_rx = (int)rte_eth_rx_burst(pd->portid, 0, pkts_burst, burst_cnt);
return PCAP_ERROR_BREAK;
}
// read once in non-blocking mode, or try many times waiting for timeout_ms.
- // if timeout_ms == 0, it will be blocked until one packet arrives or break_loop is setted.
+ // if timeout_ms == 0, it will be blocked until one packet arrives or break_loop is set.
nb_rx = dpdk_read_with_timeout(p, pkts_burst, burst_cnt);
if (nb_rx == 0){
if (pd->nonblock){
RTE_LOG(DEBUG, USER1, "dpdk: no packets available in non-blocking mode.\n");
}else{
if (p->break_loop){
- RTE_LOG(DEBUG, USER1, "dpdk: no packets available and break_loop is setted in blocking mode.\n");
+ RTE_LOG(DEBUG, USER1, "dpdk: no packets available and break_loop is set in blocking mode.\n");
p->break_loop = 0;
return PCAP_ERROR_BREAK;
return ret;
}
-// device name for dpdk shoud be in the form as dpdk:number, such as dpdk:0
+// device name for dpdk should be in the form as dpdk:number, such as dpdk:0
pcap_t * pcap_dpdk_create(const char *device, char *ebuf, int *is_ours)
{
pcap_t *p=NULL;
return -1;
/*
- * Run user level packet filter by default. Will be overriden if
+ * Run user level packet filter by default. Will be overridden if
* installing a kernel filter succeeds.
*/
handlep->filter_in_userland = 1;
#include <linux/netfilter/nfnetlink_log.h>
#include <linux/netfilter/nfnetlink_queue.h>
-/* NOTE: if your program drops privilages after pcap_activate() it WON'T work with nfqueue.
+/* NOTE: if your program drops privileges after pcap_activate() it WON'T work with nfqueue.
* It took me quite some time to debug ;/
*
- * Sending any data to nfnetlink socket requires CAP_NET_ADMIN privilages,
+ * Sending any data to nfnetlink socket requires CAP_NET_ADMIN privileges,
* and in nfqueue we need to send verdict reply after recving packet.
*
- * In tcpdump you can disable dropping privilages with -Z root
+ * In tcpdump you can disable dropping privileges with -Z root
*/
#include "pcap-netfilter-linux.h"
}
/*
- * We filter at user level, since the kernel driver does't process the packets
+ * We filter at user level, since the kernel driver doesn't process the packets
*/
static int
pcap_setfilter_win32_dag(pcap_t *p, struct bpf_program *fp) {
* full.
*
* "ps_ifdrop" counts packets dropped by the network
- * inteface (regardless of whether they would have passed
+ * interface (regardless of whether they would have passed
* the input filter, of course).
*
* If packet filtering is not being done in the kernel:
* the userland filter.
*
* "ps_ifdrop" counts packets dropped by the network
- * inteface (regardless of whether they would have passed
+ * interface (regardless of whether they would have passed
* the input filter, of course).
*
* These statistics don't include packets not yet read from
* This function can be called in two cases:
* - pcap_startcapture_remote() is called (we have to send the filter
* along with the 'start capture' command)
- * - we want to udpate the filter during a capture (i.e. pcap_setfilter()
+ * - we want to update the filter during a capture (i.e. pcap_setfilter()
* after the capture has been started)
*
* This function serializes the filter into the sending buffer ('sendbuf',
<UL>
<STRONG>Note:</STRONG> This document is part of the libpcap Git and was derived from 'pcap.3' (circa Aug/07).
<P>
- The ACN provides a customized/distributed version of this library that alows SMPs to
+ The ACN provides a customized/distributed version of this library that allows SMPs to
interact with the various IOPs within the site providing a standard mechanism
to capture LAN and WAN message traffic.
<P>
<TR><TH VALIGN=TOP NOWRAP>SMP -> IOP</TH>
<TD>
The SMP closes the file descriptor, and if the descriptor is that of
- the comminucation session with an IOP, it too is terminated.
+ the communication session with an IOP, it too is terminated.
</TD>
</TR>
<TR><TH VALIGN=TOP NOWRAP>IOP</TH>
<TR>
<TD VALIGN=TOP>ps_ifdrop</TD>
<TD VALIGN=TOP ALIGN=CENTER>4</TD>
- <TD VALIGN=TOP>The number of packets dropped by the network inteface
+ <TD VALIGN=TOP>The number of packets dropped by the network interface
(regardless of whether they would have passed the input filter).</TD>
</TR>
</TABLE>
}
}
- /* with max_packets specifying "unlimited" we stop afer the first chunk*/
+ /* with max_packets specifying "unlimited" we stop after the first chunk*/
if (PACKET_COUNT_IS_UNLIMITED(max_packets) || (packets == max_packets))
break;
}
if (sock_send(sockctrl, NULL, (char *) &tls_header,
TLS_RECORD_HEADER_LEN, errbuf, PCAP_ERRBUF_SIZE) == -1)
{
- // That failed; log a messsage and give up.
+ // That failed; log a message and give up.
rpcapd_log(LOGPRIO_ERROR, "Send to client failed: %s", errbuf);
goto end;
}
if (sock_send(sockctrl, NULL, (char *) &tls_alert,
TLS_ALERT_LEN, errbuf, PCAP_ERRBUF_SIZE) == -1)
{
- // That failed; log a messsage and give up.
+ // That failed; log a message and give up.
rpcapd_log(LOGPRIO_ERROR, "Send to client failed: %s", errbuf);
goto end;
}
// Send the reply.
if (sock_send(pars->sockctrl, pars->ssl, sendbuf, sendbufidx, errbuf, PCAP_ERRBUF_SIZE) == -1)
{
- // That failed; log a messsage and give up.
+ // That failed; log a message and give up.
rpcapd_log(LOGPRIO_ERROR, "Send to client failed: %s", errbuf);
return -1;
}
if (sock_send(pars->sockctrl, pars->ssl, (char *) &header, sizeof (struct rpcap_header), pcap_geterr(session->fp), PCAP_ERRBUF_SIZE))
{
- // That failed; log a messsage and give up.
+ // That failed; log a message and give up.
rpcapd_log(LOGPRIO_ERROR, "Send to client failed: %s", errbuf);
return -1;
}
if (sock_send(pars->sockctrl, pars->ssl, (char *) &header, sizeof (struct rpcap_header), errbuf, PCAP_ERRBUF_SIZE) == -1)
{
- // That failed; log a messsage and give up.
+ // That failed; log a message and give up.
rpcapd_log(LOGPRIO_ERROR, "Send to client failed: %s", errbuf);
return -1;
}
break;
}
- // The accept() call can return this error when a signal is catched
+ // The accept() call can return this error when a signal is caught
// In this case, we have simply to ignore this error code
// Stevens, pg 124
#ifdef _WIN32
hostlist_copy, nullAuthAllowed, uses_ssl);
}
- // If the connection is closed by the user explicitely, don't try to connect to it again
+ // If the connection is closed by the user explicitly, don't try to connect to it again
// just exit the program
if (activeclose == 1)
break;
sigemptyset(&action.sa_mask);
/*
- * Should SIGINT interrrupt, or restart, system calls?
+ * Should SIGINT interrupt, or restart, system calls?
*/
action.sa_flags = sigrestart ? SA_RESTART : 0;
return 2;
}
- //lauch fuzzer
+ //launch fuzzer
LLVMFuzzerTestOneInput(Data, Size);
free(Data);
fclose(fp);