From: Danny Milosavljevic <dannym@scratchpost.org>
To: 43653@debbugs.gnu.org
Cc: Danny Milosavljevic <dannym@scratchpost.org>
Subject: [bug#43653] [PATCH] services: dnsmasq: Add TFTP configuration.
Date: Sun, 27 Sep 2020 21:06:30 +0200 [thread overview]
Message-ID: <20200927190630.1753-1-dannym@scratchpost.org> (raw)
* gnu/services/dns.scm (<dnsmasq-configuration>): Add TFTP configuration
fields.
(dnsmasq-shepherd-service): Use them.
---
gnu/services/dns.scm | 70 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 67 insertions(+), 3 deletions(-)
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index 9caa3611be..572880561c 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -757,7 +757,29 @@ cache.size = 100 * MB
(cache-size dnsmasq-configuration-cache-size
(default 150)) ;integer
(negative-cache? dnsmasq-configuration-negative-cache?
- (default #t))) ;boolean
+ (default #t)) ;boolean
+ (tftp-enable? dnsmasq-configuration-tftp-enable?
+ (default #f)) ;boolean
+ (tftp-no-fail? dnsmasq-configuration-tftp-no-fail?
+ (default #f)) ;boolean
+ (tftp-single-port? dnsmasq-configuration-tftp-single-port?
+ (default #f)) ;boolean
+ (tftp-secure? dnsmasq-tftp-secure?
+ (default #f)) ;boolean
+ (tftp-max dnsmasq-tftp-max
+ (default #f)) ;integer
+ (tftp-mtu dnsmasq-tftp-mtu
+ (default #f)) ;integer
+ (tftp-no-blocksize? dnsmasq-tftp-no-blocksize?
+ (default #f)) ;boolean
+ (tftp-lowercase? dnsmasq-tftp-lowercase?
+ (default #f)) ;boolean
+ (tftp-port-range dnsmasq-tftp-port-range
+ (default #f)) ;string
+ (tftp-root dnsmasq-tftp-root
+ (default "/var/empty,lo")) ;string
+ (tftp-unique-root dnsmasq-tftp-unique-root
+ (default #f))) ;"" or "ip" or "mac"
(define dnsmasq-shepherd-service
(match-lambda
@@ -765,7 +787,12 @@ cache.size = 100 * MB
no-hosts?
port local-service? listen-addresses
resolv-file no-resolv? servers
- addresses cache-size negative-cache?)
+ addresses cache-size negative-cache?
+ tftp-enable? tftp-no-fail?
+ tftp-single-port? tftp-secure?
+ tftp-max tftp-mtu tftp-no-blocksize?
+ tftp-lowercase? tftp-port-range
+ tftp-root tftp-unique-root)
(shepherd-service
(provision '(dnsmasq))
(requirement '(networking))
@@ -794,7 +821,44 @@ cache.size = 100 * MB
#$(format #f "--cache-size=~a" cache-size)
#$@(if negative-cache?
'()
- '("--no-negcache")))
+ '("--no-negcache"))
+ #$@(if tftp-enable?
+ '("--enable-tftp")
+ '())
+ #$@(if tftp-no-fail?
+ '("--tftp-no-fail")
+ '())
+ #$@(if tftp-single-port?
+ '("--tftp-single-port")
+ '())
+ #$@(if tftp-secure?
+ '("--tftp-secure?")
+ '())
+ #$@(if tftp-max
+ (list (format #f "--tftp-max=~a" tftp-max))
+ '())
+ #$@(if tftp-mtu
+ (list (format #f "--tftp-mtu=~a" tftp-mtu))
+ '())
+ #$@(if tftp-no-blocksize?
+ '("--tftp-no-blocksize")
+ '())
+ #$@(if tftp-lowercase?
+ '("--tftp-lowercase")
+ '())
+ #$@(if tftp-port-range
+ (list (format #f "--tftp-port-range=~a"
+ tftp-port-range))
+ '())
+ #$@(if tftp-root
+ (list (format #f "--tftp-root=~a" tftp-root))
+ '())
+ #$@(if tftp-unique-root
+ (list
+ (if (> (length tftp-unique-root) 0)
+ (format #f "--tftp-unique-root=~a" tftp-unique-root)
+ (format #f "--tftp-unique-root")))
+ '()))
#:pid-file "/run/dnsmasq.pid"))
(stop #~(make-kill-destructor))))))
next reply other threads:[~2020-09-27 19:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-27 19:06 Danny Milosavljevic [this message]
2020-09-27 19:26 ` [bug#43653] [PATCH] services: dnsmasq: Add TFTP configuration Jonathan Brielmaier
2020-10-06 6:15 ` bug#43653: " Danny Milosavljevic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200927190630.1753-1-dannym@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=43653@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).