path: root/lib/attr.c
AgeCommit message (Collapse)AuthorFilesLines
2008-06-13Introduce nla_strdup() to help parse strings attributesThomas Graf1-0/+5
2008-05-14Remove obsolete nla_get_addr() and nla_get_data()Thomas Graf1-12/+0
Replaces obsolete calls to nla_get_addr() and nla_get_data() with nl_addr_alloc_attr() respectively nl_data_alloc_attr(). Also fixes missing error handling while parsing routing multipath configuration.
2008-05-14Thread-safe error handlingThomas Graf1-9/+7
In order for the interface to become more thread safe, the error handling was revised to no longer depend on a static errno and error string buffer. This patch converts all error paths to return a libnl specific error code which can be translated to a error message using nl_geterror(int error). The functions nl_error() and nl_get_errno() are therefore obsolete. This change required various sets of function prototypes to be changed in order to return an error code, the most prominent are: struct nl_cache *foo_alloc_cache(...); changed to: int foo_alloc_cache(..., struct nl_cache **); struct nl_msg *foo_build_request(...); changed to: int foo_build_request(..., struct nl_msg **); struct foo *foo_parse(...); changed to: int foo_parse(..., struct foo **); This pretty much only leaves trivial allocation functions to still return a pointer object which can still return NULL to signal out of memory. This change is a serious API and ABI breaker, sorry!
2008-02-22Be liberal when receiving an empty nested attributeThomas Graf1-1/+0
No longer enforce at least one attribute in a container of nested attributes. The application may do so itself by setting minlen to NLA_HDRLEN.
2008-01-30Detailed attribute documentationThomas Graf1-310/+705
This patch extends and reorganizes the existing attribute documentation and includes various verbose examples.
2008-01-14Improve message/attribute construction documentation and add nlmsg_expand()Thomas Graf1-10/+8
2008-01-14Fix stale data pointers when constructing messagesThomas Graf1-3/+2
Patrick McHardy reported a problem where pointers to the payload of a netlink message as returned by f.e. the nesting helpers become stale when the payload data chunk is reallocated. In order to avoid further problems, the payload chunk is no longer extended on the fly. Instead the allocation is made during netlink message object allocation time with a default size of a page which should be fine for the majority of all users. Additionally the functions nlmsg_alloc_size() and nlmsg_set_default_size() have been added to allocate messages of a particular length and to modify the default message size.
2007-12-13[LIBNL]: Fix format stringsPatrick McHardy1-2/+2
Use %td for ptrdiff_t and %zu for size_t. Signed-off-by: Patrick McHardy <>
2007-09-15Initial importaosp-new/nougat-mr1-arcThomas Graf1-0/+787