| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
https://bugs.freedesktop.org/show_bug.cgi?id=83097
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will allow sd-event to be integrated into an external event loop, which
in turn will allow (say) glib-based applications to use our various libraries,
without manually integrating each of them (bus, rtnl, dhcp, ...).
The external event-loop should integrate sd-event int he following way:
Every iteration must start with a call to sd_event_prepare(), which will
return 0 if no event sources are ready to be processed, a positive value if
they are and a negative value on error. sd_event_prepare() may only be called
following sd_event_dispatch(); a call to sd_event_wait() indicating that no
sources are ready to be dispatched; or a failed call to sd_event_dispatch() or
sd_event_wait().
A successful call to sd_event_prepare() indicating that no event sources are
ready to be dispatched must be followed by a call to sd_event_wait(),
which will return 0 if it timed out without event sources being ready to
be processed, a negative value on error and a positive value otherwise.
sd_event_wait() may only be called following a successful call to
sd_event_prepare() indicating that no event sources are ready to be dispatched.
If sd_event_wait() indicates that some events sources are ready to be
dispatched, it must be followed by a call to sd_event_dispatch(). This
is the only time sd_event_dispatch() may be called.
|
|
|
|
|
| |
This is a prerequisite for integrating sd-event into an external
event loop.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Remove the sd_ prefix from internal functions and get rid of the sd_memfd
type. As a memfd is now just a native file descriptor, we can get rid of our
own wrapper type, and also use close() and dup() on them directly.
|
| |
| |
| |
| |
| | |
Don't expose generic kernel API via libsystemd, but keep the code internal
for our own usage.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a generalization of the vtable privilege check we already have,
but exported, and hence useful when preparing for a polkit change.
This will deal with the complexity that on dbus1 one cannot trust the
capability field we retrieve via the bus, since it is read via
/proc/$$/stat (and thus might be out-of-date) rather than directly from
the message (like on kdbus) or bus connection (as for uid creds on
dbus1).
Also, port over all code to this new API.
|
| |
|
| |
|
|
|
|
|
|
| |
For now this only exposes the domain name (DHCP Option 15), and not
the search string (DHCP Option 119), which will be implemented in
a follow-up patch.
|
|
|
|
| |
Suggested by Kay and Lennart.
|
|
|
|
| |
Suggested by Lennart and Kay.
|
|
|
|
|
|
| |
The link is the 'object', so make this in line with our usual naming convention.
Suggested by Kay and Lennart.
|
| |
|
|
|
|
|
|
|
| |
This is the state when we are waiting for udev to initialize the device, and waiting for
libudev and rtnl to be in sync. In the future we probably will also be waiting for nl80211.
At this point we do not yet have enough information to know whether or not networkd should
be handling the device.
|
| |
|
|
|
|
| |
Also, output the collected information in "networkctl".
|
|
|
|
|
|
|
|
|
| |
The networkd should abstract the difference between DHCP supplied and
configured data, and hence the DHCP lease concept should not exposed on
the client side.
Should we want to support arbitrary DHCP fields one day, we can add a
new sd_network_get_link_dhcp_field() call or so.
|
|
|
|
|
|
|
| |
In the long run this should become a full fledged client to networkd
(but not before networkd learns bus support). For now, just pull
interesting data out of networkd, udev, and rtnl and present it to the
user, in a simple but useful output.
|
|
|
|
|
| |
This way we can introduce system-wide versions of these calls that are
called the same way, but without the "link" in the name.
|
|
|
|
| |
For now we simply take these values from the server's address.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Keep this internal to the client and simply restart it when NAK is receieved, as
per the RFC.
|
|
|
|
|
|
| |
This avoids having to distinguish between IPv4 and IPv6, allowing us
to keep their internal orderings. The consumers now has to turn the
strings into addresses.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All routes added by networkd are currently set RTPROT_BOOT, which according
to the kernel means "Route installed during boot" (rtnetlink.h). But this
is not always the case as networkd changes routing after boot too. Since
the kernel gives more detailed protocols, use them.
With this patch, user-configured static routes now use RTPROT_STATIC (which
they are) and DHCP routes use RTPROT_DHCP. There is no define for IPv4LL
yet, so those are installed as RTPROT_STATIC (though perhaps RTPROT_RA is
better?).
[tomegun: fixup
src/network/networkd-link.c:972:33: error: too few arguments to function 'route_new_dynamic']
|
|
|
|
| |
People should use rtnl for this, and then only query sd-network by the ifindices it finds.
|
|
|
|
|
|
|
|
| |
Let's settle on a single type for all address family values, even if
UNIX is very inconsitent on the precise type otherwise. Given that
socket() is the primary entrypoint for the sockets API, and that uses
"int", and "int" is relatively simple and generic, we settle on "int"
for this.
|
| |
|
|
|
|
|
|
| |
Do not expose link_is_loopback, people should just get this from rtnl directly.
Do not expose NTP servers as IP addresses, these must be strings.
Expose ifindex as int, not unsigned. This is what the kernel (mostly) and glibc uses.
|
|
|
|
|
| |
This is useful to save in the consumer of the lib, unlike ENODATA/EBUSY which
means that the user should wait until a useful state is available.
|
|
|
|
|
| |
So far both "indexes" and "indices" was used. Let's clean this up, and
stick to indices, since it appears to be used more frequently.
|
|
|
|
|
| |
makes things a bit clearer and avoids any clashes with libc's index()
symbol.
|
|
|
|
|
|
|
|
| |
arrays
As long as the number of array entries is relatively small it's nicer to
simply return the number of entries directly, instead of using a size_t*
return parameter for it.
|
|
|
|
|
|
| |
Constructors should return the object they created as first parameter,
except when they are generated as a child/member object of some other
object in which case that should be first.
|
|
|
|
|
|
|
| |
Let's turn resolved into a something truly useful: a fully asynchronous
DNS stub resolver that subscribes to network changes.
(More to come: caching, LLMNR, mDNS/DNS-SD, DNSSEC, IDN, NSS module)
|
|
|
|
|
|
|
|
|
|
| |
It appears there is no good way to decide whether or not broadcasts should be enabled,
there is hardware that must have broadcast, and there are networks that only allow
unicast. So we give up and make this configurable.
By default, unicast is used, but if the kernel were to inform us abotu certain
interfaces requiring broadcast, we could change this to opt-in by default in
those cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Vendor Class Identifier be used by DHCP clients to identify
their vendor type and configuration. When using this option,
vendors can define their own specific identifier values, such
as to convey a particular hardware or operating system
configuration or other identifying information.
Vendor-specified DHCP options—features that let administrators assign
separate options to clients with similar configuration requirements.
For example, if DHCP-aware clients for example we want to separate
different gateway and option for different set of people
(dev/test/hr/finance) in a org or devices for example web/database
servers or let's say in a embedded device etc and require a different
default gateway or DNS server than the rest of clients.
|
|
|
|
| |
all local containers
|
|
|
|
|
|
|
|
| |
file-hierarchy(7)
This new tool is based on "sd-path", a new (so far unexported) API for
libsystemd, that can hopefully grow into a workable API covering /opt
and more one day.
|
|
|
|
|
|
|
|
|
|
|
| |
Send hostname (option 12) in DISCOVER and REQUEST messages so the
DHCP server could use it to register with dynamic DNS and such.
To opt-out of this behaviour set SendHostname to false in [DHCP]
section of .network file
[tomegun: rebased, made sure a failing set_hostname is a noop and moved
config from DHCPv4 to DHCP]
|
|
|
|
|
|
| |
This adds support for DHCP options 33 and 121: Static Route and
Classless Static Route. To enable this feature, set UseRoutes=true
in .network file. Returned routes are added to the routing table.
|
|
|
|
|
|
| |
Note that /proc/sys/net/ipv4/ip_dynaddr needs to be non-zero.
[tomegun: hook up DHCP renew events to increase the lifetime when necessary]
|
| |
|
|
|
|
|
|
|
|
|
| |
Provide a function to request more options from the DHCPv6 server.
Provide a sensible default set at startup and add test basic test
cases for the intended usage.
Define DNS and NTP related option codes and add comments for the
unassigned codes.
|
|
|
|
|
| |
In some use cases stopping an ongoing ICMPv6 discovery is more
useful than always unreferencing the whole structure.
|