def _read_hopopt_options(self, length):
counter = <NUM_LIT:0>         <EOL>optkind = list()    <EOL>options = dict()    <EOL>while counter < length:<EOL><INDENT>code = self._read_unpack(<NUM_LIT:1>)<EOL>if not code:<EOL><INDENT>break<EOL><DEDENT>abbr, desc = _HOPOPT_OPT.get(code, ('<STR_LIT:none>', '<STR_LIT>'))<EOL>data = _HOPOPT_PROC(abbr)(self, code, desc=desc)<EOL>enum = _OPT_TYPE.get(code)<EOL>counter += data['<STR_LIT>']<EOL>if enum in optkind:<EOL><INDENT>if isinstance(options[abbr], tuple):<EOL><INDENT>options[abbr] += (Info(data),)<EOL><DEDENT>else:<EOL><INDENT>options[abbr] = (Info(options[abbr]), Info(data))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>optkind.append(enum)<EOL>options[abbr] = data<EOL><DEDENT><DEDENT>if counter != length:<EOL><INDENT>raise ProtocolError(f'<STR_LIT>')<EOL><DEDENT>return tuple(optkind), options<EOL>
Read HOPOPT options.

        Positional arguments:
            * length -- int, length of options

        Returns:
            * dict -- extracted HOPOPT options