summaryrefslogtreecommitdiff
path: root/tools/regression/sockets/unix_cmsg
Commit message (Collapse)AuthorAgeFilesLines
* Make timespecadd(3) and friends publicAlan Somers2018-07-301-16/+2
| | | | | | | | | | | | | | | | | | | | | | The timespecadd(3) family of macros were imported from NetBSD back in r35029. However, they were initially guarded by #ifdef _KERNEL. In the meantime, we have grown at least 28 syscalls that use timespecs in some way, leading many programs both inside and outside of the base system to redefine those macros. It's better just to make the definitions public. Our kernel currently defines two-argument versions of timespecadd and timespecsub. NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define three-argument versions. Solaris also defines a three-argument version, but only in its kernel. This revision changes our definition to match the common three-argument version. Bump _FreeBSD_version due to the breaking KPI change. Discussed with: cem, jilles, ian, bde Differential Revision: https://reviews.freebsd.org/D14725 Notes: svn path=/head/; revision=336914
* Fix the build of tools/regression/sockets/unix_cmsgAlan Somers2018-07-191-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=336466
* Add a new socket option SO_TS_CLOCK to pick from several different clockMaxim Sobolev2017-01-162-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Check that SCM_XXX timestamp returned by the kernel is less 1 secondMaxim Sobolev2016-12-094-1/+143
| | | | | | | | | away in the past from the current time. This should be plenty for the scheduler to do its job. It provides assurance that the timestamp returned is actually a valid one, not just some random garbage. Notes: svn path=/head/; revision=309773
* Auto-generate 2 test cases that differ only in structure and SCM_XXX constantMaxim Sobolev2016-12-065-205/+45
| | | | | | | | | used. We can do it programmatically, but that would make code convoluted and more complex. I have two more of those types coming for the CLOCK_REALTIME and CLOCK_MONOTONIC. This seems like an elegant and scallable approach. Notes: svn path=/head/; revision=309631
* Refactor the regression test code by splitting huge monolithic CMaxim Sobolev2016-12-0520-1643/+2300
| | | | | | | | | | | 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
* NO_MAN= has been deprecated in favor of MAN= for some time, go aheadWarner Losh2014-04-131-1/+1
| | | | | | | | | and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit. Notes: svn path=/head/; revision=264400
* Major update for unix_cmsg from Andrey Simonenko.Sergey Kandaurov2013-02-113-1249/+1652
| | | | | | | | | | | | | | | | | | | | | 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-294-0/+1823
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