]> granicus.if.org Git - libnl/log
libnl
12 years agocache: Move NL_CACHE_AF_ITER to <netlink/cache.h>
Thomas Graf [Mon, 12 Nov 2012 20:59:54 +0000 (21:59 +0100)]
cache: Move NL_CACHE_AF_ITER to <netlink/cache.h>

<netlink/cache-api.h> alreay requires <netlink/cache.h> anyway.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoAdd NL_CACHE_AF_ITER support during refill and resync
roopa [Mon, 12 Nov 2012 20:38:33 +0000 (12:38 -0800)]
Add NL_CACHE_AF_ITER support during refill and resync

This patch adds support to iter over all supported families
during cache fill and resync.

The motivation for this was previously introduced at
http://lists.infradead.org/pipermail/libnl/2012-November/000734.html
In short, this patch allows caches to request dump on all supported
families instead of only AF_UNSPEC as done today.

With feedback from thomas this patch makes the iter over all families
conditional on per cache flag NL_CACHE_AF_ITER

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoNew cache manager add cache api
roopa [Mon, 12 Nov 2012 20:38:32 +0000 (12:38 -0800)]
New cache manager add cache api

This patch is an attempt to add a new nl_cache_mngr_add_cache api
to allow adding an existing cache to cache manager.

Since the new api is similar to nl_cache_mngr_add
except for allocating the cache, the patch moves most of the
nl_cache_mngr_add code to nl_cache_mngr_add_cache and changes
nl_cache_mngr_add to call nl_cache_mngr_add_cache.

One use case for this api as pointed out by thomas would be to set cache
flags before associating the cache with a cache manager.

nl_cache_alloc_name("route/link", &cache);
nl_cache_set_flags(cache, NL_CACHE_AF_ITER);
nl_cache_mngr_add_cache(mngr, cache, ...);

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoAdd support for per cache flags
roopa [Mon, 12 Nov 2012 20:38:31 +0000 (12:38 -0800)]
Add support for per cache flags

This patch adds support for per cache flags
and adds a flag NL_CACHE_AF_ITER to iter over all
supported families when filling the cache.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agodoc: Revert to default stylesheet
Thomas Graf [Mon, 12 Nov 2012 09:26:38 +0000 (10:26 +0100)]
doc: Revert to default stylesheet

Use of a custom stylesheet breaks with almost every release of doxygen
and is thus completely unuseable.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoaddr: rtnl_addr_set_peer() is limited to IPv4
Thomas Graf [Sun, 11 Nov 2012 20:01:19 +0000 (21:01 +0100)]
addr: rtnl_addr_set_peer() is limited to IPv4

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoaddr: Return -NLE_AF_NOSUPPORT when trying to set unsupported attributes
Thomas Graf [Sun, 11 Nov 2012 15:36:29 +0000 (16:36 +0100)]
addr: Return -NLE_AF_NOSUPPORT when trying to set unsupported attributes

- multicast and anycast address only supported with IPv6
- brodcast address only supported with IPv4

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agodoc: update Doxygen layout file to latest format
Thomas Graf [Sun, 11 Nov 2012 10:21:34 +0000 (11:21 +0100)]
doc: update Doxygen layout file to latest format

Sigend-off-by: Thomas Graf <tgraf@suug.ch>
12 years agohashtable: remove doc section crashing doxygen
Thomas Graf [Sun, 11 Nov 2012 10:21:10 +0000 (11:21 +0100)]
hashtable: remove doc section crashing doxygen

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agohashtable: Fix reference leak in nl_hashtable_free()
Thomas Graf [Sat, 10 Nov 2012 09:52:26 +0000 (10:52 +0100)]
hashtable: Fix reference leak in nl_hashtable_free()

The reference counter of the linked object must be dec'ed
before freeing the node or the reference is leaked.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agohashtable: Add API reference documentation
Thomas Graf [Sat, 10 Nov 2012 09:50:16 +0000 (10:50 +0100)]
hashtable: Add API reference documentation

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoHash: Properly prefix hash functions
Thomas Graf [Sat, 10 Nov 2012 09:20:08 +0000 (10:20 +0100)]
Hash: Properly prefix hash functions

Do not pollute public namespace with unprefixed functions.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoAdd hash support to route cache
roopa [Fri, 9 Nov 2012 22:41:36 +0000 (14:41 -0800)]
Add hash support to route cache

