示例#1
0
FlowBuilder& FlowBuilder::ethDst(const uint8_t mac[6], const uint8_t mask[6]) {
    eth_addr macAddr;
    memcpy(&macAddr, mac, sizeof(eth_addr));
    if (mask) {
        eth_addr maskAddr;
        memcpy(&maskAddr, mask, sizeof(eth_addr));
        match_set_dl_dst_masked(match(), macAddr, maskAddr);
    } else {
        match_set_dl_dst(match(), macAddr);
    }
    return *this;
}
示例#2
0
文件: gen.c 项目: AndreiaAB/ryu
void
fill_match(struct match *match)
{
    match_init_catchall(match);
    match_set_in_port(match, 0xabcd);
    match_set_dl_vlan(match, htons(999));
    match_set_dl_dst(match, "\xaa\xbb\xcc\x99\x88\x77");
    match_set_dl_type(match, htons(ETH_TYPE_IP));
    match_set_nw_dst(match, inet_addr("192.168.2.1"));
    match_set_tun_src(match, inet_addr("192.168.2.3"));
    match_set_tun_dst(match, inet_addr("192.168.2.4"));
    match_set_tun_id(match, htonll(50000));
}
示例#3
0
void
fill_match(struct match *match)
{
    const struct eth_addr dl_dst =
        { { { 0xaa, 0xbb, 0xcc, 0x99, 0x88, 0x77 } } };
    match_init_catchall(match);
    match_set_in_port(match, 0xabcd);
    match_set_dl_vlan(match, htons(999));
    match_set_dl_dst(match, dl_dst);
    match_set_dl_type(match, htons(ETH_TYPE_IP));
    match_set_nw_dst(match, inet_addr("192.168.2.1"));
    match_set_tun_src(match, inet_addr("192.168.2.3"));
    match_set_tun_dst(match, inet_addr("192.168.2.4"));
    match_set_tun_id(match, htonll(50000));
}