dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

302 Commits

Author SHA1 Message Date
roopa 30d862650b 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>
2012-11-12 21:51:03 +01:00
roopa dd8a87da96 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>
2012-11-12 21:51:02 +01:00
Thomas Graf 5641c0ea61 Hash: Properly prefix hash functions
Do not pollute public namespace with unprefixed functions.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 10:22:26 +01:00
roopa 55c0e036b0 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>
2012-11-10 00:12:44 +01:00
roopa c6f89ed02f 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>
2012-11-10 00:12:36 +01:00
roopa a8741fab8e 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>
2012-11-10 00:12:08 +01:00
roopa bc7c822f54 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>
2012-11-05 13:58:50 +01:00
roopa 690264a193 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>
2012-11-05 13:31:55 +01:00
Thomas Graf 609b47961b Merge branch 'master' of https://github.com/rmfought/libnl 2012-10-26 12:48:22 +02:00
Thomas Graf 3c1ab421ee add missing '}' in __cplusplus namespaces
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-23 15:28:24 +02:00
Rich Fought d2fff93cce Source cleanup for upstream 2012-10-19 11:18:52 -07:00
Rich Fought 2d707513c6 Updated nfnetlink includes; removed ifdefs; added delete exp program 2012-10-16 12:13:33 -07:00
Rich Fought 07418658a6 define advanced attributes out 2012-10-12 17:44:27 -07:00
Rich Fought d3bec59eb9 bugfixes 2012-10-09 15:16:00 -07:00
Thomas Graf a35287a689 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>
2012-10-09 21:55:31 +02:00
Thomas Graf 36ed882e00 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>
2012-10-09 19:57:22 +02:00
Thomas Graf 6ac07179e5 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>
2012-10-09 18:15:50 +02:00
Thomas Graf e4192ff97f 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>
2012-10-09 16:16:54 +02:00
Rich Fought 4a702e6b72 Starting CLI work 2012-10-08 17:31:42 -07:00
Rich Fought f111efd894 Successful compilation of libnl-nf with expectation 2012-10-08 16:49:06 -07:00
Rich Fought c675bf0486 Checkpoint before compilation attempt 2012-10-08 15:26:55 -07:00
Rich Fought e8b3356dd2 "checkpoint" 2012-10-05 17:32:20 -07:00
Rich Fought 20035ce021 Checkpoint: compare function 2012-10-05 11:09:45 -07:00
Rich Fought 40457db1f4 Exp checkpoint 2012-10-05 06:55:04 -07:00
Thomas Graf b377ab1bbd route: Document ROUTE_CACHE_CONTENT flag
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-08-30 13:19:56 +02:00
Коренберг Марк (дома) 582a32433c 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);
2012-08-30 03:19:04 +06:00
Thomas Graf 376a0e29c7 Fix build warning after const char ** convert
Commit 25d640da4a caused the following build warning:
../include/netlink/utils.h:47:15: note: expected 'const char **' but argument is of type 'char **'
route/link/inet6.c:300:11: warning: passing argument 2 of 'nl_cancel_down_bytes' from incompatible pointer type [enabled by default]

Revert the const char ** change.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-08-29 12:05:51 +02:00
Коренберг Марк 25d640da4a lib/utils.c: One kilobit now is a 1000bits (instead of 1024)
http://en.wikipedia.org/wiki/Kilobit

Also, convert "char*" to "const char*" in output value,
as returned values can not be modified.
2012-08-28 18:59:59 +06:00
Andrew Collins 84037becfd Correct missing fwmark mask proto.
In my previous patch for adding fwmark mask support, I neglected
to add a prototype for it.  This change corrects my oversight.
2012-06-11 23:50:27 +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 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
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
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
Patrick McHardy 94cd080452 dect: transceiver: resync kernel header for P64 definitions
Signed-off-by: Patrick McHardy <kaber@trash.net>
2012-02-09 20:41:07 +01:00
Patrick McHardy c2fdebea42 libnl: resync netlink.h with kernel
Signed-off-by: Patrick McHardy <kaber@trash.net>
2012-02-09 20:37:20 +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
Jiri Pirko ef75c4edf0 link: allow to add/get linkinfo of unknown type
store type kind in rtnl_link independently. That would allow to use this
value even if type_ops are not present. This allows for example to
create devices of type unknown to libnl.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
2011-11-11 15:37:03 +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
Michael Altizer 6c70cf7d72 Don't install CLI header files when --disable-cli has been configured.
Signed-off-by: Michael Altizer <xiche@verizon.net>
2011-10-10 11:44:07 +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 15b13ddbde bonding: Install <netlink/route/link/bonding.h> 2011-09-16 13:07:03 +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
Thomas Graf 226b387557 Install headers in ${includedir}/libnl3
This allows for multiple major versions to be installed in parallel. Pkg-config
files are adapted to provide appropriate cflags to find new header locations.
2011-09-13 11:48:18 +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
Patrick McHardy 4cec8d361c packet 2011-07-06 04:39:35 +02:00
Christian Ruppert 4806c5c058 Don't redefine offsetof when already defined by e.g. stddef.h 2011-06-21 11:33:44 +02:00
Patrick McHardy 68915b1292 dect: add support for MBC statistics
Signed-off-by: Patrick McHardy <kaber@trash.net>
2011-06-18 06:04:58 +02:00
Patrick McHardy 450d03b24b headers: resync netlink.h
Signed-off-by: Patrick McHardy <kaber@trash.net>
2011-06-18 06:04:51 +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 053c93fa8a Update local copies of include/linux 2011-06-09 12:56:52 +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
Patrick McHardy 29abe5d86f dect: support transceiver features attribute
Signed-off-by: Patrick McHardy <kaber@trash.net>
2011-04-12 02:54:23 +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
Thomas Graf e4b507e290 Deprecate rtnl_qdisc_foreach_child() and rtnl_qdisc_foreach_cls()
Their usage is not completely safe, it is not possible to handle
the out of memory situation of the allocate filter. It is very
unlikely for this to cause any problem though.

The functions are still accessible but gcc will warn about their
deprecation.
2011-03-24 22:50:11 +01:00
Thomas Graf f523f297f7 Allow NLSYSCONFDIR environment variable to overwrite built-in sysconfdir 2011-03-24 21:14:52 +01:00
Thomas Graf 8d5493418a Cleanup <netlink/route/qdisc.h>
- remove dead prototypes
- reformat
2011-03-24 20:57:43 +01:00
Thomas Graf 93b6c114a8 Add NLE_NODEV error 2011-03-24 16:56:10 +01:00
Thierry Reding 9f1abddb1a Fix "make distcheck".
This commit adds some missing files (some header files, the files below
/etc and the bison/flex files) to the distribution tarball to ensure
that libnl can be built from the tarballs created using "make dist".

It also adds some incantations to properly generate the flex and bison
output since the generated output is no longer shipped in the tarball.
2011-03-23 16:00:44 +01:00
Daniel Walter 38db636f78 add missing nl_cache_search in cache.h
fix missing declaration of nl_cache_search
2011-03-22 13:13:07 +01:00
Thomas Graf c1073d6172 Documentation updates
Mostly killing doxygen warnings, some doc updates to caching
2011-03-22 00:40:26 +01:00
Patrick McHardy 93a9e4dc6a Merge git://git.kernel.org/pub/scm/libs/netlink/libnl 2011-03-21 19:11:19 +01:00