Skip to content

Obtaining unparsed information elements. #32

Open
@Sh3Rm4n

Description

@Sh3Rm4n

I have a usecase, where I'd like to obtain the raw Information Elements.

As the Nl80211Message is eagerly parsed and Nl80211Element is part of Nl80211BssInfo is part of Nl80211Attr is part of Nl80211Message, there is no easy way to obtain the elements unparsed.

I currently have two options to obtain the "unparsed" form of the information elements.

  1. Use emit again, which converts the information elements back to the serialized form. This is where Fix emit inconsitencies and add tests #30 is needed because of some incosistency issues for emit implementations.
  2. Use a custom Nl80211Message variant, which does only partially parse the payload (or doesn't at all), where the Nl80211Message::attributes field type is just Vec<u8> so that nothing is parsed by GenetlinkHandle::request.

What do you think about adding a switch somewhere (maybe in the Nl80211AttrsBuilder or even the concrete Nl80211AttrsBuilder<Nl80211Scan>), which only parses the message partially (if this is even technically possible).
E.g. maybe adding a flag/option cto force all IEs to be parsed as Other(Vec<u8>)?

Otherwise I could imagine contributing a little more convenience around a RawNl80211Message . WDYT?

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