Skip to content
Snippets Groups Projects
Commit 4c7b569c authored by Pierre LALET's avatar Pierre LALET
Browse files

Dot11: use ConditionalField() to replace .is_applicable() methods

Some fields in Dot11 protocols were using specific .is_applicable()
methods to implement similar features than ConditionalField() (which
probably didn't exist by the time Dot11 dissectors have been written).

This commit uses ConditionalField and removes specific field classes
to use generic (MACField and LEShortField) fields. This should make
the code easier to understand.

This will also prevent some fields from being displayed when they
should not:

    >>> Dot11().show()
    ###[ 802.11 ]###
      subtype= 0
      type= Management
      proto= 0
      FCfield=
      ID= 0
      addr1= 00:00:00:00:00:00
      addr2= 00:00:00:00:00:00
      addr3= 00:00:00:00:00:00
      SC= 0

    >>> Dot11(type=2, FCfield=3).show()
    ###[ 802.11 ]###
      subtype= 0
      type= Data
      proto= 0
      FCfield= to-DS+from-DS
      ID= 0
      addr1= 00:00:00:00:00:00
      addr2= 00:00:00:00:00:00
      addr3= 00:00:00:00:00:00
      SC= 0
      addr4= 00:00:00:00:00:00

    >>> Dot11(type=1).show()
    ###[ 802.11 ]###
      subtype= 0
      type= Control
      proto= 0
      FCfield=
      ID= 0
      addr1= 00:00:00:00:00:00
parent 6aaf9ef9
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