messenger: Tweak test client code

This code was sort of confusing to read.  Better now.
pxpcap: Allow injecting from bytearrays

Previously we could only inject bytes objects.  We can now handle
bytearrays (and maybe even other buffer types, sort of).
packet: Don't try to pack unparsed packets

If a packet failed to parse, but has raw data, we now just use
the raw data rather than try to re-pack data that wasn't parsed
correctly to begin with.
libopenflow: Improve type guessing for stats_reply

ofp_stats_reply can guess its body type by actually looking at
the body.  Previously, this gave a non-obvious exception when
this fails because the body was an empty list-like object.
pcap_switch: Do pxpcap check inside launch

This way you can still import the module even without pxpcap (e.g.,
for the module load test), and it fails if you don't have pxpcap
when you actually try to run the component (which was the
intention anyway).
arp_responder: copy request's vlan tag onto the answer
Merge pull request #83 from nemethf/arp_responder_vlan_v2

arp_responder: copy request's vlan tag onto the answer (v2)
packet.llc: Only parse as Ethernet when OUI=0

Previously, we always tried to parse the rest of the frame as if it were
Ethernet, but this should only be done if the OUI is 0x000000.  For any
other OUI, LLC's .next is the raw remainder of the frame.
packet: Adjust conditions for not-packing unparsed packets

1705997e3 added logic to packet_base which stops unparsed packets from
attempting to re-pack, and just uses their .raw instead.  It assumed that
.next would be set to None in cases where this should happen, but this
isn't the case with ipv4, for example, which has it set to an empty bytes.

This patch now counts anything falsey for .next as okay for non-repacking.
It's possible that this isn't a great idea and that things like ipv4 should
explicitly set .next to None instead.
libopenflow: Use OFP_DL_TYPE_NOT_ETH_TYPE in from_packet()

I haven't noticed this in the spec, but it seems like at least for
matching, if the Ethernet frame doesn't have a valid ethertype, it should
always be treated as if it were OFP_DL_TYPE_NOT_ETH_TYPE.  (Based on
OFTest and maybe OVS.)
libopenflow: Match on SNAP-encapsulated ethertype

from_packet() now checks if the frame has a SNAP header and gets the
ethertype out of it if so.  Questions remain as to ordering of VLAN and
LLC.  Also, it's possible this same thing should be done as part of
ethernet.effective_ethertype.
flow_table: Fix formatting of docstrings
flow_table: Fix formatting of function headers

Normalized spacing of class/function/method headers
flow_table: Fix some code formatting in TableEntry
flow_table: Code format improvements in TableEntry

In these cases, minor changes were made to the code to improve
readability and/or formatting.
flow_table: Raise exceptions instead of strings

Raising of strings as exceptions has been deprecated since
Python 1.5 and we probably shouldn't be doing it.
flow_table: Fix some code formatting in FlowTable
flow_table: Refactor flow removal

This factors out common code for removing flow entries into a
helper function.  Additionally, it uses a list comprehension
instead of individual removals in hopes of being more
efficient.
flow_table: Remove unnecessary for/else

Python's for/else is a strange construction and its use wasn't really
warranted here.  Removing it is more readable at no cost.
flow_table: Fix some formatting in SwitchFlowTable

This removes extraneous parentheses around if conditions and uses an
OpenFlow "constant" itself rather than its entry in the _rev_map.