summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/dhcp-server-internal.h
AgeCommit message (Collapse)Author
2016-05-17networkd: Add EmitRouter= option for DHCP Server (#3251)Clemens Gruber
Add an option to disable appending DHCP option 3 (Router) to the DHCP OFFER and ACK packets. This commit adds the boolean option EmitRouter= for the [DHCPServer] section in .network files. Rationale: On embedded devices, it is very useful to have a DHCP server running on an USB OTG ethernet gadget interface to avoid manual setup on the client PCs, but it should only serve IP addresses, no route(r)s. Otherwise, Windows clients experience network connectivity issues, due to them using the address set in DHCP option 3 as default gateway. Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
2016-02-20tree-wide: place #pragma once at the same place everywhereLennart Poettering
Usually, we place the #pragma once before the copyright blurb in header files, but in a few cases we didn't. Move those around, so that we do the same thing everywhere.
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2015-11-27tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering
GLIB has recently started to officially support the gcc cleanup attribute in its public API, hence let's do the same for our APIs. With this patch we'll define an xyz_unrefp() call for each public xyz_unref() call, to make it easy to use inside a __attribute__((cleanup())) expression. Then, all code is ported over to make use of this. The new calls are also documented in the man pages, with examples how to use them (well, I only added docs where the _unref() call itself already had docs, and the examples, only cover sd_bus_unrefp() and sd_event_unrefp()). This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we tend to call our destructors these days. Note that this defines no public macro that wraps gcc's attribute and makes it easier to use. While I think it's our duty in the library to make our stuff easy to use, I figure it's not our duty to make gcc's own features easy to use on its own. Most likely, client code which wants to make use of this should define its own: #define _cleanup_(function) __attribute__((cleanup(function))) Or similar, to make the gcc feature easier to use. Making this logic public has the benefit that we can remove three header files whose only purpose was to define these functions internally. See #2008.
2015-11-18tree-wide: sort includes in *.hThomas Hindoe Paaboel Andersen
This is a continuation of the previous include sort patch, which only sorted for .c files.
2015-10-05hashmap: refactor hash_funcTom Gundersen
All our hash functions are based on siphash24(), factor out siphash_init() and siphash24_finalize() and pass the siphash state to the hash functions rather than the hash key. This simplifies the hash functions, and in particular makes composition simpler as calling siphash24_compress() repeatedly on separate chunks of input has the same effect as first concatenating the input and then calling siphash23_compress() on the result.
2015-08-31sd-dhcp-server: simplify pool creationTom Gundersen
Merge sd_dhcp_server_set_address() and sd_dhcp_server_set_lease_pool() into sd_dhcp_server_configure_pool() as the behavior of the two former depends on the order they are called in. The flexibility is not needed, so let's just do this in one call.
2015-08-28sd-dhcp-server: improve predictability of leasesTom Gundersen
Rather than having all clients attempt to get the same leases (starting at the beginning of the pool), make each client star at a random offset into the pool determined by their client id. This greatly increases the chances of a given client receiving the same IP address even though both the client and server have lost any lease information (and distinct server instances handing out the same leases).
2015-08-27dhcp,network: support emitting DNS/NTP server information from DHCP serverLennart Poettering
For now, this is very simple and IP addresses have to be configured manually.
2015-08-27networkd: make DHCP lease timeouts configurableLennart Poettering
2015-08-26dhcp: rename index to ifindexLennart Poettering
This avoids confusion what this is, in particular as libc knows an index() function.
2015-08-26dhcp: store client id as void*, since we dont know what it isLennart Poettering
2015-08-26dhcp: stop using refcnt.hLennart Poettering
No need to invole atomic ops in single-threaded APIs, let's simplify this.
2015-08-26dhcp,network: implement RFC 4833 (DHCP Timezone option)Lennart Poettering
This one is simply to add: encode the tzdata timezone in the DHCP options and optionally make use of it.
2015-01-23#pragma once here and thereZbigniew Jędrzejewski-Szmek
2014-11-27log: rearrange log function namingLennart Poettering
- Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style.
2014-11-27log: add an "error" parameter to all low-level logging calls and intrdouce ↵Lennart Poettering
log_error_errno() as log calls that take error numbers This change has two benefits: - The format string %m will now resolve to the specified error (or to errno if the specified error is 0. This allows getting rid of a ton of strerror() invocations, a function that is not thread-safe. - The specified error can be passed to the journal in the ERRNO= field. Now of course, we just need somebody to convert all cases of this: log_error("Something happened: %s", strerror(-r)); into thus: log_error_errno(-r, "Something happened: %m");
2014-08-04sd-dhcp-server: always send out ROUTER and SUBNET_MASKTom Gundersen
For now we simply take these values from the server's address.
2014-07-28sd-dhcp-server: add forcerenew supportTom Gundersen
2014-06-13sd-dhcp-server: track bound leasesTom Gundersen
Make sure we don't hand out the same IP twice. We still don't handle lease expiry.
2014-06-13sd-dhcp-server: add support for clients requesting lease lifetimeTom Gundersen
2014-06-13sd-dhcp-server: add basic REQUEST/ACK supportTom Gundersen
2014-06-13sd-dhcp-server: add support for sending messagesTom Gundersen
2014-06-13sd-dhcp-server: add support for setting the server addressTom Gundersen
2014-06-13sd-dhcp-server: bind to raw socket for sendingTom Gundersen
We would like to use the UDP socket, but we cannot as we need to specify the MAC address manually.
2014-06-13sd-dhcp-server: add basic message parsingTom Gundersen
Parse the maximum message size the client can accept and the client id, falling back to sane defaults if they are not set.
2014-06-13sd-dhcp-server: add basic message handling and verificationTom Gundersen
2014-06-13sd-dhcp-server: bind to a given interfaceTom Gundersen
We will (at least at first), restrict our focus to running the server on at most one interface.
2014-06-13sd-dhcp-server: add basic functionality for starting/stopping serverTom Gundersen
Bind to UDP socket and listen for messages, discarding anything we receive.
2014-06-13sd-dhcp-server: add basic functionality for creating/destroying server instanceTom Gundersen