summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/dhcp-server-internal.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* network: dhcp: rename NextServer= and Filename= settingsYu Watanabe2022-03-111-2/+3
| | | | | | | And make the settings configures DHCP option 66 and 67. Follow-ups for #22615. Fixes #22661.
* sd-dhcp-server: add support to send next server and filename option for PXE ↵Yu Watanabe2022-02-241-0/+2
| | | | boot systems
* sd-dhcp-server: support packet from non-Ethernet interfaceYu Watanabe2022-01-231-0/+2
| | | | Fixes #22217.
* sd-dhcp-server: change the type of the client ID dataYu Watanabe2022-01-231-1/+1
|
* network: dhcp-server: introduce Router= setting to specify router addressYu Watanabe2021-11-021-0/+1
| | | | Closes #21202.
* libsystemd-network: make sd_dhcp_client_get_ifname() or friends return ↵Yu Watanabe2021-09-281-3/+3
| | | | negative errno on error
* sd-dhcp-server: support static lease outside of address poolYu Watanabe2021-08-111-3/+5
| | | | Closes #20341.
* sd-dhcp-server: use hashmap_ensure_put()Yu Watanabe2021-08-111-0/+2
|
* sd-dhcp-server: support static address to DHCPv4 offerborna-blazevic2021-05-271-0/+1
|
* rfc3046 implementationYegor Alexeyev2021-05-081-1/+6
|
* relay role implementationYegor Alexeyev2021-04-201-0/+1
|
* libsystemd-network: check that errno==0 is not passed to log functionsZbigniew Jędrzejewski-Szmek2021-04-141-2/+5
|
* libsystemd-network: use macro for definitions of log_{lldp,dhcp,…}_errnoZbigniew Jędrzejewski-Szmek2021-04-141-10/+5
| | | | No functional change.
* Check that errno passed log_{interface,link}_*_errno() is non-zeroZbigniew Jędrzejewski-Szmek2021-04-141-1/+1
|
* dhcp: Implemented BindToInterface= configuration optionYegor Alexeyev2021-04-141-0/+3
|
* libsystemd-network: make log_dhcp_client() or friends include interface nameYu Watanabe2021-03-031-4/+14
|
* libsystemd-network: introduce sd_xxx_{set,get}_ifname()Yu Watanabe2021-03-031-0/+1
|
* network: Use ordered_hashmap_ensure_put (#18233)Susant Sahani2021-01-171-3/+3
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* sd-dhcp-server: add sd_dhcp_server_set_callback()Marc-André Lureau2020-06-041-0/+3
|
* sd-dhcp: clean-up of DHCP lease server codeLennart Poettering2020-05-301-2/+1
| | | | | | | | | | | | | | | | | | This is an attempt to clean-up the DHCP lease server type code a bit. We now strictly use the same enum everywhere, and store server info in an array. Moreover, we use the same nomenclature everywhere. This only makes the changes in the sd-dhcp code. The networkd code is untouched so far (but should be fixed up like this too. But it's more complicated since this would then touch actual settings in .network files). Note that this also changes some field names in serialized lease files. But given that these field names have not been part of a released version of systemd yet, such a change should be ok. This is pure renaming/refactoring, shouldn't actually change any behaviour.
* sd-dhcp-server: some function prototype fix-upsLennart Poettering2020-05-141-1/+1
| | | | | | | | | Let's use size_t for numbers of entries in memory. Let's use const wherever appropriate. Drop `_server` suffix from function name where we don't have it for similar other cases.
* DHCP client: make SendOption work for DHCPv6 too.Andrew Doran2020-05-111-0/+1
|
* sd-network: DHCPv4 Add support to send and receive LPR servers.Susant Sahani2020-04-221-2/+2
|
* sd-dhcp: Add support to emit and retrieve SMTP serverSusant Sahani2020-03-281-2/+2
|
* libsystemd-network: DHCP add support to emit and retrive DHCP POP3 serverSusant Sahani2020-03-281-2/+2
|
* network: Fix split in `SendOption=` on client and serverDavid Wood2020-03-191-1/+2
| | | | | | | | | | | | | | | | | When specifying `DHCPv4.SendOption=`, it is used by systemd-networkd to set the value of that option within the DHCP request that is sent out. This differs to setting `DHCPServer.SendOption=`, which will place all the options together as suboptions into the vendor-specific information (code 43) option. This commit adds two new config options, `DHCPv4.SendVendorOption=` and `DHCPServer.SendVendorOption=`. These both have the behaviour of the old `DHCPServer.SendOption=` flag, and set the value of the suboption in the vendor-specific information option. The behaviour of `DHCPServer.SendOption=` is then changed to reflect that of `DHCPv4.SendOption=`. It will set the value of the corresponding option in the DHCP request.
* dhcp: remove struct sd_dhcp_raw_optionYu Watanabe2019-11-181-9/+0
| | | | sd_dhcp_raw_option and sd_dhcp_option are essentially equivalent.
* networkd: dhcp server Support Vendor specific 43Susant Sahani2019-10-311-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementes https://tools.ietf.org/html/rfc2132 ``` [DHCPServer] SendRawOption=26:uint32:1400 SendRawOption=23:uint8:10 ``` Frame 448: 350 bytes on wire (2800 bits), 350 bytes captured (2800 bits) on interface 0 Linux cooked capture Internet Protocol Version 4, Src: 192.168.5.1, Dst: 192.168.5.11 User Datagram Protocol, Src Port: 67, Dst Port: 68 Dynamic Host Configuration Protocol (ACK) Message type: Boot Reply (2) Hardware type: Ethernet (0x01) Hardware address length: 6 Hops: 0 Transaction ID: 0x71f8de9d Seconds elapsed: 0 Bootp flags: 0x0000 (Unicast) Client IP address: 0.0.0.0 Your (client) IP address: 192.168.5.11 Next server IP address: 0.0.0.0 Relay agent IP address: 0.0.0.0 Client MAC address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4) Client hardware address padding: 00000000000000000000 Server host name not given Boot file name not given Magic cookie: DHCP Option: (53) DHCP Message Type (ACK) Length: 1 DHCP: ACK (5) Option: (51) IP Address Lease Time Length: 4 IP Address Lease Time: (3600s) 1 hour Option: (1) Subnet Mask (255.255.255.0) Length: 4 Subnet Mask: 255.255.255.0 Option: (3) Router Length: 4 Router: 192.168.5.1 Option: (6) Domain Name Server Length: 4 Domain Name Server: 192.168.5.1 Option: (42) Network Time Protocol Servers Length: 4 Network Time Protocol Server: 192.168.5.1 Option: (101) TCode Length: 13 TZ TCode: Europe/Berlin Option: (43) Vendor-Specific Information Length: 9 Value: 1701311a0431343030 Option: (54) DHCP Server Identifier (192.168.5.1) Length: 4 DHCP Server Identifier: 192.168.5.1 Option: (255) End Option End: 255 ```
* network: DHCP server Add support to transmit SIP serverSusant Sahani2019-09-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. DHCP server trasmit 2. Client parses and saves in leases Implements http://www.rfc-editor.org/rfc/rfc3361.txt ``` Frame 134: 348 bytes on wire (2784 bits), 348 bytes captured (2784 bits) on interface 0 Ethernet II, Src: 42:65:85:d6:4e:32 (42:65:85:d6:4e:32), Dst: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4) Internet Protocol Version 4, Src: 192.168.5.1, Dst: 192.168.5.11 User Datagram Protocol, Src Port: 67, Dst Port: 68 Dynamic Host Configuration Protocol (ACK) Message type: Boot Reply (2) Hardware type: Ethernet (0x01) Hardware address length: 6 Hops: 0 Transaction ID: 0x7cc87cb4 Seconds elapsed: 0 Bootp flags: 0x0000 (Unicast) Client IP address: 0.0.0.0 Your (client) IP address: 192.168.5.11 Next server IP address: 0.0.0.0 Relay agent IP address: 0.0.0.0 Client MAC address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4) Client hardware address padding: 00000000000000000000 Server host name not given Boot file name not given Magic cookie: DHCP Option: (53) DHCP Message Type (ACK) Length: 1 DHCP: ACK (5) Option: (51) IP Address Lease Time Length: 4 IP Address Lease Time: (3600s) 1 hour Option: (1) Subnet Mask (255.255.255.0) Length: 4 Subnet Mask: 255.255.255.0 Option: (3) Router Length: 4 Router: 192.168.5.1 Option: (6) Domain Name Server Length: 4 Domain Name Server: 192.168.5.1 Option: (42) Network Time Protocol Servers Length: 4 Network Time Protocol Server: 192.168.1.1 Option: (120) SIP Servers <=====here Length: 9 SIP Server Encoding: IPv4 Address (1) SIP Server Address: 192.168.1.1 SIP Server Address: 192.168.5.2 Option: (101) TCode Length: 13 TZ TCode: Europe/Berlin Option: (54) DHCP Server Identifier (192.168.5.1) Length: 4 DHCP Server Identifier: 192.168.5.1 Option: (255) End Option End: 255 ``` ``` cat /run/systemd/netif/state  ✔  ⚡  3148  16:40:51 OPER_STATE=routable CARRIER_STATE=carrier ADDRESS_STATE=routable DNS=192.168.94.2 192.168.5.1 NTP=192.168.5.1 SIP=192.168.1.1 192.168.5.2 ``` aa
* tree-wide: use PROJECT_FILE instead of __FILE__Zbigniew Jędrzejewski-Szmek2019-07-041-2/+2
| | | | This replaces the internal uses of __FILE__ with the new macro.
* headers: remove unneeded includes from util.hZbigniew Jędrzejewski-Szmek2019-03-271-1/+1
| | | | | This means we need to include many more headers in various files that simply included util.h before, but it seems cleaner to do it this way.
* tree-wide: make hash_ops typesafeYu Watanabe2018-12-021-2/+2
|
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-201-1/+0
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: use proper unicode © instead of (C) where we canLennart Poettering2018-06-141-2/+2
| | | | | | Let's use a proper unicode copyright symbol where we can, it's prettier. This important patch is very important.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* dhcp-server: introduce log_dhcp_server_errno()Lennart Poettering2018-03-211-0/+1
| | | | | Sometimes we want to print the error number, hence do so properly, and avoid to use strerror() which is not reentrant.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* networkd: Add EmitRouter= option for DHCP Server (#3251)Clemens Gruber2016-05-181-0/+2
| | | | | | | | | | | | | | 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>
* tree-wide: place #pragma once at the same place everywhereLennart Poettering2016-02-201-2/+2
| | | | | | 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.
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering2015-11-271-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* tree-wide: sort includes in *.hThomas Hindoe Paaboel Andersen2015-11-181-4/+3
| | | | | This is a continuation of the previous include sort patch, which only sorted for .c files.
* hashmap: refactor hash_funcTom Gundersen2015-10-051-1/+1
| | | | | | | | | | | | 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.
* sd-dhcp-server: simplify pool creationTom Gundersen2015-08-311-2/+4
| | | | | | | 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.
* sd-dhcp-server: improve predictability of leasesTom Gundersen2015-08-281-1/+0
| | | | | | | | | 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).
* dhcp,network: support emitting DNS/NTP server information from DHCP serverLennart Poettering2015-08-271-0/+3
| | | | | For now, this is very simple and IP addresses have to be configured manually.
* networkd: make DHCP lease timeouts configurableLennart Poettering2015-08-271-1/+3
|
* dhcp: rename index to ifindexLennart Poettering2015-08-261-1/+1
| | | | | This avoids confusion what this is, in particular as libc knows an index() function.