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
Loading
Please register or sign in to comment