dhcp: do not directly change %load-path

This commit is contained in:
Rohan Prinja 2015-06-09 09:32:14 +05:30
parent 85624d570c
commit 9f3281e5db
7 changed files with 4 additions and 25 deletions

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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)

View File

@ -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)

View File

@ -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))