dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

335 Commits

Author SHA1 Message Date
Thomas Graf 3a96527f24 nl-qdisc-add(8), nl-qdisc-delete(8), nl-qdisc-list(8) 2010-10-21 16:14:15 +02:00
Thomas Graf 2a9c3ef70e nl-class-list tool
Same syntax as nl-qdisc-list
2010-10-20 17:40:44 +02:00
Thomas Graf 8699ba85cc nl-class-delete tool
Tool based on nl-qdisc-delete to delete traffic classes.
2010-10-20 17:15:58 +02:00
Thomas Graf cefe7db730 Make nl-qdisc-delete installable
Fixes nl_cli_confirm() and adds a check enforcing --yes before deleting
all qdiscs on all devices.
2010-10-20 16:20:37 +02:00
Thomas Graf 420438c71f Remove NL_DUMP_ENV code
Dumping objects as environment variables has never been implemented
completely and only increases the size of the library for no real
purpose. Integration into scripts is better achieved by implementing
a python module anyway.
2010-10-20 15:32:45 +02:00
Thomas Graf a670ee5d72 make nl-qdisc-list installable
Also improves usability of nl-qdisc-list
2010-10-20 15:26:06 +02:00
Thomas Graf 27883b0f9b nl-class-add tool
Adds a cli based tool to add/update traffic classes. This tool requires
each class to be supported via the respetive qdisc module in
pkglibdir/cli/qdisc/$name.so.

Syntax:
nl-class-add --dev eth2 --parent 1: --id 1:1 htb --rate 100mbit
nl-class-add --update --dev eth2 --id 1:1 htb --rate 200mbit
2010-10-20 14:57:39 +02:00
Thomas Graf 18848090f9 pfifo/bfifo qdisc support for cli libs 2010-10-19 16:51:55 +02:00
Thomas Graf 23c6191726 remove obsolete nl-qdisc-add code 2010-10-19 16:35:26 +02:00
Thomas Graf 757592ec1b classid database
A database to resolve qdisc/class names to classid values and vice versa.
The function rtnl_tc_handle2str() and rtnl_tc_str2handle() will resolve
names automatically.

A CLI based tool nl-classid-lookup is provided to integrate the database
into existing iproute2 scripts.
2010-10-19 16:31:23 +02:00
Thomas Graf fa89403149 HTB: Append TCA_OPTIONS even if no options are set
The kernel requires the TCA_OPTIONS{TCA_HTB_INIT} attribute to be
present even if the default values are to be used.
2010-10-19 13:10:26 +02:00
Thomas Graf c0cd587dfc nl-qdisc-add tool
Adds a cli based tool to add/update/replace qdiscs. This tool requires
each qdisc to be supported via a dynamic loadable module in
pkglibdir/cli/qdisc/$name.so.

So far HTB and blackhole have been implemented.

Syntax:
nl-qdisc-add --dev eth2 --parent root --id 1: htb --r2q=5
nl-qdisc-add --update-only --dev eth2 --id 1: htb --r2q=10
2010-10-19 13:06:42 +02:00
Patrick McHardy ac50c84f8c Merge branch 'master' of /repos/git/libnl
Conflicts:
	lib/Makefile.am
	src/Makefile.am

Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-10-15 04:16:08 +02:00
Thomas Graf 3229b32e39 - Prepare for 2.1.x tree
- Bump interface number, we will break API in the development tree
2010-10-14 13:56:46 +02:00
dima 2dbc1ca76c Generic Netlink multicast groups support
I have a patch against commit d378220c96
extending libnl with a facility to receive generic netlink messages sent
to multicast groups.

Essentially it add one new function genl_ctrl_resolve_grp which
prototype looks like this
int genl_ctrl_resolve_grp(struct nl_sock *sk, const char *family_name,
        const char *grp_name)
It resolves  the family name and the group name to group id. Then
the returned id can be used in nl_socket_add_membership to subscribe
to multicast messages.

Besides that it adds two more functions

uint32_t nl_socket_get_peer_groups(struct nl_sock *sk)
void nl_socket_set_peer_groups(struct nl_sock *sk, uint32_t groups)

allowing to modify the socket peer groups field. So it's possible to
multicast messages from the user space using the legacy interface.
Looks like there is no way (or I was not able to find one?) to modify
the netlink socket destination group from the user space, when the
group id is greater then 32.
2010-10-14 13:46:02 +02:00
Thomas Graf 513e45ccce Don't include pktloc_syntax.h in BUILT_SOURCES 2010-10-13 16:50:33 +02:00
David Lamparter 2b3fabab9e route_obj: don't add empty destination to nlmsg
don't try to give the kernel an empty RTA_DST attribute. this would
previously happening on trying to delete the default route as returned
from the kernel. the kernel doesn't add a RTA_DST atttribute, so libnl
does nl_addr_alloc(0) and inserts a zero-length RTA_DST attribute into
the deletion request, which the kernel then refuses with ERANGE.

