27 Commits

Author SHA1 Message Date
lordwelch
ce29a6f436 fix ip length 2020-08-10 22:05:40 -07:00
lordwelch
7923e58428 dhcp4d: add an options argument for the dhcp server 2020-08-10 18:12:35 -07:00
lordwelch
3c451f06ca Add the ability to run router7 on a normal Linux distribution 2020-08-10 18:12:34 -07:00
Matt Layher
988aa405be
cmd/dhcp4d: make use of unused assignment
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2020-05-09 16:58:57 -04:00
Michael Stapelberg
2b6ab5b2bd dhcp4d: make hostname override settable from status page 2020-04-12 10:33:11 +02:00
Michael Stapelberg
e34148d4e7 dhcp4d: add some leeway for lease activity 2020-02-06 18:48:19 +01:00
Michael Stapelberg
a543cb9a34 dhcp4d: add header describing whether lease is active
Should be interpreted by the DHCP server so that other programs don’t need to
hard-code the lease time.
2020-01-31 19:11:08 +01:00
Michael Stapelberg
a2ea8c2f95 cmd/dhcp4d: refactor for testing, add /lease/ test 2020-01-31 19:00:51 +01:00
Michael Stapelberg
4558cb61b4 dhcp4d: serve lease json data at /lease/<hostname> 2020-01-31 18:30:18 +01:00
Michael Stapelberg
3707ba290c dhcp4d: move http.HandleFunc into logic 2020-01-31 18:25:02 +01:00
Michael Stapelberg
e76886dab4 dhcp4d: protect leases with a mutex
The HTTP handler runs in a separate goroutine.
2020-01-31 18:23:19 +01:00
Michael Stapelberg
fa82132962 dhcp4d: add HostnameOverride field
This can be used to permanently override a hostname, regardless of whether the
lease is static or not. We use a separate field because we want devices to be
able to change their hostname themselves, until we override it.
2019-08-30 09:06:21 +02:00
Michael Stapelberg
323cc42b8e dhcp4d: polish status page, actually update it upon changes 2019-07-20 11:07:11 +02:00
Michael Stapelberg
c602f1d6b6 dhcp4d: introduce -interface flag 2019-07-20 10:50:30 +02:00
Michael Stapelberg
c211763b5d dhcp4d: indent leases.json for easier human editing 2019-07-20 10:49:53 +02:00
Michael Stapelberg
abeddabbb7 dhcp4d: restrict lease details page to internal IPs 2019-02-19 07:50:39 +01:00
Michael Stapelberg
6320b6c3a7 dhcp4d: display MAC vendor of each lease’s HardwareAddr 2019-01-06 18:02:01 +01:00
Michael Stapelberg
8df6329209 use renameio to write files atomically 2019-01-06 15:25:33 +01:00
Michael Stapelberg
d9f5d95812 dhcp4d: export number of non-expired DHCP leases 2018-10-23 08:49:29 +02:00
Michael Stapelberg
b347ed74c5 update import paths 2018-07-09 08:54:04 +02:00
Michael Stapelberg
ff7aa8f2cb add copyright notices 2018-06-28 20:08:23 +02:00
Michael Stapelberg
ae15230da3 dhcp4d: log in leases callback 2018-06-24 11:56:39 +02:00
Michael Stapelberg
3ba84074c7 dhcp4d: send replies as unicast using raw sockets
Preferring unicast over multicast (which hogs a lot of airtime on WiFi networks)
is a best practice.

Some device/access point vendor combinations even seem to entirely eat (some?)
broadcast traffic (sometimes), e.g. my Apple iPhone SE/Ubiquiti UAP-AC-HD, so
that using unicast is required for reliable WiFi.
2018-06-23 17:46:53 +02:00
Michael Stapelberg
4c69109db5 dhcp4d: implement permanent leases (no expiration) 2018-06-12 08:21:07 +02:00
Michael Stapelberg
d21822f531 dhcp4d: implement loading leases files from persistent storage 2018-06-09 15:18:01 +02:00
Michael Stapelberg
2ef8bf6ea0 dnsd/dhcp4d: listen on configured address (not hard-coded) 2018-06-04 08:22:45 +02:00
Michael Stapelberg
6b9ce5728a Initial commit 2018-05-27 17:30:42 +02:00