nmap / nmap/npcap

How to cancel a pcap_sendqueue_transmit?

Open
#753 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
3.6k
Forks
592
PR merge metrics
No merged PRs in 30d

Description

Context

The API pcap_sendqueue_transmit allows for more or less accurate delta time between packets
We have an interactive application where user select a packet, and a bitrate, and the application burst send that packet with the specified bitrate.

This is helpful for load tests of application and embedded devices kernel performance.

In order to send the packet with the specified bitrate, we create a pcap sendqueue that lasts few seconds, with a small delta time between packets.

We offer another interface to user, where user can manually provide multiple packets, and delta time between them, especially helpful for timing attack.

The problem

  • Application is interactive, user may request to stop burst transmission at any moment
  • The function pcap_sendqueue_transmit have no API to cancel a queue once started
  • Using smaller queue was tried, but the jitter of multiple calls to pcap_sendqueue_transmit with the same small queue was too big.
  • If user accidentally provide a delta time between packets (for example an hour), they basically dead-lock the application, with no way to recover.

Expected behavior
We are welcome to any way that would allow canceling a pcap_sendqueue_transmit, but officially in the API docs of libpcap/npcap we can't call any function on the same pcap_t handle, while another function call is in progress.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pcap_sendqueue_transmit API and its documentation, then review the stated restriction on calling functions on a pcap_t handle during an active operation. Determine whether a supported cancellation behavior can be specified; done should include a clearly documented, recoverable way to stop transmission or an explicit documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.