code: def _read_tcp_options(self, size):
          
          counter = 0         # length of read option list
          optkind = list()    # option kind list
          options = dict()    # dict of option data
  
          while counter < size:
              # get option kind
              kind = self._read_unpack(1)
  
              # fetch corresponding option tuple
              opts = TCP_OPT.get(kind)
              enum = OPT_TYPE.get(kind)
              if opts is None:
                  len_ = size - counter
                  counter = size
                  optkind.append(enum)
                  options[enum.name] = self._read_fileng(len_)
                  break
  
              # extract option
              dscp = opts[1]
              if opts[0]:
                  len_ = self._read_unpack(1)
                  byte = opts[2](len_)
                  if byte:    # check option process mode
                      data = process_opt[opts[3]](self, byte, kind)
                  else:       # permission options (length is 2)
                      data = dict(
                          kind=kind,      # option kind
                          length=2,       # option length
                          flag=True,      # permission flag
                      )
              else:           # 1-bytes options
                  len_ = 1
                  data = dict(
                      kind=kind,      # option kind
                      length=1,       # option length
                  )
  
              # record option data
              counter += len_
              if enum in optkind:
                  if isinstance(options[dscp], tuple):
                      options[dscp] += (Info(data),)
                  else:
                      options[dscp] = (Info(options[dscp]), Info(data))
              else:
                  optkind.append(enum)
                  options[dscp] = data
  
              # break when eol triggered
              if not kind:
                  break
  
          # get padding
          if counter < size:
              len_ = size - counter
              options['padding'] = self._read_fileng(len_)
  
          return tuple(optkind), options
docs: Read TCP option list.
  
          Positional arguments:
              * size -- int, length of option list
  
          Returns:
              * tuple -- TCP option list
              * dict -- extracted TCP option