public class StaticFlowEntryType
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
StaticFlowEntryType.SubActionStruct
subaction class.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COLUMN_ACTIONS |
static java.lang.String |
COLUMN_ACTIVE |
static java.lang.String |
COLUMN_COOKIE |
static java.lang.String |
COLUMN_DL_DST |
static java.lang.String |
COLUMN_DL_SRC |
static java.lang.String |
COLUMN_DL_TYPE |
static java.lang.String |
COLUMN_DL_VLAN |
static java.lang.String |
COLUMN_DL_VLAN_PCP |
static java.lang.String |
COLUMN_HARD_TIMEOUT |
static java.lang.String |
COLUMN_IDLE_TIMEOUT |
static java.lang.String |
COLUMN_IN_PORT |
static java.lang.String |
COLUMN_NAME |
static java.lang.String |
COLUMN_NW_DST |
static java.lang.String |
COLUMN_NW_PROTO |
static java.lang.String |
COLUMN_NW_SRC |
static java.lang.String |
COLUMN_NW_TOS |
static java.lang.String |
COLUMN_PRIORITY |
static java.lang.String |
COLUMN_SWITCH |
static java.lang.String |
COLUMN_TP_DST |
static java.lang.String |
COLUMN_TP_SRC |
static java.lang.String |
COLUMN_WILDCARD |
static int |
STATIC_FLOW_APP_ID |
private static byte[] |
zeroMac
represents a null(zero) mac.
|
Constructor and Description |
---|
StaticFlowEntryType() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkMatchIp(java.util.Map<java.lang.String,java.lang.Object> rows)
Checks to see if the user matches IP information without
checking for the correct ether-type (2048).
|
static long |
computeEntryCookie(org.openflow.protocol.OFFlowMod fm,
int userCookie,
java.lang.String name)
This function generates a random hash for the bottom half of the cookie
|
private static StaticFlowEntryType.SubActionStruct |
decode_enqueue(java.lang.String subaction)
parse a subaction 'enqueue'
|
private static StaticFlowEntryType.SubActionStruct |
decode_output(java.lang.String subaction)
parse a subaction 'output'
|
private static StaticFlowEntryType.SubActionStruct |
decode_set_dst_ip(java.lang.String subaction)
parse a subaction 'set-dst-ip'
|
private static StaticFlowEntryType.SubActionStruct |
decode_set_dst_mac(java.lang.String subaction)
parse a subaction 'set-dst-mac'
|
private static StaticFlowEntryType.SubActionStruct |
decode_set_dst_port(java.lang.String subaction)
parse a subaction 'set-dst-port'
|
private static StaticFlowEntryType.SubActionStruct |
decode_set_src_ip(java.lang.String subaction)
parse a subaction 'set-src-ip'
|
private static StaticFlowEntryType.SubActionStruct |
decode_set_src_mac(java.lang.String subaction)
parse a subaction 'set-src-mac'
|
private static StaticFlowEntryType.SubActionStruct |
decode_set_src_port(java.lang.String subaction)
parse a subaction 'set-src-port'
|
private static StaticFlowEntryType.SubActionStruct |
decode_set_tos_bits(java.lang.String subaction)
parse a subaction 'set-tos-bits'
|
private static StaticFlowEntryType.SubActionStruct |
decode_set_vlan_id(java.lang.String subaction)
parse a subaction 'set-vlan-id'
|
private static StaticFlowEntryType.SubActionStruct |
decode_set_vlan_priority(java.lang.String subaction)
parse a aubsection 'set-vlan-priority'
|
private static StaticFlowEntryType.SubActionStruct |
decode_strip_vlan(java.lang.String subaction)
parse a subaction 'strip-vlan'
|
private static java.lang.String |
flowModActionsToString(java.util.List<org.openflow.protocol.action.OFAction> fmActions)
Returns a String representation of all the openflow actions.
|
static java.util.Map<java.lang.String,java.lang.Object> |
flowModToStorageEntry(org.openflow.protocol.OFFlowMod fm,
java.lang.String sw,
java.lang.String name)
Parses an OFFlowMod (and it's inner OFMatch) to the storage entry format.
|
private static byte |
get_byte(java.lang.String str)
Parse byte as decimal, hex (start with 0x or #) or octal (starts with 0)
|
private static int |
get_int(java.lang.String str)
Parse int as decimal, hex (start with 0x or #) or octal (starts with 0)
|
private static int |
get_ip_addr(java.util.regex.Matcher n,
java.lang.String subaction)
This method extracts IP address information from the given subaction.
|
private static byte[] |
get_mac_addr(java.util.regex.Matcher n,
java.lang.String subaction)
from a subaction, extract a mac address.
|
private static short |
get_short(java.lang.String str)
Parse short as decimal, hex (start with 0x or #) or octal (starts with 0)
|
static java.lang.String |
getEntryNameFromJson(java.lang.String fmJson)
Gets the entry name of a flow mod
|
static void |
initDefaultFlowMod(org.openflow.protocol.OFFlowMod fm,
java.lang.String entryName)
Sets defaults for an OFFlowMod
|
static java.util.Map<java.lang.String,java.lang.Object> |
jsonToStorageEntry(java.lang.String fmJson)
Turns a JSON formatted Static Flow Pusher string into a storage entry.
|
static void |
parseActionString(org.openflow.protocol.OFFlowMod flowMod,
java.lang.String actionstr)
Parses OFFlowMod actions from strings.
|
public static final int STATIC_FLOW_APP_ID
public static final java.lang.String COLUMN_NAME
public static final java.lang.String COLUMN_SWITCH
public static final java.lang.String COLUMN_ACTIVE
public static final java.lang.String COLUMN_IDLE_TIMEOUT
public static final java.lang.String COLUMN_HARD_TIMEOUT
public static final java.lang.String COLUMN_PRIORITY
public static final java.lang.String COLUMN_COOKIE
public static final java.lang.String COLUMN_WILDCARD
public static final java.lang.String COLUMN_IN_PORT
public static final java.lang.String COLUMN_DL_SRC
public static final java.lang.String COLUMN_DL_DST
public static final java.lang.String COLUMN_DL_VLAN
public static final java.lang.String COLUMN_DL_VLAN_PCP
public static final java.lang.String COLUMN_DL_TYPE
public static final java.lang.String COLUMN_NW_TOS
public static final java.lang.String COLUMN_NW_PROTO
public static final java.lang.String COLUMN_NW_SRC
public static final java.lang.String COLUMN_NW_DST
public static final java.lang.String COLUMN_TP_DST
public static final java.lang.String COLUMN_TP_SRC
public static final java.lang.String COLUMN_ACTIONS
private static byte[] zeroMac
public static long computeEntryCookie(org.openflow.protocol.OFFlowMod fm, int userCookie, java.lang.String name)
fm
- userCookie
- name
- public static void initDefaultFlowMod(org.openflow.protocol.OFFlowMod fm, java.lang.String entryName)
fm
- The OFFlowMod to set defaults forentryName
- The name of the entry. Used to compute the cookie.public static java.lang.String getEntryNameFromJson(java.lang.String fmJson) throws java.io.IOException
fmJson
- The OFFlowMod in a JSON representationjava.io.IOException
- If there was an error parsing the JSONpublic static java.util.Map<java.lang.String,java.lang.Object> flowModToStorageEntry(org.openflow.protocol.OFFlowMod fm, java.lang.String sw, java.lang.String name)
fm
- The FlowMod to parsesw
- The switch the FlowMod is going to be installed onname
- The name of this static flow entryprivate static java.lang.String flowModActionsToString(java.util.List<org.openflow.protocol.action.OFAction> fmActions)
fmActions
- A list of OFActions to encode into one stringpublic static java.util.Map<java.lang.String,java.lang.Object> jsonToStorageEntry(java.lang.String fmJson) throws java.io.IOException
{ "switch": "AA:BB:CC:DD:EE:FF:00:11", "name": "flow-mod-1", "cookie": "0", "priority": "32768", "ingress-port": "1", "actions": "output=2", }
fmJson
- The JSON formatted static flow pusher entryjava.io.IOException
- If there was an error parsing the JSONpublic static void parseActionString(org.openflow.protocol.OFFlowMod flowMod, java.lang.String actionstr)
flowMod
- The OFFlowMod to set the actions foractionstr
- The string containing all the actionslog
- A logger to log for errors.private static StaticFlowEntryType.SubActionStruct decode_output(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_enqueue(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_strip_vlan(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_set_vlan_id(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_set_vlan_priority(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_set_src_mac(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_set_dst_mac(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_set_tos_bits(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_set_src_ip(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_set_dst_ip(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_set_src_port(java.lang.String subaction)
subaction
- private static StaticFlowEntryType.SubActionStruct decode_set_dst_port(java.lang.String subaction)
subaction
- private static byte[] get_mac_addr(java.util.regex.Matcher n, java.lang.String subaction)
decode_set_dst_mac(String)
, and decode_set_src_mac(String)
.n
- subaction
- private static int get_ip_addr(java.util.regex.Matcher n, java.lang.String subaction)
decode_set_dst_ip(String)
, and decode_set_src_ip(String)
.n
- subaction
- private static int get_int(java.lang.String str)
str
- private static short get_short(java.lang.String str)
str
- private static byte get_byte(java.lang.String str)
str
- public static boolean checkMatchIp(java.util.Map<java.lang.String,java.lang.Object> rows)
rows
- The Map that is a string representation of
the static flow.