@Override public RoutingProtocol getProtocol() { return getOspfMetricType().toRoutingProtocol(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_metricType == null) ? 0 : _metricType.ordinal()); return result; }
@Override public void exitRo_default_information(Ro_default_informationContext ctx) { OspfProcess proc = _currentOspfProcess; proc.setDefaultInformationOriginate(true); boolean always = ctx.ALWAYS().size() > 0; proc.setDefaultInformationOriginateAlways(always); if (ctx.metric != null) { int metric = toInteger(ctx.metric); proc.setDefaultInformationMetric(metric); } if (ctx.metric_type != null) { int metricTypeInt = toInteger(ctx.metric_type); OspfMetricType metricType = OspfMetricType.fromInteger(metricTypeInt); proc.setDefaultInformationMetricType(metricType); } if (ctx.map != null) { String map = ctx.map.getText(); int line = ctx.map.getLine(); proc.setDefaultInformationOriginateMap(map); proc.setDefaultInformationOriginateMapLine(line); _configuration.referenceStructure(ROUTE_MAP, map, OSPF_DEFAULT_ORIGINATE_ROUTE_MAP, line); } }
@Override public void exitRo_redistribute_eigrp(Ro_redistribute_eigrpContext ctx) { OspfProcess proc = _currentOspfProcess; RoutingProtocol sourceProtocol = RoutingProtocol.EIGRP; OspfRedistributionPolicy r = new OspfRedistributionPolicy(sourceProtocol); proc.getRedistributionPolicies().put(sourceProtocol, r); long asn = toLong(ctx.tag); r.getSpecialAttributes().put(OspfRedistributionPolicy.EIGRP_AS_NUMBER, asn); if (ctx.metric != null) { int metric = toInteger(ctx.metric); r.setMetric(metric); } if (ctx.type != null) { int typeInt = toInteger(ctx.type); OspfMetricType type = OspfMetricType.fromInteger(typeInt); r.setOspfMetricType(type); } else { r.setOspfMetricType(OspfRedistributionPolicy.DEFAULT_METRIC_TYPE); } if (ctx.map != null) { String map = ctx.map.getText(); int mapLine = ctx.map.getStart().getLine(); r.setRouteMap(map); r.setRouteMapLine(mapLine); _configuration.referenceStructure(ROUTE_MAP, map, OSPF_REDISTRIBUTE_EIGRP_MAP, mapLine); } r.setOnlyClassfulRoutes(ctx.SUBNETS().isEmpty() && !ospfRedistributeSubnetsByDefault(_format)); }
outputRouteBuilder .getOspfMetricType() .toRoutingProtocol() .getDefaultAdministrativeCost(_c.getConfigurationFormat())); outputRouteBuilder.setNetwork(potentialExportRoute.getNetwork());
OspfMetricType type = OspfMetricType.fromInteger(typeInt); r.setOspfMetricType(type); } else {
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + _network.hashCode(); result = prime * result + ((_nextHopIp == null) ? 0 : _nextHopIp.hashCode()); result = prime * result + _admin; result = prime * result + Long.hashCode(_metric); result = prime * result + Long.hashCode(_lsaMetric); result = prime * result + ((getOspfMetricType() == null) ? 0 : getOspfMetricType().ordinal()); return result; } }
@Override public OspfExternalRoute build() { RoutingProtocol protocol = _ospfMetricType.toRoutingProtocol(); OspfExternalRoute route; if (protocol == RoutingProtocol.OSPF_E1) {
@Override public void exitRo_redistribute_connected(Ro_redistribute_connectedContext ctx) { OspfProcess proc = _currentOspfProcess; RoutingProtocol sourceProtocol = RoutingProtocol.CONNECTED; OspfRedistributionPolicy r = new OspfRedistributionPolicy(sourceProtocol); proc.getRedistributionPolicies().put(sourceProtocol, r); if (ctx.metric != null) { int metric = toInteger(ctx.metric); r.setMetric(metric); } if (ctx.map != null) { String map = ctx.map.getText(); int mapLine = ctx.map.getLine(); r.setRouteMap(map); r.setRouteMapLine(mapLine); _configuration.referenceStructure(ROUTE_MAP, map, OSPF_REDISTRIBUTE_CONNECTED_MAP, mapLine); } if (ctx.type != null) { int typeInt = toInteger(ctx.type); OspfMetricType type = OspfMetricType.fromInteger(typeInt); r.setOspfMetricType(type); } else { r.setOspfMetricType(OspfRedistributionPolicy.DEFAULT_METRIC_TYPE); } if (ctx.tag != null) { long tag = toLong(ctx.tag); r.setTag(tag); } r.setOnlyClassfulRoutes(ctx.subnets == null && !ospfRedistributeSubnetsByDefault(_format)); }
neighborRoute .getOspfMetricType() .toRoutingProtocol() .getDefaultAdministrativeCost(_c.getConfigurationFormat()));
@Override public void exitRo_redistribute_static(Ro_redistribute_staticContext ctx) { OspfProcess proc = _currentOspfProcess; RoutingProtocol sourceProtocol = RoutingProtocol.STATIC; OspfRedistributionPolicy r = new OspfRedistributionPolicy(sourceProtocol); proc.getRedistributionPolicies().put(sourceProtocol, r); if (ctx.metric != null) { int metric = toInteger(ctx.metric); r.setMetric(metric); } if (ctx.map != null) { String map = ctx.map.getText(); int mapLine = ctx.map.getLine(); r.setRouteMap(map); r.setRouteMapLine(mapLine); _configuration.referenceStructure(ROUTE_MAP, map, OSPF_REDISTRIBUTE_STATIC_MAP, mapLine); } if (ctx.type != null) { int typeInt = toInteger(ctx.type); OspfMetricType type = OspfMetricType.fromInteger(typeInt); r.setOspfMetricType(type); } else { r.setOspfMetricType(OspfRedistributionPolicy.DEFAULT_METRIC_TYPE); } if (ctx.tag != null) { long tag = toLong(ctx.tag); r.setTag(tag); } r.setOnlyClassfulRoutes(ctx.subnets == null && !ospfRedistributeSubnetsByDefault(_format)); }