This patch adds keygen function to route object

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoAdd hash support to neigh cache
roopa [Fri, 9 Nov 2012 22:41:35 +0000 (14:41 -0800)]
Add hash support to neigh cache

This patch adds keygen function to the neigh object

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoAdd hash support to link cache
roopa [Fri, 9 Nov 2012 22:41:34 +0000 (14:41 -0800)]
Add hash support to link cache

This patch adds keygen function to link cache

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoAdd hash support in cache mngr
roopa [Fri, 9 Nov 2012 22:41:33 +0000 (14:41 -0800)]
Add hash support in cache mngr

This patch adds support to create, delete modify hash table for a cache

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoAdd nl hashtable structures and access functions
roopa [Fri, 9 Nov 2012 22:41:32 +0000 (14:41 -0800)]
Add nl hashtable structures and access functions

This patch adds the required structures and access functions to create
and manage hashtables for netlink cache objects

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoAdd hash function
roopa [Fri, 9 Nov 2012 22:41:31 +0000 (14:41 -0800)]
Add hash function

This patch adds a hash function for hashing libnl objects.

This hash function is from:
http://ccodearchive.net/info/hash.html

The original code was modified to remove unwanted dependencies,
unwanted code and fixes to header file locations

One requirement with this hash function is, hashing over multiple fields of an
un-packed struct requires that the struct be zeroed, otherwise random padding
bytes will change the hash.

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agonl: Improve API doc of nl_send_simple()
Thomas Graf [Thu, 8 Nov 2012 20:17:32 +0000 (21:17 +0100)]
nl: Improve API doc of nl_send_simple()

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agonl: Improve API doc of nl_connect() and nl_close()
Thomas Graf [Thu, 8 Nov 2012 12:41:54 +0000 (13:41 +0100)]
nl: Improve API doc of nl_connect() and nl_close()

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agonl: Allow to overwrite nl_send()
Thomas Graf [Thu, 8 Nov 2012 12:19:07 +0000 (13:19 +0100)]
nl: Allow to overwrite nl_send()

Up to now only calls to nl_send_auto() could be overwritten with
nl_cb_overwrite_send(). This patch extends the capability to
nl_send()

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agonl: improve API doc of transmit functions
Thomas Graf [Thu, 8 Nov 2012 00:29:12 +0000 (01:29 +0100)]
nl: improve API doc of transmit functions

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agodoc: increase dot max graph nodes to 100
Thomas Graf [Wed, 7 Nov 2012 23:11:13 +0000 (00:11 +0100)]
doc: increase dot max graph nodes to 100

12 years agonl: improve nl_sendto() docs and error checks
Thomas Graf [Tue, 6 Nov 2012 16:48:28 +0000 (17:48 +0100)]
nl: improve nl_sendto() docs and error checks

Make nl_sendto() return NLE_INVAL if provided buffer is NULL
and make it return NLE_BAD_SOCK if the socket is not connected.

Add note in docs about lack of NL_CB_MSG_OUT invokation

12 years agosocket: document nl_socket_get_fd()
Thomas Graf [Tue, 6 Nov 2012 16:36:53 +0000 (17:36 +0100)]
socket: document nl_socket_get_fd()

12 years agonl_recv: fix indent style
Thomas Graf [Tue, 6 Nov 2012 13:27:34 +0000 (14:27 +0100)]
nl_recv: fix indent style

12 years agonl_recv: return NLE_INVAL if socket address pointer is NULL
Thomas Graf [Tue, 6 Nov 2012 13:24:09 +0000 (14:24 +0100)]
nl_recv: return NLE_INVAL if socket address pointer is NULL

12 years agonl_recv: return NLE_INVAL if buf is NULL
Thomas Graf [Tue, 6 Nov 2012 13:22:50 +0000 (14:22 +0100)]
nl_recv: return NLE_INVAL if buf is NULL

12 years agonl_recv: improve function documentation
Thomas Graf [Tue, 6 Nov 2012 13:21:18 +0000 (14:21 +0100)]
nl_recv: improve function documentation

12 years agonl_recv: Don't update *buf in error path
Thomas Graf [Mon, 5 Nov 2012 23:21:35 +0000 (00:21 +0100)]
nl_recv: Don't update *buf in error path

iov.iov_base is either NULL or invalid

12 years agoDocument buffer size limitations of nl_recv()
Thomas Graf [Mon, 5 Nov 2012 23:19:28 +0000 (00:19 +0100)]
Document buffer size limitations of nl_recv()

