Code Duplication    Length = 13-13 lines in 3 locations

lib/exabgp/bgp/message/update/attribute/bgpls/node/opaque.py 1 location

@@ 30-42 (lines=13) @@
27
#   Use of draft-tantsura-bgp-ls-segment-routing-msd-02 in this TLV is not clear
28
29
30
@LINKSTATE.register()
31
class NodeOpaque(object):
32
    TLV = 1025
33
34
    def __init__(self, opaque):
35
        self.opaque = opaque
36
37
    def __repr__(self):
38
        return "Node Opaque attribute: %s" % (self.opaque)
39
40
    @classmethod
41
    def unpack(cls, data, length):
42
        return cls(unpack("!%ds" % length, data[:length])[0])
43

lib/exabgp/bgp/message/update/attribute/bgpls/link/opaque.py 1 location

@@ 29-41 (lines=13) @@
26
# This TLV is added here for completeness but we don't look into the TLV.
27
28
29
@LINKSTATE.register()
30
class LinkOpaque(object):
31
    TLV = 1097
32
33
    def __init__(self, opaque):
34
        self.opaque = opaque
35
36
    def __repr__(self):
37
        return "Link Opaque attribute: %s" % (self.opaque)
38
39
    @classmethod
40
    def unpack(cls, data, length):
41
        return cls(unpack("!%ds" % length, data[:length])[0])
42

lib/exabgp/bgp/message/update/attribute/bgpls/prefix/opaque.py 1 location

@@ 27-39 (lines=13) @@
24
#
25
26
27
@LINKSTATE.register()
28
class PrefixOpaque(object):
29
    TLV = 1157
30
31
    def __init__(self, opaque):
32
        self.opaque = opaque
33
34
    def __repr__(self):
35
        return "Prefix Opaque attribute: %s" % (self.opaque)
36
37
    @classmethod
38
    def unpack(cls, data, length):
39
        return cls(unpack("!%ds" % length, data[:length])[0])
40
41
    # XXX: Missing JSON