diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-15 16:00:57 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-15 16:00:57 +0900 |
commit | b73c4df33906a09acce12a4159f96626ae045797 (patch) | |
tree | 61513674defe72873c7d82e3718303ca6e23d59e /gomrt/main.go | |
parent | b5a99b203589b792d747f00a0636b1b8842de8dc (diff) |
mrt: move mrt.go and mrt_test.go to bgp package
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'gomrt/main.go')
-rw-r--r-- | gomrt/main.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gomrt/main.go b/gomrt/main.go index 86fad3a2..aeca76af 100644 --- a/gomrt/main.go +++ b/gomrt/main.go @@ -18,7 +18,7 @@ package main import ( "fmt" "github.com/osrg/gobgp/api" - "github.com/osrg/gobgp/gomrt/packet" + "github.com/osrg/gobgp/packet" "github.com/spf13/cobra" "golang.org/x/net/context" "google.golang.org/grpc" @@ -77,7 +77,7 @@ func main() { go func() { for { - buf := make([]byte, mrt.MRT_COMMON_HEADER_LEN) + buf := make([]byte, bgp.MRT_COMMON_HEADER_LEN) _, err := file.Read(buf) if err == io.EOF { break @@ -86,7 +86,7 @@ func main() { os.Exit(1) } - h := &mrt.MRTHeader{} + h := &bgp.MRTHeader{} err = h.DecodeFromBytes(buf) if err != nil { fmt.Println("failed to parse") @@ -100,27 +100,27 @@ func main() { os.Exit(1) } - msg, err := mrt.ParseMRTBody(h, buf) + msg, err := bgp.ParseMRTBody(h, buf) if err != nil { fmt.Println("failed to parse:", err) os.Exit(1) } - if msg.Header.Type == mrt.TABLE_DUMPv2 { - subType := mrt.MRTSubTypeTableDumpv2(msg.Header.SubType) + if msg.Header.Type == bgp.TABLE_DUMPv2 { + subType := bgp.MRTSubTypeTableDumpv2(msg.Header.SubType) var af *api.AddressFamily switch subType { - case mrt.PEER_INDEX_TABLE: + case bgp.PEER_INDEX_TABLE: continue - case mrt.RIB_IPV4_UNICAST: + case bgp.RIB_IPV4_UNICAST: af = api.AF_IPV4_UC - case mrt.RIB_IPV6_UNICAST: + case bgp.RIB_IPV6_UNICAST: af = api.AF_IPV6_UC default: fmt.Println("unsupported subType:", subType) os.Exit(1) } - rib := msg.Body.(*mrt.Rib) + rib := msg.Body.(*bgp.Rib) prefix := rib.Prefix.String() path := &api.Path{} path.Nlri = &api.Nlri{ |