12 years agoAdd support for updating objects in the cache
roopa [Thu, 1 Nov 2012 21:13:30 +0000 (14:13 -0700)]
Add support for updating objects in the cache

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>
12 years agoAdd new object op oo_id_attrs_get
roopa [Thu, 1 Nov 2012 14:15:28 +0000 (07:15 -0700)]
Add new object op oo_id_attrs_get

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>
12 years agoSet err and free ntbl when leaving neightbl_msg_parser
Michele Baldessari [Sat, 27 Oct 2012 18:38:21 +0000 (20:38 +0200)]
Set err and free ntbl when leaving neightbl_msg_parser

Make sure we leave neightbl_msg_parser() by setting the proper err variable and
freeing ntbl

12 years agoAdd missing va_end() calls
Michele Baldessari [Sat, 27 Oct 2012 18:38:22 +0000 (20:38 +0200)]
Add missing va_end() calls

Add missing va_end() calls on all error paths

12 years agoRemove unreachable code
Michele Baldessari [Sat, 27 Oct 2012 18:38:20 +0000 (20:38 +0200)]
Remove unreachable code

This code gets never called anyway

12 years agoAdd configure option to disable pthreads support
Rich Fought [Fri, 26 Oct 2012 19:19:26 +0000 (12:19 -0700)]
Add configure option to disable pthreads support

12 years agoMerge branch 'master' of https://github.com/rmfought/libnl
Thomas Graf [Fri, 26 Oct 2012 10:48:22 +0000 (12:48 +0200)]
Merge branch 'master' of https://github.com/rmfought/libnl

12 years agoadd missing '}' in __cplusplus namespaces
Thomas Graf [Tue, 23 Oct 2012 13:28:24 +0000 (15:28 +0200)]
add missing '}' in __cplusplus namespaces

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agoMerge branch 'fixes' of https://github.com/socketpair/libnl
Thomas Graf [Mon, 22 Oct 2012 10:24:19 +0000 (12:24 +0200)]
Merge branch 'fixes' of https://github.com/socketpair/libnl

12 years agoDon't include doc/ in toplevel dist
Thomas Graf [Mon, 22 Oct 2012 10:09:03 +0000 (12:09 +0200)]
Don't include doc/ in toplevel dist

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>
12 years agoSource cleanup for upstream
Rich Fought [Fri, 19 Oct 2012 18:18:52 +0000 (11:18 -0700)]
Source cleanup for upstream

12 years agonl_recv(): work with credentials only if "creds" given and NL_SOCK_PASSCRED set
Коренберг Марк (дома) [Fri, 19 Oct 2012 17:23:10 +0000 (23:23 +0600)]
nl_recv(): work with credentials only if "creds" given and NL_SOCK_PASSCRED set

12 years agonl_recv(): small code cleanups
Коренберг Марк (дома) [Fri, 19 Oct 2012 17:06:23 +0000 (23:06 +0600)]
nl_recv(): small code cleanups

1. memset around nla is unnecessary
2. calloc() is unnecessary. malloc() used instead.

12 years agonl_recv(): EWOULDBLOCK return value also checked
Коренберг Марк (дома) [Fri, 19 Oct 2012 17:04:23 +0000 (23:04 +0600)]
nl_recv(): EWOULDBLOCK return value also checked

12 years agonl_recv(): Memory allocation errors are handled properly now
Коренберг Марк (дома) [Fri, 19 Oct 2012 16:58:58 +0000 (22:58 +0600)]
nl_recv(): Memory allocation errors are handled properly now

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.

12 years agonl_recv(): "else if" logick simplified and refined
Коренберг Марк (ноутбук дома) [Sun, 9 Sep 2012 20:25:07 +0000 (02:25 +0600)]
nl_recv(): "else if" logick simplified and refined

12 years agonf-log example: correct copy-range parsing
Коренберг Марк (дома) [Fri, 21 Sep 2012 17:10:26 +0000 (23:10 +0600)]
nf-log example: correct copy-range parsing

12 years agoClang diagnostics
Коренберг Марк (ноутбук дома) [Sun, 9 Sep 2012 19:33:04 +0000 (01:33 +0600)]
Clang diagnostics

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

