summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gobgp/neighbor.go4
-rw-r--r--cmd/gobgp/vrf.go14
2 files changed, 15 insertions, 3 deletions
diff --git a/cmd/gobgp/neighbor.go b/cmd/gobgp/neighbor.go
index ef8e904b..5b0d5012 100644
--- a/cmd/gobgp/neighbor.go
+++ b/cmd/gobgp/neighbor.go
@@ -713,7 +713,7 @@ func showValidationInfo(p *api.Path, shownAs map[uint32]struct{}) error {
func showRibInfo(r, name string) error {
def := addr2AddressFamily(net.ParseIP(name))
- if r == cmdGlobal {
+ if r == cmdGlobal || r == cmdVRF {
def = ipv4UC
}
family, err := checkAddressFamily(def)
@@ -731,6 +731,8 @@ func showRibInfo(r, name string) error {
t = api.TableType_ADJ_IN
case cmdAdjOut:
t = api.TableType_ADJ_OUT
+ case cmdVRF:
+ t = api.TableType_VRF
default:
return fmt.Errorf("invalid resource to show RIB info: %s", r)
}
diff --git a/cmd/gobgp/vrf.go b/cmd/gobgp/vrf.go
index 73162519..1034091c 100644
--- a/cmd/gobgp/vrf.go
+++ b/cmd/gobgp/vrf.go
@@ -115,7 +115,7 @@ func showVrfs() error {
return nil
}
-func showVrf(name string) error {
+func showVrfRib(name string) error {
return showNeighborRib(cmdVRF, name, nil)
}
@@ -196,7 +196,7 @@ func newVrfCmd() *cobra.Command {
Run: func(cmd *cobra.Command, args []string) {
var err error
if len(args) == 1 {
- err = showVrf(args[0])
+ err = showVrfRib(args[0])
} else {
err = fmt.Errorf("usage: gobgp vrf <vrf-name> rib")
}
@@ -285,5 +285,15 @@ func newVrfCmd() *cobra.Command {
}
vrfCmd.PersistentFlags().StringVarP(&subOpts.AddressFamily, "address-family", "a", "", "address family")
+ summaryCmd := &cobra.Command{
+ Use: cmdSummary,
+ Run: func(cmd *cobra.Command, args []string) {
+ if err := showRibInfo(cmdVRF, args[0]); err != nil {
+ exitWithError(err)
+ }
+ },
+ }
+ ribCmd.AddCommand(summaryCmd)
+
return vrfCmd
}