Commit graph

31 commits

Author SHA1 Message Date
Umut Tezduyar Lindskog 5c1d3fc93d sd-network: IPv4 link-local support [v2]
Implements IPv4LL with respect to RFC 3927
(http://tools.ietf.org/rfc/rfc3927.txt) and integrates it
with networkd. Majority of the IPv4LL state machine is
taken from avahi (http://avahi.org/) project's autoip.

IPv4LL can be enabled by IPv4LL=yes under [Network]
section of .network file.

IPv4LL works independent of DHCP but if DHCP lease is
aquired, then LL address will be dropped.

[tomegun: removed a trailing newline and a compiler warning]
2014-03-03 23:24:34 +01:00
Lennart Poettering 151b9b9662 api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:

1. The object the new object is derived from is put first, if there is any

2. The object we are creating will be returned in the next arguments

3. This is followed by any additional arguments

Rationale:

For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.

Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.

Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that.
2014-02-20 00:03:10 +01:00
Tom Gundersen 4fb7242cbb sd-rtnl-message: store reference to the bus in the message
This mimics the sd-bus api, as we may need it in the future.
2014-02-18 11:21:22 +01:00
Tom Gundersen 818dc5e72a sd-rtnl: always include linux/rtnetlink.h 2014-02-15 12:14:45 +01:00
Tom Gundersen ee3a6a51e5 sd-rtnl: message_open_container - don't take a 'size' argument
We can always know the size based on the type, so let's do this inside the library.
2014-02-15 12:14:45 +01:00
Lennart Poettering 31a4e15384 rtnl: support adding VETH_INFO_PEER containers into rtnl messages 2014-02-13 18:47:53 +01:00
Lennart Poettering d595c5cc9e rtnl: rename constructors from the form sd_rtnl_xxx_yyy_new() to sd_rtnl_xxx_new_yyy()
So far we followed the rule to always indicate the "flavour" of
constructors after the "_new_" or "_open_" in the function name, so
let's keep things in sync here for rtnl and do the same.
2014-02-13 13:53:25 +01:00
Susant Sahani 7b1796403a Added attribute support for sd-rtnl
Added sd_rtnl_message_append_u8 and
  few attribute support in sd_rtnl_message_append_u32
       IFLA_GROUP, IFLA_TXQLEN, IFLA_NUM_TX_QUEUES, IFLA_NUM_RX_QUEUES
2014-02-05 00:07:29 +01:00
Tom Gundersen e5c4350b0d sd-rtnl: add support for reading containers
Also insist on messages being sealed before reading them. In other
words we don't allow interleaving of reading and appending to messages.
2014-01-24 22:20:34 +01:00
Tom Gundersen 5a72317435 sd-rtnl: simplify sd_rtnl_message_addr_new()
Split out into sd_rtnl_message_addr_set_{prefixlen,flags,scope}().
2014-01-22 18:01:45 +01:00
Tom Gundersen 01b36069cc sd-rtnl: add sd_rtnl_message_append_u16() 2014-01-22 17:56:49 +01:00
Tom Gundersen 5d4795f372 sd-rtnl: link - allow setting the change mask 2014-01-22 17:56:49 +01:00
Tom Gundersen 0a0dc69b65 rtnl: replace message_append by typesafe versions 2013-12-16 17:28:18 +01:00
Tom Gundersen 0fc7531b40 rtnl: support interleaved reading and writing, and rewind 2013-12-16 17:28:18 +01:00
Tom Gundersen 1f01fb4f29 rtnl: simplify route_new()
Drop most of the arguments and instead introduce set_dst_prefixlen().
2013-12-16 17:28:18 +01:00
Tom Gundersen fc25d7f805 rtnl: simplify link_new()
Drop most of the arguments and instead introduce link_set_{flags,type}.
2013-12-16 17:28:18 +01:00
Tom Gundersen 50b3c42f97 rtnl: add link_get_flags 2013-12-04 14:15:13 +01:00
Tom Gundersen 8cec01b9e9 rtnl: add callback support
sd_rtnl_add_match allows you to add a callback function for when given types of
messages are received.
2013-12-04 14:15:13 +01:00
Tom Gundersen 33125ac50b rtnl: add preliminary support for containers
For now, we only support one container type IFLA_LINKINFO, and we
still lack support for parsing the containers again.
2013-11-26 01:32:25 +01:00
Tom Gundersen b4f2a5b197 rtnl: add event loop integration 2013-11-14 23:22:58 +01:00
Tom Gundersen e16bcf986e rtnl: add call_async and call_async_cancel
They work in the same way as the sd-bus equivalents.
2013-11-14 14:32:48 +01:00
Tom Gundersen 4555ec72d6 rtnl: start adding support for asynchronous messaging
Similarly to sd-bus, add:

sd_rtnl_wait
sd_rtnl_process
sd_rtnl_send

and adapt sd_rtnl_call accordingly.
2013-11-13 19:52:17 +01:00
Tom Gundersen fe4824e065 rtnl: rename rtnl_bus_send_with_reply_and_block() to rtnl_bus_call()
Follow the equivalent rename in sd-bus to stay as similar as possible.
2013-11-13 19:48:44 +01:00
Lennart Poettering 0095c45415 api: replace manual C++ guards by macros 2013-11-07 16:53:26 +01:00
Lennart Poettering 6695ed7a84 api: add C++ guards 2013-11-07 03:47:42 +01:00
Lennart Poettering 0a0a68282c rtnl: headers in src/systemd/ may not use #pragma once 2013-11-07 03:40:43 +01:00
Lennart Poettering a33dece5f8 rtnl: headers in src/systemd/ may not include internal headers
Hence including "util.h" from sd-rtnl.h is not OK. Let's minimize our
headers we pull in a bit.
2013-11-07 03:39:32 +01:00
Tom Gundersen 03d7e632c0 rtnl: add support for routes 2013-11-04 23:00:48 +01:00
Tom Gundersen 3aeb37bc4f rtnl: move set_link_properties to rtnl-utils 2013-10-29 21:26:22 +01:00
Tom Gundersen dabfa9d1ef sd-rtnl: minor fixes 2013-10-29 16:12:11 +01:00
Tom Gundersen 65f568bbeb libsystemd-rtnl: add a rtnetlink library
This is intentionally as similar to sd-bus as possible. While it
would be simple to export it, the intentions is to keep this
internal (at least for the forseeable future).

Currently only synchronous communication is implemented
2013-10-27 22:18:34 +01:00