Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong interpretation of bitmaps in spec? #41

Open
etnt opened this issue Sep 12, 2013 · 0 comments
Open

wrong interpretation of bitmaps in spec? #41

etnt opened this issue Sep 12, 2013 · 0 comments

Comments

@etnt
Copy link

etnt commented Sep 12, 2013

Hi,

I suspect that there is a wrong interpretation of some bitmaps,
For example, look at the 1.2 spec, A.3.5.4 Table Statistics:

/* Body of reply to OFPST_TABLE request. */
struct ofp_table_stats {
    ...   
    uint64_t match; /* Bitmap of (1 << OFPXMT_*) that indicate the
                               fields the table can match on. */
    ....
    uint32_t instructions; /* Bitmap of OFPIT_* values supported. */
    ....

The match field consists of enums which start on zero, hence the left-shift.
This works ok:

> ofp_utils:binary_to_flags(ofp_v3_enum, oxm_ofb_match_fields,<<0,0,0,0,0,0,0,1>>).
[in_port]

However, the instructions field consists of enums which start on one, hence no left-shift.
Now this I belive is implemented wrong in of_protocol:

> ofp_utils:binary_to_flags(ofp_v3_enum, instruction_type, <<0,0,0,2#10>>).
[goto_table]

Really, 'goto_table' should be represented as:

<<0,0,0,2#1>>

or ?

But that results in:

> ofp_utils:binary_to_flags(ofp_v3_enum, instruction_type, <<0,0,0,2#1>>).          
** exception throw: bad_enum

I also wonder how you represent the:

....
OFPIT_EXPERIMENTER = 0xFFFF
....

enum in a bitmap?

Cheers, Tobbe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant