def read_arp(self, length):
if length is None:<EOL><INDENT>length = len(self)<EOL><DEDENT>_hwty = self._read_unpack(<NUM_LIT:2>)<EOL>_ptty = self._read_unpack(<NUM_LIT:2>)<EOL>_hlen = self._read_unpack(<NUM_LIT:1>)<EOL>_plen = self._read_unpack(<NUM_LIT:1>)<EOL>_oper = self._read_unpack(<NUM_LIT:2>)<EOL>_shwa = self._read_addr_resolve(_hlen, _hwty)<EOL>_spta = self._read_proto_resolve(_plen, _ptty)<EOL>_thwa = self._read_addr_resolve(_hlen, _hwty)<EOL>_tpta = self._read_proto_resolve(_plen, _ptty)<EOL>if _oper in (<NUM_LIT:5>, <NUM_LIT:6>, <NUM_LIT:7>):<EOL><INDENT>self._acnm = '<STR_LIT>'<EOL>self._name = '<STR_LIT>'<EOL><DEDENT>elif _oper in (<NUM_LIT:8>, <NUM_LIT:9>):<EOL><INDENT>self._acnm = '<STR_LIT>'<EOL>self._name = '<STR_LIT>'<EOL><DEDENT>elif _oper in (<NUM_LIT:3>, <NUM_LIT:4>):<EOL><INDENT>self._acnm = '<STR_LIT>'<EOL>self._name = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>self._acnm = '<STR_LIT>'<EOL>self._name = '<STR_LIT>'<EOL><DEDENT>_htype = HRD.get(_hwty)<EOL>if re.match(r'<STR_LIT>', _htype, re.IGNORECASE):<EOL><INDENT>_ptype = ETHERTYPE.get(_ptty)<EOL><DEDENT>else:<EOL><INDENT>_ptype = f'<STR_LIT>'<EOL><DEDENT>arp = dict(<EOL>htype=_htype,<EOL>ptype=_ptype,<EOL>hlen=_hlen,<EOL>plen=_plen,<EOL>oper=OPER.get(_oper),<EOL>sha=_shwa,<EOL>spa=_spta,<EOL>tha=_thwa,<EOL>tpa=_tpta,<EOL>len=<NUM_LIT:8> + _hlen * <NUM_LIT:2> + _plen * <NUM_LIT:2>,<EOL>)<EOL>length -= arp['<STR_LIT>']<EOL>arp['<STR_LIT>'] = self._read_packet(header=arp['<STR_LIT>'], payload=length)<EOL>return self._decode_next_layer(arp, None, length)<EOL>
Read Address Resolution Protocol.

        Structure of ARP header [RFC 826]:
            Octets      Bits        Name                    Description
              0           0     arp.htype               Hardware Type
              2          16     arp.ptype               Protocol Type
              4          32     arp.hlen                Hardware Address Length
              5          40     arp.plen                Protocol Address Length
              6          48     arp.oper                Operation
              8          64     arp.sha                 Sender Hardware Address
              14        112     arp.spa                 Sender Protocol Address
              18        144     arp.tha                 Target Hardware Address
              24        192     arp.tpa                 Target Protocol Address