12 years agoROUTE_DIFF result was not used in some place in route_compare
Коренберг Марк (ноутбук дома) [Sun, 9 Sep 2012 19:21:52 +0000 (01:21 +0600)]
ROUTE_DIFF result was not used in some place in route_compare

12 years agogenl/family flags can be damaged during the auto-indentation.
Коренберг Марк (ноутбук дома) [Sun, 9 Sep 2012 16:30:20 +0000 (22:30 +0600)]
genl/family flags can be damaged during the auto-indentation.

"-" 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.

12 years ago3.2.14 release libnl3_2_14
Thomas Graf [Fri, 19 Oct 2012 14:35:51 +0000 (16:35 +0200)]
3.2.14 release

12 years agoOnly include doc/ in dist
Thomas Graf [Fri, 19 Oct 2012 14:35:28 +0000 (16:35 +0200)]
Only include doc/ in dist

12 years agodoc: Split doc/ into separate packages
Thomas Graf [Fri, 19 Oct 2012 14:16:06 +0000 (16:16 +0200)]
doc: Split doc/ into separate packages

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>
12 years agodoc: mark route.txt as WIP
Thomas Graf [Fri, 19 Oct 2012 13:06:50 +0000 (15:06 +0200)]
doc: mark route.txt as WIP

12 years agoConntrack Dump ICMP
Rich Fought [Thu, 4 Oct 2012 21:55:36 +0000 (21:55 +0000)]
Conntrack Dump ICMP

Looks like a cut and paste oversight ...

12 years agoUpdated nfnetlink includes; removed ifdefs; added delete exp program
Rich Fought [Tue, 16 Oct 2012 19:13:33 +0000 (12:13 -0700)]
Updated nfnetlink includes; removed ifdefs; added delete exp program

12 years agodefine advanced attributes out
Rich Fought [Sat, 13 Oct 2012 00:44:27 +0000 (17:44 -0700)]
define advanced attributes out

12 years agoBugfixes
Rich Fought [Wed, 10 Oct 2012 20:08:23 +0000 (13:08 -0700)]
Bugfixes

12 years agoreinit port numers on tuple dump
Rich Fought [Tue, 9 Oct 2012 22:22:16 +0000 (15:22 -0700)]
reinit port numers on tuple dump

12 years agobugfixes
Rich Fought [Tue, 9 Oct 2012 22:16:00 +0000 (15:16 -0700)]
bugfixes

12 years agolink: Support link grouping
Thomas Graf [Tue, 9 Oct 2012 19:55:31 +0000 (21:55 +0200)]
link: Support link grouping

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>
12 years agodoc: Provide documentation for link promis counter and rx/tx queues
Thomas Graf [Tue, 9 Oct 2012 19:37:31 +0000 (21:37 +0200)]
doc: Provide documentation for link promis counter and rx/tx queues

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agolink: Include IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES when building messages
Thomas Graf [Tue, 9 Oct 2012 19:24:35 +0000 (21:24 +0200)]
link: Include IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES when building messages

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agolink: Only print "promisc-mode" if users > 0
Thomas Graf [Tue, 9 Oct 2012 17:58:54 +0000 (19:58 +0200)]
link: Only print "promisc-mode" if users > 0

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agolink: Support IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES
Thomas Graf [Tue, 9 Oct 2012 17:57:22 +0000 (19:57 +0200)]
link: Support IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES

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>
12 years agoupdate gitignore
Rich Fought [Tue, 9 Oct 2012 17:54:07 +0000 (10:54 -0700)]
update gitignore

12 years agoExpectation get cli tool
Rich Fought [Tue, 9 Oct 2012 17:52:34 +0000 (10:52 -0700)]
Expectation get cli tool

12 years agolink: correctly set LINK_ATTR_PROMISCUITY
Thomas Graf [Tue, 9 Oct 2012 17:34:23 +0000 (19:34 +0200)]
link: correctly set LINK_ATTR_PROMISCUITY

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agoCompile CLI
Rich Fought [Tue, 9 Oct 2012 16:50:31 +0000 (09:50 -0700)]
Compile CLI

12 years agolink: Support IFLA_PROMISCUITY link attribute
Thomas Graf [Tue, 9 Oct 2012 16:15:50 +0000 (18:15 +0200)]
link: Support IFLA_PROMISCUITY link attribute

 * read-only attribute
 * dumped in details sections "promisc-mode (N users)"

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agonl: Provide API to specify the default buffer size when receiving netlink messages
Thomas Graf [Tue, 9 Oct 2012 14:15:08 +0000 (16:15 +0200)]
nl: Provide API to specify the default buffer size when receiving netlink 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>
12 years agoStarting CLI work
Rich Fought [Tue, 9 Oct 2012 00:31:42 +0000 (17:31 -0700)]
Starting CLI work

