diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-07-31 19:43:45 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-07-31 19:43:45 -0700 |
commit | ae616308f83458cfce286303ea34022810c7ec72 (patch) | |
tree | 5a0264071bf386d40ecd407e7bcb66ceaf8103a8 /pcap_can_set_rfmon.3pcap | |
parent | c20155c1872b6d07ee01f07899dd75bcd6e65ec1 (diff) | |
download | libpcap-ae616308f83458cfce286303ea34022810c7ec72.tar.gz |
Give a better discussion of possible errors.
Give each warning and error code its own paragraph.
Note that, in the future, additional warning and error codes may be
added, so programs should treat *all* negative return codes as errors,
and, if the warning or error code isn't one the program specifically
checks for, and isn't PCAP_ERROR, it should use pcap_statustostr() to
report the error.
(Yes, we've added additional return codes in the past, subsequent to
release 1.0, so it's not as if we're changing anything with this
announcement.)
Diffstat (limited to 'pcap_can_set_rfmon.3pcap')
-rw-r--r-- | pcap_can_set_rfmon.3pcap | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/pcap_can_set_rfmon.3pcap b/pcap_can_set_rfmon.3pcap index 07d65d7d..389e50dd 100644 --- a/pcap_can_set_rfmon.3pcap +++ b/pcap_can_set_rfmon.3pcap @@ -37,26 +37,36 @@ the handle is activated. .SH RETURN VALUE .B pcap_can_set_rfmon() returns 0 if monitor mode could not be set, -1 if monitor mode could be set, +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 .B PCAP_ERROR_NO_SUCH_DEVICE -if the capture source specified when the handle was created doesn't -exist, +The capture source specified when the handle was created doesn't +exist. +.TP .B PCAP_ERROR_PERM_DENIED -if the process doesn't have permission to check whether monitor mode -could be supported, +The process doesn't have permission to check whether monitor mode +could be supported. +.TP .B PCAP_ERROR_ACTIVATED -if called on a capture handle that has been activated, or +The capture handle has already been activated. +.TP .B PCAP_ERROR -if an error occurred. -If -.B PCAP_ERROR -is returned, +Another error occurred. .B pcap_geterr() or .B pcap_perror() may be called with .I p -as an argument to fetch or display the error text. +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 +return codes as errors. +.B pcap_statustostr() +can be called, with a warning or error code as an argument, to fetch a +message describing the warning or error code. .SH SEE ALSO pcap(3PCAP), pcap_create(3PCAP), pcap_activate(3PCAP), pcap_set_rfmon(3PCAP) |