diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-09-13 22:39:21 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-09-13 22:39:21 +0900 |
commit | 5be31cce0de1797664d4125957d157991a6fbd4a (patch) | |
tree | 5a54a2f12184ea6d7bface519707bf878df859f9 /packet | |
parent | c717f53456e0c1ac256377bfdd933431cc6a66bd (diff) |
Add bmp support
Can be enabled like:
[Global]
[Global.GlobalConfig]
As = 64512
RouterId = "10.0.255.254"
[BmpServers]
[[BmpServers.BmpServerList]]
[BmpServers.BmpServerList.BmpServerConfig]
Address = "127.0.0.1"
Port=11019
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet')
-rw-r--r-- | packet/bmp.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packet/bmp.go b/packet/bmp.go index 4da37779..80b74eb0 100644 --- a/packet/bmp.go +++ b/packet/bmp.go @@ -34,6 +34,11 @@ const ( BMP_PEER_HEADER_SIZE = 42 ) +const ( + BMP_PEER_TYPE_GLOBAL = iota + BMP_PEER_TYPE_L3VPN +) + func (h *BMPHeader) DecodeFromBytes(data []byte) error { h.Version = data[0] if data[0] != 3 { @@ -242,7 +247,9 @@ func (body *BMPPeerDownNotification) Serialize() ([]byte, error) { } } default: - buf = append(buf, body.Data...) + if body.Data != nil { + buf = append(buf, body.Data...) + } } return buf, nil } |