Skip to content
Snippets Groups Projects
Commit b55872a3 authored by Greg Bonik's avatar Greg Bonik Committed by CQ bot account: commit-bot@chromium.org
Browse files

[wlan][common] Overhaul the IE parsing/writing functionality

- Separate element splitting from parsing. This allows e.g. finding a
  single specific element in the frame without parsing others.
  This also avoid unnecessary "serialization of state" (switching on
  element id twice)
- Make a universal write_ie!() helper macro that makes element
  serialization much easier and less repetitive. This is similar to the
  current C++ template-based design.
- Split the module into several files to keep it more organized.
- Introduce a strong type alias for element ID.
- Make element parsing as zerocopy as possible. E.g., TIM header is not
  copied when parsed. This also allows in-place modification of fields.
- Make sure all parsing works over a generic ByteSlice and is not
  limited to immutable slices.
- Explicit error types for frame parsing and writing instead of the
  generic failure::Error. This allows the client code to recover from
  specific errors safely and explicitly.
- Helper macros for frame validation during parsing and writing.

Change-Id: I88262817cc51996c9575e0bf99ab729e3bf18f68
parent 2c446468
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment