summaryrefslogtreecommitdiff
path: root/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathLimitAttribute.java
blob: 732b0181400da54f1417c416dd6c88f4d1a5820d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.lumaserv.bgp.protocol.attribute;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class ASPathLimitAttribute implements PathAttribute {

    byte upperBound;
    int as;

    public ASPathLimitAttribute(byte typeCode, byte[] data) {
        upperBound = data[0];
        as = ((data[1] & 0xFF) << 24) |
                ((data[2] & 0xFF) << 16) |
                ((data[3] & 0xFF) << 8) |
                (data[4] & 0xFF);
    }

    public byte getTypeCode() {
        return 21;
    }

    public byte[] build() {
        return new byte[0];
    }

}