summaryrefslogtreecommitdiff
path: root/usr.sbin/switchd
AgeCommit message (Collapse)Author
2016-10-13Implement simple feature request/reply support so we can get moreRafael Zalamena
information about the target switch and its datapath id. Also I commented out some requests that are not currently being used, like table properties, flow dump and description. ok reyk@
2016-10-12Start reworking the "device" support in switchd: Once connected, aReyk Floeter
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@
2016-10-12Teach switchd(8) how to send set_config to the switch so we can be ableRafael Zalamena
to get packet payloads from switch(4). ok reyk@
2016-10-12copy updated log.c from vmd: for correctness, save errno when doingReyk Floeter
additional actions before printing it. OK rzalamena@
2016-10-11Sync proc.c file vmd(8) and switchd(8).Rafael Zalamena
New changes: * Fix msgbuf_write() usage idiom; * Add context (function name) that fatal()ed; * Use less fds on startup; ok mlarkin@, reyk@
2016-10-07Move some shared code into a new file.Reyk Floeter
Discussed with rzalamena@
2016-10-07Add support for multipart replies and implement a simple ofp 1.3.5 errorRafael Zalamena
message sending function. ok reyk@
2016-10-06Switch switchd to the _switchd user.Reyk Floeter
2016-10-05Sync with httpd(8) proc file. Check for dup2() usage to avoid oldd == newdRafael Zalamena
and remove the CLOEXEC with fcntl() if necessary. ok reyk@
2016-10-05Call setsid() to create a new session for the executed processes.Reyk Floeter
From deraadt@ OK rzalamena@
2016-10-05sync proc.c with vmd: add p_pw to specify a non-standard user for a process.Reyk Floeter
OK rzalamena@
2016-10-05Remove ofp_validate_header() hereReyk Floeter
2016-10-05Move ofp_validate_header() to ofp10.c until we have a better placeReyk Floeter
2016-10-05I added a second buffer as fix for the fact that /dev/switch doesn'tReyk Floeter
act like a socket. Unfortunately, this broke handling of jumbo buffers in the adjusted version of ofrelay. Don't abort the connection until there is no more data to read or the connection has been closed. Problem out by rzalamena@
2016-10-05More debuggingReyk Floeter
2016-09-30Remove local copy of ofp.h and use net/ofp.h insteadReyk Floeter
2016-09-30Disable write events if there is nothing to write.Reyk Floeter
2016-09-30Open next available tap(4) device instead of just tap0Reyk Floeter
2016-09-30Implement socket server code that properly handles async I/O, partialReyk Floeter
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@
2016-09-29Add print_hex() for debugging of received packets (from iked)Reyk Floeter
2016-09-29Rename ofp_send to ofp_outputReyk Floeter
2016-09-29Teach switchd(8) how to request flow entries and how to validate theRafael Zalamena
request/reply. With this we get the OXM type/value printing for all directions.
2016-09-29handle AF_UNIX sockaddrsReyk Floeter
2016-09-29Replace memset in ibuf_zero with explicit_bzero as done in iked.Reyk Floeter
2016-09-29Use the macro OFP_ALIGN() to find alignment instead of rolling my own way.Rafael Zalamena
ok reyk@
2016-09-29Teach switchd(8) how to ask for and debug equipment descriptionRafael Zalamena
requests / replies.
2016-09-29Teach switchd(8) some multipart table properties request/parse code toRafael Zalamena
handle basic display.
2016-09-28Use the packed attribute for every structure that is used in the wireRafael Zalamena
messages. ok reyk@
2016-09-28Always ask the switch to send the whole packet unbuffered so we canRafael Zalamena
analyze the content of the packet and not truncate it when sending packet_out. ok reyk@
2016-09-27Fix previous: don't attempt to write a NULL packet to the tap device.Reyk Floeter
Also print a debug message if the packet has been truncated by the switch.
2016-09-27OpenFlow PACKET_IN can send truncated packets; this only makes senseReyk Floeter
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@
2016-09-26Teach switchd(8) how to create flows for new connections using OpenFlowRafael Zalamena
1.3.5, implement the OXM filters to use with flow matching and Set-Action, prepare code to receive group management and add dummy flow_removed handler to avoid closing the connection on idle flows.
2016-09-26Set pkt_buf variable on incoming packet_in messages.Rafael Zalamena
small style correction and ok reyk@
2016-09-26Fix a memory leak and a loop in the ofp_read() that happens every time aRafael Zalamena
message is received or a socket is closed. This is just a temporary fix to avoid switchd(8) from hogging the cpu and leaking memory while testing. ok reyk@
2016-09-26Enable more debug messages to help developing flow modification messages.Rafael Zalamena
ok reyk@
2016-09-25Correct the flag listing for switchd(8) and add a files section for theJonathan Gray
configuration file. Sync usage() with the result. With feedback from and ok jmc@
2016-09-23It is ok to call free() on NULL pointers.Rafael Zalamena
ok reyk@
2016-09-20Unbreak logging for children process in switchd(8). log_init/verbose()Rafael Zalamena
must be called before proc_init() otherwise child process won't have this configured. ok reyk@
2016-09-19Fix 'const char *' qualifier removal warning by casting it out withRafael Zalamena
uintptr_t. It is safe here to pass a 'const' to exec*(). improved by and ok millert@
2016-09-18Kill p_env from proc.c. The p_env variable was not being used seriously andRafael Zalamena
it was always a copy of ps->ps_env. You might access the env variable now with: p->p_ps->ps_env. ok reyk@
2016-09-15Teach switchd(8) how to shutdown using close() instead of kill().Rafael Zalamena
This commit mostly removes the parent SIGCHLD handler, the rest of the code is already in proc.c. ok reyk@
2016-09-14Teach switchd(8) how to fork+exec.Rafael Zalamena
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@
2016-08-30does not need sys/param.hTheo de Raadt
2016-08-25goda@ contributed most of the OpenFlow 1.3.5 parts in ofp.h (for theReyk Floeter
"still-unreleased" switch(4) driver), so it is only fair to add his copyright. This header file will eventually move to net/ofp.h.
2016-08-08Create socket with SOCK_NONBLOCK instead of using fcntl() without theRafael Zalamena
proper flag handling. ok reyk@
2016-08-08Handle imsg_read() EAGAIN like the man page code example.Rafael Zalamena
ok reyk@
2016-08-08Fix previous. Obvously the condition is reversed.YASUOKA Masahiko
2016-08-08Split ofcconn into switch part and connection part to make the switchYASUOKA Masahiko
part be able to have multiple connections. ok reyk.
2016-07-22"wpath" is needed in the parent pledge when using the /dev/switch0 device.Reyk Floeter
2016-07-21Add basic support for OpenFlow 1.3 PACKET_IN+PACKET_OUT,Reyk Floeter
no FLOW_MOD yet.