code: def _read_hopopt_options(self, length):
          
          counter = 0         # length of read options
          optkind = list()    # option type list
          options = dict()    # dict of option data
  
          while counter < length:
              # break when eol triggered
              code = self._read_unpack(1)
              if not code:
                  break
  
              # extract parameter
              abbr, desc = _HOPOPT_OPT.get(code, ('none', 'Unassigned'))
              data = _HOPOPT_PROC(abbr)(self, code, desc=desc)
              enum = _OPT_TYPE.get(code)
  
              # record parameter data
              counter += data['length']
              if enum in optkind:
                  if isinstance(options[abbr], tuple):
                      options[abbr] += (Info(data),)
                  else:
                      options[abbr] = (Info(options[abbr]), Info(data))
              else:
                  optkind.append(enum)
                  options[abbr] = data
  
          # check threshold
          if counter != length:
              raise ProtocolError(f'{self.alias}: invalid format')
  
          return tuple(optkind), options
docs: Read HOPOPT options.
  
          Positional arguments:
              * length -- int, length of options
  
          Returns:
              * dict -- extracted HOPOPT options