diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-11-23 20:56:35 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-11-23 20:56:35 -0800 |
commit | 48fbe321170f30de3e0c2aed5927aff9b0893a66 (patch) | |
tree | ca007998219e42ea1660767ff19ebd7c57d9adbb /pcap_loop.3pcap | |
parent | b262e73dfdda6599b3b08750fcd6ff2a6a5a16c0 (diff) |
Style cleanup.
Use the BSD house style, in which, in
foobar() returns 17 on success and 137 on failure.
"foobar" is boldfaced but "()" isn't.
Diffstat (limited to 'pcap_loop.3pcap')
-rw-r--r-- | pcap_loop.3pcap | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/pcap_loop.3pcap b/pcap_loop.3pcap index d535b0d0..7ef0b812 100644 --- a/pcap_loop.3pcap +++ b/pcap_loop.3pcap @@ -42,7 +42,7 @@ pcap_handler callback, u_char *user); .ft .fi .SH DESCRIPTION -.B pcap_loop() +.BR pcap_loop () processes packets from a live capture or ``savefile'' until .I cnt packets are processed, the end of the ``savefile'' is @@ -57,13 +57,13 @@ A value of \-1 or 0 for is equivalent to infinity, so that packets are processed until another ending condition occurs. .PP -.B pcap_dispatch() +.BR pcap_dispatch () processes packets from a live capture or ``savefile'' until .I cnt packets are processed, the end of the current bufferful of packets is reached when doing a live capture, the end of the ``savefile'' is reached when reading from a ``savefile'', -.B pcap_breakloop() +.BR pcap_breakloop () is called, or an error occurs. Thus, when doing a live capture, .I cnt @@ -79,7 +79,7 @@ processed when reading a ``savefile''. .PP Note that, when doing a live capture on some platforms, if the read timeout expires when there are no packets available, -.B pcap_dispatch() +.BR pcap_dispatch () will return 0, even when not in non-blocking mode, as there are no packets to process. Applications should be prepared for this to happen, but must not rely on it happening. @@ -102,9 +102,9 @@ a pointer which is passed in the .I user argument to -.B pcap_loop() +.BR pcap_loop () or -.BR pcap_dispatch() , +.BR pcap_dispatch (), a .I const struct pcap_pkthdr pointer pointing to the packet time stamp and lengths, and a @@ -127,21 +127,21 @@ format of the link-layer header is indicated by the return value of the routine when handed the .B pcap_t value also passed to -.B pcap_loop() +.BR pcap_loop () or -.BR pcap_dispatch() . +.BR pcap_dispatch (). .I https://www.tcpdump.org/linktypes.html lists the values -.B pcap_datalink() +.BR pcap_datalink () can return and describes the packet formats that correspond to those values. The value it returns will be valid for all packets received unless and until .BR pcap_set_datalink (3PCAP) is called; after a successful call to -.BR pcap_set_datalink() , +.BR pcap_set_datalink (), all subsequent packets will have a link-layer header of the type specified by the link-layer header type value passed to -.BR pcap_set_datalink() . +.BR pcap_set_datalink (). .PP Do .B NOT @@ -156,7 +156,7 @@ have some other data link type, such as .B DLT_EN10MB for Ethernet. .SH RETURN VALUE -.B pcap_loop() +.BR pcap_loop () returns 0 if .I cnt is exhausted or if, when reading from a ``savefile'', no more packets @@ -165,14 +165,14 @@ are available. It returns if an error occurs or .B PCAP_ERROR_BREAK if the loop terminated due to a call to -.B pcap_breakloop() +.BR pcap_breakloop () before any packets were processed. It does .B not return when live packet buffer timeouts occur; instead, it attempts to read more packets. .PP -.B pcap_dispatch() +.BR pcap_dispatch () returns the number of packets processed on success; this can be 0 if no packets were read from a live capture (if, for example, they were discarded because they didn't pass the packet filter, or if, on @@ -185,7 +185,7 @@ in a ``savefile.'' It returns if an error occurs or .B PCAP_ERROR_BREAK if the loop terminated due to a call to -.B pcap_breakloop() +.BR pcap_breakloop () before any packets were processed. .ft B If your application uses pcap_breakloop(), |