dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

484 Commits

Author SHA1 Message Date
Thomas Graf cc33b0940f Add missing declaration of rtnl_tc_get_link() 2011-04-21 14:58:05 +02:00
Thomas Graf daefa76959 Provide rtnl_tc_get_link() and fix link refcnt
Adds rtnl_tc_get_link() returning the link associated with a tc
object.

Don't clone link associated with tc object when cloning the tc
object, refer to same link instead and bump refcnt.

Fix refcnt leak when assigning link in msg parser.
2011-04-21 14:48:54 +02:00
Thomas Graf 83f14112e2 Fix clone() of AF specific link data
Passed the original link to ao_clone() instead of the new one.
2011-04-21 14:46:06 +02:00
Thomas Graf c18730ddf6 Set tc->tc_link if link cache is available
When parsing tc objects, lookup link in link cache if such a
cache is available.
2011-04-20 16:30:49 +02:00
Thomas Graf fac4885608 Improve readability of classid string representation
1: is more readable than 01:
2011-04-20 16:29:42 +02:00
Thomas Graf 4c6dd3a8bd Expose <netlink/route/link/inet.h> 2011-04-20 11:53:04 +02:00
Thomas Graf 36b04747c7 Support link info types with no payload 2011-04-19 09:57:35 +02:00
Thomas Graf 3d70697e4c Add support for ARPHRD_NONE 2011-04-19 09:57:14 +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 5a6610190a dummy interface support 2011-04-15 15:31:22 +02:00
Thomas Graf e81814a29f Support for rtnl_link_add()
API for adding virtual links
2011-04-15 15:30:46 +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 b5918b5ce3 fix line removed by mistake
This line was removed by mistake in the last commit
2011-04-11 12:40:40 +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 2dbe7d7cfc Initialize dump buffer in case caller missed it
(Set an end to all the bug reports of applications failing
to do so.)
2011-04-10 10:18:04 +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 350b15f9d1 Move to asciidoc
The core library documentation has been converted to use asciidoc. It
provides better flexibility in creating documentation such as tables
and more powerful formatting rules.

The doxygen based API reference remains and three scripts have been
added to:
 - gen-tags.sh: extract tag information from doxygen reference
 - tags2dict.sh: generate a name=link dictionary file
 - doxygen-link.py: replace all references in the asciidoc documentation
                    refering to API functions, struct, etc. with a link
		    into the doxygen API reference.

'make gendoc' continue to generate all documentation.

The following tools are required to generate documentation:
 - asciidoc
 - mscgen
 - asciidoc mscgen plugin
 - pygments
 - xmlstarlet
2011-03-31 14: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
Nicolas Sitbon 7e9d5f69e5 correctly handle the object not found case
Removing non existent route (both ipv4 and ipv6) using
rtnl_route_delete return NLE_FAILURE generic error code. After
investigation, it seems the linux kernel return -ESRCH in that case
(see http://lxr.linux.no/linux+v2.6.38/net/ipv6/route.c#L1367). Same
behaviour apply for removing non existent address. The function
nl_syserr2nlerr (lib/error.c) which is responsible for translating
from kernel error to libnl error doesn't handle ESRCH.
2011-03-25 16:51:31 +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 a62bfdb8e0 Check if all mandatory attributes are present in rtnl_tc_msg_build()
TCA_ATTR_IFINDEX | TCA_ATTR_PARENT | TCA_ATTR_KIND
2011-03-24 17:00:38 +01:00
Thomas Graf 93b6c114a8 Add NLE_NODEV error 2011-03-24 16:56:10 +01:00
Thomas Graf 14fa557ba9 Set default MTU to 1500 2011-03-24 12:59:57 +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
Thierry Reding 913579b460 Fix out-of-tree build.
This patch fixes out-of-tree build, that is, when building with
$builddir != $srcdir. In such a case, some generated header files are
not found because they live in a different tree and can be fixed by
adding the directories to the compiler's include search path.
2011-03-23 15:51:56 +01:00
Thomas Graf a0fe7a1c9a Omit empty nested attributes
Check for empty nested attributes in nla_nest_end() and omit the
attribute alltogether if is is the case.
2011-03-23 13:39:18 +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
Daniel Walter f0603a467b add missing checks for ROUTE_ATTR_MULTIPATH
attached patch adds missing checks for ROUTE_ATTR_MULTIPATH
when dealing with multipath routing.

Affected functions

rtnl_route_remove_nexthop
rtnl_route_get_nexthops
rtnl_route_get_nnexthops
2011-03-22 13:11:09 +01:00
Thomas Graf c1073d6172 Documentation updates
Mostly killing doxygen warnings, some doc updates to caching
2011-03-22 00:40:26 +01:00
Thomas Graf 55f803c64d libnl-3.0 2011-03-21 17:03:01 +01:00
Thomas Graf 722a227795 fix module parent references 2011-03-21 16:54:37 +01:00
Thomas Graf 45941f9d5f rename sch -> qdisc 2011-03-21 16:47:42 +01:00
Thomas Graf 8eb5b5532e Unified TC API
Finally got rid of all the qdisc/class/cls code duplication in
the tc module API. The API takes care of allocation/freeing the
tc object specific data.

I hope I got it right this time.
2011-03-21 15:51:52 +01:00
Thomas Graf 5dc897d5de provide function to retrieve htb rate 2011-03-17 17:31:08 +01:00
Thomas Graf 552c85cab7 Hold reference to obj while calling callback of cache iterator 2011-03-17 17:30:32 +01:00
Thomas Graf 33e94038c4 Print debugging info while iterating a cache based on a filter 2011-03-17 16:40:39 +01:00
Thomas Graf 2c75886060 Fix off-by-one when reading IFLA_INET6_CONF and IFLA_INET6_STATS 2011-03-17 16:11:10 +01:00
Thomas Graf 5a9f50b8e9 __nlmsg_alloc(): Guarantee minimal message size of at least the header 2011-03-17 16:03:11 +01:00
Thomas Graf ae5dfb1cc7 Make struct nl_object public, NLHDR_COMMON has been public anyway 2011-03-17 14:44:56 +01:00
Miguel Di Ciurcio Filho 59c3474b3d Add missing argument in rtnl_link_change example
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
2011-03-16 13:49:08 +01:00
Thomas Graf d8d67c0a4c Provide numeric version defines 2011-03-16 13:46:41 +01:00
Reuben Hawkins b5c474e533 allowing silent rules in build 2011-03-16 13:21:50 +01:00