summaryrefslogtreecommitdiffstats
path: root/usr.sbin/switchd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add "features request" support and reply validation.rzalamena2016-11-221-13/+66
| | | | ok reyk@
* Implement support for version negotiation using hello messages. Thisrzalamena2016-11-225-19/+200
| | | | | | | also prevents connections from switching the version in the middle of the operation. tweak from and ok reyk@
* Do more strict checks of OXM by looking at mask restrictions and addrzalamena2016-11-211-7/+48
| | | | | | missing OXM type (IP_PROTO). ok reyk@
* Add truncation validation for packet-out and reuse the action validationrzalamena2016-11-211-31/+36
| | | | | | function instead of manually rolling the code again. ok reyk@
* Fix jumbo regress test for ofp10.c and use htonl() with OFP_PKTOUT_NO_BUFFERrzalamena2016-11-212-8/+8
| | | | | | for consistency. ok reyk@
* Implement better table features validation. With this we get free switchctlrzalamena2016-11-211-18/+161
| | | | | | display of table features. ok reyk@
* Parse flow-status instructions in multipart replies, so we can see whatrzalamena2016-11-211-3/+25
| | | | instructions are used by the flow.
* The special LOCAL and CONTROLLER ports are valid source ports thatreyk2016-11-182-10/+12
| | | | | | should be learned by the cache. Fixes "addlocal" ports on switch(4). OK rzalamena@
* Make switchd(8) use more strings just like tcpdump(8). While here removerzalamena2016-11-181-73/+67
| | | | action field display from features request.
* Define a group_id map and rename the defines accordingly.reyk2016-11-182-3/+4
| | | | Requested by rzalamena@
* Define constmap in ofp_map.h to be shared along with ofp_map.creyk2016-11-184-16/+12
|
* Remove leading _ from include guards as this violates the reserved space.reyk2016-11-183-12/+12
|
* Add more maps to print. As discussed with rzalamena@reyk2016-11-181-1/+6
|
* Exclude the description field from the generated maps by default.reyk2016-11-181-5/+18
|
* Small code improvements:rzalamena2016-11-181-35/+47
| | | | | | | - Free ibufs on validation failures; - Don't use htons() for flow-mod command; ok reyk@
* Fix the flowmod header to send the correct command and buffer id.reyk2016-11-181-1/+7
| | | | OK rzalamena@
* Define the struct constmap in each generated C file.reyk2016-11-181-3/+7
|
* Fix file reference in generated comment OK rzalamena@reyk2016-11-181-3/+3
|
* Fix some styles issues: break big lines and remove some useless spaces.rzalamena2016-11-173-8/+11
|
* In oflowmod, automatically open the instructions block with the firstreyk2016-11-171-3/+9
| | | | instruction. This allows to make the grammar more flexible.
* Add an abstraction layer / API to create flows including all matchesreyk2016-11-174-39/+321
| | | | | | | | | and instructions. This makes it easier to integrate flow features in switchd and switchctl later. Written and committed during a long flight. OK rzalamena@
* Accept OFP_XM_T_ETH_TYPE.reyk2016-11-171-1/+11
| | | | OK rzalamena@
* Add ofp_validate() for all supported versions. Will be used by switchctl,reyk2016-11-172-2/+22
| | | | no functional change.
* Added the missing code to build flow-mod messages and to installrzalamena2016-11-173-3/+123
| | | | | | table-miss by default for switch(4). ok reyk@
* Sync switchd(8) and vmd(8) with the latest proc.c changes. This syncrzalamena2016-11-162-7/+27
| | | | | | basically imports the imsg_flush() fix from reyk@ in httpd(8). ok reyk@
* Add a socket_setport() util function, in addition to socket_getport(),reyk2016-11-152-2/+21
| | | | | and use it in switchctl to set a default port for "dump". No functional change for switchd itself.
* Move ofp_validate_header() into ofp_common.c. No functional change.reyk2016-11-113-40/+40
|
* Remove "workarounds" for the read and write path that were needed toreyk2016-11-112-96/+15
| | | | | | | | | handle /dev/switch connections that didn't quite behave like TCP connections (no support for writev, no partial reads). With rzalamena's changes to switch(4), it now works as expected and doesn't need any special treatment anymore. OK rzalamena@
* Implement support for flow-mod messages validation, this includes:rzalamena2016-11-071-2/+300
| | | | | | action and instructions validation. ok reyk@
* Fix a small parsing error in packet-in: don't count ofp_match header bytesrzalamena2016-11-071-1/+2
| | | | | | | when iterating over the OXMs. It only works because the last bytes are either padding or something that looks like OXM. ok reyk@
* Empty -> empty in log messagesreyk2016-11-041-3/+3
|
* Move ofp_output() into ofp_common.c and few function prototypes intoreyk2016-11-044-43/+42
| | | | switchd.h. No functional change.
* spread the Xr! as a bonus, typo fix in switchd.conf.5 too;jmc2016-10-202-5/+9
| | | | Xr diff from kapetanakis giannis
* Implement simple feature request/reply support so we can get morerzalamena2016-10-131-8/+71
| | | | | | | | 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@
* Start reworking the "device" support in switchd: Once connected, areyk2016-10-128-167/+278
| | | | | | | | | | | | | | | | | 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@
* Teach switchd(8) how to send set_config to the switch so we can be ablerzalamena2016-10-121-2/+54
| | | | | | to get packet payloads from switch(4). ok reyk@
* copy updated log.c from vmd: for correctness, save errno when doingreyk2016-10-121-8/+11
| | | | additional actions before printing it. OK rzalamena@
* Sync proc.c file vmd(8) and switchd(8).rzalamena2016-10-111-78/+90
| | | | | | | | | New changes: * Fix msgbuf_write() usage idiom; * Add context (function name) that fatal()ed; * Use less fds on startup; ok mlarkin@, reyk@
* Move some shared code into a new file.reyk2016-10-074-894/+938
| | | | Discussed with rzalamena@
* Add support for multipart replies and implement a simple ofp 1.3.5 errorrzalamena2016-10-073-11/+143
| | | | | | message sending function. ok reyk@
* Switch switchd to the _switchd user.reyk2016-10-061-2/+2
|
* Sync with httpd(8) proc file. Check for dup2() usage to avoid oldd == newdrzalamena2016-10-051-2/+8
| | | | | | and remove the CLOEXEC with fcntl() if necessary. ok reyk@
* Call setsid() to create a new session for the executed processes.reyk2016-10-051-1/+5
| | | | | From deraadt@ OK rzalamena@
* sync proc.c with vmd: add p_pw to specify a non-standard user for a process.reyk2016-10-052-5/+11
| | | | OK rzalamena@
* Remove ofp_validate_header() herereyk2016-10-051-35/+1
|
* Move ofp_validate_header() to ofp10.c until we have a better placereyk2016-10-051-1/+35
|
* I added a second buffer as fix for the fact that /dev/switch doesn'treyk2016-10-051-6/+7
| | | | | | | | | 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@
* More debuggingreyk2016-10-051-1/+4
|
* Remove local copy of ofp.h and use net/ofp.h insteadreyk2016-09-308-881/+20
|
* Disable write events if there is nothing to write.reyk2016-09-303-10/+25
|