Esempio n. 1
0
    def _unpack_body(self, raw, offset, avail):
        offset, (self.subtype, host, sw) = of._unpack('!HHI', raw, offset)
        offset = of._skip(raw, offset, 8)

        self.fd = VidAddr(sw, host)

        return offset
  def _unpack_body (self, raw, offset, avail):
    """
    Unpack body in raw starting at offset.

    Return new offset
    """
    offset,enable = of._unpack("!B", raw, offset)
    offset = of._skip(raw, offset, 7)
    self.enable = True if enable else False
    return offset
  def unpack (self, raw, offset=0):
    _offset = offset
    offset,length = self._unpack_header(raw, offset)
    offset,(vendor,subtype) = _unpack("!LL", raw, offset)
    assert subtype == self.subtype
    #print "vendor %08x  subtype %i" % (vendor,subtype)
    offset,(self._buffer_id, self._total_len, self.reason, self.table_id,
            self.cookie, match_len) = _unpack("!LHBBQH", raw, offset)
    offset = _skip(raw, offset, 6)

    self.match = None
    offset = self.match.unpack(raw, offset, match_len)

    offset = _skip(raw, offset, (match_len + 7)//8*8 - match_len)
    offset = _skip(raw, offset, 2)

    offset,self.data = _read(raw, offset, length-(offset-_offset))
    assert length == len(self)
    return offset,length
 def _unpack_body (self, raw, offset, avail):
   offset,(self.subtype,) = \
       of._unpack('!H', raw, offset)
   offset = of._skip(raw, offset, 6)
   return offset
 def _unpack_body (self, raw, offset, avail):
   offset,(self.subtype,self.fin_idle_timeout,self.fin_hard_timeout) = \
       of._unpack('!HHH', raw, offset)
   offset = of._skip(raw, offset, 2)
   return offset
 def _unpack_body (self, raw, offset, avail):
   offset,(self.subtype,self.in_port,self.table) = \
       of._unpack('!HHB', raw, offset)
   offset = of._skip(raw, offset, 3)
   return offset
Esempio n. 7
0
    def _unpack_body(self, raw, offset, avail):
        offset, (self.subtype, ) = of._unpack('!H', raw, offset)
        offset = of._skip(raw, offset, 8)

        return offset