mirror of git://git.savannah.gnu.org/guix/dhcp.git
dhcp: do not directly change %load-path
This commit is contained in:
parent
85624d570c
commit
9f3281e5db
|
@ -20,9 +20,6 @@
|
|||
coding: utf-8
|
||||
!#
|
||||
|
||||
(add-to-load-path (string-append (dirname (current-filename))
|
||||
"/.."))
|
||||
|
||||
; DHCP client module
|
||||
(define-module (dhcp client)
|
||||
#:export (main))
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(add-to-load-path (string-append (dirname (current-filename))
|
||||
"/.."))
|
||||
|
||||
(define-module (dhcp dhcp)
|
||||
#:export (<dhcp>
|
||||
dhcp-start
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(add-to-load-path (string-append (dirname (current-filename))
|
||||
"/.."))
|
||||
|
||||
(define-module (dhcp interfaces)
|
||||
#:export (<net-interface>
|
||||
hardware-address
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(add-to-load-path (string-append (dirname (current-filename))
|
||||
"/.."))
|
||||
|
||||
; Module for constructing and parsing DHCP messages
|
||||
(define-module (dhcp messages)
|
||||
#:export (<dhcp-message>
|
||||
|
@ -100,8 +97,8 @@ simply ignored whilst serializing."
|
|||
(if (eq? #nil opt)
|
||||
(loop (1+ i))
|
||||
(let ((code i)
|
||||
(len (dhcp-option-len opt))
|
||||
(val (dhcp-option-val opt)))
|
||||
(len (slot-ref opt 'len))
|
||||
(val (slot-ref opt 'val)))
|
||||
(begin
|
||||
(if (zero? len)
|
||||
(bytevector-u8-set! dst idx code)
|
||||
|
@ -208,14 +205,14 @@ from BV starting at index START"
|
|||
(define-method (set-option! (msg <dhcp-message>) (opt <dhcp-option>))
|
||||
"Set an <option> in a <dhcp-message>."
|
||||
(vector-set! (slot-ref msg 'options)
|
||||
(dhcp-option-code opt)
|
||||
(slot-ref opt 'code)
|
||||
opt))
|
||||
|
||||
(define-method (option-value (msg <dhcp-message>) code)
|
||||
"Retrieve an option's value from a <dhcp-message>."
|
||||
(let* ((opts (slot-ref msg 'options))
|
||||
(opt (vector-ref opts code))
|
||||
(val (dhcp-option-val opt)))
|
||||
(val (slot-ref opt 'val)))
|
||||
val))
|
||||
|
||||
; Get the DHCP message type. See Section 9.6, RFC 2132.
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(add-to-load-path (string-append (dirname (current-filename))
|
||||
"/.."))
|
||||
|
||||
(define-module (test-dhcp-dhcp))
|
||||
|
||||
(use-modules (oop goops)
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(add-to-load-path (string-append (dirname (current-filename))
|
||||
"/.."))
|
||||
|
||||
(define-module (test-dhcp-interfaces))
|
||||
|
||||
(use-modules (srfi srfi-64)
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(add-to-load-path (string-append (dirname (current-filename))
|
||||
"/.."))
|
||||
|
||||
(define-module (test-dhcp-messages))
|
||||
|
||||
|
|
Loading…
Reference in New Issue