summaryrefslogtreecommitdiff
path: root/src/main/java/com/lumaserv/bgp/protocol/attribute/NextHopAttribute.java
blob: 14d5367b4d47702d2534feda4f7ea22be84abfab (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
package com.lumaserv.bgp.protocol.attribute;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class NextHopAttribute implements PathAttribute {

    byte[] address;

    public NextHopAttribute(byte typeCode, byte[] data) {
        this.address = new byte[data.length];
        System.arraycopy(data, 0, address, 0, address.length);
    }

    public byte getTypeCode() {
        return 3;
    }

    public byte[] build() {
        return address;
    }

}