2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-28 21:07:47 +00:00

163 Commits

Author SHA1 Message Date
Isaku Yamahata
6ae0fd547b lib/ofp-actions: improve ofpact_instruction_name_from_type()
eliminate unnecessary loop.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-28 11:02:10 -07:00
Ethan Jackson
9ff262f435 ofp-actions: Correct copyright statement.
This patch changes the name of Nicira from "Nicira Networks" which
is incorrect, to "Nicira, Inc." which is correct.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-08-21 13:30:01 -07:00
Mehak Mahajan
c2d967a562 Add Nicira vendor extension action NXAST_DEC_TTL_CNT_IDS.
Currently, if a controller having a nonzero id registers to get a
OFPR_INVALID_TTL async message, it will not receive it.  This is because
compose_dec_ttl() only sent the invalid ttl packets to the default controller
id.  NXAST_DEC_TTL_CNT_IDS is a new action that accepts a list of controller
ids, each separated by `,', to which the OFPR_INVALID_TTL packets must be sent.
The earlier requirement of the controller having to explicitly register to
receive these asynchronous messages is retained.
The syntax of this action is:
    dec_ttl(id1,id2)
where id1, id2 are valid controller ids.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-08-16 14:52:04 -07:00
Isaku Yamahata
a359d5ad70 ofp-actions/instruction: helper functions for intructions
This patch introduces helper functions
- to cast
- to convert from/to text

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-14 09:58:18 -07:00
Isaku Yamahata
a64f0b0fcd ofp-actions: export OVSINST_OFPIT11_xxx
They will be used by ofp-parser.c.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-14 09:58:11 -07:00
Simon Horman
a07c15bc39 ofp-actions: Return action size
Modify ofpacts_put_openflow11_actions() to return the length of actions
appended. This will be used when encoding Packet Out messages for
Open Flow 1.1 and 1.2. The motivation for this is to avoid open coding
the size calculation which may end up being needed elsewhere too.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-08 16:27:09 -07:00
Isaku Yamahata
0300caafc5 ofp-actions: simplify ofpacts_from_openflow1[01]
Those logic is same, so simplify it. This will be also use for OF12.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-18 09:07:27 -07:00
Ben Pfaff
699dddf180 ofp-actions: Improve action error logging a bit more.
Commit 0c449c5683a improved action error logging for one case, but we might
as well do it for the other case too.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-17 21:15:40 -07:00
Ethan Jackson
1ec3db6fd8 ofproto: Fix compiler warnings.
This patch fixes the following warnings on my system:

lib/ofp-actions.c:458:13: error: format '%x' expects argument of
type 'unsigned int', but argument 4 has type 'long unsigned int'
[-Werror=format]

ofproto/ofproto.c:3940:13: error: comparison between 'enum
ofoperation_type' and 'enum nx_flow_update_event'
[-Werror=enum-compare]

ofproto/ofproto.c:3941:13: error: comparison between 'enum
ofoperation_type' and 'enum nx_flow_update_event'
[-Werror=enum-compare]

ofproto/ofproto.c:3942:13: error: comparison between 'enum
ofoperation_type' and 'enum nx_flow_update_event'
[-Werror=enum-compare]

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-17 09:47:14 -07:00
Ben Pfaff
13f894b1f0 ofp-actions: Improve comments.
Reported-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-16 14:46:22 -07:00
Ben Pfaff
0c449c5683 ofp-actions: Add hex dump of bad actions to log message on error.
This should make debugging easier in such cases.

Bug #12460.
Reported-by: Natasha Gude <natasha@nicira.com>
Reported-by: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-11 01:05:09 -07:00
Ben Pfaff
d01c980ffe ofp-actions: Add decoding and encoding OF1.1 instructions and actions.
So far, only the Apply-Actions instruction is supported, and only
actions that have identical semantics to OpenFlow 1.0 actions.

Co-authored-by: Simon Horman <horms@verge.net.au>
Co-authored-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-03 22:21:12 -07:00
Ben Pfaff
f25d0cf3c3 Introduce ofpacts, an abstraction of OpenFlow actions.
OpenFlow actions have always been somewhat awkward to handle.
Moreover, over time we've started creating actions that require more
complicated parsing.  When we maintain those actions internally in
their wire format, we end up parsing them multiple times, whenever
we have to look at the set of actions.

When we add support for OpenFlow 1.1 or later protocols, the situation
will get worse, because these newer protocols support many of the same
actions but with different representations.  It becomes unrealistic to
handle each protocol in its wire format.

This commit adopts a new strategy, by converting OpenFlow actions into
an internal form from the wire format when they are read, and converting
them back to the wire format when flows are dumped.  I believe that this
will be more maintainable over time.

Thanks to Simon Horman and Pravin Shelar for reviews.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-03 22:21:11 -07:00