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

exabgp.bgp.message.update.attribute.bgpls.node.nodeflags.NodeFlags.json()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 2
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 2
dl 2
loc 2
rs 10
c 0
b 0
f 0
1
# encoding: utf-8
2
"""
3
nodename.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
#     |O|T|E|B|R|V| Rsvd|
18
#     +-+-+-+-+-+-+-+-+-+
19
#     https://tools.ietf.org/html/rfc7752 Sec 3.3.1.1.  Node Flag Bits TLV
20
#        +-----------------+-------------------------+------------+
21
#        |       Bit       | Description             | Reference  |
22
#        +-----------------+-------------------------+------------+
23
#        |       'O'       | Overload Bit            | [ISO10589] |
24
#        |       'T'       | Attached Bit            | [ISO10589] |
25
#        |       'E'       | External Bit            | [RFC2328]  |
26
#        |       'B'       | ABR Bit                 | [RFC2328]  |
27
#        |       'R'       | Router Bit              | [RFC5340]  |
28
#        |       'V'       | V6 Bit                  | [RFC5340]  |
29
#        | Reserved (Rsvd) | Reserved for future use |            |
30
#        +-----------------+-------------------------+------------+
31
# 		https://tools.ietf.org/html/rfc7752 sec 3.3.1.1 Node Flag Bits Definitions
32
33
# 	RFC 7752 3.3.1.1. Node Flag Bits TLV
34
35
36
@LINKSTATE.register()
37
class NodeFlags(LsGenericFlags):
38
    REPR = 'Node Flags'
39
    JSON = 'node-flags'
40
    TLV = 1024
41
    LS_NODE_FLAGS = ['O', 'T', 'E', 'B', 'R', 'V', 'RSV', 'RSV']
42
    LEN = 1
43