summaryrefslogtreecommitdiffhomepage
path: root/server/bmp.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-12-30 17:39:13 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-01-09 22:43:01 +0900
commitf4c07da88154dd4b21012576a4ceb205715f4b3e (patch)
tree1c00c7ee3c5d439008291532c3b70e83ab230d74 /server/bmp.go
parentda01fa48af05820d8b8731379cf647be049be503 (diff)
server: add REQ_BMP_NEIGHBORS api for internal bmp use
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/bmp.go')
-rw-r--r--server/bmp.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/bmp.go b/server/bmp.go
index 86029983..3d8b50f6 100644
--- a/server/bmp.go
+++ b/server/bmp.go
@@ -35,7 +35,7 @@ func (m *broadcastBMPMsg) send() {
m.ch <- m
}
-type bmpConn struct {
+type bmpServer struct {
conn *net.TCPConn
host string
}
@@ -160,18 +160,18 @@ func (c *bmpClient) send() chan *broadcastBMPMsg {
return c.ch
}
-func bmpPeerUp(laddr string, lport, rport uint16, sent, recv *bgp.BGPMessage, t int, policy bool, pd uint64, peeri *table.PeerInfo, timestamp int64) *bgp.BMPMessage {
- ph := bgp.NewBMPPeerHeader(uint8(t), policy, pd, peeri.Address.String(), peeri.AS, peeri.LocalID.String(), float64(timestamp))
+func bmpPeerUp(laddr string, lport, rport uint16, sent, recv *bgp.BGPMessage, t uint8, policy bool, pd uint64, peeri *table.PeerInfo, timestamp int64) *bgp.BMPMessage {
+ ph := bgp.NewBMPPeerHeader(t, policy, pd, peeri.Address.String(), peeri.AS, peeri.ID.String(), float64(timestamp))
return bgp.NewBMPPeerUpNotification(*ph, laddr, lport, rport, sent, recv)
}
-func bmpPeerDown(reason uint8, t int, policy bool, pd uint64, peeri *table.PeerInfo, timestamp int64) *bgp.BMPMessage {
- ph := bgp.NewBMPPeerHeader(uint8(t), policy, pd, peeri.Address.String(), peeri.AS, peeri.LocalID.String(), float64(timestamp))
+func bmpPeerDown(reason uint8, t uint8, policy bool, pd uint64, peeri *table.PeerInfo, timestamp int64) *bgp.BMPMessage {
+ ph := bgp.NewBMPPeerHeader(t, policy, pd, peeri.Address.String(), peeri.AS, peeri.ID.String(), float64(timestamp))
return bgp.NewBMPPeerDownNotification(*ph, reason, nil, []byte{})
}
-func bmpPeerRoute(t int, policy bool, pd uint64, peeri *table.PeerInfo, timestamp int64, payload []byte) *bgp.BMPMessage {
- ph := bgp.NewBMPPeerHeader(uint8(t), policy, pd, peeri.Address.String(), peeri.AS, peeri.LocalID.String(), float64(timestamp))
+func bmpPeerRoute(t uint8, policy bool, pd uint64, peeri *table.PeerInfo, timestamp int64, payload []byte) *bgp.BMPMessage {
+ ph := bgp.NewBMPPeerHeader(t, policy, pd, peeri.Address.String(), peeri.AS, peeri.ID.String(), float64(timestamp))
m := bgp.NewBMPRouteMonitoring(*ph, nil)
body := m.Body.(*bgp.BMPRouteMonitoring)
body.BGPUpdatePayload = payload