diff options
-rw-r--r-- | whispers/services/whispers/vpn.scm | 65 |
1 files changed, 30 insertions, 35 deletions
diff --git a/whispers/services/whispers/vpn.scm b/whispers/services/whispers/vpn.scm index 55847ee..2531fcc 100644 --- a/whispers/services/whispers/vpn.scm +++ b/whispers/services/whispers/vpn.scm @@ -863,28 +863,26 @@ service with the string PHY-DEV-NAME recorded in its "physical-dev-state") (display "Burning new 'physical-dev-state service.\n") (register-services - (make <service> - #:provides '(physical-dev-state) + (service + '(physical-dev-state) #:start (lambda whatever #f) #:stop (lambda whatever #t) - #:actions (make-actions - (physical-interface-name - "Return the name of the physical + #:actions (list (action + 'physical-interface-name + (lambda (running) phy-dev-name) + "Return the name of the physical) interface which supported the default route when -the VPN was disconnected." - (lambda (running) phy-dev-name)) - (physical-gateway-ip - "Return the ip of the gateway +the VPN was disconnected.") + (action + 'physical-gateway-ip + (lambda (running) router-ip) + "Return the ip of the gateway of the physical interface which supported the default route when the VPN was -disconnected." - (lambda (running) router-ip))) - #:docstring "Queryable physical network device -restoration state of a -Whispers VPN." - #:one-shot? #t))))))) +disconnected.")) + #:one-shot? #t)))))) (define physical-dev-resolve-actions (list (shepherd-action @@ -1536,19 +1534,17 @@ action.") "want-connect-state")) (display "Burning new 'want-connect-state service.\n") (register-services - (make <service> - #:provides '(want-connect-state) + (service + '(want-connect-state) #:start (lambda whatever #f) #:stop (lambda whatever #t) - #:actions (make-actions - (want-connect? - "Return the connection status wish of a + #:actions (list (action + 'want-connect? + (lambda (running) want?) + "Return the connection status wish of a VPN client. The returned boolean value is used only at the end of client registration, to determine if connection is to be performed -auto-immedately." - (lambda (running) want?))) - #:docstring "Queryable connection status wish state of a -Whispers VPN." +auto-immedately.")) #:one-shot? #t))))))) (define want-connect-resolve-actions @@ -2672,17 +2668,16 @@ through its 'vouchers action.") "network-state") (display "Burning new 'network-state service.\n") (register-services - (make <service> - #:provides '(network-state) - #:start (lambda whatever #f) - #:stop (lambda whatever #t) - #:actions (make-actions - (vouchers - "Return the network state stored in the -service." - (lambda (running) (car new-state)))) - #:docstring "Queryable network state of a Whispers VPN." - #:one-shot? #t))))) + (service + '(network-state) + #:start (lambda whatever #f) + #:stop (lambda whatever #t) + #:actions (list (action + 'vouchers + (lambda (running) (car new-state)) + "Return the network state stored in the +service.")) + #:one-shot? #t))))) (shepherd-action (name 'network-state) (documentation "Return the list of vouchers returned by the |