dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

650 Commits

Author SHA1 Message Date
Коренберг Марк (ноутбук дома) 8959d95e22 Using only single quotes now and multi-line lists
Nothing algorithmic changed really, just cosmetics
2012-06-08 22:26:35 +06:00
Коренберг Марк (ноутбук дома) 83f06bfbb8 Fix indentation (spaces vs tabs)
Now, python files use pseudo-tab equal 4 spaces
2012-06-08 22:26:35 +06:00
Коренберг Марк (ноутбук дома) fb890a5b5e Code cleanups
1. unused "import struct" removed
2. AddressFamily.__len__ is defined, but why in so way? removed.
3. comparison against instancemethod type fixed
2012-06-08 22:26:35 +06:00
Коренберг Марк (ноутбук дома) c1547d90d7 Flags properties description and implementation fixed
1. Address, Link and Vlan classes affected with same bug
2. Flags property are not designed as set class. Setting to property will
   not replace flags, just add flags to set. So, jist document that, and
   fixed obvious logick.
2012-06-08 22:26:35 +06:00
Коренберг Марк (ноутбук дома) 38fefc5c1b Fixed various str-related logick 2012-06-08 22:26:35 +06:00
Коренберг Марк (ноутбук дома) b369d22f92 Fix whitespaces at EOL
Make git happy with that
2012-06-08 22:26:35 +06:00
Коренберг Марк (ноутбук дома) 4be1ae2ae2 Introduce Python's absolute_imports
Helps greatly when porting to Python 3
2012-06-08 22:26:35 +06:00
Коренберг Марк (ноутбук дома) f55ea7ff9d Fix typo in still unused function that generate colored message 2012-06-08 22:26:35 +06:00
Коренберг Марк (ноутбук дома) 1e75bd006b Make syntax highlighters happy
Fix typo in docstring
2012-06-08 22:26:35 +06:00
Коренберг Марк 9d60ef0d59 Removed generated .pyc files from repository 2012-06-08 22:26:34 +06:00
Коренберг Марк (ноутбук дома) bf54d6d03a Fixed address deletion
1. rtnl_addr_delete require three arguments
2. comment fixed (fixed copy-past from link.py)
2012-06-08 22:26:34 +06:00
Thomas Graf d8a25e4c5c netem: Use ARRAY_SIZE() 2012-06-08 15:21:51 +02:00
Коренберг Марк (ноутбук дома) d3dcde2585 rtnl_netem_set_delay_distribution: fix possible segfault
fix counting of elements in array. Just typo, as I think.
2012-06-08 01:38:53 +06:00
Коренберг Марк (ноутбук дома) 2275bb0aaa Fix compilation with clang
classid_exit unnecessarily used gcc-only closure.
conversion to simple static function works OK.
2012-06-07 23:48:28 +06:00
Thomas Graf 405d16827d libnl 3.2.10 2012-06-06 11:43:53 +02:00
Neil Horman 0c408aad1f genl: modify genl_ctrl_resolve and friends to allow for module auto-loading
Generic netlink has the ability to autoload modules in response to a request for
a family.  Currently libnl uses a GETFAMILY call with the NLM_F_DUMP flag to
list all the available families, but doing so neglects the possibility of an
autoloaded module.  This patch modifies the genl code to probe the kernel for a
specific family rather than dumping a list of all the currenlty available ones,
making autoload work properly.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Graf <tgraf@redhat.com>
2012-06-03 13:52:16 +02:00
Thomas Graf 43eab4696d genl: Update genl-ctrl-list(8) 2012-06-01 13:10:03 +02:00
Thomas Graf 8fad2e3194 genl: Export genl_ops_resolve() and genl_mngt_resolve() in header
These have been public but have not been declared in a header yet.
2012-06-01 11:51:43 +02:00
Thomas Graf faef2fa45f genl: Support registration of families without depending on caches
Introduces the functions genl_register_family() and
genl_unregister_family() to register a Generic Netlink family
which does not implement a cachable type.

API users can direct received messages into genl_handle_msg() which
will validate the messages and call the callback functions defined
in the commands definition.

