Working on unit tests. Found bugs in TCP and UDP. ByteBuffer returns a (signed) short for ports, but they are valid 0-65535, not -32768-32767. Convert possibly negative ports from BB to positive ints using a bitmask.
Refactor IPv4 and UDP payload's protocol class map the proper way.
Load balancer quick fix due to prior IPv4 packet changes. Uses LOXI IpProtocol now to reference certain protocol numbers, not IPv4 anymore.
Added option to remove debug counters from the hierarchy if it's been added; useful for keeping track of switch or device counters, which might not stick around forever. Fixed bug in CounterNode where non-null was returned regardless of whether a counter was already present or was a new counter. DebugCounterServiceImpl prints a debug message if non-null is returned, mistakenly indicating you're adding a counter that you already had registerd (generated TONS of annoying debug messages at startup). Next bug, I accidentally initialized counters twice in the OFSwitchManager; now only done once.
Merge remote-tracking branches 'upsteam/master' and 'origin/openflow-1.3' into openflow-1.3
remove unnecessary comments
Fix DebugCounter related things in core.web. Other misc optimizations in core.web.
Add 'json' to the DeviceManager's REST API to be consistent with the rest. Ending the path in a / is bad REST practice.
Use /wm/device/all/json for all devices and /*** where *** is a filter by mac, vlan, ip, etc
Changed DebugCounterServiceImpl's registerCounter(). It turns out we do need to always return a reference to an IDebugCounter. If the counter we're trying to add is already there, return the existing IDebugCounter, else if the counter is not there, add it, and return it instead.
Merge remote-tracking branches 'upsteam/master' and 'origin/openflow-1.3' into openflow-1.3
Added SwitchCounters.java. Similar to SwitchManagerCounters.java, the SwitchCounters class contained within contains and maintains all the counters for a switch instance. When the switch disconnects, either accidentally or forcefully with disconnect(), the SwitchCounters will be removed from the IDebugCounterService, since they will no longer be valid or meaningful if the switch never reconnects.
Changed methodology after realizing the counters are already defined in OFConnectionCounters, which makes more sense since switches can have multiple connections now. OFConnectionCounters now refactored to remove counters when a switch disconnects.
Undo weaving of IDebugCounterService into the OFSwitch class for previous SwitchCounters implementation.
switchDisconnected() already called when the main connection is closed (so it wasn't a bug after all).
Merge remote-tracking branches 'upsteam/master' and 'origin/openflow-1.3' into openflow-1.3
Fixed some more unit tests. In the process, discovered some errors in more overridden equals(). Also, discovered I had inadvertently commented out an important few lines the routing module uses to set the ingress port of flows used in the route. Those lines are now ported and use MatchUtils to copy the Match properly.
Merge remote-tracking branch 'upsteam/master' into openflow-1.3