12 years agoSuccessful compilation of libnl-nf with expectation
Rich Fought [Mon, 8 Oct 2012 23:49:06 +0000 (16:49 -0700)]
Successful compilation of libnl-nf with expectation

12 years agoCheckpoint before compilation attempt
Rich Fought [Mon, 8 Oct 2012 22:26:55 +0000 (15:26 -0700)]
Checkpoint before compilation attempt

12 years ago"checkpoint"
Rich Fought [Sat, 6 Oct 2012 00:32:20 +0000 (17:32 -0700)]
"checkpoint"

12 years agoCheckpoint: compare function
Rich Fought [Fri, 5 Oct 2012 18:09:45 +0000 (11:09 -0700)]
Checkpoint: compare function

12 years agoExp checkpoint
Rich Fought [Fri, 5 Oct 2012 13:55:04 +0000 (06:55 -0700)]
Exp checkpoint

12 years agoEnabled the use of Links as context managers.
Antoni S. Puimedon [Thu, 4 Oct 2012 20:36:55 +0000 (16:36 -0400)]
Enabled the use of Links as context managers.

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

12 years ago3.2.13 release libnl3_2_13
Thomas Graf [Mon, 3 Sep 2012 11:41:11 +0000 (13:41 +0200)]
3.2.13 release

12 years agolibnl-3.2.12 - ./configure --disable-doc: error: conditional "LINK_DOC" was never...
Jeroen Roovers [Sun, 2 Sep 2012 13:34:53 +0000 (15:34 +0200)]
libnl-3.2.12 - ./configure --disable-doc: error: conditional "LINK_DOC" was 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

12 years agoMerge branch 'asprintf' of https://github.com/socketpair/libnl
Thomas Graf [Fri, 31 Aug 2012 14:25:47 +0000 (16:25 +0200)]
Merge branch 'asprintf' of https://github.com/socketpair/libnl

12 years agoMerge branch 'doxyfile' of https://github.com/socketpair/libnl
Thomas Graf [Fri, 31 Aug 2012 14:23:39 +0000 (16:23 +0200)]
Merge branch 'doxyfile' of https://github.com/socketpair/libnl

12 years agodoc: Update Doxyfile.in to latest syntax
Thomas Graf [Fri, 31 Aug 2012 14:23:07 +0000 (16:23 +0200)]
doc: Update Doxyfile.in to latest syntax

12 years agogenl_ctrl_probe_by_name: fix checking of genlmsg_put() return value
Коренберг Марк [Thu, 30 Aug 2012 16:53:19 +0000 (22:53 +0600)]
genl_ctrl_probe_by_name: fix checking of genlmsg_put() return value

It's a pointer! not an error code :) nasty bugs

12 years agoRemove auto-generated Doxyfile from git
Коренберг Марк [Thu, 30 Aug 2012 16:43:09 +0000 (22:43 +0600)]
Remove auto-generated Doxyfile from git

Also, add it to gitignore

12 years agoasprintf related fixed in yy parser
Коренберг Марк [Thu, 30 Aug 2012 16:25:21 +0000 (22:25 +0600)]
asprintf related fixed in yy parser

1. According to man asprintf:
   If memory allocation wasn't possible, or some other error occurs,
   these functions will return -1, and the contents of strp is undefined.
2. Sometimes, errp was not filled at all. In high-level code, free(errp)
   will called, so segmantation fault may appear in case of error in parser
3. The most cases of using asprintf is to report about allocation fail.
   So, probability of allocation of asprintf buffer is very high. And that
   will lead to trash in errp.
4. For simple casses I decide to replace asprintf with strdup

12 years agoAddress comparison bug fixed
Коренберг Марк [Thu, 30 Aug 2012 14:59:38 +0000 (20:59 +0600)]
Address comparison bug fixed

Bug introduced in 794ac78c5618ee81a45e4f58694ee27b3403ebd7

12 years agoMore clean NL_AUTO_PORT and NL_AUTO_SEQ usage in nl_complete_msg
Коренберг Марк [Thu, 30 Aug 2012 12:40:11 +0000 (18:40 +0600)]
More clean NL_AUTO_PORT and NL_AUTO_SEQ usage in nl_complete_msg

