lib/classifier: Clarify trie_lookup_value().

trie_lookup_value() is easier to read with the local variable 'plen'
renamed as 'ofs'.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/classifier: Fix use of uninitialized memory.

When reaching the end of a prefix trie, we checked one bit off the end
to the intended data.  However, since the trie node in that case has
NULLs for both edge links, this did not result in incorrect
functionality.

Found via check-valgrind.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
util: Move definition of HANDLE here.

A few Open vSwitch source files use a type named HANDLE on Windows systems,
in a way that makes it easier to avoid #ifdefs if we have a dummy
definition on other platforms.  <linux/types.h> was a really weird place
for this dummy definition.  This commit moves it to util.h.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
Do not seemingly #include Linux-specific headers on other platforms.

Until now, the OVS source tree has had a whole maze of header files that
make "#include <linux/openvswitch.h>" work OK regardless of platform, but
this confuses everyone new to the tree, at first glance, and is difficult
to understand at second glance too.

This commit moves the core of the Netlink definitions that were in
include/linux/openvswitch.h into a new header
include/odp-netlink-internal.h, and then adds two wrappers:

    * datapath/linux/compat/include/linux/openvswitch.h: This wrapper
      allows the Linux datapath code to continue using "#include
      <linux/openvswitch.h>".

    * lib/odp-netlink.h: Userspace code uses this wrapper.

This change allows all of the include/linux/* files to be deleted.

Signed-off-by: Ben Pfaff <blp@nicira.com>
odp-netlink-internal.h: Use ovs_32aligned_u64.

Open vSwitch userspace uses special types to indicate that a particular
object may not be naturally aligned.  Netlink is one source of such
problems: in Netlink, 64-bit integers are often aligned only on 32-bit
boundaries.  Now that the header file for Open vSwitch datapath Netlink
definitions has diverged somewhat from the upstream Linux kernel version,
it makes sense to use ovs_32aligned_u64 locally to make it harder to
accidentally access a misaligned 64-bit member.

Signed-off-by: Ben Pfaff <blp@nicira.com>