See test/test-genl.c for an example on how to use it.
2012-06-01 11:48:08 +02:00
Thomas Graf 3656b6f908 genl: Add genlmsg_user_hdr(), genlmsg_user_data(), and genlmsg_user_datalen()
These functions deprecate the function genlmsg_data() which did not
allow to specify the length of the user header. Use of the new API
will make code much clearer. The old function is still kept around
for backwards compatibility but marked deprecated in the API reference.
2012-05-31 13:37:57 +02:00
Thomas Graf 71b442b955 genl: Add genlmsg_hdr()
Explicit function to calculate the genl hdr based on nlh
2012-05-31 13:13:50 +02:00
Thomas Graf 0b70de5155 genl: updates to API reference documentation 2012-05-31 13:11:48 +02:00
Jiri Pirko d733f8a0a6 use MSG_TRUNC flag to get recv message size at once
prevent multiple calls of recvmsg.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
2012-05-29 11:46:01 +02:00
Andrew Collins 970f5d0221 correct HTB rtable/HZ calculations
The HTB implementation in libnl uses units of microseconds in a number
of places where it seems TC is expecting time in units of ticks, which
causes actual rates much higher than requested.  Additionally, libnl
uses USER_HZ for calculating buffer and cbuffer sizes, which can
result in much larger buffers than necessary on systems with high
resolution timers.

Note that the TBF qdisc uses microseconds incorrectly in two spots as
well, I fixed this but did not test.
2012-05-29 11:42:48 +02:00
A C 9bb30a5e80 add fwmark mask support
The fw classifier allows a mask to be set, which is necessary for some
complex shaping/firewall scenarios.  The attached patch adds support
for it to libnl.
2012-05-29 11:40:13 +02:00
Bushman, Jeff ca883b61bc Fix for dumping objects to a buffer instead of file descriptor
Attached is a patch to fix two problems with dumping objects to a buffer in=
stead of a file descriptor.
One was a problem in detecting the end of the buffer in the newline code.
The other was a problem with clearing the whole buffer before printing each=
 object.
2012-05-18 15:03:46 +02:00
Adrian Ban 24d577c93d u32: fix various u32 hashing related warnings
I've add an missing u32 hash filter missing from u32.h
I've fix all warnings in file test-complex-HTB-with-hash-filters.c
2012-05-16 13:43:52 +02:00
Thomas Graf 6627ec3836 tc: fix included headers
Reported-by: Adrian Ban <adrian.ban@mantech.ro>
2012-05-16 13:42:05 +02:00
Isaac 996b502961 FTBFS with musl libc: Missing includes
Hello,
libnl 3.2.9 does not build with musl libc, without patching.
I' using a current musl libc (http://www.etalabs.net/musl/)
with linux 2.6.32 headers.
At first there were a couple problems on the musl side, but those are
resolved.
However, I found some other issues:
First, two files were missing
#include <byteswap.h>:
lib/netfilter/log_msg.c
lib/netfilter/queue_msg.c
These files used __bswap_64 (which should be bswap_64), a macro
declared in byteswap.h

Second, I got this error after fixing that:

In file included from nf-queue.c:16:
./include/linux/netfilter.h:53: error: field in has incomplete type
./include/linux/netfilter.h:54: error: field in6 has incomplete type

I found that src/nf-queue.c is missing an
#include <netinet/in.h>

