Commit graph

198 commits

Author SHA1 Message Date
Thomas Graf
8a365dbd49 rename nl_send_auto_complete() -> nl_send_auto(), nl_auto_complete -> nl_complete_msg()
Old symbols left to maintain backwards compatibility
2010-11-18 14:13:49 +01:00
Thomas Graf
063a2ebf53 only perform automatic sequence checking if auto-ack mode is enabled 2010-11-18 12:51:20 +01:00
Thomas Graf
09daef3d83 Don't build doc.c, there is no real code in it 2010-11-18 12:47:40 +01:00
Thomas Graf
c32c3f3664 socket: constify interface 2010-11-18 12:47:16 +01:00
Thomas Graf
cf5577d280 constify struct trans_tbl 2010-11-17 16:09:08 +01:00
Thomas Graf
98ffedec04 link/inet6: pretty printing 2010-11-17 15:14:08 +01:00
Thomas Graf
d8eeb0a26f New function nl_size2str() 2010-11-17 15:13:33 +01:00
Thomas Graf
10424b20c1 Rename nl_get_hz() to nl_get_user_hz() to indicate it's not the in-kernel HZ value 2010-11-17 11:55:42 +01:00
Thomas Graf
3a9562001c sfq: perturb period is in seconds, not jiffies 2010-11-17 11:55:03 +01:00
Thomas Graf
4d28cc51bc link/inet: pretty printing, make output more readable 2010-11-17 00:06:34 +01:00
Thomas Graf
01bc3c58c2 link/inet: documentation: add examples 2010-11-16 15:07:27 +01:00
Thomas Graf
ee57cc716f link: define RTM_SETLINK to allow pretty printing 2010-11-16 13:54:54 +01:00
Thomas Graf
2575d03135 link: Add missing IFLA_AF_SPEC container attribute 2010-11-16 13:54:15 +01:00
Thomas Graf
e2099719a5 link/inet: Fix array access 2010-11-16 13:47:41 +01:00
Thomas Graf
b6592cb5de link: Fix typo, use rtnl_link_af_alloc() to make sure data buffer is allocated 2010-11-16 13:46:49 +01:00
Thomas Graf
53015f8381 link: AF_INET link module
Note: The code for this is not upstream yet.

Extends the link api to allow address family modules to fill a link
message and implements a AF_INET address family link module which
uses the new interface.
2010-11-16 12:41:43 +01:00
Thomas Graf
2e3ca4db0c link: Support for IFLA_AF_SPEC
This feature isn't upstream yet. It's required to test a patch in
my local tree.

Makes the link parser understand IFLA_AF_SPEC and call the address
family specific parser.
2010-11-13 01:38:13 +01:00
Thomas Graf
a4efc65c3a link: Add support for IPv6 specific link data
- parses IFLA_PROTINFO
 - dumps flags, cacheinfo, devconf and all statistics
2010-11-11 23:15:28 +01:00
Thomas Graf
e69efadc46 Add support for per interface ICMPv6 statistics 2010-11-11 23:14:57 +01:00
Thomas Graf
7ff4deeb56 Extend rtnl_link_alloc_cache() to support address families
Adds a family argument which allows to request link dumps for a certain
address family. This allows to f.e. dump ipv6 specific statistics and data.

nl-link-list --family inet6
2010-11-11 22:26:11 +01:00
Thomas Graf
2847cf081b Make nl_str2af return a negative value if parsing fails 2010-11-11 22:25:32 +01:00
Thomas Graf
12b82e4f6f link/api: Improve API documentation. 2010-11-11 16:38:53 +01:00
Thomas Graf
67aeb7474f link/api: Convert link info ops to use nl_list_head
rtnl_link_info_ops_lookup() now returns a pointer with refcnt increment,
you must return it using rtnl_link_info_ops_put()
2010-11-11 16:18:53 +01:00
Thomas Graf
800013b787 link: Support for AF_BRIDGE address family
Supports parsing of IFLA_PROTINFO returned when dumping with PF_BRIDGE
2010-11-11 16:02:48 +01:00
Thomas Graf
280d457c22 link/api: Check for null pointer in rtnl_link_af_ops_put() 2010-11-11 16:02:02 +01:00
Thomas Graf
3fa6a6b410 link: API for address family specific link data
Introduces a new API to handle address familiy specific link data such as
IFLA_PROTINFO. It provides entry hooks for parsing IFLA_PROTINFO attributes
and allows to include the parsed data when a link object is dumped.
2010-11-11 15:50:49 +01:00
Thomas Graf
fd857eeb9f link: Support IFLA_NUM_VF attribute
- parses attribute if available
- provides API to access value
    rtnl_link_get_num_vf(link, num_vf)
2010-11-11 14:11:32 +01:00
Thomas Graf
8970c5cde6 link: Support IFLA_IFALIAS attribute
- parse IFLA_IFALIAS if available
- provides API to access/change ifalias
     rtnl_link_get_ifalias(link)
     rtnl_link_set_ifalias(link, alias)
