summaryrefslogtreecommitdiffstats
path: root/lib/libnv
Commit message (Collapse)AuthorAgeFilesLines
* Add test case for unpack with diffrent flags.oshogbo2015-05-021-0/+35
| | | | Approved by: pjd (mentor)
* Introduce the NV_FLAG_NO_UNIQUE flag. When set, it allows to storeoshogbo2015-05-021-0/+2
| | | | | | | | | | | | multiple values using the same key in a nvlist. Approved by: pjd (mentor) Obtained from: WHEEL Systems (http://www.wheelsystems.com) Update man page. Reviewed by: AllanJude Approved by: pjd (mentor)
* Approved, oprócz użycie RESTORE_ERRNO() do ustawiania errno.oshogbo2015-05-023-11/+47
| | | | | | | | | | | | | | | | | Change the nvlist_recv() function to take additional argument that specifies flags expected on the received nvlist. Receiving a nvlist with different set of flags than the ones we expect might lead to undefined behaviour, which might be potentially dangerous. Update consumers of this and related functions and update the tests. Approved by: pjd (mentor) Update man page for nvlist_unpack, nvlist_recv, nvlist_xfer, cap_recv_nvlist and cap_xfer_nvlist. Reviewed by: AllanJude Approved by: pjd (mentor)
* Add nvlist_flags() function, which returns nvlist's public flags.oshogbo2015-05-012-1/+11
| | | | Approved by: pjd (mentor)
* Sort MLINKS alphabetically.oshogbo2015-05-011-46/+46
| | | | Approved by: pjd (mentor)
* Remove the nvlist_.*[fv] functions.oshogbo2015-04-291-82/+0
| | | | | | | | | | | | | | | | Those functions are problematic, because there is no way to report memory allocation problems without complicating the API, so we can either abort or potentially return invalid results. None of which is acceptable. In most cases the caller knows the size of the name, so he can allocate buffer on the stack and use snprintf(3) to prepare the name. After some discussion the conclusion is to removed those functions, which also simplifies the API. Discussed with: pjd, rstone Approved by: pjd (mentor)
* Remove the use of nvlist_.*[fv] functions from tests.oshogbo2015-04-292-48/+24
| | | | Approved by: pjd (mentor)
* Fix lib/libnv tests compilation with -std=c++11, by adding appropriatedim2015-03-082-11/+11
| | | | | | | casts for NULL to invocations of the ATF_REQUIER_EQ() macro. Reviewed by: rstone, jmmv Differential Revision: https://reviews.freebsd.org/D2027
* Fix build of nv_tests.ccrstone2015-03-011-1776/+0
| | | | | | | | | nv_tests.cc managed to get two copies of several functions due to me applying a patch in an unclean working tree. My kingdom for an "svn clean" command. MFC after: 1 month X-MFC-With: r279424
* Move libnv into the kernel and hook it into the kernel buildrstone2015-03-019-4385/+6
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1883 Reviewed by: jfv MFC after: 1 month Sponsored by: Sandvine Inc.
* Add macros to make code compile in kernelrstone2015-03-018-121/+349
| | | | | | | | | | | | | | | | Make it possible to compile libnv in the kernel. Mostly this involves wrapping functions that have a different signature in the kernel and in userland (e.g. malloc()) in a macro that will conditionally expand to the right API depending on whether the code is being compiled for the kernel or not. I have also #ifdef'ed out all of file descriptor-handling code, as well as the unsafe varargs functions. Differential Revision: https://reviews.freebsd.org/D1882 Reviewed by: jfv MFC after: 1 month Sponsored by: Sandvine Inc
* Prevent creation of an invalid nvlistrstone2015-03-012-0/+39
| | | | | | | | | | | If an nvlist is set as a child of another nvlist with nvlist_move_nvlist then fail the operation and set the parent nvlist to the error state. Differential Revision: https://reviews.freebsd.org/D1880 Reviewers: jfv MFC after: 1 month Sponsored by: Sandvine Inc
* Don't allocate memory for operations that do not insertrstone2015-03-013-178/+217
| | | | | | | | | | | | | | | | | | Almost every operation performed on an nvlist was allocating a new string to hold the key name. The nvlist_exists* family of functions would always return false if they failed to allocate the string. The rest of the functions would outright abort(). Fix the non-varargs variants of the functions to perform the requested operations directly and the varargs versions to allocate the string and call into the non-varargs versions. The varargs versions are still broken and really can't be fixed, so we might consider axing them entirely. However, now the non- varargs functions are always safe to call. Differential Revision: https://reviews.freebsd.org/D1879 Reviewed by: pjd, jfv MFC after: 1 month Sponsored by: Sandvine Inc.
* Add function to force an nvlist into the error staterstone2015-03-015-1/+65
| | | | | | | | | | | Add an nvlist_set_error() function that can be used to force an nvlist into the error state. This is useful both for writing tests and for writing APIs that use nvlists internally. Differential Revision: https://reviews.freebsd.org/D1878 Reviewed by: pjd, jfv MFC After: 1 month Sponsored by: Sandvine Inc.
* Extend the unit test to fix the bug caught in r277925rstone2015-03-011-2/+19
| | | | | | Differential Revision: https://reviews.freebsd.org/D1888 MFC After: 1 month Sponsored by: Sandvine Inc.
* Add tests for dnvlist_take_*rstone2015-03-011-0/+288
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1876 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for dnv_get_*rstone2015-03-012-1/+292
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1875 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for nvlist_free* functionsrstone2015-03-011-0/+206
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1874 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for nvlist_take_*rstone2015-03-011-0/+292
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1873 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add test cases for nvlist_move_*rstone2015-03-011-0/+82
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1872 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for nvlist_pack/unpackrstone2015-03-011-0/+185
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1871 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for nvlist_clonerstone2015-03-011-0/+120
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1870 Reviewed by: pjd, jfv MFC after: 1 month Sponsored by: Sandvine Inc
* Tests of basic nvlist add functionsrstone2015-03-012-1/+2079
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1869 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Revert r279422. My "apply patch and commit" script wasn't addingrstone2015-03-011-3/+1
| | | | | | new files properly. Pointy hat to: rstone
* Tests of basic nvlist add functionsrstone2015-03-011-1/+3
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1869 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Make libnv headers includable from C++rstone2015-03-012-0/+8
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1868 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Make gcc happy.pjd2015-01-301-3/+12
| | | | Reported by: bz
* Add missing nvlist_get_parent(3) link.pjd2015-01-301-0/+1
| | | | Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
* Handle empty nvlists correctly.pjd2015-01-301-16/+35
| | | | Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
* Modify nvlist_get_parent() API to take additional cookie argument.pjd2015-01-303-19/+41
| | | | | | | This allow for non-recursive iteration over nested nvlists, as in documented example. Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
* If moving descriptor or binary data to an nvlist fails, we need to close thepjd2015-01-301-5/+27
| | | | | | | | descriptor or free the memory before returning. Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> While here, protect errno, so it won't be overwritted by close(2) or free(3).
* Convert libraries to use LIBADDbapt2014-11-251-2/+1
| | | | While here reduce a bit overlinking
* fix typo, properly install a link to nv for nvlist_freev...jmg2014-10-271-1/+1
|
* Fix problem on big endian systems introduced in r271579 - when we werepjd2014-10-094-40/+40
| | | | | | | returning from handling a nested nvlist we were resetting big-endian flag. Reported by: Kuleshov Aleksey @ yandex.ru Tested by: Kuleshov Aleksey @ yandex.ru
* Document the new nvlist_get_parent() function.pjd2014-09-251-1/+7
| | | | Submitted by: Mariusz Zaborski
* Don't use nvl in case of a failure.pjd2014-09-181-1/+2
| | | | | Reported by: Coverity CID: 1238922
* Use non-recursive algorithm for traversing nvlists. This also removespjd2014-09-146-176/+306
| | | | | | the limit on number of nested nvlists. Submitted by: Mariusz Zaborski
* Remove the limit on descriptors that can be send in one nvlist.pjd2014-09-141-17/+96
| | | | Submitted by: Mariusz Zaborski
* Include src.opts.mk after SHLIBDIR has been defined so libnv is installed tongie2014-09-071-1/+2
| | | | | | | | | | /lib , not /usr/lib MFC after: 3 days Approved by: rpaulo (mentor) Submitted by: antoine Pointyhat to: me Phabric: D739
* Use better type for i.pjd2014-09-031-2/+2
|
* Declare i.pjd2014-09-031-1/+1
| | | | Reported by: sbruno
* Fix descriptors leak in case of nvlist_xunpack() failure.pjd2014-09-031-1/+4
| | | | Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
* Integrate lib/libnv into the build/kyuangie2014-08-058-0/+1429
| | | | | | | | | Rename all of the TAP test applications from <test> to <test>_test to match the convention described in the TestSuite wiki page Phabric: D538 Approved by: jmmv (mentor) Sponsored by: EMC / Isilon Storage Division
* use .Mt to mark up email addresses consistently (part3)bapt2014-06-231-1/+1
| | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de>
* Correct a typo.rstone2014-05-171-1/+1
| | | | MFC after: 1 week
* libnv: Don't lose big-endian flag when receiving a message.jilles2014-04-011-1/+1
| | | | | | | | | | | | A bug caused the "big endian" flag to be lost when receiving a message. As a result, the bits are interpreted as little endian and an extremely large allocation is attempted. This change fixes ping(8)'s communication to casperd(8) on big-endian architectures. Reported by: Anton Shterenlikht Tested by: danfe
* nv(3) was not in 10.0.bdrewery2014-03-211-2/+2
| | | | | | | It might be MFC'd to stable/10 for 10.1, but for now update the manual to avoid confusion on its availability. Discussed with: pjd
* Assert input arguments to buf_send() and buf_recv().pjd2014-02-021-0/+7
| | | | Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
* Fix sending empty nvlist.pjd2014-02-021-2/+2
| | | | Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
* MFp4 @1189711:pjd2014-01-031-1/+3
| | | | | | | Fix resource leaks on nvlist_destroy(). Reported by: Mariusz Zaborski <oshogbo@FreeBSD.org> MFC after: 3 days
OpenPOWER on IntegriCloud