Search in sources :

Example 1 with CookieType

use of org.openkilda.model.cookie.CookieBase.CookieType in project open-kilda by telstra.

the class AnyFlowStatsEntryHandler method initTags.

private TagsFormatter initTags(FlowSegmentCookie decodedCookie) {
    TagsFormatter tags = new TagsFormatter();
    tags.addFlowIdTag(null);
    tags.addDirectionTag(Direction.UNKNOWN);
    tags.addSwitchIdTag(switchId);
    tags.addCookieTag(statsEntry.getCookie());
    tags.addTableIdTag(statsEntry.getTableId());
    tags.addInPortTag(statsEntry.getInPort());
    tags.addOutPortTag(statsEntry.getOutPort());
    CookieType cookieType;
    boolean flowSatellite = isFlowSatelliteEntry(decodedCookie);
    if (decodedCookie != null) {
        cookieType = decodedCookie.getType();
        if (flowSatellite) {
            tags.addIsFlowRttInjectTag(cookieType == CookieType.SERVER_42_FLOW_RTT_INGRESS);
            tags.addIsMirrorTag(decodedCookie.isMirror());
            tags.addIsLoopTag(decodedCookie.isLooped());
        }
    } else {
        cookieType = new Cookie(statsEntry.getCookie()).getType();
    }
    tags.addIsFlowSatelliteTag(flowSatellite);
    tags.addCookieTypeTag(cookieType);
    return tags;
}
Also used : Cookie(org.openkilda.model.cookie.Cookie) FlowSegmentCookie(org.openkilda.model.cookie.FlowSegmentCookie) CookieType(org.openkilda.model.cookie.CookieBase.CookieType)

Example 2 with CookieType

use of org.openkilda.model.cookie.CookieBase.CookieType in project open-kilda by telstra.

the class RecordHandler method processInstallDefaultFlowByCookie.

