summaryrefslogtreecommitdiffhomepage
path: root/api/util.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-07-06 15:49:35 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-07-06 23:56:54 +0900
commite4031c14a5060c4fadf7e3c655bd0f6d7714b634 (patch)
tree101986ba40d8cd3a5e2cfa8471bbc41b8bada765 /api/util.go
parent69f866a77cb83db8925fb95fb55d6086fbfe899c (diff)
api: decrease the dependency
move grpc_server.go to server/ Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'api/util.go')
-rw-r--r--api/util.go20
1 files changed, 0 insertions, 20 deletions
diff --git a/api/util.go b/api/util.go
index 9b7a389e..b77b35ec 100644
--- a/api/util.go
+++ b/api/util.go
@@ -20,7 +20,6 @@ import (
"net"
"time"
- "github.com/osrg/gobgp/config"
"github.com/osrg/gobgp/packet/bgp"
)
@@ -108,22 +107,3 @@ func (p *Path) GetNativePathAttributes() ([]bgp.PathAttributeInterface, error) {
}
return UnmarshalPathAttributes(p.AnyPattrs)
}
-
-func extractFamilyFromConfigAfiSafi(c *config.AfiSafi) uint32 {
- if c == nil {
- return 0
- }
- // If address family value is already stored in AfiSafiState structure,
- // we prefer to use this value.
- if c.State.Family != 0 {
- return uint32(c.State.Family)
- }
- // In case that Neighbor structure came from CLI or gRPC, address family
- // value in AfiSafiState structure can be omitted.
- // Here extracts value from AfiSafiName field in AfiSafiConfig structure.
- if rf, err := bgp.GetRouteFamily(string(c.Config.AfiSafiName)); err == nil {
- return uint32(rf)
- }
- // Ignores invalid address family name
- return 0
-}