ofproto: Destroy rule in ofproto_get_vlan_usage().

Found by inspection.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
lib/classifier: Simplify subtable array.

Do not cache the 'tag' and 'max_priority' in the subtable array.  This
makes later changes to classifier easier.

Change CLS_SUBTABLES_FOR_EACH to iterate with a regular array index.

Makes the 'cls_subtables*' functions to always leave the subtables
array in a consistent state.  This includes the new
cls_subtables_insert() function and removal of the old
cls_subtables_push_back() function.

Finally, using qsort() instead of our hand rolled sort routines.  This
simplifies the code significantly.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Co-authored-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
classifier: Get rid of cls_rule_move() and it's user.

This makes rule creation a bit more straight forward.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
classifier: Use a match instead of a cls_rule in cursors.

This marginally simplifies the code, and makes the API more intuitive.

Signed-off-by: Ethan Jackson <ethan@nicira.com>