---
name: "pcap_can_set_rfmon"
section: "3pcap"
platform: "macos"
package: "libpcap"
version: "146"
release: "macOS 26.5"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/pcap_can_set_rfmon/3pcap"
---

# pcap\_can\_set\_rfmon(3pcap)

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**(3PCAP) **or** **pcap\_perror**(3PCAP) **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**(3PCAP) **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**(3PCAP), **pcap\_create**(3PCAP), **pcap\_activate**(3PCAP), **pcap\_set\_rfmon**(3PCAP)
