My code is simply to query statistics of flows with the same <srcip,
dstip> (also in_port is specified). However, I find that by some
reason the srcip and dstip are also wildcarded.

No matter tmpmatch.nw_src=1 or 2 or anything, all the flows will be
returned. srcip and dstip are indeed wildcarded although I dont want
to.

===============
size_t size = sizeof(ofp_stats_request) + sizeof(ofp_aggregate_stats_request);
        boost::shared_array<char> raw_of(new char[size]);
        ofp_stats_request *ost = (ofp_stats_request*)raw_of.get();
        ost->header.version = OFP_VERSION;
        ost->header.type = OFPT_STATS_REQUEST;
        ost->header.length = htons(size);
        uint32_t id=rand();
        ost->header.xid = htonl(id);
        ost->type = htons(OFPST_AGGREGATE);
        ost->flags = htons(0);

        ofp_aggregate_stats_request* ofsr =
(ofp_aggregate_stats_request*)(((uint8_t*)ost->body)+0);
        ofsr->table_id = 0xff; //request for all flows
        ofsr->out_port = OFPP_NONE;
        ofp_match tmpmatch;
        tmpmatch.nw_src=1;//(flow.nw_src);
        tmpmatch.nw_dst=1;//(flow.nw_dst);
        tmpmatch.in_port=5;
        tmpmatch.wildcards=htonl( OFPFW_NW_PROTO | OFPFW_DL_VLAN |
OFPFW_DL_SRC | OFPFW_DL_DST | OFPFW_DL_TYPE | OFPFW_TP_SRC |
OFPFW_TP_DST );
       memcpy(&ofsr->match, &tmpmatch, sizeof(ofp_match));
       send_openflow_command(thisdp, &ost->header, false) ;



On Wed, Dec 23, 2009 at 1:01 AM, Guanyao Huang <gyhu...@ucdavis.edu> wrote:
> This question might be too naive. If I want to specify nw_src and
> nw_dst, and make other fields wildcards, shouldn't the code be as
> follows:
> tmpmatch.wildcards=htonl( OFPFW_NW_PROTO | OFPFW_DL_VLAN |
> OFPFW_DL_SRC | OFPFW_DL_DST | OFPFW_DL_TYPE | OFPFW_TP_SRC |
> OFPFW_TP_DST );
> Is there anything wrong? 0 means not to wildcarded it.
>

_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to