Signed-off-by: David Lamparter <equinox@diac24.net>
2010-10-13 15:21:14 +02:00
Andreas Bießmann cb05bbb0e2 automake: add ${top_builddir}/include to AM_CFLAGS
This patch enables out-of-source builds like this
  $ cd builddir && src_dir/configure && make

 Before this patch there was an error about missing netlink/version.h which
 is built by automake in top_builddir rather than top_srcdir which is already
 in include search path.

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
2010-10-13 14:36:09 +02:00
Thomas Graf 706ac94ed5 Use CPPFLAGS 2010-10-13 14:30:50 +02:00
Matthew L. Creech a172e3ccf0 Put preprocessor definitions in AM_CPPFLAGS
When an alternate kernel header include directory is added in
CPPFLAGS, the libnl build fails.  This is because the local copy of
kernel headers is added in AM_CFLAGS, which gets included after
CPPFLAGS in the automake-generated makefile.  Switching to AM_CPPFLAGS
fixes the problems.
2010-10-13 14:29:34 +02:00
Andreas Fett 4ab22ccd47 add user data to change_func_t for caches
the patch below adds the possibility to
pass user data to callbacks of type
change_func_t when using the nl_cache_mngr_*
family of functions.

If there is any better way to do this,
without duplicating the code in
cache_mngr.c please let me know.
2010-10-13 13:41:57 +02:00
Denys Fedorysychenko 86b6f6f629 Trivial fix for TBF memleak
Without this patch, running alloc / free cache loop  will lead to huge memory
leaks on machine with 3000 interfaces with tbf qdiscs.

Here was valgrind output:

==5580== 18,070,728 bytes in 347,514 blocks are definitely lost in loss record
32 of 32
==5580==    at 0x4025485: calloc (in /lib/valgrind/vgpreload_memcheck-x86-
linux.so)
==5580==    by 0x405F410: tbf_msg_parser (tbf.c:46)
==5580==    by 0x405302B: qdisc_msg_parser (qdisc.c:119)
==5580==    by 0x4033DC9: nl_cache_parse (cache.c:643)
==5580==    by 0x4033E7C: update_msg_parser (cache.c:460)
==5580==    by 0x4038A11: nl_recvmsgs (netlink-local.h:112)
==5580==    by 0x4034175: __cache_pickup (cache.c:483)
==5580==    by 0x40343FF: nl_cache_pickup (cache.c:516)
==5580==    by 0x403447D: nl_cache_refill (cache.c:698)
==5580==    by 0x4034AB7: nl_cache_alloc_and_fill (cache.c:198)
==5580==    by 0x4053216: rtnl_qdisc_alloc_cache (qdisc.c:388)
==5580==    by 0x80489DB: main (in /home/root/nltest)

Patch complied and tested for same test case, no more leaks anymore.
2010-10-13 13:24:25 +02:00
Karl Hiramoto 018c297274 libnl: optionally disable cli tools.
compile and link time can reduced, most non-developers don't need these cli tools.

./configure --disable-cli
time make
real    0m40.485s
user    0m33.784s
sys     0m2.793s

./configure
time make
real    0m53.097s
user    0m42.077s
sys     0m4.396s

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
2010-10-13 13:10:48 +02:00
Patrick McHardy 2dc8bc1921 dect: show Z-CRC errors in transceiver statistics
Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-09-10 16:49:00 +02:00
Patrick McHardy 432a1a31f2 unbind 2010-09-02 02:08:59 +02:00
Patrick McHardy edaf9cac24 dect: support monitor mode
Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-08-19 18:41:56 +02:00
Patrick McHardy 2080dce45e package config: include nl-cli in Libs
Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-08-19 18:39:38 +02:00
Patrick McHardy ac263675d1 dect: support DECT_LLME_MAC_RFP_PRELOAD
Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-08-04 22:48:25 +02:00
Patrick McHardy a9886abe70 dect: rename DECT_HLC_ACCESS_RIGHT_REQUESTS to DECT_HLC_ACCESS_RIGHTS_REQUESTS
Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-08-04 22:48:23 +02:00
Thomas Graf 6921b1c879 Ignore vim swap files 2010-07-03 15:56:51 +02:00
Thomas Graf 7cf52dd94b Let git ignore generated pktloc source files 2010-07-03 15:56:07 +02:00
Thomas Graf 0fa04772ab Fix compile warning in utils.c 2010-07-03 15:17:04 +02:00
Thomas Graf 256d7e723c Fix compile warning in nl.c 2010-07-03 15:15:12 +02:00
Thomas Graf db5bd57899 Packet Location Interface 2010-07-02 14:06:59 +02:00
Patrick McHardy 6ff91c4799 Merge branch 'master' of x2:/home/dect/git/libnl 2010-05-20 18:14:52 +02:00
Patrick McHardy 47a4c5a4c0 Merge branch 'master' of /repos/git/libnl 2010-05-20 17:20:12 +02:00
Karl Hiramoto d378220c96 src/nf-queue.c: cleanup and improve performance of test program for NF_QUEUE
* Fix filename in file header

