packet lib: implement ryu.lib.packet.lldp.lldp.__len__

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
YAMAMOTO Takashi 2013-08-02 16:36:01 +09:00 committed by FUJITA Tomonori
parent 39c9718210
commit ce4a758fc7

View File

@ -167,6 +167,9 @@ class lldp(packet_base.PacketBase):
return tlv_cls
return _set_type
def __len__(self):
return sum(LLDP_TLV_SIZE + tlv.len for tlv in self.tlvs)
@lldp.set_tlv_type(LLDP_TLV_END)
class End(LLDPBasicTLV):