summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for updating objects in the cacheroopa2012-11-054-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support to update a cache object during cache_include instead of the current approach of deleting the original object and adding a new one. This operation is conditional on the object implementing the operation. If the update is not successful, cache_include falls back to the existing cache inclusion process of deleting and adding the object. It adds a new object operation called oo_update. oo_update takes two objects as arguments, first being the existing cache object that needs update, the second argument being the new object. Currently it is left to the implementor to use the msg type to decide wether to delete or add the new object attributes to the old one. But the operation type or msg type can be easily made part of the object arguments. The motivation for this change is explained below in the context of including support for AF_BRIDGE objects into the link cache. libnl today deletes an object before it includes an identical object. But for some objects like the AF_BRIDGE objects this does not work well. link cache uses the ifindex as its key in object searches. If link cache were to support AF_BRIDGE family objects, todays implementation, - will replace the original link object with the bridge port link object for add notifications - And a bridge port delete notification from kernel would delete the link object from the cache leaving the cache without the link object until the kernel sends another notification for that link The bridge port link notification contains some base link object attributes plus bridge specific protocol info attributes. In such cases we think an operation to update the existing object in place in cache might be useful. This can be made to work for AF_INET6 link objects too. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com> Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com> Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
* Add new object op oo_id_attrs_getroopa2012-11-052-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current oo_id_attrs nl_object op allows a fixed id attribute list for an cache. But a cache with multiple families may need to specify different id attributes for different families. An example for this is the bridge fdb entries in the neigh cache: neigh entries belonging to the AF_UNSPEC family use (NEIGH_ATTR_IFINDEX | NEIGH_ATTR_DST | NEIGH_ATTR_FAMILY) as id attributes. AF_BRIDGE fdb entries which also support the same msg type, will need to use (NEIGH_ATTR_LLADDR | NEIGH_ATTR_FAMILY) as id attributes. Today you cannot specify different set of attributes to two families belonging to the same cache. This patch adds a new object function oo_id_attrs_get to get the attributes. An example implementation of oo_id_attrs_get for the neigh cache will look like: static uint32_t neigh_id_attrs_get(struct nl_object *obj) { struct rtnl_neigh *neigh = (struct rtnl_neigh *)obj; if (neigh->n_family == AF_BRIDGE) return (NEIGH_ATTR_LLADDR | NEIGH_ATTR_FAMILY); else return (NEIGH_ATTR_IFINDEX | NEIGH_ATTR_DST | NEIGH_ATTR_FAMILY); } Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com> Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com> Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
* Set err and free ntbl when leaving neightbl_msg_parserMichele Baldessari2012-10-291-1/+1
| | | | | Make sure we leave neightbl_msg_parser() by setting the proper err variable and freeing ntbl
* Add missing va_end() callsMichele Baldessari2012-10-291-4/+12
| | | | Add missing va_end() calls on all error paths
* Remove unreachable codeMichele Baldessari2012-10-291-5/+0
| | | | This code gets never called anyway
* Add configure option to disable pthreads supportRich Fought2012-10-262-2/+28
|
* Merge branch 'master' of https://github.com/rmfought/libnlThomas Graf2012-10-2618-196/+2708
|\
| * Source cleanup for upstreamRich Fought2012-10-198-649/+636
| |
| * Updated nfnetlink includes; removed ifdefs; added delete exp programRich Fought2012-10-1614-283/+607
| |
| * define advanced attributes outRich Fought2012-10-123-56/+179
| |
| * BugfixesRich Fought2012-10-105-19/+189
| |
| * reinit port numers on tuple dumpRich Fought2012-10-091-1/+3
| |
| * bugfixesRich Fought2012-10-095-9/+22
| |
| * update gitignoreRich Fought2012-10-091-0/+1
| |
| * Expectation get cli toolRich Fought2012-10-092-1/+131
| |
| * Compile CLIRich Fought2012-10-092-23/+1
| |
| * Starting CLI workRich Fought2012-10-082-0/+157
| |
| * Successful compilation of libnl-nf with expectationRich Fought2012-10-083-106/+57
| |
| * Checkpoint before compilation attemptRich Fought2012-10-085-374/+396
| |
| * "checkpoint"Rich Fought2012-10-053-259/+360
| |
| * Checkpoint: compare functionRich Fought2012-10-052-40/+127
| |
| * Exp checkpointRich Fought2012-10-055-2/+1468
| |
* | add missing '}' in __cplusplus namespacesThomas Graf2012-10-232-0/+7
| | | | | | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | Merge branch 'fixes' of https://github.com/socketpair/libnlThomas Graf2012-10-228-51/+100
|\ \
| * | nl_recv(): work with credentials only if "creds" given and NL_SOCK_PASSCRED setКоренберг Марк (дома)2012-10-191-12/+15
| | |
| * | nl_recv(): small code cleanupsКоренберг Марк (дома)2012-10-191-8/+4
| | | | | | | | | | | | | | | 1. memset around nla is unnecessary 2. calloc() is unnecessary. malloc() used instead.
| * | nl_recv(): EWOULDBLOCK return value also checkedКоренберг Марк (дома)2012-10-191-3/+2
| | |
| * | nl_recv(): Memory allocation errors are handled properly nowКоренберг Марк (дома)2012-10-191-22/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. all cleanup actions (like free()) now located at the end of function 2. in case of error or EOF, *buf and *creds (if given) set to NULL This protect from invalid code at user's side, like: char *buf; x = nl_recv(..., &buf, ...); if (x<=0) goto cleanup; cleanup: free(buf); 3. all intermediate buffers are stored into local variables, and user's variables only touches at the end.
| * | nl_recv(): "else if" logick simplified and refinedКоренберг Марк (ноутбук дома)2012-10-191-8/+16
| | |
| * | nf-log example: correct copy-range parsingКоренберг Марк (дома)2012-10-191-1/+1
| | |
| * | Clang diagnosticsКоренберг Марк (ноутбук дома)2012-10-195-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on clang diagnostics: 1. lib/nl.c: recvmsgs(): nla filling with zeros commented. 2. lib/route/classid.c: & lib/route/pktloc.c: remove zero-filling of struct stat 3. lib/route/qdisc/htb.c: Fix htb_qdisc_msg_fill(): fix zero-filling 4. ematch/container.c: container_parse: commented why only 4 bytes are copied len marked as unused to eliminate compiler warning
| * | ROUTE_DIFF result was not used in some place in route_compareКоренберг Марк (ноутбук дома)2012-10-191-1/+1
| | |
| * | genl/family flags can be damaged during the auto-indentation.Коренберг Марк (ноутбук дома)2012-10-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "-" was never used in the names of the flags. "_" was used in all places of the library. So, I just changed the undescore to the minus. Automatic indentation can insert spaces on either side of the minus, so the library will be compiled, but will not be usable (in this part of the code), as the parser will split words by white space, and the flag "admin - perm" will never work.
* | | Don't include doc/ in toplevel distThomas Graf2012-10-222-2/+1
|/ / | | | | | | | | | | | | On a second thought, don't include doc/ in dist at all and distribute it separately. The doc source files are available in the git tree anyway. Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | 3.2.14 releaselibnl3_2_14Thomas Graf2012-10-191-4/+4
| |
* | Only include doc/ in distThomas Graf2012-10-191-1/+2
| |
* | doc: Split doc/ into separate packagesThomas Graf2012-10-1913-151/+1284
| | | | | | | | | | | | | | | | | | | | Separates all the documentation generation trickery to its own configure.in and allows to easily generate a pre built doc dist file for distribution. Arguments to configure will be passed on to doc/configure Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | doc: mark route.txt as WIPThomas Graf2012-10-191-0/+3
| |
* | Conntrack Dump ICMPRich Fought2012-10-181-2/+2
| | | | | | | | Looks like a cut and paste oversight ...
* | link: Support link groupingThomas Graf2012-10-094-1/+56
| | | | | | | | | | | | | | | | | | | | New functions: rtnl_link_set_group(link, group) rtnl_link_get_group(link) The group identifier is printed in the brief section as "group N" Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | doc: Provide documentation for link promis counter and rx/tx queuesThomas Graf2012-10-091-5/+38
| | | | | | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | link: Include IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES when building messagesThomas Graf2012-10-091-0/+6
| | | | | | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | link: Only print "promisc-mode" if users > 0Thomas Graf2012-10-091-1/+1
| | | | | | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | link: Support IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUESThomas Graf2012-10-093-0/+93
| | | | | | | | | | | | | | | | | | | | New functions: rtnl_link_set_num_tx_queues(link, nqueues) rtnl_link_get_num_tx_queues(link) rtnl_link_set_num_rx_queues(link, nqueues) rtnl_link_get_num_rx_queues(link) Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | link: correctly set LINK_ATTR_PROMISCUITYThomas Graf2012-10-091-2/+2
| | | | | | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | link: Support IFLA_PROMISCUITY link attributeThomas Graf2012-10-094-41/+102
| | | | | | | | | | | | | | * read-only attribute * dumped in details sections "promisc-mode (N users)" Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | nl: Provide API to specify the default buffer size when receiving netlink ↵Thomas Graf2012-10-094-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | messages New functions: nl_socket_set_msg_buf_size(sk, size) nl_socket_get_msg_buf_size(sk) Default remains getpagesize() Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | Enabled the use of Links as context managers.Antoni S. Puimedon2012-10-041-0/+9
|/ | | | | | | | | | | | | | | | | With this change you can still set do modifications of Links and then to change to pass the changes to the kernel. But it additionally enables you to interact with this part of libnl-python in a more pythonic way. Instead of: eth0 = links['eth0'] eth0.mtu = 5000 eth0.change() you can do: with links['eth0'] as eth0: eth0.mtu = 5000
* 3.2.13 releaselibnl3_2_13Thomas Graf2012-09-031-2/+2
|
* libnl-3.2.12 - ./configure --disable-doc: error: conditional "LINK_DOC" was ↵Jeroen Roovers2012-09-031-4/+4
| | | | | | | | | | | never defined. \ Usually this means the macro was only invoked conditionally. configure: error: conditional "LINK_DOC" was never defined. Usually this means the macro was only invoked conditionally. Attached patch provided by Martin Jansa. See also https://bugs.gentoo.org/show_bug.cgi?id=433565