[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dhcp] 01/03: dhcp: do not directly change %load-path
From: |
Rohan Prinja |
Subject: |
[dhcp] 01/03: dhcp: do not directly change %load-path |
Date: |
Wed, 10 Jun 2015 04:18:06 +0000 |
wenderen pushed a commit to branch master
in repository dhcp.
commit 9f3281e5db55f3156e8ccaaebef9eac5fa3cbee6
Author: Rohan Prinja <address@hidden>
Date: Tue Jun 9 09:32:14 2015 +0530
dhcp: do not directly change %load-path
---
dhcp/client.scm | 3 ---
dhcp/dhcp.scm | 3 ---
dhcp/interfaces.scm | 3 ---
dhcp/messages.scm | 11 ++++-------
tests/dhcp-dhcp.scm | 3 ---
tests/dhcp-interfaces.scm | 3 ---
tests/dhcp-messages.scm | 3 ---
7 files changed, 4 insertions(+), 25 deletions(-)
diff --git a/dhcp/client.scm b/dhcp/client.scm
index 99e6530..0fa0174 100644
--- a/dhcp/client.scm
+++ b/dhcp/client.scm
@@ -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))
diff --git a/dhcp/dhcp.scm b/dhcp/dhcp.scm
index 46242d9..cee2fa1 100644
--- a/dhcp/dhcp.scm
+++ b/dhcp/dhcp.scm
@@ -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
diff --git a/dhcp/interfaces.scm b/dhcp/interfaces.scm
index fa595f5..e1854bd 100644
--- a/dhcp/interfaces.scm
+++ b/dhcp/interfaces.scm
@@ -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
diff --git a/dhcp/messages.scm b/dhcp/messages.scm
index 4c7c422..30261c3 100644
--- a/dhcp/messages.scm
+++ b/dhcp/messages.scm
@@ -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.
diff --git a/tests/dhcp-dhcp.scm b/tests/dhcp-dhcp.scm
index 2dba34d..c00a76b 100644
--- a/tests/dhcp-dhcp.scm
+++ b/tests/dhcp-dhcp.scm
@@ -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)
diff --git a/tests/dhcp-interfaces.scm b/tests/dhcp-interfaces.scm
index 7f65b12..09d41e8 100644
--- a/tests/dhcp-interfaces.scm
+++ b/tests/dhcp-interfaces.scm
@@ -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)
diff --git a/tests/dhcp-messages.scm b/tests/dhcp-messages.scm
index 42a82fc..7395c33 100644
--- a/tests/dhcp-messages.scm
+++ b/tests/dhcp-messages.scm
@@ -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))