* If the kernel or netlink socket becomes over loaded,
  the kernel starts printing error messages like:

nf_queue: full at 1024 entries, dropping packets(s). Dropped: 1
nf_queue: full at 1024 entries, dropping packets(s). Dropped: 2
nf_queue: full at 1024 entries, dropping packets(s). Dropped: 3

So detect out of order packet ID's and set the NF_ACCEPT verdict,
so they will be removed from the kernel queue.

* increase socket buffer to improve performance

without these changes sending more than 100 KB/s over tcp HTTP lo(localhost)
was difficult on my core2 duo machine, due to so many dropped packets.
After these changes over 150 MB/s was easy.

* improve help text

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
2010-04-19 12:58:39 +02:00
Thomas Graf d966a3ecf7 Don't install private header files. 2010-04-19 12:56:31 +02:00
Patrick McHardy b3096c4acf object: fix attribute comparison
Currently two attributes are regarded as different if they are absent in
both objects to be compared. This is obviously incorrect, change to
regard objects as different if an attribute is only present on one of
them or if the attribute data differs.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-04-19 12:51:24 +02:00
Patrick McHardy 3c28aa5dca Fix rule attribute comparison
Rules don't have unique identifiers, so all attributes are compared
by initializing the ID mask to ~0. This doesn't work however since
nl_object_identical verifies whether the ID attributes are actually
present before comparing the objects, which is never the case.

Work around by using the intersection of present attributes when
comparing two rule objects.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-04-19 12:43:18 +02:00
Patrick McHardy 0e4f54d288 addr: add NL_DUMP_ENV function
Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-04-19 12:43:01 +02:00
Patrick McHardy f5f49c2248 addr: restore anycast functions
Seems it got lost during some cleanups.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-04-19 12:42:53 +02:00
Patrick McHardy 8290725718 neigh: fix id_attrs to include ifindex
Neighbour entries for the same destination may exist on multiple
interfaces. Include the interface in the ID attributes.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-04-19 12:42:40 +02:00
Patrick McHardy ba1bd9050d cache: properly invoke change_cb for deleted objects in nl_cache_resync()
When resyncing a cache, there are no delete messages, so they need to
be synthesized for deleted objects.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-04-19 12:42:27 +02:00
Patrick McHardy c17d47977e Merge branch 'master' of x2:/repos/git/libnl 2010-03-19 01:05:09 +01:00
Jose Ignacio Naranjo Hernández 52d6b8b9ee Fix a bug when calculating ticks_per_usec
I've noticed a wrong behavior when setting up some delays in a netem
qdisc.  I will try to make the things easier for the reader describing
the calls path.

To set up a delay (or jitter...) I use 'rtnl_netem_set_delay' which
requires an int parameter that tells the delay in micro seconds. Inside
this func, the delay is set up with the help of 'nl_us2ticks', which is
just an arithmetic operation (us * ticks_per_usec), where us is the
input parameter and ticks_per_usec is a global variable initialized in
'get_psched_settings'. And here is the problem:

If this variable is going to be calculated using '/proc/net/psched', I
think the file scan is not done properly.

I don't understand what the meaning of the asterisk is here:

int r = fscanf(fd, "%08x%08x%08x%*08x", &tick, &us, &nom);
if (4 == r && nom == 1000000 && !got_tick)
        ticks_per_usec = (double)tick/(double)us;

The execution path never gets in the if statement, because r is always
3, and if the fourth parameter is read (avoiding the asterisk), there is
no variable to store it in, so it comes a segv. In my opinion we can get
rid of the if statement, because I think the proc psched file has always
a fixed format of 4 parameters, and 'nom' is always 1000000
(http://lxr.linux.no/#linux+v2.6.32/net/sched/sch_api.c#L1678).

Find attached a patch I did, if I am correct.
2010-03-10 16:18:54 +01:00
Karl Hiramoto cafdaa4e06 new function nfnl_queue_msg_send_verdict_payload()
nfnl_queue_msg_send_verdict_payload() will to send the verdict, mark,
and possibly changed payload through the netlink socket.

Add a few docbook comments in other funcs.

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
2010-03-10 16:02:01 +01:00
Karl Hiramoto 27c505eb89 new feature nl_send_iovec(), nl_auto_complete() and code refactoring.
Create new function nl_send_iovec() to be used to send multiple 'struct iovec'
through the netlink socket.  This will be used for NF_QUEUE, to send
packet payload of a modified packet.

Refactor nl_send() to use nl_send_iovec() sending a single struct iovec.

Create new function nl_auto_complete() by refactoring nl_send_auto_complete(),
so other functions that call nl_send may also use nl_auto_complete()

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
2010-03-10 16:01:46 +01:00
Patrick McHardy 44fde8fcbb dect: adapt capability handling to latest kernel changes
Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-03-08 04:02:53 +01:00
Patrick McHardy 2826c89a77 dect: transceiver: add missing DECT_DEL_TRANSCEIVER handling
Signed-off-by: Patrick McHardy <kaber@trash.net>
2009-12-30 00:57:56 +01:00