summaryrefslogtreecommitdiff
path: root/tools/regression/sockets/unix_cmsg/unix_cmsg.c
Commit message (Collapse)AuthorAgeFilesLines
* Add a new socket option SO_TS_CLOCK to pick from several different clockMaxim Sobolev2017-01-161-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sources to return timestamps when SO_TIMESTAMP is enabled. Two additional clock sources are: o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME); o nanosecond resolution monotonic clock (equivalent of CLOCK_MONOTONIC). In addition to this, this option provides unified interface to get bintime (equivalent of using SO_BINTIME), except it also supported with IPv6 where SO_BINTIME has never been supported. The long term plan is to depreciate SO_BINTIME and move everything to using SO_TS_CLOCK. Idea for this enhancement has been briefly discussed on the Net session during dev summit in Ottawa last June and the general input was positive. This change is believed to benefit network benchmarks/profiling as well as other scenarios where precise time of arrival measurement is necessary. There are two regression test cases as part of this commit: one extends unix domain test code (unix_cmsg) to test new SCM_XXX types and another one implementis totally new test case which exchanges UDP packets between two processes using both conventional methods (i.e. calling clock_gettime(2) before recv(2) and after send(2)), as well as using setsockopt()+recv() in receive path. The resulting delays are checked for sanity for all supported clock types. Reviewed by: adrian, gnn Differential Revision: https://reviews.freebsd.org/D9171 Notes: svn path=/head/; revision=312296
* Refactor the regression test code by splitting huge monolithic CMaxim Sobolev2016-12-051-1643/+71
| | | | | | | | | | | file into smaller pieces that are hopefully easier to understand and extend. This is to pave the ground for adding few more socket timestamp formats that I am working on here. No functional changes (I hope). Notes: svn path=/head/; revision=309554
* Don't run the t_cmsg_len testcase on 64-bit architecturesEnji Cooper2016-01-231-0/+12
| | | | | | | | | | | | | | It always fails when trying to send through the sendit(9) private KPI in the kernel due to a size mismatch between the msghdr and data being sent [*], which suspiciously seems like it's related to sizeof pointers instead of scalars, or something of that ilk MFC after: 1 week PR: 206543, 206544 [*] Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294646
* - Don't return immediately in check_xucred, check_scm_creds_cmsgcred, andEnji Cooper2016-01-231-81/+98
| | | | | | | | | | | | | | | | | check_scm_creds_sockcred after initial != NULL checks have been done for debugging purposes - Use more terse names for bintime (bt), cmesgcred (cmcred), sockcred (sc), and timeval (tv) [*] - Add some debug messages to better understand some of the flow of the test program MFC after: 1 week Requested by: bde [*] Use of the word "terse" (^.^) corrected by: jhb, rpokala [*] Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294645
* Major update for unix_cmsg from Andrey Simonenko.Sergey Kandaurov2013-02-111-1130/+1469
| | | | | | | | | | | | | | | | | | | | | Quoting the submitter: - Added tests for SCM_BINTIME, LOCAL_PEERCRED, cmsghdr.cmsg_len - Code that checks correctness of groups was corrected (getgroups(2) change) - unix_cmsg.c was completely redesigned and simplified - Use less timeout value in unix_cmsg.c for faster work - Added support for not sending data in a message, not sending data and data array associated with a cmsghdr structure in a message - Existent tests were improved - unix_cmsg.t was redesigned and simplified Correctness of unix_cmsg verified on 7.1-STABLE, 9.1-STABLE and 10-CURRENT. PR: bin/131567 Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> MFC after: 2 weeks Notes: svn path=/head/; revision=246670
* Zero the whole struct not just the size of a pointer.Ed Maste2012-11-191-1/+1
| | | | | | | Found by: clang Notes: svn path=/head/; revision=243314
* remove duplicate semicolons where possible.Eitan Adler2012-10-221-1/+1
| | | | | | | | Approved by: cperciva MFC after: 1 week Notes: svn path=/head/; revision=241844
* o Let getopt(3) report errors in command line arguments.Maxim Konovalov2006-05-311-13/+11
| | | | | | | | | | | o If something is wrong with options, then output short usage help message. o Output errstr returned from strtonum(3). PR: bin/98141 Submitted by: Andrey Simonenko Notes: svn path=/head/; revision=159095
* o Add a collection of regression tests for ancillary (control)Maxim Konovalov2006-05-291-0/+1632
data passing for unix domain sockets, stream and datagram. There are 15 tests: Test/Type of socket STREAM DGRAM ---------------------------------------------------------------------- Sending, receiving cmsgcred 1 6 Receiving sockcred (listening socket has LOCAL_CREDS) 2 n/a Receiving sockcred (accepted socket has LOCAL_CREDS) 3 n/a Receiving sockcred n/a 7 Sending cmsgcred, receiving sockcred 4 8 Sending, receiving timestamp 5 9 Sending, receiving cmsgcred (no control data) 10 13 Sending cmsgcred, receiving sockcred (no control data) 11 14 Sending, receiving timestamp (no control data) 12 15 Currently we pass 8 tests. All the rest marked as TODO. PR: kern/90800 Submitted by: Andrey Simonenko Notes: svn path=/head/; revision=159045