Attached is a patch which resolves these issues.  I've tested with both
musl and glibc, and it builds cleanly on both.
2012-05-13 11:18:28 +02:00
Thomas Graf fec10a2823 doc: documentation restructuring
- changes the modules hierarchy to better represent the set of libaries
- list the header file that needs to be included
- remove examples/doc from api ref that is included in the guide
- add references to the guide
- fix doxygen api linking for version 1.8.0
- readd doxygen mainpage to config file
- fix a couple of doxygen doc bugs
2012-05-10 12:03:59 +02:00
Justin Mayfield 32057bc154 __str2flags fix
I found a minor bug in __str2flags where empty strings or short strings
will match all or many flags respectively.  Basically the test needs to
ensure the test string is the same length as the table entry before
doing a strncasecmp to avoid doing just a prefix test.
2012-05-10 09:12:18 +02:00
Thomas Graf 100403a99a route: Add FIXME to rtnl_route_nh_set_gateway() to fix return value
Reported-by: Justin Mayfield <jmayfield@cradlepoint.com>
2012-05-09 15:03:46 +02:00
Thomas Graf 2fbab02ba8 doc: add section about addressing
Adds a new section to netlink fundamentals explaining the common
addressing use cases and illustrates kernel->user, user->user,
and user->kernel communication.
2012-05-09 15:02:40 +02:00
Thomas Graf 183e86913a doc: Check documentation generation requirements with autoconf
Adds --enable-doc/--disable-doc, if omitted doc will only be build
if requirements are met. If explicitely enabled, configure script
will fail if requirements are not met.
2012-05-09 10:06:24 +02:00
Adrian Ban 7b503a12a0 u32: example/test code for u32 hashing with HTB 2012-05-08 23:17:53 +02:00
Adrian Ban beb40e2b4e u32: add support for hashing 2012-05-08 23:14:13 +02:00
Thomas Graf f8b4f9271b 3.2.9 release 2012-05-08 22:53:26 +02:00
Thomas Graf 6f156a7b58 nl: Fix return value of nl_recvmsgs()
Apparently the change to have nl_recvmsgs() return the number of
parsed messages broke nl_wait_for_ack() among other applications.

This patch reverts to the old behaviour and provides a new function
nl_recvmsgs_report() which provides the additional information for
use by the cache manager and possibly other applications.

Reported-by: Scott Bonar <sbonar@cradlepoint.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-05-08 22:48:00 +02:00
Jeroen Roovers d726ecd2d7 Fix two bugs in 3.2.8/doc/
doc/Doxyfile.in:
  Refer to @top_srcdir@ instead of @src_dir@
doc/Makefile.in:
  Set .PHONY to api_ref instead of api_refs

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/libnl/files/

Cheers,
     jer
2012-05-07 14:54:42 +02:00
Thomas Graf ad5d2b7738 3.2.8 release 2012-04-26 11:22:49 +02:00
Thomas Graf ff3e9e314c object: Add functions to access the object type, cache and object ops 2012-04-24 14:55:23 +02:00
Thomas Graf bd1e4d0384 cache: Add co_include_event allowing caches to provide their own nl_cache_include() implementation 2012-04-22 15:23:52 +02:00
Thomas Graf 2e23491c50 cache: improve documentation of co_event_filter 2012-04-22 14:36:01 +02:00
Thomas Graf 8bbcd2208e genl: Make genl_unregister() a NOP if NULL pointer is passed 2012-04-22 11:12:01 +02:00
Thomas Graf 2e93940a86 cache_mngr: Make providing the result pointer to nl_cache_mngr_add() optional 2012-04-21 15:51:43 +02:00
Thomas Graf 2ed371eb59 test-cache-mngr: Allow for management of arbitary caches via argument string
Let the user specify a list of cache types to add to the manager
as arguments instead of adding a static list.

Uses the newly added nl_cache_mngr_info() to constantly print
information about the manager.
2012-04-21 15:49:09 +02:00
Thomas Graf 516536625f cache_mngr: Provide nl_cache_mngr_info() to pring cache manager details
Useful for debugging and testing
2012-04-21 15:48:37 +02:00
Thomas Graf 743756f3b4 cache_mngr: API doc updates 2012-04-21 15:22:04 +02:00
Thomas Graf a518a318d4 cache_mngr: Let nl_cache_mngr_data_ready() read multiple messages
Having nl_recvmsgs() return the number of read messages allows
to continue reading until the underlying recvmsg() will return
EAGAIN for the non blocking socket.
2012-04-21 12:47:29 +02:00
Thomas Graf e0482794a8 nl: Make nl_recvmsgs() return the number of netlink messages processed 2012-04-21 12:46:01 +02:00