private Long processInstallDefaultFlowByCookie(SwitchId switchId, long cookie) throws SwitchOperationException {
    ISwitchManager switchManager = context.getSwitchManager();
    DatapathId dpid = DatapathId.of(switchId.toLong());
    Cookie encodedCookie = new Cookie(cookie);
    PortColourCookie portColourCookie = new PortColourCookie(cookie);
    CookieType cookieType = encodedCookie.getType();
    if (cookie == DROP_RULE_COOKIE) {
        return switchManager.installDropFlow(dpid);
    } else if (cookie == VERIFICATION_BROADCAST_RULE_COOKIE) {
        return switchManager.installVerificationRule(dpid, true);
    } else if (cookie == VERIFICATION_UNICAST_RULE_COOKIE) {
        return switchManager.installVerificationRule(dpid, false);
    } else if (cookie == DROP_VERIFICATION_LOOP_RULE_COOKIE) {
        return switchManager.installDropLoopRule(dpid);
    } else if (cookie == CATCH_BFD_RULE_COOKIE) {
        return switchManager.installBfdCatchFlow(dpid);
    } else if (cookie == ROUND_TRIP_LATENCY_RULE_COOKIE) {
        return switchManager.installRoundTripLatencyFlow(dpid);
    } else if (cookie == VERIFICATION_UNICAST_VXLAN_RULE_COOKIE) {
        return switchManager.installUnicastVerificationRuleVxlan(dpid);
    } else if (cookie == MULTITABLE_PRE_INGRESS_PASS_THROUGH_COOKIE) {
        return switchManager.installPreIngressTablePassThroughDefaultRule(dpid);
    } else if (cookie == MULTITABLE_INGRESS_DROP_COOKIE) {
        return switchManager.installDropFlowForTable(dpid, INGRESS_TABLE_ID, MULTITABLE_INGRESS_DROP_COOKIE);
    } else if (cookie == MULTITABLE_POST_INGRESS_DROP_COOKIE) {
        return switchManager.installDropFlowForTable(dpid, POST_INGRESS_TABLE_ID, MULTITABLE_POST_INGRESS_DROP_COOKIE);
    } else if (cookie == MULTITABLE_EGRESS_PASS_THROUGH_COOKIE) {
        return switchManager.installEgressTablePassThroughDefaultRule(dpid);
    } else if (cookie == MULTITABLE_TRANSIT_DROP_COOKIE) {
        return switchManager.installDropFlowForTable(dpid, TRANSIT_TABLE_ID, MULTITABLE_TRANSIT_DROP_COOKIE);
    } else if (cookie == LLDP_INPUT_PRE_DROP_COOKIE) {
        return switchManager.installLldpInputPreDropFlow(dpid);
    } else if (cookie == LLDP_INGRESS_COOKIE) {
        return switchManager.installLldpIngressFlow(dpid);
    } else if (cookie == LLDP_POST_INGRESS_COOKIE) {
        return switchManager.installLldpPostIngressFlow(dpid);
    } else if (cookie == LLDP_POST_INGRESS_VXLAN_COOKIE) {
        return switchManager.installLldpPostIngressVxlanFlow(dpid);
    } else if (cookie == LLDP_POST_INGRESS_ONE_SWITCH_COOKIE) {
        return switchManager.installLldpPostIngressOneSwitchFlow(dpid);
    } else if (cookie == LLDP_TRANSIT_COOKIE) {
        return switchManager.installLldpTransitFlow(dpid);
    } else if (cookie == ARP_INPUT_PRE_DROP_COOKIE) {
        return switchManager.installArpInputPreDropFlow(dpid);
    } else if (cookie == ARP_INGRESS_COOKIE) {
        return switchManager.installArpIngressFlow(dpid);
    } else if (cookie == ARP_POST_INGRESS_COOKIE) {
        return switchManager.installArpPostIngressFlow(dpid);
    } else if (cookie == ARP_POST_INGRESS_VXLAN_COOKIE) {
        return switchManager.installArpPostIngressVxlanFlow(dpid);
    } else if (cookie == ARP_POST_INGRESS_ONE_SWITCH_COOKIE) {
        return switchManager.installArpPostIngressOneSwitchFlow(dpid);
    } else if (cookie == ARP_TRANSIT_COOKIE) {
        return switchManager.installArpTransitFlow(dpid);
    } else if (cookie == SERVER_42_FLOW_RTT_TURNING_COOKIE) {
        return switchManager.installServer42FlowRttTurningFlow(dpid);
    } else if (cookie == SERVER_42_ISL_RTT_TURNING_COOKIE) {
        return switchManager.installServer42IslRttTurningFlow(dpid);
    } else if (cookie == SERVER_42_FLOW_RTT_VXLAN_TURNING_COOKIE) {
        return switchManager.installServer42FlowRttVxlanTurningFlow(dpid);
    } else if (cookieType == CookieType.MULTI_TABLE_INGRESS_RULES) {
        return switchManager.installIntermediateIngressRule(dpid, portColourCookie.getPortNumber());
    } else if (cookieType == CookieType.MULTI_TABLE_ISL_VLAN_EGRESS_RULES) {
        return switchManager.installEgressIslVlanRule(dpid, portColourCookie.getPortNumber());
    } else if (cookieType == CookieType.MULTI_TABLE_ISL_VXLAN_TRANSIT_RULES) {
        return switchManager.installTransitIslVxlanRule(dpid, portColourCookie.getPortNumber());
    } else if (cookieType == CookieType.MULTI_TABLE_ISL_VXLAN_EGRESS_RULES) {
        return switchManager.installEgressIslVxlanRule(dpid, portColourCookie.getPortNumber());
    } else if (cookieType == CookieType.LLDP_INPUT_CUSTOMER_TYPE) {
        return switchManager.installLldpInputCustomerFlow(dpid, portColourCookie.getPortNumber());
    } else if (cookieType == CookieType.ARP_INPUT_CUSTOMER_TYPE) {
        return switchManager.installArpInputCustomerFlow(dpid, portColourCookie.getPortNumber());
    } else if (cookie == SERVER_42_FLOW_RTT_VXLAN_TURNING_COOKIE) {
        return switchManager.installServer42FlowRttVxlanTurningFlow(dpid);
    } else {
        logger.warn("Skipping the installation of unexpected default switch rule {} for switch {}", encodedCookie, switchId);
    }
    return null;
}
Also used : FlowSharedSegmentCookie(org.openkilda.model.cookie.FlowSharedSegmentCookie) PortColourCookie(org.openkilda.model.cookie.PortColourCookie) Cookie(org.openkilda.model.cookie.Cookie) ISwitchManager(org.openkilda.floodlight.switchmanager.ISwitchManager) CookieType(org.openkilda.model.cookie.CookieBase.CookieType) DatapathId(org.projectfloodlight.openflow.types.DatapathId) PortColourCookie(org.openkilda.model.cookie.PortColourCookie)

Aggregations

Cookie (org.openkilda.model.cookie.Cookie)2 CookieType (org.openkilda.model.cookie.CookieBase.CookieType)2 ISwitchManager (org.openkilda.floodlight.switchmanager.ISwitchManager)1 FlowSegmentCookie (org.openkilda.model.cookie.FlowSegmentCookie)1 FlowSharedSegmentCookie (org.openkilda.model.cookie.FlowSharedSegmentCookie)1 PortColourCookie (org.openkilda.model.cookie.PortColourCookie)1 DatapathId (org.projectfloodlight.openflow.types.DatapathId)1