for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# encoding: utf-8
"""
temetric.py
Created by Evelio Vila on 2016-12-01.
Copyright (c) 2014-2017 Exa Networks. All rights reserved.
from struct import unpack
from exabgp.bgp.message.notification import Notify
from exabgp.bgp.message.update.attribute.bgpls.linkstate import LinkState
from exabgp.bgp.message.update.attribute.bgpls.linkstate import BaseLS
# 0 1 2 3
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | Type | Length |
# | TE Default Link Metric |
# https://tools.ietf.org/html/rfc7752#section-3.3.2.3 TE Metric
@LinkState.register()
class TeMetric(BaseLS):
TLV = 1092
REPR = 'TE Default Metric'
JSON = 'te-metric'
LEN = 4
@classmethod
def unpack(cls, data, length):
cls.check(length)
return cls(unpack('!L', data)[0])