MCPcopy
hub / github.com/osrg/gobgp / WatchPostUpdate

Function WatchPostUpdate

pkg/server/server.go:4904–4926  ·  view source on GitHub ↗
(current bool, peerAddress string, peerGroup string)

Source from the content-addressed store, hash-verified

4902}
4903
4904func WatchPostUpdate(current bool, peerAddress string, peerGroup string) WatchOption {
4905 return func(o *watchOptions) {
4906 o.postUpdate = true
4907 if current {
4908 o.initPostUpdate = true
4909 }
4910 if peerAddress != "" || peerGroup != "" {
4911 o.postUpdateFilter = func(w watchEvent) bool {
4912 ev, ok := w.(*watchEventUpdate)
4913 if !ok || ev == nil {
4914 return false
4915 }
4916 if len(peerAddress) > 0 && ev.Neighbor != nil && ev.Neighbor.State.NeighborAddress == netip.MustParseAddr(peerAddress) {
4917 return true
4918 }
4919 if len(peerGroup) > 0 && ev.Neighbor != nil && ev.Neighbor.State.PeerGroup == peerGroup {
4920 return true
4921 }
4922 return false
4923 }
4924 }
4925 }
4926}
4927
4928func WatchEor(current bool) WatchOption {
4929 return func(o *watchOptions) {

Callers 4

loopMethod · 0.85
loopMethod · 0.85
watchEventMethod · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…