---
name: "pcap_can_set_rfmon"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/pcap_can_set_rfmon"
---

# pcap\_can\_set\_rfmon(3)

check whether monitor mode can be set for a not-yet-activated capture handle

## NAME

pcap\_can\_set\_rfmon - check whether monitor mode can be set for a not-yet-activated capture handle

## SYNOPSIS

```
#include <pcap/pcap.h>
```

**int pcap\_can\_set\_rfmon(pcap\_t \*p);**

## DESCRIPTION

**pcap\_can\_set\_rfmon**() **checks whether monitor mode could be set on a capture handle when** **the handle is activated.**

## RETURN VALUE

**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.** **A negative return value indicates what error condition occurred.** **The possible error values are:**

- **PCAP\_ERROR\_NO\_SUCH\_DEVICE**

  **The capture source specified when the handle was created doesn't** **exist.**

- **PCAP\_ERROR\_PERM\_DENIED**

  **The process doesn't have permission to check whether monitor mode** **could be supported.**

- **PCAP\_ERROR\_ACTIVATED**

  **The capture handle has already been activated.**

- **PCAP\_ERROR**

  **Another error occurred.** [**pcap\_geterr**(3)](/pcap_geterr/3.md) **or** [**pcap\_perror**(3)](/pcap_perror/3.md) **may be called with** *p* **as an argument to fetch or display a message describing the error.**

**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.** [**pcap\_statustostr**(3)](/pcap_statustostr/3.md) **can be called, with a warning or error code as an argument, to fetch a** **message describing the warning or error code.**

## SEE ALSO

[**pcap**(3)](/pcap/3.md), [**pcap\_create**(3)](/pcap_create/3.md), [**pcap\_activate**(3)](/pcap_activate/3.md), [**pcap\_set\_rfmon**(3)](/pcap_set_rfmon/3.md)
