Search in sources :

Example 1 with ServiceCookie

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

the class ConnectedDevicesService method handlePacketIn.

private void handlePacketIn(OfInput input) {
    U64 rawCookie = input.packetInCookie();
    if (rawCookie == null) {
        return;
    }
    ServiceCookie cookie = new ServiceCookie(rawCookie.getValue());
    SwitchId switchId = new SwitchId(input.getDpId().getLong());
    final ServiceCookieTag serviceTag = cookie.getServiceTag();
    if (lldpServiceTags.contains(serviceTag)) {
        logger.debug("Receive connected device LLDP packet from {} OF-xid:{}, cookie: {}", input.getDpId(), input.getMessage().getXid(), cookie);
        handleSwitchLldp(input, switchId, cookie.getValue());
    } else if (arpServiceTags.contains(serviceTag)) {
        logger.debug("Receive connected device ARP packet from {} OF-xid:{}, cookie: {}", input.getDpId(), input.getMessage().getXid(), cookie);
        handleArp(input, switchId, cookie.getValue());
    }
}
Also used : U64(org.projectfloodlight.openflow.types.U64) ServiceCookieTag(org.openkilda.model.cookie.ServiceCookie.ServiceCookieTag) ServiceCookie(org.openkilda.model.cookie.ServiceCookie) SwitchId(org.openkilda.model.SwitchId)

Example 2 with ServiceCookie

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

the class MeterStatsHandler method handleStatsEntry.

@Override
public void handleStatsEntry(DummyMeterDescriptor descriptor) {
    TagsFormatter tags = initTags();
    if (isMeterIdOfDefaultRule(statsEntry.getMeterId())) {
        tags.addCookieHexTag(new ServiceCookie(new MeterId(statsEntry.getMeterId())));
        emitServiceMeterPoints(tags);
    } else {
        handleFlowStats(tags, null, null);
        log.warn("Missed cache for switch '{}' meterId '{}'", switchId, statsEntry.getMeterId());
    }
}
Also used : ServiceCookie(org.openkilda.model.cookie.ServiceCookie) MeterId(org.openkilda.model.MeterId)

Aggregations

ServiceCookie (org.openkilda.model.cookie.ServiceCookie)2 MeterId (org.openkilda.model.MeterId)1 SwitchId (org.openkilda.model.SwitchId)1 ServiceCookieTag (org.openkilda.model.cookie.ServiceCookie.ServiceCookieTag)1 U64 (org.projectfloodlight.openflow.types.U64)1