OpenBSD CVS

CVS log for src/usr.sbin/switchd/Attic/ofp10.c


[BACK] Up to [local] / src / usr.sbin / switchd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.22, Thu Nov 11 09:59:19 2021 UTC (2 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: HEAD
Changes since 1.21: +1 -1 lines
FILE REMOVED

Retire switchd and switchctl. While interesting they never managed to
really get into a usable state. The OpenFlow API is mostly superseeded
by P4 and so this is a bit of a dead end.
OK akoshibe@ yasuoka@ deraadt@ kn@ patrick@ sthen@

Revision 1.21 / (download) - annotate - [select for diffs], Sun May 5 21:33:00 2019 UTC (5 years, 1 month ago) by akoshibe
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.20: +9 -4 lines
Diff to previous 1.20 (colored)

switchd(8) will sometimes not save a copy of a packet needing forwarding
even when a switch(4) instance requires it to supply it. Cases where this
can happen are: if the copy of the packet recieved from the switch is too
short (source/destination pairs can't be recovered), is non-unicast, or
when switchd has to fall back to flooding traffic.

Factor out the check for short packets, stopping before forwarding
decisions are made if the full packet is needed by the switch. Set the
packet buffer early for cases where it is needed otherwise.

Also replace a few bzero's with memset's.

Diff based on one by guenther@
OK phessler@

Revision 1.20 / (download) - annotate - [select for diffs], Sun Sep 9 14:21:32 2018 UTC (5 years, 9 months ago) by akoshibe
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.19: +3 -2 lines
Diff to previous 1.19 (colored)

Make switchd(8) ignore PACKET_INs generated from looped traffic. Currently,
it responds to these messages with an invalid PACKET_OUT onto OFP*_PORT_ANY,
resulting in the switch responding with an error, causing switchd to
disconnect the switch.

OK phessler@ claudio@

Revision 1.19 / (download) - annotate - [select for diffs], Fri Dec 2 14:39:46 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.18: +4 -12 lines
Diff to previous 1.18 (colored)

Implement the connection state machine for OpenFlow 1.0 and 1.3 to detect
invalid state transitions and invalid protocol version switching after the
hello messages exchange.

ok reyk@

Revision 1.18 / (download) - annotate - [select for diffs], Tue Nov 22 22:05:20 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.17: +66 -13 lines
Diff to previous 1.17 (colored)

Add "features request" support and reply validation.

ok reyk@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Nov 22 17:21:56 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.16: +3 -8 lines
Diff to previous 1.16 (colored)

Implement support for version negotiation using hello messages. This
also prevents connections from switching the version in the middle of
the operation.

tweak from and ok reyk@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Nov 21 18:19:51 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.15: +5 -5 lines
Diff to previous 1.15 (colored)

Fix jumbo regress test for ofp10.c and use htonl() with OFP_PKTOUT_NO_BUFFER
for consistency.

ok reyk@

Revision 1.15 / (download) - annotate - [select for diffs], Fri Nov 18 20:20:19 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.14: +6 -5 lines
Diff to previous 1.14 (colored)

The special LOCAL and CONTROLLER ports are valid source ports that
should be learned by the cache.	 Fixes "addlocal" ports on switch(4).

OK rzalamena@

Revision 1.14 / (download) - annotate - [select for diffs], Thu Nov 17 16:24:00 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.13: +3 -2 lines
Diff to previous 1.13 (colored)

Fix some styles issues: break big lines and remove some useless spaces.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Nov 11 22:07:40 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.12: +1 -35 lines
Diff to previous 1.12 (colored)

Move ofp_validate_header() into ofp_common.c.  No functional change.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Oct 5 15:42:28 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.11: +35 -1 lines
Diff to previous 1.11 (colored)

Move ofp_validate_header() to ofp10.c until we have a better place

Revision 1.11 / (download) - annotate - [select for diffs], Fri Sep 30 12:48:27 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.10: +3 -2 lines
Diff to previous 1.10 (colored)

Remove local copy of ofp.h and use net/ofp.h instead

Revision 1.10 / (download) - annotate - [select for diffs], Fri Sep 30 11:57:57 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.9: +1 -2 lines
Diff to previous 1.9 (colored)

Implement socket server code that properly handles async I/O, partial
messages, multiple messages per buffer and important things like
connection limits and file descriptor accounting.  It works with TCP
connections as well as switch(4).  The ofrelay.c part replaces
networking that was in ofp.c and will soon handle all socket
connections of switchd.  It is called "ofrelay" because it will be
used as client, server, and forwarder.

OK rzalamena@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Sep 29 18:25:54 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.8: +4 -4 lines
Diff to previous 1.8 (colored)

Rename ofp_send to ofp_output

Revision 1.8 / (download) - annotate - [select for diffs], Tue Sep 27 22:27:38 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.7: +13 -6 lines
Diff to previous 1.7 (colored)

Fix previous: don't attempt to write a NULL packet to the tap device.
Also print a debug message if the packet has been truncated by the switch.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Sep 27 19:40:43 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.6: +8 -3 lines
Diff to previous 1.6 (colored)

OpenFlow PACKET_IN can send truncated packets; this only makes sense
if the switch buffers packets, otherwise we might end up forwarding
truncated packets to the network with the PACKET_OUT response.  So,
for now, only close the connection if the packet is not buffered by
the switch but truncated.

OK rzalamena@

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jul 21 08:40:14 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

long to uint32_t port

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jul 21 08:39:23 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

With uint32_t ports, we cannot sneak the port into an int anymore

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jul 21 07:58:44 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.3: +41 -54 lines
Diff to previous 1.3 (colored)

Turn ofp*_debug functions into ofp*_validate functions to follow a
similar approach like iked: first validate the packet, then parse it,
and execute actions.  debug logging is a side effect of validation.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jul 20 14:15:08 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.2: +4 -1 lines
Diff to previous 1.2 (colored)

Update OpenFlow 1.3 stub based on the 1.0 code.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jul 19 18:11:08 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

Correctly use ssize_t instead of size_t for read/write return values.
Pointed out by David Hill and clang.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jul 19 16:54:26 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN

Import switchd(8), a basic WIP OpenFlow implementation for OpenBSD.

switchd consists of two parts:
1. switchd(8) and switchctl(8), an OpenFlow controller or "vswitch".
2. switch(4), an OpenFlow-aware kernel "bridge".

This the 1st part, the driver will be imported later.  The code will
remain disabled for a while, but it helps development to have it in
the tree.  switchd currently supports partial OpenFlow 1.0, but the
goal is to use OpenFlow 1.3.5 instead (switch(4) already does 1.3.5).

For more background information see:
http://www.openbsd.org/papers/bsdcan2016-switchd.pdf
https://youtu.be/Cuo0qT-lqig

With help from yasuoka@ goda@
Import discussed with deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.