OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.21, Thu Nov 11 09:59:19 2021 UTC (2 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: HEAD
Changes since 1.20: +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.20 / (download) - annotate - [select for diffs], Mon Sep 6 13:32:18 2021 UTC (2 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

repair missing paths on unveil failure

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jan 27 07:21:54 2021 UTC (3 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.18: +3 -1 lines
Diff to previous 1.18 (colored)

these programs (with common ancestry) had a -fno-common problem related
to privsep_procid.
ok mortimer

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jul 23 00:31:31 2019 UTC (4 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

delete a stray blank from the usage() message; reported by Jesper Wallin

Revision 1.17 / (download) - annotate - [select for diffs], Mon Jul 22 09:19:52 2019 UTC (4 years, 10 months ago) by mestre
Branch: MAIN
Changes since 1.16: +5 -1 lines
Diff to previous 1.16 (colored)

switchd(8)'s main proc needs to open the following paths, and which can be
unveiled:

/ -> read, it will open config files from anywhere in the system
/dev -> read/write, in order to open /dev/tap* and /dev/switch*

hint and OK akoshibe@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Sep 10 13:21:39 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.15: +2 -2 lines
Diff to previous 1.15 (colored)

Mirror bluhm's fixes for proc.c daemons to dup /dev/null for child processes
in switchd(8).

OK henning@ bluhm@

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jan 9 14:49:22 2017 UTC (7 years, 5 months ago) by reyk
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.14: +2 -2 lines
Diff to previous 1.14 (colored)

Stop accessing verbose and debug variables from log.c directly.

This replaces log_verbose() and "extern int verbose" with the two functions
log_setverbose() and log_getverbose().

Pointed out by benno@
OK krw@ eric@ gilles@ (OK gilles@ for the snmpd bits as well)

Revision 1.14 / (download) - annotate - [select for diffs], Wed Oct 12 19:07:42 2016 UTC (7 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.13: +170 -78 lines
Diff to previous 1.13 (colored)

Start reworking the "device" support in switchd: Once connected, a
device is just an fd that is connected to a switch, either via TCP or
via /dev/switch.  Change the switchctl from "device add" to "connect"
etc.  This change is an intermediate step towards other changes,
including the configuration grammar, so a few things will be left
undocumented for now.

switchctl(8) examples,
switchctl connect /dev/switch0
switchctl connect /dev/switch0 forward-to 10.1.1.1
switchctl connect 127.0.0.1
switchctl connect 127.0.0.1 forward-to 10.1.1.1
switchctl disconnect /dev/switch0

Discussed with rzalamena@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Sep 30 12:32:31 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.12: +12 -6 lines
Diff to previous 1.12 (colored)

Open next available tap(4) device instead of just tap0

Revision 1.12 / (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.11: +47 -13 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Sun Sep 25 23:05:29 2016 UTC (7 years, 8 months ago) by jsg
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

Correct the flag listing for switchd(8) and add a files section for the
configuration file.  Sync usage() with the result.

With feedback from and ok jmc@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Sep 20 16:45:09 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

Unbreak logging for children process in switchd(8). log_init/verbose()
must be called before proc_init() otherwise child process won't have this
configured.

ok reyk@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Sep 15 15:52:22 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.8: +3 -45 lines
Diff to previous 1.8 (colored)

Teach switchd(8) how to shutdown using close() instead of kill().

This commit mostly removes the parent SIGCHLD handler, the rest of the
code is already in proc.c.

ok reyk@

Revision 1.8 / (download) - annotate - [select for diffs], Wed Sep 14 13:46:51 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.7: +24 -5 lines
Diff to previous 1.7 (colored)

Teach switchd(8) how to fork+exec.

Note: this daemon has the -Wcast-qual compilation flag which trigger a
warning that wasn't enable in httpd(8) or relayd(8). This will be fixed
in a next diff and then synchronized with other daemons.

ok reyk@

Revision 1.7 / (download) - annotate - [select for diffs], Mon Aug 8 16:52:15 2016 UTC (7 years, 10 months ago) by rzalamena
Branch: MAIN
Changes since 1.6: +3 -4 lines
Diff to previous 1.6 (colored)

Create socket with SOCK_NONBLOCK instead of using fcntl() without the
proper flag handling.

ok reyk@

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jul 22 09:31:33 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.5: +3 -2 lines
Diff to previous 1.5 (colored)

"wpath" is needed in the parent pledge when using the /dev/switch0 device.

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

pledge(2) all the switchd processes.

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jul 20 11:43:31 2016 UTC (7 years, 10 months ago) by jsg
Branch: MAIN
Changes since 1.3: +15 -3 lines
Diff to previous 1.3 (colored)

Add a -n flag to check the configuration and exit.  Matches what almost
all the other daemons do.

ok reyk@

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

L2 tun is tap now

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

Don't use .p_shutdown in the proc struct

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.