summaryrefslogtreecommitdiffhomepage
path: root/table/destination.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-07-11 21:54:50 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-07-20 04:25:25 +0900
commitf27afac154c955e1e2508d2443ef29ecfc62c6b8 (patch)
tree7fd57b56426706790a3fc6c746d2604e30b80493 /table/destination.go
parente090609b146fdde93714e966aa8ec300b5842ba3 (diff)
move gRPC-related code in path.go and destination.go to grpc_server.go
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/destination.go')
-rw-r--r--table/destination.go28
1 files changed, 0 insertions, 28 deletions
diff --git a/table/destination.go b/table/destination.go
index f6de40d1..b1fa3509 100644
--- a/table/destination.go
+++ b/table/destination.go
@@ -20,7 +20,6 @@ import (
"encoding/binary"
"fmt"
log "github.com/Sirupsen/logrus"
- api "github.com/osrg/gobgp/api"
"github.com/osrg/gobgp/config"
"github.com/osrg/gobgp/packet/bgp"
"net"
@@ -139,33 +138,6 @@ func NewDestination(nlri bgp.AddrPrefixInterface) *Destination {
return d
}
-func (dd *Destination) ToApiStruct(id string) *api.Destination {
- prefix := dd.GetNlri().String()
- paths := func(arg []*Path) []*api.Path {
- ret := make([]*api.Path, 0, len(arg))
- first := true
- for _, p := range arg {
- if p.Filtered(id) == POLICY_DIRECTION_NONE {
- pp := p.ToApiStruct(id)
- if first {
- pp.Best = true
- first = false
- }
- ret = append(ret, pp)
- }
- }
- return ret
- }(dd.knownPathList)
-
- if len(paths) == 0 {
- return nil
- }
- return &api.Destination{
- Prefix: prefix,
- Paths: paths,
- }
-}
-
func (dd *Destination) Family() bgp.RouteFamily {
return dd.routeFamily
}