a >h @s(ddlZddlmZGdddeZdS)N)SoSMapcsPeZdZdZddgZdZdZdZdZdZ fd d Z fd d Z d dZ Z S) SoSMacMapaMapping store for MAC addresses MAC addresses added to this map will be broken into two halves, vendor and device like how MAC addresses are normally crafted. For the vendor hextets, obfuscation will take the form of 53:4f:53, or 'SOS' in hex. The following device hextets will be obfuscated by a series of suffixes starting from zeroes. For example a MAC address of '60:55:cb:4b:c9:27' may be obfuscated into '53:4f:53:00:00:1a' or similar. This map supports both 48-bit and 64-bit MAC addresses. 48-bit address may take the form of either: MM:MM:MM:SS:SS:SS MM-MM-MM-SS-SS-SS For 64-bit addresses, the identifier injected by IPv6 standards is used in obfuscated returns. These addresses may take either of these forms: MM:MM:MM:FF:FE:SS:SS:SS MMMM:MMFF:FESS:SSSS All mapped mac addresses are converted to lower case. Dash delimited styles will be converted to colon-delimited style. zff:ff:ff:ff:ff:ffz00:00:00:00:00:00z53:4f:53:%s:%s:%sz53:4f:53:ff:fe:%s:%s:%sz534f:53ff:fe%s:%s%sFrcs&|ddd}t|SN-:z=.,)replacelowerstripsuperaddselfitem __class__@/usr/lib/python3.9/site-packages/sos/cleaner/mappings/mac_map.pyr 6sz SoSMacMap.addcs&|ddd}t|Sr)rrr r getr rrrr:sz SoSMacMap.getcsd|jd7_|jd?|jd?d|jdg}tfdd|D}td|r^|j|Std |rt|j|Std |r|j|Sd S) zVObfuscate the device hextets, and append those to our 'vendor' hextet Z0123456789abdcefc3s*|]"}|d|dVqdS)rNr).0iZ hexdigitsrr Jsz*SoSMacMap.sanitize_item..z$(([0-9a-fA-F]{2}:){7}[0-9a-fA-F]{2})z&(([0-9a-fA-F]{4}:){3}([0-9a-fA-F]){4})z([0-9a-fA-F][:_]?){12}N)ob_hextets_cnttuplerematch mac6_templatemac6_quad_template mac_template)r rhextetsrrr sanitize_item>s         zSoSMacMap.sanitize_item)__name__ __module__ __qualname____doc__Zignore_matchesr"r r!Zcompile_regexesrr rr$ __classcell__rrrrrs  r)rZsos.cleaner.mappingsrrrrrr s