Commit Graph
89 Commits
Author SHA1 Message Date
Ben Pfaff 6b617bac12 Move exported headers to include/openflow, private headers to lib/.
This makes it easier to install the headers, or to use them directly from
another software package with -I$(openflow)/include, without invading
the top-level include file namespace.
2008-10-29 15:15:45 -07:00
Justin Pettit b969b51164 Fix leaking of flows when output action validation fails.
Thanks to Brandon Heller for catching this.
2008-10-25 13:29:17 -07:00
Ben Pfaff a948b96315 New routine ofpbuf_put_zeros() to simplify a common code sequence. 2008-10-14 13:31:09 -07:00
Ben Pfaff 4a4424a739 Support up to 0xff00 ports in OpenFlow, without changing the implemented max. 2008-10-14 10:53:27 -07:00
Justin Pettit 26819fe177 Remove unnecessary check for validity when dereferencing an array.
Thanks to Masa et al. for pointing this out.
2008-10-13 23:45:29 -07:00
Justin Pettit a835cab0ea Return error message when a flow can't be added due to full tables.
When a flow cannot be added to any tables because they are full, send
a message with type OFPET_FLOW_MOD_FAILED and code OFPFMFC_ALL_TABLES_FULL.
2008-10-13 17:49:45 -07:00
Justin Pettit 1489ca2657 Add support for vendor-defined and variable-length actions.
Allow vendors to define their own actions.  Actions were originally fixed-
length, which was a bit constraining.  Actions now contain a length field,
which gives them more flexibility.
2008-10-03 16:44:13 -07:00
Justin Pettit 06e22ff0fe Modify VLAN actions to support setting both VID and priority.
Stripping VLANs is now done through the OFPAT_STRIP_VLAN action (i.e., you
don't specify a magic value in the generirc VLAN action).  Also, it is now
possible to modify the priority bits associated with the VLAN tag through
the OFPAT_SET_VLAN_PCP action.  The OFPAT_SET_DL_VLAN has been renamed to
OFPAT_SET_VLAN_VID.
2008-09-25 15:00:38 -07:00
Justin Pettit 9da88ee2ad Modify OpenFlow commands related to ports to be more expressive.
This new OpenFlow message format provides a cleaner interface and greater
detail and control over ports.  It is now possible to see what features
the switch's port is currently configured as having, what it's advertising,
and what it's capable of handling.  It is also possible to return the
features advertised by the port's peer.
2008-09-22 15:18:22 -07:00
Justin Pettit 034f125955 Added lookup count to ofp_table_stats. 2008-09-18 19:47:27 -07:00
Justin Pettit e4cf5c4b82 Added OFPFC_MODIFY_STRICT flow mod command.
This cleans up the handling of modifying existing flows.  There now exists
OFPFC_MODIFY and OFPFC_MODIFY_STRICT commands, which have the same matching
characteristics to their OFPFC_DELETE* counterparts.  When adding a flow that
already exists, the counters and timers are now reset (ie, its treated as a
new flow).  This commit also adds the "--strict" option to dpctl to allow
strict matching for "mod-flows" and "del-flows".
2008-09-16 16:07:41 -07:00
Ben Pfaff b7d8bab74d Merge commit 'origin/master'
Conflicts:

	switch/datapath.c
	utilities/dpctl.c
2008-09-15 15:43:44 -07:00
Ben Pfaff f593e3ab70 Merge branch "partner", to simplify partner integration. 2008-09-15 15:31:36 -07:00
Justin Pettit 57d5205765 Add support for OFPFC_MODIFY Flow Mod command.
The OFPFC_MODIFY command allows the controller to modify the actions of
existing flows.  When it does this, it does not reset counters or timers.
2008-09-15 15:27:04 -07:00
Ben Pfaff 9c1b16772c Implement OFPT_HELLO simple version negotiation. 2008-09-15 14:29:53 -07:00
Ben Pfaff 553dfa572d Break passive vconns out into separate pvconn routines and data structures.
There really was nothing in common between the active and passive vconns.
This arrangement makes more sense.
2008-09-15 14:29:53 -07:00
Ben Pfaff 39136b0fb9 Make switches send error messages when they receive a bad request. 2008-09-10 13:22:25 -07:00
Justin Pettit 176265ed07 Use new method to describe table entries in OpenFlow wire protocol.
Older versions of OpenFlow pre-defined a few different types of tables and the
Features Reply message would indicate how many of those entries existed.  This
was very inflexible, so now the Features Reply just indicates how many tables
there are.  The controller now sends a Table Stats request to find out how
many entries are supported and the fields that can be wildcarded.

This change also removes the "buffer_mb" field from the Features Reply, since
it was not being used and seemed to be of limited value.
2008-09-10 13:03:25 -07:00
Ben Pfaff b5e9402df5 Implement 802.1D Spanning Tree Protocol. 2008-09-09 14:15:57 -07:00
Ben Pfaff a3d01200b1 In userspace switch, don't truncate packets to 0 bytes with max_len of 0.
From partner.
2008-09-04 13:53:27 -07:00
Ben Pfaff 95204b0bf0 Don't use designated array initializers in code compiled outside of Linux.
Needed for partner builds.
2008-09-04 13:53:27 -07:00
Ben Pfaff eda1328578 Avoid pointer arithmetic on void*.
This is a GCC extension not supported by other compilers.
2008-09-04 13:53:26 -07:00
Ben Pfaff 5549180a54 Rename struct buffer to struct ofpbuf.
Fixes namespace conflict for partner development.
2008-09-04 13:53:26 -07:00
Ben Pfaff 4870c3cc79 Simplify code by using rconn_send_with_limit() helper function. 2008-09-04 09:48:27 -07:00
Ben Pfaff 2137c4a80e Initialize otherwise uninitialized variable.
Found by valgrind.
2008-09-04 09:47:33 -07:00
Justin Pettit 7d7d973d8b Add serial number to description status message. 2008-09-03 17:51:42 -07:00
Ben Pfaff ab43666b20 vlog: Apply rate-limiting everywhere it seems warranted. 2008-08-26 13:25:21 -07:00
Justin Pettit f1c6daebf3 Send PORT_STATUS messages on port and link changes. Add ability to remotely enable and disable a port through the PORT_MOD message. 2008-08-22 12:47:54 -07:00
Ben Pfaff 9630e41005 Implement subnet mask matching in OpenFlow. 2008-08-18 14:26:50 -07:00
Justin Pettit d6a1e67a8d Add stats message that allows querying description of components in OpenFlow. 2008-08-16 09:43:05 -07:00
Justin Pettit b41a6a0a6d Added new interface statistics. 2008-08-14 23:12:37 -07:00
Justin Pettit 0226bbc742 Switch to new packet-out format and add OFPP_IN_PORT.
The original packet-out format allowed multiple actions to be specified for
buffered packets, but only a destination port for messages including data.
This change makes packet-out more consistent by allowing multiple actions
regardless of how the packet is stored.

This change also disallows sending packets through the incoming port without
explicitly using the OFPP_IN_PORT virtual port.
2008-08-14 00:07:18 -07:00
Ben Pfaff 903d0940fb Drop rconn's responsibility for limiting the tx queue.
Now it helps clients track the number of in-flight messages, but lets the
clients do the limiting themselves.  This will come in handy for packet-in
rate limiting (in an upcoming commit), in which we want to track in-flight
packet-in messages separately from other in-flight messages.
2008-08-12 15:21:30 -07:00
Ben Pfaff b3b28afb7b Use signal-based timekeeping functions throughout the source base. 2008-08-12 15:21:30 -07:00
Ben Pfaff 7bee00fad9 Implement OpenFlow hard timeouts.
This updates the OpenFlow protocol version and changes the names of
structure members, so any software that uses OpenFlow will need to be
updated to match.
2008-08-07 15:19:31 -07:00
Ben Pfaff 7462f2e8bd Fix bug in clearing unsupported switch flags.
We need to keep the flags we support, not drop them.
2008-08-07 13:29:10 -07:00
Ben Pfaff 8effb451eb Don't allow unsupported flags to be set in the switch. 2008-08-07 10:34:37 -07:00
Ben Pfaff eca2aeb329 Implement OFPC_FRAG_DROP fragment handling policy. 2008-08-07 10:34:37 -07:00
Ben Pfaff 2a6dc4f319 Reduce redundancy in datapath code. 2008-08-07 10:34:37 -07:00
Ben Pfaff 844a4678aa Maintain userspace switch configuration in host byte order.
This makes it easier to work with and makes the code more like the
kernel switch.
2008-08-07 10:23:06 -07:00
Ben Pfaff 6ca5840e48 Fix memory leak when OFPP_TABLE is used for a packet that matches no flow. 2008-08-07 10:23:06 -07:00
Justin Pettit 5caaf64f20 Properly track table match counts. 2008-08-06 01:58:15 -07:00
Ben Pfaff 17778ffd72 Verify OpenFlow version number in vconn_recv(). 2008-07-23 17:04:15 -07:00
Ben Pfaff 4d90ee6aef vconn: Add utility functions make_openflow() and update_openflow_length().
Use these functions to simplify code that creates and sends
OpenFlow packets.
2008-07-18 14:08:18 -07:00
Ben Pfaff 2afec34627 netdev: Add ability to permanently set device flags. 2008-07-18 13:55:12 -07:00
Ben Pfaff e55d52c988 netdev: Add argument to netdev_open() to specify Ethernet type to capture.
This is needed by the controller, which wants to listen only for
OpenFlow discovery BPDUs on its network devices.

Also, update all existing callers.
2008-07-18 13:42:38 -07:00
Ben Pfaff 7470a21307 packets: Move IP checksum functionality into new csum.c, csum.h. 2008-07-18 13:42:38 -07:00
Ben Pfaff a304614f57 Prevent switch implementations from complaining about echo-reply messages.
Thanks to Reid Price <reid@nicira.com> for reporting the issue (which
only caused spurious warning messages).
2008-07-15 12:43:59 -07:00
Ben Pfaff 258f32a084 Respond to echo requests in OpenFlow implementations.
Nothing yet sends such requests.  This is preparation for their
use in following commits.
2008-07-01 10:51:50 -07:00
Ben Pfaff 7225d06a78 Add utility functions for generating random numbers, and use where appropriate. 2008-07-01 10:51:47 -07:00