dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

171 Commits

Author SHA1 Message Date
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 0b70de5155 genl: updates to API reference documentation 2012-05-31 13:11:48 +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
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
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
Adrian Ban beb40e2b4e u32: add support for hashing 2012-05-08 23:14:13 +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
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 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 e34ed950bd cache_mngr: Automatically allocate socket if needed
The requirement to have the caller provide the socket does not
make much sense. Automatically allocate the socket if none was
provided.

This may also avoid some future abuse of reusing request sockets
for handling notifications.

Also rename cm_handle to cm_sock for clarity (no API change)
2012-04-21 12:11:45 +02:00
Thierry Reding 0b40364150 Add new nl_cache_clone() function.
The function can be used to make a copy of an existing cache. It is very
similar to nl_cache_subset() except that it allows no filtering but
copies every object.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-02-16 13:42:49 +01:00
Shriram Rajagopalan a17970b974 Support plug qdisc - queue traffic until explicit release
The plug qdisc supports two operations - plug and unplug. When the
qdisc receives a plug ("buffer") command via netlink request,
packets arriving henceforth are buffered until a corresponding unplug
command is received. Depending on the type of unplug ("release_one"
or "release_indefinite"), the queue can be unplugged indefinitely or
selectively.

The plug qdisc allows a user to implement network output buffering
(aka output commit), used commonly in checkpoint based fault tolerance
systems. It also supports a general purpose queue plug/unplug
functionality.

The associated kernel module is available in David Miller's net-next
tree, commit: c3059be16c9ef29c05f0876a9df5fea21f29724f

This patch introduces userspace tools and API, to control the qdisc
via netlink messages.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-02-14 12:02:04 +01:00
Brett Ciphery a39bb563ab add new function to provide neighbour event parsing
the neighbour parsing function was previously not accessible, so
custom callback functions had to handle the decoding itself.
rtnl_neigh_parse is introduced and implemented in much the same way
as rtnl_route_parse.

Signed-off-by: Brett Ciphery <brett.ciphery@windriver.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-30 12:54:29 +01:00
Thomas Graf 4a7791eca1 dsmark: Add missing declarations for rtnl_class_dsmark_(get|set)_bitmask()
The existing declarations refered to non-existing functions so removing
them is safe.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-25 16:09:34 +01:00
Thomas Graf 03f3a58733 link: generic link enslaving API
Adds rtnl_link_enslave() / rtnl_link_release() providing a genreic
link enslaving/release API for use with all link types which use
the IFLA_MASTER property.
2011-11-07 12:32:35 +01:00
Thomas Graf 2bcd8ecd27 cache: event_filter() cache operation to filter notifications
Certain notifications need to be filtered out and should not be applied to
a cache when a cache is handled by a cache manager.
2011-10-21 11:31:15 +02:00
Thomas Graf 1c9b175a47 Provide micro version in <netlink/version.h> 2011-09-19 11:28:20 +02:00
Thomas Graf 076909aa82 Bonding: Fix header guard of <netlink/route/link/bonding.h>
(Would be a good idea to change the header guard name when c&p
 an existing header file to create a new one.)
2011-09-16 13:17:04 +02:00
Thomas Graf 96f17ce146 bonding: API to create/enslave/release
Although it has been possible to create bonding devices, enslave and
release using the regular link API. The added API simplifies usage
and hides some of the compatibility logic.

F.e. enslave() and release() will both verify that the master assignment
has in fact been changed and return -NLE_OPNOTSUPP if it did not.

Also the API will make sure to use RTM_NEWLINK or RTM_SETLINK depending
on what is availble.

Examples are provided in src/ as nl-link-enslave.c and nl-link-release.c
2011-09-16 12:57:52 +02:00
Thomas Graf b50195c691 addr: Add missing header to <netlink/route/addr.h>
Fixes a gcc warning
2011-09-13 23:13:51 +02:00
Thomas Graf 4c210adcb5 Switch to libtool versioning system
It has been a request that multiple libnl versions should be installabe
in parallel.

In order to achieve this, the basename of the library was changed to
libnl-3 which reflects the 3rd generation of libnl APIs. It also means
that release based library versioning is left behind and libtool
versioning is used instead.

Projects using pkgconfig will automatically link against the new library
basename and will not notice a difference.

The SO versioning is based on the glib model:
  current := 100 * minor + micro - revision
  revision := revision
  age := age (number of backwards compatible versions)
2011-09-13 22:58:08 +02:00
Jiri Pirko 6faeffe64a socket: introduce nl_socket_modify_err_cb
This function does the same as nl_socket_modify_cb except for error
callback

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
2011-08-31 09:23:58 +02:00
Thomas Graf 70c9371760 Updated link documentation
- API documentation
- developer guide
- enabled doxygen navbar
- fixed css
2011-07-28 16:23:57 +02:00
Thomas Graf f3ee216715 include <linux/if.h> from <netlink/route/link.h> to export IFF_* flags 2011-07-25 10:32:26 +02:00
Thomas Graf 8219cc79f8 VLAN: rtnl_link_is_vlan() function and API documentation 2011-07-21 17:47:00 +02:00
Thomas Graf 16d38a49d1 Use 'link type' instead of 'link info type'
The term 'link type' is much more easier to understand than 'link info type'

