Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Guile DNS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hugo Hörnquist
Guile DNS
Commits
59f42c4d
Commit
59f42c4d
authored
May 23, 2022
by
Hugo Hörnquist
Browse files
Options
Downloads
Patches
Plain Diff
Move resolvconf back into tree.
parent
d87bbef4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dns/resolvconf.scm
+4
-8
4 additions, 8 deletions
dns/resolvconf.scm
main.scm
+1
-1
1 addition, 1 deletion
main.scm
with
5 additions
and
9 deletions
resolvconf.scm
→
dns/
resolvconf.scm
+
4
−
8
View file @
59f42c4d
(
define-module
(
resolvconf
)
(
define-module
(
dns
resolvconf
)
:use-module
(
ice-9
regex
)
:use-module
(
ice-9
rdelim
)
:use-module
(
srfi
srfi-88
)
:export
(
resolvconf
))
(
define
(
read-all
port
)
(
read-delimited
""
port
))
(
define
(
read-file
fname
)
(
call-with-input-file
fname
read-all
))
(
define
(
regexp-exec/all
rx
str
)
(
let
loop
((
start
0
))
(
cond
((
regexp-exec
rx
str
start
)
...
...
@@ -17,6 +12,7 @@
(
define
rx
(
make-regexp
"^nameserver\\s+(\\S+)\\s*$"
regexp/newline
))
(
define*
(
resolvconf
optional:
(
file
"/etc/resolv.conf"
))
(
map
(
lambda
(
m
)
(
match:substring
m
1
))
(
regexp-exec/all
rx
(
read-file
file
))))
(
define*
(
resolvconf
#
:optional
(
fname
"/etc/resolv.conf"
))
(
map
(
lambda
(
m
)
(
match:substring
m
1
))
(
regexp-exec/all
rx
(
call-with-input-file
fname
read-string
))))
This diff is collapsed.
Click to expand it.
main.scm
+
1
−
1
View file @
59f42c4d
...
...
@@ -106,11 +106,11 @@
(
define
dns-server-address
(
or
(
option-ref
options
'server
#f
)
(
car
((
@
(
resolvconf
)
resolvconf
)))))
;; (highlight-record (format #f "~s~%" msg))
(
call-with-values
(
lambda
()
((
bytes->dns-message
(
run
dns-server-address
msg
))
0
))
(
lambda
(
resp
_
)
(
format-everything
msg
resp
)))
(
car
((
@
(
dns
resolvconf
)
resolvconf
)))))
(
newline
)
(
format
#t
";; Server: ~a (UDP)~%"
dns-server-address
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment