Skip to content

Finish incorporating timestamp method selection improvements into Npcap/Libpcap #174

@guyharris

Description

@guyharris

The call might look like

ULONG * PacketGetTimestampModes(LPADAPTER AdapterObject, UINT *NumModes);

which would return a pointer to an allocated array of ULONG values corresponding to supported time stamp modes and set *NumModes to the number of modes in the array. That might require another routine to free that array.

Alternatively, it might look like

int PacketGetTimestampModes(LPADAPTER AdapterObject, ULONG *Modes)

which:

  • if Modes is null, returns either the number of modes on success or -1 on failure;
  • if Modes is non-null, fills in *Modes and returns the number of modes on success or -1 on failure.

The caller would first call it with a null Modes, to find out how big a buffer it needs, and then allocate the buffer and call it again with that buffer. I don't expect that the number of available modes will change over time without, for example, installing a newer version of Npcap, so two calls should suffice.

This might be implemented atop BIOCGNUMTIMESTAMPMODES and BIOCGTIMESTAMPMODES ioctls. The first takes an int-sized buffer and fills it in with a count of the number of time stamp modes; the second takes a pointer to the array of ULONG and fills it in.

This would allow libpcap to implement pcap_list_tstamp_types() with Npcap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions