diff options
author | Denis Ovsienko <denis@ovsienko.info> | 2020-08-21 19:54:55 +0100 |
---|---|---|
committer | Denis Ovsienko <denis@ovsienko.info> | 2020-08-21 19:54:55 +0100 |
commit | 011ac98ff8857872b6318b481e4081e8bf5493d5 (patch) | |
tree | dc601c66328ec21d9136459957267efa6845518e | |
parent | b21fe86991032e95d58de95f33354421d9858edb (diff) | |
download | libpcap-011ac98ff8857872b6318b481e4081e8bf5493d5.tar.gz |
man: Format more special constants bold. [skip ci]
Some man pages used bold font for special meaning constants (e.g. -1 for
infinity, 0 for false, 1 for true, NULL), but some didn't. Make the
formatting consistently bold, but leave ordinary constants (number of
packets in a buffer, a timeout, a buffer size) intact.
-rw-r--r-- | pcap.3pcap.in | 12 | ||||
-rw-r--r-- | pcap_activate.3pcap | 4 | ||||
-rw-r--r-- | pcap_can_set_rfmon.3pcap | 12 | ||||
-rw-r--r-- | pcap_compile.3pcap.in | 4 | ||||
-rw-r--r-- | pcap_dump_flush.3pcap | 4 | ||||
-rw-r--r-- | pcap_findalldevs.3pcap | 4 | ||||
-rw-r--r-- | pcap_get_required_select_timeout.3pcap | 9 | ||||
-rw-r--r-- | pcap_init.3pcap | 10 | ||||
-rw-r--r-- | pcap_inject.3pcap | 8 | ||||
-rw-r--r-- | pcap_is_swapped.3pcap | 6 | ||||
-rw-r--r-- | pcap_lookupnet.3pcap | 4 | ||||
-rw-r--r-- | pcap_loop.3pcap | 26 | ||||
-rw-r--r-- | pcap_next_ex.3pcap | 6 | ||||
-rw-r--r-- | pcap_set_buffer_size.3pcap | 4 | ||||
-rw-r--r-- | pcap_set_datalink.3pcap | 4 | ||||
-rw-r--r-- | pcap_set_immediate_mode.3pcap.in | 4 | ||||
-rw-r--r-- | pcap_set_promisc.3pcap | 4 | ||||
-rw-r--r-- | pcap_set_protocol_linux.3pcap | 4 | ||||
-rw-r--r-- | pcap_set_rfmon.3pcap | 4 | ||||
-rw-r--r-- | pcap_set_snaplen.3pcap | 4 | ||||
-rw-r--r-- | pcap_set_timeout.3pcap | 4 | ||||
-rw-r--r-- | pcap_set_tstamp_precision.3pcap.in | 4 | ||||
-rw-r--r-- | pcap_set_tstamp_type.3pcap.in | 4 | ||||
-rw-r--r-- | pcap_setdirection.3pcap | 4 | ||||
-rw-r--r-- | pcap_setfilter.3pcap | 4 | ||||
-rw-r--r-- | pcap_setnonblock.3pcap | 16 | ||||
-rw-r--r-- | pcap_stats.3pcap | 4 |
27 files changed, 132 insertions, 45 deletions
diff --git a/pcap.3pcap.in b/pcap.3pcap.in index e129a54e..c9fc5f04 100644 --- a/pcap.3pcap.in +++ b/pcap.3pcap.in @@ -178,7 +178,9 @@ Note that even if an application does not set promiscuous mode, the adapter could well be in promiscuous mode for some other reason. .IP For now, this doesn't work on the "any" device; if an argument of "any" -or NULL is supplied, the setting of promiscuous mode is ignored. +or +.B NULL +is supplied, the setting of promiscuous mode is ignored. .IP Promiscuous mode is set with .BR pcap_set_promisc (). @@ -641,7 +643,9 @@ packet. It returns a .I const u_char to the first .B caplen -bytes of the packet on success, and NULL on error. +bytes of the packet on success, and +.B NULL +on error. .PP .BR pcap_next_ex () is passed two pointer arguments, one of which points to a @@ -715,7 +719,9 @@ whose value can be used as a timeout in those routines. When the routine returns, an attmept should be made to read packets from the device. If .BR pcap_get_required_select_timeout () -returns NULL, no such timeout is available, and those routines cannot be +returns +.BR NULL , +no such timeout is available, and those routines cannot be used with the device. .PP In addition, for various diff --git a/pcap_activate.3pcap b/pcap_activate.3pcap index 29bfa656..169a7565 100644 --- a/pcap_activate.3pcap +++ b/pcap_activate.3pcap @@ -37,7 +37,9 @@ at packets on the network, with the options that were set on the handle being in effect. .SH RETURN VALUE .BR pcap_activate () -returns 0 on success without warnings, a non-zero positive value on +returns +.B 0 +on success without warnings, a non-zero positive value on success with warnings, and a negative value on error. A non-zero return value indicates what warning or error condition occurred. diff --git a/pcap_can_set_rfmon.3pcap b/pcap_can_set_rfmon.3pcap index ad40c1c2..be03956b 100644 --- a/pcap_can_set_rfmon.3pcap +++ b/pcap_can_set_rfmon.3pcap @@ -36,8 +36,11 @@ checks whether monitor mode could be set on a capture handle when the handle is activated. .SH RETURN VALUE .BR pcap_can_set_rfmon () -returns 0 if monitor mode could not be set, -1 if monitor mode could be set, and a negative value on error. +returns +.B 0 +if monitor mode could not be set, +.B 1 +if monitor mode could be set, and a negative value on error. A negative return value indicates what error condition occurred. The possible error values are: .TP @@ -62,7 +65,10 @@ may be called with as an argument to fetch or display a message describing the error. .LP Additional error codes may be added in the future; a program should -check for 0, 1, and negative, return codes, and treat all negative +check for +.BR 0 , +.BR 1 , +and negative, return codes, and treat all negative return codes as errors. .BR pcap_statustostr (3PCAP) can be called, with a warning or error code as an argument, to fetch a diff --git a/pcap_compile.3pcap.in b/pcap_compile.3pcap.in index 9f26c4da..8238e54f 100644 --- a/pcap_compile.3pcap.in +++ b/pcap_compile.3pcap.in @@ -69,7 +69,9 @@ in multiple threads in a single process without some form of mutual exclusion allowing only one thread to call it at any given time. .SH RETURN VALUE .BR pcap_compile () -returns 0 on success and +returns +.B 0 +on success and .B PCAP_ERROR on failure. If .B PCAP_ERROR diff --git a/pcap_dump_flush.3pcap b/pcap_dump_flush.3pcap index 493b01d6..c6e0f86e 100644 --- a/pcap_dump_flush.3pcap +++ b/pcap_dump_flush.3pcap @@ -38,7 +38,9 @@ written with but not yet written to the ``savefile'' will be written. .SH RETURN VALUE .BR pcap_dump_flush () -returns 0 on success and +returns +.B 0 +on success and .B PCAP_ERROR on failure. .SH SEE ALSO diff --git a/pcap_findalldevs.3pcap b/pcap_findalldevs.3pcap index 67429e8e..41c98fe1 100644 --- a/pcap_findalldevs.3pcap +++ b/pcap_findalldevs.3pcap @@ -199,7 +199,9 @@ which frees the list pointed to by .IR alldevs . .SH RETURN VALUE .BR pcap_findalldevs () -returns 0 on success and +returns +.B 0 +on success and .B PCAP_ERROR on failure; as indicated, finding no devices is considered success, rather than failure, so 0 will be diff --git a/pcap_get_required_select_timeout.3pcap b/pcap_get_required_select_timeout.3pcap index 4c7e7e63..e70bc02a 100644 --- a/pcap_get_required_select_timeout.3pcap +++ b/pcap_get_required_select_timeout.3pcap @@ -105,7 +105,7 @@ timeout was returned, regardless of whether it's indicated as having anything to read from it or not. .PP All devices with a -.RB non-NULL +.RB non- NULL timeout must be put in non-blocking mode with .BR pcap_setnonblock (3PCAP). .PP @@ -115,7 +115,9 @@ timeout has expired. A call to .BR pcap_dispatch () or .BR pcap_next_ex (3PCAP) -will return 0 in this case, but will not block. +will return +.B 0 +in this case, but will not block. .PP .BR pcap_get_required_select_timeout () is not available on Windows. @@ -135,7 +137,8 @@ and .BR kevent () cannot be used on any capture source for which .BR pcap_get_selectable_fd () -returns \-1. +returns +.BR \-1 . .PP In libpcap release 1.10.0 and later, the timeout value can change from call to call, so diff --git a/pcap_init.3pcap b/pcap_init.3pcap index 05fbbd71..ba34cc45 100644 --- a/pcap_init.3pcap +++ b/pcap_init.3pcap @@ -77,8 +77,14 @@ is called, as will initialize Winsock itself on Windows. .SH RETURN VALUE .BR pcap_init () -returns 0 on success and \-1 on failure. -If \-1 is returned, +returns +.B 0 +on success and +.B \-1 +on failure. +If +.B \-1 +is returned, .I errbuf is filled in with an appropriate error message. .I errbuf diff --git a/pcap_inject.3pcap b/pcap_inject.3pcap index ea88de99..989ddf0e 100644 --- a/pcap_inject.3pcap +++ b/pcap_inject.3pcap @@ -64,7 +64,9 @@ nominally support sending completely raw and unchanged packets. .BR pcap_sendpacket () is like .BR pcap_inject (), -but it returns 0 on success, rather than returning the number of bytes +but it returns +.B 0 +on success, rather than returning the number of bytes written. .RB ( pcap_inject () comes from OpenBSD; @@ -77,7 +79,9 @@ returns the number of bytes written on success and on failure. .PP .BR pcap_sendpacket () -returns 0 on success and +returns +.B 0 +on success and .B PCAP_ERROR on failure. .PP diff --git a/pcap_is_swapped.3pcap b/pcap_is_swapped.3pcap index 4d401c1c..260601a9 100644 --- a/pcap_is_swapped.3pcap +++ b/pcap_is_swapped.3pcap @@ -32,11 +32,11 @@ int pcap_is_swapped(pcap_t *p); .fi .SH DESCRIPTION .BR pcap_is_swapped () -returns true (1) if +returns true (\fB1\fP) if .I p refers to a ``savefile'' that uses a different byte order than the current system. For a live capture, it always returns false -(0). +(\fB0\fP). .PP It must not be called on a pcap descriptor created by .BR \%pcap_create (3PCAP) @@ -44,7 +44,7 @@ that has not yet been activated by .BR \%pcap_activate (3PCAP). .SH RETURN VALUE .BR pcap_is_swapped () -returns true (1) or false (0) on success and +returns true (\fB1\fP) or false (\fB0\fP) on success and .B PCAP_ERROR_NOT_ACTIVATED if called on a capture handle that has been created but not activated. .SH SEE ALSO diff --git a/pcap_lookupnet.3pcap b/pcap_lookupnet.3pcap index b9d184f7..c12fa55e 100644 --- a/pcap_lookupnet.3pcap +++ b/pcap_lookupnet.3pcap @@ -51,7 +51,9 @@ are pointers. .SH RETURN VALUE .BR pcap_lookupnet () -returns 0 on success and +returns +.B 0 +on success and .B PCAP_ERROR on failure. If .B PCAP_ERROR diff --git a/pcap_loop.3pcap b/pcap_loop.3pcap index aaed4b15..1e9261b9 100644 --- a/pcap_loop.3pcap +++ b/pcap_loop.3pcap @@ -52,7 +52,11 @@ is called, or an error occurs. It does .B not return when live packet buffer timeouts occur. -A value of \-1 or 0 for +A value of +.B \-1 +or +.B 0 +for .I cnt is equivalent to infinity, so that packets are processed until another ending condition occurs. @@ -71,7 +75,11 @@ is the maximum number of packets to process before returning, but is not a minimum number; when reading a live capture, only one bufferful of packets is read at a time, so fewer than .I cnt -packets may be processed. A value of \-1 or 0 for +packets may be processed. A value of +.B \-1 +or +.B 0 +for .I cnt causes all the packets received in one buffer to be processed when reading a live capture, and causes all the packets in the file to be @@ -87,9 +95,15 @@ but must not rely on it happening. .ft B (In older versions of libpcap, the behavior when \fIcnt\fP -was 0 was undefined; different platforms and devices behaved +was +.B 0 +was undefined; different platforms and devices behaved differently, so code that must work with older versions of libpcap -should use \-1, not 0, as the value of +should use +.BR \-1 , +not +.BR 0 , +as the value of \fIcnt\fP.) .ft R .PP @@ -159,7 +173,9 @@ have some other data link type, such as for Ethernet. .SH RETURN VALUE .BR pcap_loop () -returns 0 if +returns +.B 0 +if .I cnt is exhausted or if, when reading from a ``savefile'', no more packets are available. It returns diff --git a/pcap_next_ex.3pcap b/pcap_next_ex.3pcap index 567d4859..2bd1a427 100644 --- a/pcap_next_ex.3pcap +++ b/pcap_next_ex.3pcap @@ -114,7 +114,11 @@ have some other data link type, such as for Ethernet. .SH RETURN VALUE .BR pcap_next_ex () -returns 1 if the packet was read without problems, 0 if packets are +returns +.B 1 +if the packet was read without problems, +.B 0 +if packets are being read from a live capture and the packet buffer timeout expired, .B PCAP_ERROR if an error occurred while reading the packet, and diff --git a/pcap_set_buffer_size.3pcap b/pcap_set_buffer_size.3pcap index 946318a0..49492c06 100644 --- a/pcap_set_buffer_size.3pcap +++ b/pcap_set_buffer_size.3pcap @@ -38,7 +38,9 @@ the handle is activated to which is in units of bytes. .SH RETURN VALUE .BR pcap_set_buffer_size () -returns 0 on success or +returns +.B 0 +on success or .B PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated. .SH SEE ALSO diff --git a/pcap_set_datalink.3pcap b/pcap_set_datalink.3pcap index 9fbc116f..14e9d209 100644 --- a/pcap_set_datalink.3pcap +++ b/pcap_set_datalink.3pcap @@ -38,7 +38,9 @@ to the type specified by .IR dlt . .SH RETURN VALUE .BR pcap_set_datalink () -returns 0 on success and +returns +.B 0 +on success and .B PCAP_ERROR on failure. If .B PCAP_ERROR diff --git a/pcap_set_immediate_mode.3pcap.in b/pcap_set_immediate_mode.3pcap.in index d3b57242..e493d55a 100644 --- a/pcap_set_immediate_mode.3pcap.in +++ b/pcap_set_immediate_mode.3pcap.in @@ -41,7 +41,9 @@ If is non-zero, immediate mode will be set, otherwise it will not be set. .SH RETURN VALUE .BR pcap_set_immediate_mode () -returns 0 on success or +returns +.B 0 +on success or .B PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated. .SH BACKWARD COMPATIBILITY diff --git a/pcap_set_promisc.3pcap b/pcap_set_promisc.3pcap index 0d523a3e..cfc6cdda 100644 --- a/pcap_set_promisc.3pcap +++ b/pcap_set_promisc.3pcap @@ -39,7 +39,9 @@ If is non-zero, promiscuous mode will be set, otherwise it will not be set. .SH RETURN VALUE .BR pcap_set_promisc () -returns 0 on success or +returns +.B 0 +on success or .B PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated. .SH SEE ALSO diff --git a/pcap_set_protocol_linux.3pcap b/pcap_set_protocol_linux.3pcap index 4a6c8e4e..a891d749 100644 --- a/pcap_set_protocol_linux.3pcap +++ b/pcap_set_protocol_linux.3pcap @@ -59,7 +59,9 @@ but can be filtered by specifying the socket-layer protocol type using .BR pcap_set_protocol_linux (). .SH RETURN VALUE .BR pcap_set_protocol_linux () -returns 0 on success or +returns +.B 0 +on success or .B PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated. .SH BACKWARD COMPATIBILITY diff --git a/pcap_set_rfmon.3pcap b/pcap_set_rfmon.3pcap index 43f7db70..2b104c25 100644 --- a/pcap_set_rfmon.3pcap +++ b/pcap_set_rfmon.3pcap @@ -39,7 +39,9 @@ If is non-zero, monitor mode will be set, otherwise it will not be set. .SH RETURN VALUE .BR pcap_set_rfmon () -returns 0 on success or +returns +.B 0 +on success or .B PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated. .SH SEE ALSO diff --git a/pcap_set_snaplen.3pcap b/pcap_set_snaplen.3pcap index 5efd4438..e3acff15 100644 --- a/pcap_set_snaplen.3pcap +++ b/pcap_set_snaplen.3pcap @@ -37,7 +37,9 @@ is activated to .IR snaplen . .SH RETURN VALUE .BR pcap_set_snaplen () -returns 0 on success or +returns +.B 0 +on success or .B PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated. .SH SEE ALSO diff --git a/pcap_set_timeout.3pcap b/pcap_set_timeout.3pcap index 7fb4d20f..d909b2c4 100644 --- a/pcap_set_timeout.3pcap +++ b/pcap_set_timeout.3pcap @@ -45,7 +45,9 @@ recommend always setting the timeout to a non-zero value unless immediate mode is set, in which case the timeout has no effect. .SH RETURN VALUE .BR pcap_set_timeout () -returns 0 on success or +returns +.B 0 +on success or .B PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated. .SH SEE ALSO diff --git a/pcap_set_tstamp_precision.3pcap.in b/pcap_set_tstamp_precision.3pcap.in index 186c2472..eb449d5d 100644 --- a/pcap_set_tstamp_precision.3pcap.in +++ b/pcap_set_tstamp_precision.3pcap.in @@ -49,7 +49,9 @@ use options to request desired precision. By default, time stamps are in microseconds. .SH RETURN VALUE .BR pcap_set_tstamp_precision () -returns 0 on success if the specified time stamp precision is expected to be +returns +.B 0 +on success if the specified time stamp precision is expected to be supported by the capture device, .B PCAP_ERROR_TSTAMP_PRECISION_NOTSUP if the capture device does not support the requested time stamp diff --git a/pcap_set_tstamp_type.3pcap.in b/pcap_set_tstamp_type.3pcap.in index 60c8919e..e19d6e5f 100644 --- a/pcap_set_tstamp_type.3pcap.in +++ b/pcap_set_tstamp_type.3pcap.in @@ -49,7 +49,9 @@ See for a list of all the time stamp types. .SH RETURN VALUE .BR pcap_set_tstamp_type () -returns 0 on success if the specified time stamp type is expected to be +returns +.B 0 +on success if the specified time stamp type is expected to be supported by the capture device, .B PCAP_WARNING_TSTAMP_TYPE_NOTSUP if the specified time stamp type is not supported by the diff --git a/pcap_setdirection.3pcap b/pcap_setdirection.3pcap index 0d6f34ac..7b388450 100644 --- a/pcap_setdirection.3pcap +++ b/pcap_setdirection.3pcap @@ -57,7 +57,9 @@ support This operation is not supported if a ``savefile'' is being read. .SH RETURN VALUE .BR pcap_setdirection () -returns 0 on success and +returns +.B 0 +on success and .B PCAP_ERROR on failure. If .B PCAP_ERROR diff --git a/pcap_setfilter.3pcap b/pcap_setfilter.3pcap index e9210818..1e3c5a59 100644 --- a/pcap_setfilter.3pcap +++ b/pcap_setfilter.3pcap @@ -40,7 +40,9 @@ struct, usually the result of a call to .BR \%pcap_compile (3PCAP). .SH RETURN VALUE .BR pcap_setfilter () -returns 0 on success and +returns +.B 0 +on success and .B PCAP_ERROR on failure. If .B PCAP_ERROR diff --git a/pcap_setnonblock.3pcap b/pcap_setnonblock.3pcap index a38ca0d7..65cfea28 100644 --- a/pcap_setnonblock.3pcap +++ b/pcap_setnonblock.3pcap @@ -47,8 +47,9 @@ If there is an error, .B PCAP_ERROR is returned and .I errbuf -is filled in with an appropriate error message; otherwise, 0 is -returned. +is filled in with an appropriate error message; otherwise, +.B 0 +is returned. .PP In ``non-blocking'' mode, an attempt to read from the capture descriptor @@ -56,7 +57,8 @@ with .BR pcap_dispatch (3PCAP) and .BR pcap_next_ex (3PCAP) -will, if no packets are currently available to be read, return 0 +will, if no packets are currently available to be read, return +.B 0 immediately rather than blocking waiting for packets to arrive. .PP .BR pcap_loop (3PCAP) @@ -65,7 +67,9 @@ available; .BR pacp_dispatch () should be used instead. .BR pcap_next (3PCAP) -will return NULL if there are no packets currently available to read; +will return +.B NULL +if there are no packets currently available to read; this is indistinguishable from an error, so .BR pcap_next_ex () should be used instead. @@ -80,7 +84,9 @@ is required in order to put it into ``non-blocking'' mode. .SH RETURN VALUE .BR pcap_getnonblock () returns the current ``non-blocking'' state of the capture descriptor; it -always returns 0 on ``savefiles''. +always returns +.B 0 +on ``savefiles''. If there is an error, .B PCAP_ERROR is returned and diff --git a/pcap_stats.3pcap b/pcap_stats.3pcap index 9a50375b..aa03013c 100644 --- a/pcap_stats.3pcap +++ b/pcap_stats.3pcap @@ -83,7 +83,9 @@ statistic is unavailable, so it should not be treated as an indication that the interface did not drop any packets. .SH RETURN VALUE .BR pcap_stats () -returns 0 on success and returns +returns +.B 0 +on success and returns .B PCAP_ERROR if there is an error or if .I p |