aboutsummaryrefslogtreecommitdiff
path: root/lib/ofp-parse.c
AgeCommit message (Collapse)Author
2011-11-09Support matching and modifying IP TTL.Justin Pettit
Add support matching the IPv4 TTL and IPv6 hop limit fields. This commit also adds support for modifying the IPv4 TTL. Modifying the IPv6 hop limit isn't currently supported, since we don't support modifying IPv6 headers. We will likely want to change the user-space interface, since basic matching and setting the TTL are not generally useful. We will probably want the ability to match on extraordinary events (such as TTL of 0 or 1) and a decrement action. Feature #8024 Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-10-28nicira-ext: New action "exit".Ethan Jackson
The exit action causes the switch to immediately halt processing of further actions. It's intended to be used in conjunction with multi table support. It allows a table to force tables which call it to discontinue processing a flow.
2011-10-18ofp-parse: Validate range of table, priority, and timeout values.Ben Pfaff
Otherwise, "table=257" (e.g.) was silently accepted but had a surprising effect. Bug #7445. Reported-by: Michael Mao <mmao@nicira.com>
2011-10-03ofp-parse: Remove write-only variable in parse_ofp_flow_mod_str().Ben Pfaff
2011-09-13Implement new "learn" action.Ben Pfaff
There are a few loose ends here. First, learning actions cause too much flow revalidation. Upcoming commits will fix that problem. The following additional issues have not yet been addressed: * Resource limits: nothing yet limits the maximum number of flows that can be learned. It is possible to exhaust all system memory. * Age reporting: there is no way to find out how soon a learned table entry is due to be evicted. To try this action out, here's a recipe for a very simple-minded MAC learning switch. It uses a 10-second MAC expiration time to make it easier to see what's going on: ovs-vsctl del-controller br0 ovs-ofctl del-flows br0 ovs-ofctl add-flow br0 "table=0 actions=learn(table=1, hard_timeout=10, \ NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \ output:NXM_OF_IN_PORT[]), resubmit(,1)" ovs-ofctl add-flow br0 "table=1 priority=0 actions=flood" You can then dump the MAC learning table with: ovs-ofctl dump-flows br0 table=1
2011-09-13meta-flow: New library for working with fields by id.Ben Pfaff
OVS already has a fairly good set of functions for working with fields that are known at compile time, but support for working with fields that are known only at runtime is fairly limited (and fairly unneeded). However, with NXM identifiers becoming more and more widely used throughout Nicira extensions, it's becoming corresponding more and more common to need to refer to fields at runtime. This new library represents a first attempt at a systematic approach for doing so.
2011-09-13ofp-util: New function for parsing key-value pairs.Ben Pfaff
This will soon have a new user, but it's a worthwhile cleanup on its own.
2011-09-13ofp-util: Add type-safe functions for serializing actions.Ben Pfaff
2011-09-13ofp-parse: Refactor action parsing to improve compiler warnings.Ben Pfaff
When a new action is added, compiler warnings show most of the places that need new code to handle that action. The action parsing code in ofp-parse.c was the one remaining missing case. This commit fixes that.
2011-09-13ofp-util: New functions for parsing and formatting OpenFlow port numbers.Ben Pfaff
These functions were previously used only in ofp-parse.c and ofp-print.c, but they are more generally useful and future commits will add more users.
2011-09-13classifier: Change cls_rule_set_nd_target() to take a pointer.Ben Pfaff
The other cls_rule_*() functions that take IPv6 addresses take a pointer to an in6_addr, so cls_rule_set_nd_target() should as well for consistency. Possibly this is more efficient also, although I guess it doesn't really make much of a difference either way.
2011-08-12nicra-ext: New action NXAST_OUTPUT_REG.Ethan Jackson
The NXAST_OUTPUT_REG action outputs to the OpenFlow port contained in a supplied NXM field.
2011-08-12flow: New FLOW_WC_SEQ build assertion.Ethan Jackson
Changing "struct flow" or its wildcards requires minor adjustments in many places in the code. This patch adds a new FLOW_WC_SEQ sequence number which when incremented will cause build assertion failures aiding the developer in finding code which needs to change.
2011-08-12ofp-parse: Fix parsing of register values 2**31 and greater.Ben Pfaff
Reported-by: Ethan Jackson <ethan@nicira.com>
2011-08-09ofp-util: Rename struct flow_stats_request with ofputil_ prefix.Ben Pfaff
Most of the structs in ofp-util.h have the ofputil_ prefix. Rename this one for consistency.
2011-08-09ofp-util: Rename struct flow_mod to struct ofputil_flow_mod.Ben Pfaff
Most of the structs in ofp-util.h have the ofputil_ prefix. Rename this one for consistency.
2011-08-09New action NXAST_RESUBMIT_TABLE.Ben Pfaff
This makes multiple table support in ofproto-dpif useful, by allowing resubmits into tables other than 0.
2011-07-22bundle: New action "bundle_load".Ethan Jackson
The bundle_load action behaves the same as the bundle action, except instead of outputting, it writes its result to a register.
2011-07-19vswitch: Implement bundle action.Ethan Jackson
This patch creates a new action called "bundle". Bundles are a way to implement a simple form of multipath in OpenFlow by grouping several ports in a single output-like action.
2011-06-28ofp-parse: Fix invalid memory use.Ethan Jackson
In some cases, parsing of the note action could cause a realloc which would result in the use of memory which was no longer allocated.
2011-06-23ovs-ofctl: Accept only valid flow_mod and flow_stats_request fields.Ben Pfaff
OpenFlow commands have several idiosyncratic fields that are used in some cases and ignored in others. Until now, ovs-ofctl has been lax about allowing some of them in places where they are ignored. This commit tightens the checks to exactly what is allowed. Bug #5979. Reported-by: Reid Price <reid@nicira.com>
2011-06-17ovs-ofctl: Print the offending flow on parse error when reading from a file.Andrew Evans
When an error is encountered while parsing flows from a file, ovs-ofctl doesn't print the erroneous flow, so it's not always obvious which flow is causing the error. Print the flow before the error message to make it clear.
2011-06-14ofp-parse: Ignore extra fields produced by dump-flows.Ben Pfaff
It's reasonable to want to dump a flow table with "dump-flows" and then later use that output as input to other commands that read flows, but until now that hasn't been directly possible because "dump-flows" adds extra fields that other commands reject on input. This changes the flow parser to just ignore those extra fields.
2011-06-14ofp-parse: Add support for vlan_tci field.Ben Pfaff
Until now, the flow parser has supported dl_vlan and dl_vlan_pcp but not the fully maskable vlan_tci that NXM allows. This adds that support.
2011-06-09Remove NXAST_DROP_SPOOFED_ARP action.Justin Pettit
The NXAST_DROP_SPOOFED_ARP action has been deprecated in favor of defining flows using the NXM_NX_ARP_SHA flow match for a while. This commit removes it. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-06-07ofp-parse: Add support for dl_dst masks in flow match parsing.Ben Pfaff
This makes it possible to add flows that match on the Ethernet multicast bit with ovs-ofctl. CC: Paul Ingram <paul@nicira.com> CC: Amar Padmanabhan <amar@nicira.com>
2011-06-07ofp-parse: Fix wildcard bits for dl_dst in flow parsing.Ben Pfaff
This fixes a really minor corner case in flow parsing that doesn't make much sense anyway.
2011-05-27ovs-ofctl: Report attempts to add (remove, etc.) non-normalized flows.Ben Pfaff
Commit 0b3f27253 (ovs-ofctl: Warn about flows not in normal form) made ovs-ofctl warn about non-normalized flows, that is, flows some of whose specified fields will be ignored by the switch. This was convenient for users, who are understandably confused by flow normalization. However, later commit 8050b31d6 (ofp-parse: Refactor flow parsing) accidentally deleted the warning. This commit restores it and adds a test to ensure that it doesn't get deleted again later. Reported-by: Reid Price <reid@nicira.com> Bug #5029.
2011-05-12Merge 'master' into 'next'.Ben Pfaff
2011-05-12Implement basic multiple table support.Ben Pfaff
This implements basic multiple table support in ofproto and supporting libraries and utilities. The design is the same as the one that has been on the Open vSwitch "wdp" branch for a long time. There is no support for multiple tables in the software switch implementation (ofproto-dpif), only a set of hooks for other switch implementations to use. To allow controllers to add flows in a particular table, Open vSwitch adds an OpenFlow 1.0 extension called NXT_FLOW_MOD_TABLE_ID.
2011-05-11ofproto: Break apart into generic and hardware-specific parts.Ben Pfaff
In addition to the changes to ofproto, this commit changes all of the instances of "struct flow" in the tree so that the "in_port" member is an OpenFlow port number. Previously, this member was an OpenFlow port number in some cases and an ODP port number in other cases.
2011-04-26Remove support for obsolete "tun_id_from_cookie" extension.Ben Pfaff
The "tun_id_from_cookie" OpenFlow extension predated NXM and supports only a fraction of its features. Nothing (at Nicira, anyway) uses it any longer. Support for it had been broken since January and it took until a few days ago for anyone to complain, so it cannot be too important. This commit removes it.
2011-04-18Fix calls to ctype functions.Ben Pfaff
The ctype functions often need casts to be fully C standards compliant. Here's the full explanation that I used to post to comp.lang.c from time to time when the issue came up: With the to*() and is*() functions, you should be careful to cast `char' arguments to `unsigned char' before calling them. Type `char' may be signed or unsigned, depending on your compiler or its configuration. If `char' is signed, then some characters have negative values; however, the arguments to is*() and to*() functions must be nonnegative (or EOF). Casting to `unsigned char' fixes this problem by forcing the character to the corresponding positive value. This fixes the following warnings from some version of GCC: lib/ofp-parse.c:828: warning: array subscript has type 'char' lib/ofp-print.c:617: warning: array subscript has type 'char' Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2011-04-11autopath: Create the autopath action.Ethan Jackson
The newly created autopath action will be the way OpenFlow interacts with the existing bonding infrastructure.
2011-03-18ofp-parse: Generalize parse_ofp_add_flow_file() to parse_ofp_flow_mod_file().Ben Pfaff
An upcoming commit will want to pass a different command.
2011-03-18ovs-ofctl: New commands "replace-flows" and "diff-flows".Ben Pfaff
Requested-by: Paul Ingram <paul@nicira.com>
2011-03-16dynamic-string: New function ds_get_preprocessed_line().Ben Pfaff
This commit adds one user. It will be useful elsewhere in an upcoming commit.
2011-02-23ofp-parse: Don't segfault when an OpenFlow action's argument is missing.Ben Pfaff
Some actions checked that 'arg' was nonnull before attempting to parse it but a lot of them didn't. This commit avoids the segfault by substituting an empty string when no argument is given. It also updates a few of the action implementations to correspond. Reported-by: Reid Price <reid@nicira.com> Bug #4462. Coverity #10712.
2011-02-02nicira-ext: Support matching IPv6 Neighbor Discovery messages.Justin Pettit
IPv6 uses Neighbor Discovery messages in a similar manner to how IPv4 uses ARP. This commit adds support for matching deeper into the payloads of Neighbor Solicitation (NS) and Neighbor Advertisement (NA) messages. Currently, the matching fields include: - NS and NA Target (nd_target) - NS Source Link Layer Address (nd_sll) - NA Target Link Layer Address (nd_tll) When defining IPv6 Neighbor Discovery rules, the Nicira Extensible Match (NXM) extension to OVS must be used. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-02nicira-ext: Support matching IPv6 traffic.Justin Pettit
Provides ability to match over IPv6 traffic in the same manner as IPv4. Currently, the matching fields include: - IPv6 source and destination addresses (ipv6_src and ipv6_dst) - Traffic Class (nw_tos) - Next Header (nw_proto) - ICMPv6 Type and Code (icmp_type and icmp_code) - TCP and UDP Ports over IPv6 (tp_src and tp_dst) When defining IPv6 rules, the Nicira Extensible Match (NXM) extension to OVS must be used. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-02nicira-ext: Support matching ARP source and target hardware addresses.Justin Pettit
OpenFlow 1.0 doesn't allow matching on the ARP source and target hardware address. This has caused us to introduce hacks such as the Drop Spoofed ARP action. Now that we have extensible match, we can match on more fields within ARP: - Source Hardware Address (arp_sha) - Target Hardware Address (arp_tha) Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-02lib: Replace IP_TYPE_ references with IPPROTO_.Justin Pettit
A few common IP protocol types were defined in "lib/packets.h". However, we already assume the existence of <netinet/in.h> which contains a more exhaustive list and should be available on POSIX systems.
2011-01-20Implement arbitrary bitwise masks for tun_id field.Ben Pfaff
This was documented to work, but not implemented. Requested-by: Pankaj Thakkar <thakkar@nicira.com>
2011-01-02ofp-parse: ofp-parse fails to properly validate DROP.Ethan Jackson
The str_to_action function of ofp-parse was not properly incrementing it's actions counter. Thus it did not enforce the requirement that DROP actions not be preceded by other actions.
2010-12-17Implement a new Nicira extension action for multipath link selection.Ben Pfaff
2010-12-10Expand tunnel IDs from 32 to 64 bits.Ben Pfaff
We have a need to identify tunnels with keys longer than 32 bits. This commit adds basic datapath and OpenFlow support for such keys. It doesn't actually add any tunnel protocols that support 64-bit keys, so this is not very useful yet. The 'arg' member of struct odp_msg had to be expanded to 64-bits also, because it sometimes contains a tunnel ID. This member also contains the argument passed to ODPAT_CONTROLLER, so I expanded that action's argument to 64 bits also so that it can use the full width of the expanded 'arg'. Userspace doesn't take advantage of the new space though (it was only using 16 bits anyhow). This commit has been tested only to the extent that it doesn't disrupt basic Open vSwitch operation. I have not tested it with tunnel traffic. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Feature #3976.
2010-12-09ofp-print, ofp-parse: Add support for NXAST_REG_MOVE and NXAST_REG_LOAD.Ben Pfaff
2010-12-09ovs-ofctl: Fix del-flows command parsing bugs.Ben Pfaff
"ovs-ofctl del-flows br0" segfaulted because do_flow_mod__() assumed that it always had a "flow" argument, which is not true for the del-flows command. Beyond that, parse_ofp_flow_mod_str() rejected "ovs-ofctl del-flows br0" because no actions were supplied, even though supplying actions doesn't make sense for deleting flows. This commit fixes both problems and adds a simple test that would have caught both problems. Bug #4112.
2010-12-07ovs-ofctl: Add NXM support.Ben Pfaff
2010-12-07ofp-parse: Add support for registers.Ben Pfaff
This updates the ovs-ofctl manpage even though ovs-ofctl doesn't really support registers yet.