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.
flow_table: Fix formatting in process_flow_mod()

This patch stores some instance variables of the flow_mod in local
variables to make the code more readable.
flow_table: Compare to None using is/is not
flow_table: Remove obsolete comment
flow_table: Remove counters dictionary

Various things (including but not limited to counters) were stored
in a dictionary.  They're now just kept in attributes.
flow_table: Fix computation of flow nsec

The nanosecond duration for an entry was being computed as the
*total* nanoseconds.  It's supposed to be the nanosecond delta
from the seconds field.  Fixed.  (Spec 5.3.5)