12 years ago3.2.12 release libnl3_2_12
Thomas Graf [Thu, 30 Aug 2012 11:46:29 +0000 (13:46 +0200)]
3.2.12 release

12 years agoconfigure: Check for pygmentize when building docs
Thomas Graf [Thu, 30 Aug 2012 11:36:23 +0000 (13:36 +0200)]
configure: Check for pygmentize when building docs

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agodoc: Update Doxyfile config to latest release
Thomas Graf [Thu, 30 Aug 2012 11:22:21 +0000 (13:22 +0200)]
doc: Update Doxyfile config to latest release

12 years agoroute: Document ROUTE_CACHE_CONTENT flag
Thomas Graf [Thu, 30 Aug 2012 11:19:56 +0000 (13:19 +0200)]
route: Document ROUTE_CACHE_CONTENT flag

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoconfigure: Check for graphviz and source-highlight before building documentation
Thomas Graf [Thu, 30 Aug 2012 11:15:45 +0000 (13:15 +0200)]
configure: Check for graphviz and source-highlight before building documentation

Signed-off-by: Thomas Graf <tgraf@suug.ch>
12 years agoPrevent potential socket file descriptor leak
Коренберг Марк (дома) [Wed, 29 Aug 2012 22:33:40 +0000 (04:33 +0600)]
Prevent potential socket file descriptor leak

This may happen when passing connected socket to nl_cache_mngr_alloc().

Now, nl_connect() will return error trying to connect already connected socket.

Also, dont call close(-1) if socket() fails.

12 years agoFix warning "not checking return value of fscanf" in lib/utils.c: get_psched_settings
Коренберг Марк (дома) [Wed, 29 Aug 2012 18:47:09 +0000 (00:47 +0600)]
Fix warning "not checking return value of fscanf" in lib/utils.c: get_psched_settings

Also, change internal variables type from uint32_t to unsigned int.
Correct scanf format string should contain "SCNx32" instead of just "x",
but I decide not to fix that and just changed variable type.

12 years agoFix typo in textual description in ct_dump_stats()
Коренберг Марк (дома) [Wed, 29 Aug 2012 18:15:12 +0000 (00:15 +0600)]
Fix typo in textual description in ct_dump_stats()

Bug introduced in a0f1c0e281ee78ab8ee874bbb6c2140c12101284

12 years ago"%llu" replaced with "%" PRIu64
Коренберг Марк (дома) [Wed, 29 Aug 2012 17:59:17 +0000 (23:59 +0600)]
"%llu" replaced with "%" PRIu64

On some architectures, uint64_t is defined as:

typedef unsigned long long int __u64;

on another architectures as:

typedef unsigned long int __u64;

So, according to man 3 printf,
uint64_t should be printed as "%llu" on some architectures, and as "%lu" on another. The same for scanf.

To eliminate that challenge, there is inttypes.h, in which appropriate constants
are defined for current architecture.

32-bit types (and even 16 and 8 bit types) should be printed using such constants if
printed variable defined as uint_XXXt or intXXXt type. But in reality 32-bit and less
types does not gain run-time error (except in scanf), because they pushed to stack as
32-bit values at least. So, I decide not to fix that.

12 years agoRun-time version information is now available
Коренберг Марк (дома) [Wed, 29 Aug 2012 16:55:14 +0000 (22:55 +0600)]
Run-time version information is now available

Run-time version information is available as exported four integers:
- const int      nl_ver_num = LIBNL_VER_NUM;
- const int      nl_ver_maj = LIBNL_VER_MAJ;
- const int      nl_ver_min = LIBNL_VER_MIN;
- const int      nl_ver_mic = LIBNL_VER_MIC;

The purpose of this is to get version of compiled library as run time.
Use cases:
- To know exact version of the library in Python's ctypes module,
  Say, to find out if nl_cache_mngr_alloc() allow sk=NULL

- To make sure that the version of the loaded library corresponds to the
  version of headers (for the paranoid). Say, to check:

  if (LIBNL_VER_NUM != nl_ver_num)
      exit(1);

12 years agoAdded lex.yy.c to .gitignore
Коренберг Марк (дома) [Wed, 29 Aug 2012 16:38:46 +0000 (22:38 +0600)]
Added lex.yy.c to .gitignore