Page MenuHomeFreeBSD

wtapctl(8): Introduce new tool for wtap(4)

Authored by enweiwu on Jan 7 2023, 8:37 AM.
Referenced Files
Unknown Object (File)
Mon, Nov 27, 1:40 PM
Unknown Object (File)
Mon, Nov 27, 1:40 PM
Unknown Object (File)
Mon, Nov 27, 1:40 PM
Unknown Object (File)
Sun, Nov 26, 7:03 PM
Unknown Object (File)
Sun, Nov 26, 5:09 PM
Unknown Object (File)
Wed, Nov 15, 6:31 PM
Unknown Object (File)
Wed, Nov 8, 8:54 AM
Unknown Object (File)
Wed, Nov 8, 4:12 AM



Below is the planned commit message:

Wtap(4) originally worked with two user-space scripts: device creation/deletion with
src/tools/tools/wtap/wtap.c, and visibility control with src/tools/tools/wtap/vis_map.c.
Since the two tools are necessary for wtap(4), it's not reasonable to locate them in

Wtapctl(8) not only combines the two scripts but also adds some convenient features,
Some of these features needs the modification of wtap(4) and the others are done by
adding some of the ioctl(2) command in wtap(4).
- Device creation without id (automate the device creation in wtap(4))
- Device list
- Show the link in the visibility plugin

Also, wtap(4) can only support 64 nodes (by checking the size of mac_pool in
wtap_hal/hal.c and the #define MAX_NBR_WTAP (64)), but the size for
struct vis_map in plugins/visibility.h is unreasonably large (for 1024 nodes).
I fixed the bug by changing the size and doing some conditional checks in wtap(4).

Signed-off-by: EnWeiWu <>

This diff depends on D35841.

Test Plan

See wtapctl.8.

Diff Detail

rG FreeBSD src repository
Lint Skipped
Tests Skipped

Event Timeline added inline comments.

No list to close here.


Audience check: will most people reading this know what a wtap vap is?


No list here either.

This revision now requires changes to proceed.Jan 19 2023, 12:07 AM

Remove unnecessary .El and the term "vap" in wtapctl.8.

This revision is now accepted and ready to land.Jan 19 2023, 8:24 PM