# -*- coding: utf-8 -*-"""Link-Layer Address (LLA) Option Code==========================================.. module:: pcapkit.vendor.mh.lla_codeThis module contains the vendor crawler for **Link-Layer Address (LLA) Option Code**,which is automatically generating :class:`pcapkit.const.mh.lla_code.LLACode`."""importcollectionsimportsysfromtypingimportTYPE_CHECKINGfrompcapkit.vendor.defaultimportVendorifTYPE_CHECKING:fromcollectionsimportCounter__all__=['LLACode']#: LLA option codes.DATA={#: Wildcard requesting resolution for all nearby access points.0:'Wilcard',#: Link-Layer Address of the New Access Point.1:'New Access Point',#: Link-Layer Address of the MN.2:'MH',#: Link-Layer Address of the NAR (i.e., Proxied Originator).3:'NAR',#: Link-Layer Address of the source of RtSolPr or PrRtAdv.#: message.4:'RtSolPr or PrRtAdv',#: The access point identified by the LLA belongs to the#: current interface of the router.5:'access point',#: No prefix information available for the access point#: identified by the LLA.6:'no prefix information',#: No fast handover support available for the access point#: identified by the LLA.7:'no fast handover support',}# type: dict[int, str]
[docs]classLLACode(Vendor):"""Link-Layer Address (LLA) Option Code"""#: Value limit checker.FLAG='isinstance(value, int) and 0 <= value <= 255'defrequest(self)->'dict[int, str]':# type: ignore[override] # pylint: disable=arguments-differ"""Fetch registry data. Returns: Registry data (:data:`~pcapkit.vendor.ipv4.qs_function.DATA`). """returnDATAdefcount(self,data:'dict[int, str]')->'Counter[str]':# type: ignore[override]"""Count field records. Args: data: Registry data. Returns: Field recordings. """returncollections.Counter(map(self.safe_name,data.values()))defprocess(self,data:'dict[int, str]')->'tuple[list[str], list[str]]':# type: ignore[override]"""Process registry data. Args: data: Registry data. Returns: Enumeration fields and missing fields. """enum=[]# type: list[str]miss=["return extend_enum(cls, 'Unassigned_%d' % value, value)",]forcode,nameinDATA.items():renm=self.rename(name,code)# type: ignore[arg-type]enum.append(f"{renm} = {code}".ljust(76))returnenum,miss