Added more action in table stats, renamed actions to fit in the screen
diff --git a/cli/cli/c_actions.py b/cli/cli/c_actions.py
index ac30dc8..0ccdc9c 100755
--- a/cli/cli/c_actions.py
+++ b/cli/cli/c_actions.py
@@ -69,6 +69,21 @@
return newActions
else:
actions
+def renameActions(actions):
+ actions = actions.replace('GOTO_TABLE','GOTO')
+ actions = actions.replace('WRITE_ACTIONS','WRITE')
+ actions = actions.replace('APPLY_ACTIONS','APPLY')
+ actions = actions.replace('DEC_NW_TTL: True','DEC_NW_TTL')
+ actions = actions.replace('POP_MPLS: True','POP_MPLS')
+ actions = actions.replace('COPY_TTL_IN: True','COPY_TTL_IN')
+ actions = actions.replace('COPY_TTL_OUT: True','COPY_TTL_OUT')
+ actions = actions.replace('DEC_MPLS_TTL: True','DEC_MPLS_TTL')
+ actions = actions.replace('SET_DL_SRC','SRC_MAC')
+ actions = actions.replace('SET_DL_DST','DST_MAC')
+ actions = actions.replace('SET_NW_SRC','SRC_IP')
+ actions = actions.replace('SET_NW_DST','DST_IP')
+
+ return actions
def check_rest_result(result, message=None):
if isinstance(result, collections.Mapping):
@@ -2247,6 +2262,10 @@
#raise error.ArgumentValidationError('\n\n\n %s' % json.tool(entries))
instructions = ipTableEntry['instructions']
actions = str(instructions[0]) if instructions[0] else None
+ print "actions: ", actions
+ if actions != None:
+ actions = remove_unicodes(actions)
+ actions = renameActions(actions)
actions = remove_unicodes(actions)
combResult.append({
'switch' : ipTableEntry['switch'],
@@ -2271,7 +2290,9 @@
instructions = ipTableEntry['instructions']
#raise error.ArgumentValidationError('\n\n\n %s' %len(actions))
actions = str(instructions[0])if instructions[0] else None
- actions = remove_unicodes(actions)
+ if actions != None:
+ actions = remove_unicodes(actions)
+ actions = renameActions(actions)
combResult.append({
'switch' : ipTableEntry['switch'],
'byteCount' : ipTableEntry['byteCount'],
@@ -2314,7 +2335,9 @@
mplsBos = match.get('mplsBos') if match.get('mplsBos') else '*'
instructions = ipTableEntry['instructions']
actions = str(instructions[0])if instructions[0] else None
- actions = remove_unicodes(actions)
+ if actions != None:
+ actions = remove_unicodes(actions)
+ actions = renameActions(actions)
combResult.append({
'switch' : ipTableEntry['switch'],
'byteCount' : ipTableEntry['byteCount'],
diff --git a/src/main/java/net/floodlightcontroller/core/web/serializers/OFFlowStatsEntryModSerializer.java b/src/main/java/net/floodlightcontroller/core/web/serializers/OFFlowStatsEntryModSerializer.java
index f3bca85..8756c05 100644
--- a/src/main/java/net/floodlightcontroller/core/web/serializers/OFFlowStatsEntryModSerializer.java
+++ b/src/main/java/net/floodlightcontroller/core/web/serializers/OFFlowStatsEntryModSerializer.java
@@ -142,7 +142,7 @@
else{
jGen.writeNumberField("output", ((OFActionOutput)action).getPort().getPortNumber());
}
- }/*
+ }
else if(action.getType().compareTo(OFActionType.POP_MPLS) == 0
|| action.getType().compareTo(OFActionType.COPY_TTL_IN) == 0
|| action.getType().compareTo(OFActionType.COPY_TTL_OUT) == 0
@@ -151,10 +151,10 @@
|| action.getType().compareTo(OFActionType.POP_PBB) == 0
|| action.getType().compareTo(OFActionType.POP_VLAN) == 0){
jGen.writeStringField(action.getType().name(), "True");
- }*/
- else if(action.getType().compareTo(OFActionType.POP_MPLS) == 0){
- jGen.writeStringField("POP_MPLS", ((OFActionPopMpls)action).getEthertype().toString());
}
+ /*else if(action.getType().compareTo(OFActionType.POP_MPLS) == 0){
+ jGen.writeStringField("POP_MPLS", ((OFActionPopMpls)action).getEthertype().toString());
+ }*/
else if (action.getType().equals(OFActionType.SET_FIELD)){
//TODO Support for more setFields
if (((OFActionSetField)action).getField().toString().contains("OFOxmEthSrcVer13")){