aboutsummaryrefslogtreecommitdiff
path: root/lib/ofp-parse.c
diff options
context:
space:
mode:
authorAndy Zhou <azhou@nicira.com>2013-03-05 16:27:55 -0800
committerBen Pfaff <blp@nicira.com>2013-03-06 13:40:28 -0800
commitbd85dac14ed7fa42d5804592fd4e903826d9e899 (patch)
tree958da5acb0c2bfdf435846965a52d82f4155c064 /lib/ofp-parse.c
parent9a9e3786b3a8065723887ab009aedb7f6d2667aa (diff)
nicira-ext: Add Nicira actions NXAST_STACK_PUSH and NXAST_STACK_POP.
The Push action takes a single parameter. Any source allowed by NXAST_REG_MOVE is allowed to be pushed onto the stack. When the source is a bit field, its value will be right shifted to bit zero before being pushed onto the stack. The remaining bits will be set to zero. The Pop action also takes a single parameter. Any destination allowed by NXAST_REG_MOVE can be used as the destination of the action. The value, in case of a bit field, will be taken from top of the stack, starting from bit zero. The stack size is not limited. The initial 8KB is statically allocated to efficiently handle most common use cases. When more stack space is required, the stack can grow using malloc(). Signed-off-by: Andy Zhou <azhou@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ofp-parse.c')
-rw-r--r--lib/ofp-parse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index f1802048..e8abc9f6 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -591,6 +591,12 @@ parse_named_action(enum ofputil_action_code code, const struct flow *flow,
ofpact_put_POP_MPLS(ofpacts)->ethertype =
htons(str_to_u16(arg, "pop_mpls"));
break;
+ case OFPUTIL_NXAST_STACK_PUSH:
+ nxm_parse_stack_action(ofpact_put_STACK_PUSH(ofpacts), arg);
+ break;
+ case OFPUTIL_NXAST_STACK_POP:
+ nxm_parse_stack_action(ofpact_put_STACK_POP(ofpacts), arg);
+ break;
}
}