summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/bgp.go
diff options
context:
space:
mode:
Diffstat (limited to 'packet/bgp/bgp.go')
-rw-r--r--packet/bgp/bgp.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go
index a07cd5e5..f7d39a30 100644
--- a/packet/bgp/bgp.go
+++ b/packet/bgp/bgp.go
@@ -994,10 +994,13 @@ type AddrPrefixInterface interface {
Flat() map[string]string
PathIdentifier() uint32
SetPathIdentifier(uint32)
+ PathLocalIdentifier() uint32
+ SetPathLocalIdentifier(uint32)
}
type PrefixDefault struct {
- id uint32
+ id uint32
+ localId uint32
}
func (p *PrefixDefault) PathIdentifier() uint32 {
@@ -1008,6 +1011,14 @@ func (p *PrefixDefault) SetPathIdentifier(id uint32) {
p.id = id
}
+func (p *PrefixDefault) PathLocalIdentifier() uint32 {
+ return p.localId
+}
+
+func (p *PrefixDefault) SetPathLocalIdentifier(id uint32) {
+ p.localId = id
+}
+
func (p *PrefixDefault) decodePathIdentifier(data []byte) ([]byte, error) {
if len(data) < 4 {
code := uint8(BGP_ERROR_UPDATE_MESSAGE_ERROR)
@@ -1020,7 +1031,7 @@ func (p *PrefixDefault) decodePathIdentifier(data []byte) ([]byte, error) {
func (p *PrefixDefault) serializeIdentifier() ([]byte, error) {
buf := make([]byte, 4)
- binary.BigEndian.PutUint32(buf, p.PathIdentifier())
+ binary.BigEndian.PutUint32(buf, p.PathLocalIdentifier())
return buf, nil
}