---
name: "pcap_set_rfmon"
section: "3pcap"
platform: "linux"
package: "libpcap"
version: "1.11.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/pcap_set_rfmon/3pcap"
---

# pcap\_set\_rfmon(3pcap)

set monitor mode for a not-yet-activated capture handle

## NAME

pcap\_set\_rfmon - set monitor mode for a not-yet-activated capture handle

## SYNOPSIS

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

**int pcap\_set\_rfmon(pcap\_t \*p, int rfmon);**

## DESCRIPTION

**pcap\_set\_rfmon**() **sets whether monitor mode should be set on a capture handle when** **the handle is activated.** **If** *rfmon* **is non-zero, monitor mode will be set, otherwise it will not be set.**

## RETURN VALUE

**pcap\_set\_rfmon**() **returns** **0** **on success or** **PCAP\_ERROR\_ACTIVATED** **if called on a capture handle that has been activated.**

## SEE ALSO

**pcap**(3PCAP), **pcap\_create**(3PCAP), **pcap\_activate**(3PCAP), **pcap\_can\_set\_rfmon**(3PCAP)