- extends nl-link-set to test functionality
2010-11-11 13:57:10 +01:00
Thomas GraF
59880cb01e pktloc: support to specify a shift operator for packet locations
no users yet though.
2010-11-04 20:01:36 +01:00
Thomas GraF
d283c8e889 Correctly state the process of sending a netlink message. A message
passes through nl_send_iovec() before hitting nl_sendmsg()
2010-11-04 19:35:57 +01:00
Thomas Graf
d95a4193f3 ematch/meta: id definitions 2010-11-03 01:09:28 +01:00
Thomas Graf
4e48d90e71 Correctly parse and generate classids
Make sure to parse strings starting with a hex represention letter
but not representing a valid number as tc names.

Fix typo while generating classid.
2010-11-01 13:17:19 +01:00
Thomas Graf
4267d8f336 classid auto generation if provided tc name does not exist
Manually editing etc/libnl/classid before adding tc objects is a pain.
This patch adds code to attempt auto generating a unique tc id which
will then be assigned to the provided name and added to the classid
file.

This will make the following commands work with prior definitions of
the names "top" and "test"
	sudo sbin/nl-qdisc-add --dev eth0 --parent root --id top htb
	sudo sbin/nl-class-add --dev eth0 --parent top --id test htb --rate 100mbit

It will generate the following ids automatically:
4001:			top
4001:1			test
2010-11-01 08:17:40 +01:00
Thomas Graf
7903d6ab4b Support for meta match
Syntax:
	meta(pktlen > 768)
2010-10-31 23:13:01 +01:00
Thomas Graf
c7a673787b text ematch support 2010-10-29 21:10:02 +02:00
Thomas Graf
93f992eac5 attr: Add padding if nested data does not end at an alignment boundry
This could happen if a user put an unaligned amount of data inside
an attribute with nlmsg_append().
2010-10-29 18:40:48 +02:00
Thomas Graf
cc22992d0c Improved debugging messages while constructing messages/attributes 2010-10-29 18:34:27 +02:00
Thomas Graf
f703192a4f routing rules: adapt to unified routing rules
- Use FRA_ definitions
- Removed obsoleted fields
- Added fwmask and goto support
2010-10-29 12:48:46 +02:00
Thomas Graf
1eccb7b99c Revert "routing rules: mark support"
This reverts commit ee88c71d16.
2010-10-29 11:52:22 +02:00
Thomas Graf
858527622a Revert "Include RTA_MARK in routing rule messages"
This reverts commit 6862c6592a.
2010-10-29 11:52:08 +02:00
Thomas Graf
48cdb1fe66 Support RT_TABLE_COMPAT 2010-10-29 02:06:14 +02:00
Thomas Graf
2e6d49784b Support neighbour flag NTF_USE 2010-10-29 02:00:53 +02:00
Thomas Graf
873a64e2c1 Support for 64bit link counters IFLA_STATS64 2010-10-29 01:58:27 +02:00
Thomas Graf
6d434415ad Updated arp and ethernet codes 2010-10-29 01:48:13 +02:00
Thomas Graf
6862c6592a Include RTA_MARK in routing rule messages 2010-10-29 01:38:10 +02:00
Thomas Graf
ee88c71d16 routing rules: mark support
Obsolete RTA_PROTOINFO code and parse RTA_MARK

rtnl_rule_set_mark(rule, mark)
rtnl_rule_get_mark(rule)

now access the mark as in firewall mark
2010-10-29 01:34:15 +02:00
Thomas Graf
691905bc56 cgroup classifier improvements
- enabled again
 - ematch support
 - cli tools module

Example:
	nl-qdisc-add --dev eth0 --parent root --id 1: htb
	nl-cls-add --dev eth0 --parent 1: --id dead: cgroup
	nl-class-add --dev eth0 --parent 1: --id 1:<CGROUP> htb --rate 77mbit
2010-10-29 00:51:11 +02:00
Thomas Graf
2f867686ac basic: Only add ematches to message if available 2010-10-29 00:45:45 +02:00
Thomas Graf
d7a561a137 Tons of ematch work
- Fixes a bunch of bugs related to ematches
 - Adds support for the nbyte ematch
 - Adds a bison/flex parser for ematch expressions, expressions
   may look like this:
      ip.length > 256 && pattern(ip6.src = 3ffe::/16)
   documenation on syntax follows
 - adds ematch support to the basic classifier (--ematch EXPR)
2010-10-29 00:20:42 +02:00
Thomas Graf
e1eacd6b16 Fix use of uninitialized data at the end of netlink message
The netlink message buffer is preallocated to a page and later
expanded as needed. Everything was properly paded and zeroed
out except for the unused part at the end. Use calloc() to
allocate the buffer.
2010-10-29 00:17:07 +02:00