rtnl_link_set/get_info_type() left around for backwards compatibility
2011-07-21 16:45:01 +02:00
Thomas Graf 21d52eabba Support for NLM_F_INTR
Check if a dump was interrupted and needs to be redone
2011-07-14 10:51:49 +02:00
Thomas Graf 09210d9619 HTB: Add support for level and direct pkt stats, complete access functions
- Adds support for htb class level and direct packet
  statistics
- Complete all get/set access functions
- Complete error handling
- Documentation
2011-06-09 13:32:13 +02:00
Thomas Graf 58e0e1eda9 Add nl_rate2str() 2011-06-09 12:29:21 +02:00
Thomas Graf ed69b2a79b Add rtnl_tc_data_check()
Behaves like rtnl_tc_data() but verifies that the traffic control
object is of the expected type.
2011-06-09 12:28:04 +02:00
Thomas Graf 4cb1666fe1 Provide silent variation of nl_cache_require()
Use in addr and tc layer to avoid warnings being printed if no
cache is available.
2011-05-11 09:33:29 +02:00
Thomas Graf d44c31da5f addr: store link object and provide rtnl_addr_get()
stores rtnl_link object in address if cache is availble. Provide access
via rtnl_addr_get_link() and rtnl_addr_set_link().

Add rtnl_addr_get() which searches a address cache for an address
matching ifindex and local address.
2011-05-03 11:48:14 +02:00
Thomas Graf cc33b0940f Add missing declaration of rtnl_tc_get_link() 2011-04-21 14:58:05 +02:00
Thomas Graf 4c6dd3a8bd Expose <netlink/route/link/inet.h> 2011-04-20 11:53:04 +02:00
Thomas Graf 8ffab45698 export rtnl_link_add() and rtnl_link_build_add_request() 2011-04-15 15:31:47 +02:00
Thomas Graf 96bc6d6f66 Improve rtnl_link_change() behaviour
- avoid unncessary name change requests
    The kernel does not check if the specified IFNAME is different
    from the current name. It assumes that if IFNAME and ifindex
    are both specified, a name change is requested. Therefore avoid
    specyfing IFNAME if ifindex is provided and original and new
    name are identical.
- move link building to own function (to allow link add later on)
- error if immutable changes have been made
- better documentation
2011-04-13 16:42:34 +02:00
Thomas Graf 48d543cfdf API to issue direct GET requests to the kernel
Provide nl_pickup() to pick up an answer from a netlink request and parse
it using the supplied parser.

Add rtnl_link_get_kernel() which sends an RTM_GETLINK to the kernel to
fetch a single link directly from the kernel. This can be faster than
dumping the whole table, especially if lots of links are configured.
2011-04-11 12:34:01 +02:00
Thomas Graf 41fb241b7b link: Provide rtnl_link_delete() to delete virtual links
Takes a link object and extracts ifindex and name to build a deletion request
message to delete virtual network links.
2011-04-10 11:02:47 +02:00
Thomas Graf 0893aafcec link: Make return and argument type match 2011-04-10 10:24:12 +02:00
Thomas Graf 23c27b4738 Provide nl_cache_set_arg{1,2}() to specify cache args
Added based on a RFE. This is required if allocation and
(re)filling is to be splitted.
2011-04-10 10:22:27 +02:00
Thomas Graf ef327ffd44 Provide nl_object_dump_buf() to easily dump to buffers 2011-04-10 10:22:01 +02:00
Thomas Graf 475dffa699 Provide TC_HANDLE(maj, min) macro to generate tc handles 2011-04-01 16:25:57 +02:00
Thomas Graf 7c620500bb trafic class/classifer API improvements and documentation
- removed dead functions in header files
- deprecated rtnl_class_foreach_*() functions due to their missing
  handling possibility of OOM situations
- improved API documentation
2011-03-29 12:41:59 +02:00
Thomas Graf 747b892c91 Qdisc API improvements and documentation
Deprecated the functions rtnl_qdisc_change() and
rtnl_qdisc_build_change_request() for their lack of being able to
specify flags. The new functions rtnl_qdisc_update() and
rtnl_qdisc_build_update_request() may be used instead. The old
functions are still available though. However, rtnl_qdisc_update()
no longer implies NLM_F_REPLACE, it has to specified implicitely
to allow updating a qdisc without risking to replace another qdisc.

Included detailed documentation of qdisc addition/update/deletion.

Introduced APPBUG() macro to let application developer know of
API abuse.
2011-03-25 18:13:19 +01:00
Thomas Graf 23845e942c Add nl_send_sync()
Function which sends message using nl_send_auto(), frees the message and
waits for ACK/error message (if auto-ack is not disabled).
2011-03-25 18:11:52 +01:00