bool SwitchManager::writeFlow(const std::string& objId,
                              int tableId, FlowEntryPtr el) {
    FlowEntryList tmpEl;
    if (el)
        tmpEl.push_back(el);
    return writeFlow(objId, tableId, tmpEl);
}
Exemple #2
0
void FlowExecutorFixture::createTestFlows() {
    flows.push_back(FlowEntryPtr(new FlowEntry()));
    FlowEntry& e0 = *(flows.back());
    e0.entry->table_id = 0;
    e0.entry->priority = 100;
    e0.entry->cookie = 0xabcd;
    match_set_reg(&e0.entry->match, 3, 42);
    match_set_dl_type(&e0.entry->match, htons(ETH_TYPE_IP));
    match_set_nw_dst(&e0.entry->match, 0x01020304);
    ActionBuilder ab0;
    ab0.SetRegLoad(MFF_REG0, 100);
    ab0.SetOutputToPort(OFPP_IN_PORT);
    ab0.Build(e0.entry);

    flows.push_back(FlowEntryPtr(new FlowEntry()));
    FlowEntry& e1 = *(flows.back());
    e1.entry->table_id = 5;
    e1.entry->priority = 50;
    match_set_in_port(&e1.entry->match, 2168);
    ActionBuilder ab1;
    ab1.SetGotoTable(10);
    ab1.Build(e1.entry);
}
Exemple #3
0
void FlowBuilder::build(FlowEntryList& list) {
    list.push_back(build());
}