floodlight/floodlight — pull request #429 by rizard (2013-11-13 21:46:46+00:00)
Title: Allow static flow pusher to match/rewrite transport port numbers >= 32768

As it stands now, ports for switches and L4 port numbers are stored as shorts. This is great and just enough space to store all the possible port numbers uniquely. However, Java does not have unsigned shorts. If a port number needs to have a '1' in bit 15 (all ports >= 32768), it will appear as a negative number. When writing flows with the static flow pusher, this short is converted to a string, and thus appears negative in the string. When the flow is composed, the action is ignored, since there are no negative port numbers.

I am simply going to cast the port numbers as ints in StaticFlowPusherEntries.java before they are converted to strings. If the int is negative, then I'll convert it to the positive number it would be if the original short was unsigned.