Add some missing common Open Flow definitions

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovsdb-idl: Fix memory leak writing synthetic rows in ovsdb_idl_txn_write().

This could cause a slow but steady memory leak in ovs-vswitchd.

Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Fix minor memory leaks found by valgrind.

All of these leaks are in normally short-lived programs, so none of them
is very important.

Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: Suppress valgrind error reports from glibc timer_create() function.

valgrind reports a memory leak and a parameter error in glibc's
timer_create() in almost every program execution.  I don't know a way to
avoid them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: Gracefully shut down ovsdb-server, to avoid valgrind leak warnings.

When ovsdb-server exits gracefully it frees all the memory that it owns,
which keeps valgrind from warning about "possibly lost" blocks.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Rearrange structures to better fit valgrind's memory leak heuristics.

valgrind's memory leak detector considers a pointer to the head of a memory
block to be "definitely" a pointer to that memory block but a pointer to
the interior of a memory block only "possibly" a pointer to that memory
block.  Open vSwitch hmap_node and list data structures can go anywhere
inside a structure; if they are in the middle of a structure then valgrind
considers pointers to them to be possible leaks.  Therefore, this commit
moves some of these from the middle of data structures to the head, to
reduce valgrind's uncertainty.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Use ovs_be32 in nx_flow_mod_table_id

This corrects what appears to be an oversight
whereby uing32_t is used while all other structures
in the file make use of ovs_be* in place of uint*_t.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Use ovs_be16 in ofp_queue_prop_min_rate

Use ovs_be16 in place of uint16_t.
This corrects an error made by me when
adding ofp_queue_prop_min_rate.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Move structures into openflow-common.h

* Move ofp_packet_in_reason into openflow-common.h as it
  contains elements first defined in both the
  Openflow 1.0 and 1.2 specifications.

* Move ofp_flow_removed_reason into openflow-common.h as
  subsequent patches will add an element first defined in the
  Openflow 1.1 specification.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Add some missing Open Flow 1.0 definitions

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Add some missing Open Flow 1.1 definitions

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com added OFPRR_GROUP_DELETE to
 ofp_flow_removed_reason_to_string()]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Definitions for Open Flow 1.2

This is a first pass at adding include/openflow/openflow-1.2.h to
include enum and struct definitions for Open Flow 1.2 that
are not already covered by Open Flow 1.1.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
check-structs: Disallow uint<N>_t because ovs_be<N> should always be used.

The header files that check-structs checks should only contain big-endian
data, never native-endian data, so disallow uint<N>_t entirely.  (We had
a couple of mistakes in this area until recently.)

uint8_t is an obvious exception.

Reported-by: Simon Horman <horms@verge.net.au>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
unixctl.py: Allow callers to manually set unixctl version.

Some clients of unixctl.py may want to use a different version than
the one supplied in ovs.version.VERSION.  This patch supports an
optional manual override of this value.

Feature #10383.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
datapath: Backport nla_put_be* functions.

Linux 3.5 replaces the NLA_PUT_* functions with non-macro version,
which required adding the endian-typed versions.  This backports
those functions and drops the macro backports.

Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath: Stop using NLA_PUT*().

These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.

Signed-off-by: David S. Miller <davem@davemloft.net>
[jesse: Additional transformations for code not upstream.]
Signed-off-by: Jesse Gross <jesse@nicira.com>
AUTHORS: Add David S. Miller

Signed-off-by: Jesse Gross <jesse@nicira.com>
bugtool - Collect version information for all running Open vSwitch daemons.

This is an improvement in {ovs|xen}-bugtool archive output to determine the
version which was running for all the OVS daemons. It is implemented as a
plugin which internally calls "ovs-appctl -t <daemon> version" command for
daemons whose pid file is present in /var/run/openvswitch directory.

Feature #10383
Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
[blp@nicira.com updated debian/copyright.in]
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath: tunnelling: capwap: UDP_ENCAP_CAPWAP is an abitrary value

It seems to me that as the value of UDP_ENCAP_CAPWAP is hardcoded
it would be more appropriate to describe it as arbitrary than
random.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Granular link health statistics for cfm.

The changes display the cfm_health of an interface.  The cfm_health
is an exponential weighted moving average of the health of all
remote_mpids.  The value can vary from 0 to 100, 100 being very healthy
and 0 being unhealthy.

Feature #10363
Requested-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>