Completed
Push — master ( 229cac...232edf )
by Thomas
10:56
created

MplsMask.__init__()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
# encoding: utf-8
2
"""
3
mplsmask.py
4
5
Created by Evelio Vila on 2016-12-01.
6
Copyright (c) 2014-2017 Exa Networks. All rights reserved.
7
"""
8
from exabgp.bgp.message.notification import Notify
9
from exabgp.bgp.message.update.attribute.bgpls.linkstate import LINKSTATE
10
from exabgp.bgp.message.update.attribute.bgpls.linkstate import LsGenericFlags
11
12
#      0                   1                   2                   3
13
#      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
14
#     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
15
#     |              Type             |             Length            |
16
#     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
17
#     |L|R|  Reserved |
18
#     +-+-+-+-+-+-+-+-+
19
#     https://tools.ietf.org/html/rfc7752#section-3.3.2.2  MPLS Protocol Mask
20
#
21
#   +------------+------------------------------------------+-----------+
22
#   |    Bit     | Description                              | Reference |
23
#   +------------+------------------------------------------+-----------+
24
#   |    'L'     | Label Distribution Protocol (LDP)        | [RFC5036] |
25
#   |    'R'     | Extension to RSVP for LSP Tunnels        | [RFC3209] |
26
#   |            | (RSVP-TE)                                |           |
27
#   | 'Reserved' | Reserved for future use                  |           |
28
#   +------------+------------------------------------------+-----------+
29
30
# 	RFC 7752 3.3.2.2.  MPLS Protocol Mask TLV
31
32
@LINKSTATE.register()
33
class MplsMask(LsGenericFlags):
34
    REPR = 'MPLS Protocol mask'
35
    JSON = 'mpls-mask'
36
    TLV = 1094
37
    FLAGS = ['LDP', 'RSVP-TE', 'RSV', 'RSV', 'RSV', 'RSV', 'RSV', 'RSV']
38
    LEN = 1
39