@Test public void testGetTableMetadataBGP() { List<String> expected = ImmutableList.of( COL_NODE, COL_VRF_NAME, COL_NETWORK, COL_NEXT_HOP_IP, COL_NEXT_HOP_INTERFACE, COL_PROTOCOL, COL_AS_PATH, COL_METRIC, COL_LOCAL_PREF, COL_COMMUNITIES, COL_ORIGIN_PROTOCOL, COL_ORIGIN_TYPE, COL_ORIGINATOR_ID, COL_CLUSTER_LIST, COL_TAG); List<ColumnMetadata> columnMetadata = getTableMetadata(RibProtocol.BGP).getColumnMetadata(); assertThat( columnMetadata.stream() .map(ColumnMetadata::getName) .collect(ImmutableList.toImmutableList()), equalTo(expected)); }
@VisibleForTesting static TableMetadata getTableMetadata(RibProtocol rib) { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); addCommonTableColumnsAtStart(columnBuilder); switch (rib) { case EVPN: columnBuilder .add( new ColumnMetadata( COL_ROUTE_DISTINGUISHER, Schema.STRING, "Route distinguisher", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case BGP: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case MAIN: default: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP, Schema.STRING, "Inferred hostname of the next hop", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ADMIN_DISTANCE, Schema.INTEGER, "Route's Admin distance", Boolean.FALSE, Boolean.TRUE)); } addCommonTableColumnsAtEnd(columnBuilder); return new TableMetadata(columnBuilder.build(), "Display RIB routes"); }
RoutesAnswerer extends Answerer { @VisibleForTesting static TableMetadata getTableMetadata(RibProtocol rib) { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); addCommonTableColumnsAtStart(columnBuilder); switch (rib) { case EVPN: columnBuilder .add( new ColumnMetadata( COL_ROUTE_DISTINGUISHER, Schema.STRING, "Route distinguisher", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case BGP: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case MAIN: default: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP, Schema.STRING, "Inferred hostname of the next hop", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ADMIN_DISTANCE, Schema.INTEGER, "Route's Admin distance", Boolean.FALSE, Boolean.TRUE)); } addCommonTableColumnsAtEnd(columnBuilder); return new TableMetadata(columnBuilder.build(), "Display RIB routes"); } }
RoutesAnswerer extends Answerer { @VisibleForTesting static TableMetadata getTableMetadata(RibProtocol rib) { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); addCommonTableColumnsAtStart(columnBuilder); switch (rib) { case EVPN: columnBuilder .add( new ColumnMetadata( COL_ROUTE_DISTINGUISHER, Schema.STRING, "Route distinguisher", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case BGP: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case MAIN: default: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP, Schema.STRING, "Inferred hostname of the next hop", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ADMIN_DISTANCE, Schema.INTEGER, "Route's Admin distance", Boolean.FALSE, Boolean.TRUE)); } addCommonTableColumnsAtEnd(columnBuilder); return new TableMetadata(columnBuilder.build(), "Display RIB routes"); } RoutesAnswerer(Question question, IBatfish batfish); }
RoutesAnswerer extends Answerer { @VisibleForTesting static TableMetadata getTableMetadata(RibProtocol rib) { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); addCommonTableColumnsAtStart(columnBuilder); switch (rib) { case EVPN: columnBuilder .add( new ColumnMetadata( COL_ROUTE_DISTINGUISHER, Schema.STRING, "Route distinguisher", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case BGP: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case MAIN: default: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP, Schema.STRING, "Inferred hostname of the next hop", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ADMIN_DISTANCE, Schema.INTEGER, "Route's Admin distance", Boolean.FALSE, Boolean.TRUE)); } addCommonTableColumnsAtEnd(columnBuilder); return new TableMetadata(columnBuilder.build(), "Display RIB routes"); } RoutesAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot); @Override AnswerElement answerDiff(NetworkSnapshot snapshot, NetworkSnapshot reference); }
RoutesAnswerer extends Answerer { @VisibleForTesting static TableMetadata getTableMetadata(RibProtocol rib) { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); addCommonTableColumnsAtStart(columnBuilder); switch (rib) { case EVPN: columnBuilder .add( new ColumnMetadata( COL_ROUTE_DISTINGUISHER, Schema.STRING, "Route distinguisher", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case BGP: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_AS_PATH, Schema.STRING, "Route's AS path", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_LOCAL_PREF, Schema.LONG, "Route's Local Preference", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_COMMUNITIES, Schema.list(Schema.STRING), "Route's List of communities", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_PROTOCOL, Schema.STRING, "Route's Origin protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGIN_TYPE, Schema.STRING, "Route's Origin type", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ORIGINATOR_ID, Schema.STRING, "Route's Originator ID", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_CLUSTER_LIST, Schema.list(Schema.LONG), "Route's Cluster List", Boolean.FALSE, Boolean.TRUE)); break; case MAIN: default: columnBuilder .add( new ColumnMetadata( COL_NEXT_HOP, Schema.STRING, "Inferred hostname of the next hop", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_IP, Schema.IP, "Route's Next Hop IP", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_NEXT_HOP_INTERFACE, Schema.STRING, "Route's Next Hop Interface", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_PROTOCOL, Schema.STRING, "Route's Protocol", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_METRIC, Schema.LONG, "Route's Metric", Boolean.FALSE, Boolean.TRUE)) .add( new ColumnMetadata( COL_ADMIN_DISTANCE, Schema.INTEGER, "Route's Admin distance", Boolean.FALSE, Boolean.TRUE)); } addCommonTableColumnsAtEnd(columnBuilder); return new TableMetadata(columnBuilder.build(), "Display RIB routes"); } RoutesAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot); @Override AnswerElement answerDiff(NetworkSnapshot snapshot, NetworkSnapshot reference);  }