mirror of git://git.savannah.gnu.org/guix/dhcp.git
dhcp: correct copyright
This commit is contained in:
parent
a9f5c30360
commit
85624d570c
|
@ -0,0 +1,20 @@
|
|||
#!/usr/local/bin/guile
|
||||
coding: utf-8
|
||||
!#
|
||||
|
||||
; Tell Guile to also search for modules in the
|
||||
; current directory.
|
||||
(add-to-load-path (dirname (current-filename)))
|
||||
|
||||
; Module for constructing and parsing ARP messages
|
||||
(define-module (arp-messages)
|
||||
#:export (<arp-message>))
|
||||
|
||||
(use-modules (oop goops))
|
||||
|
||||
(define-class <arp-message> ()
|
||||
(hw-type #:init-value 1) ; ethernet
|
||||
(protocol-type #:init-value #x800)
|
||||
(hlen #:init-value 48)
|
||||
(plen #:init-value 32) ; ipv4
|
||||
'TODO)
|
|
@ -1,3 +1,20 @@
|
|||
;;; GNU Guix DHCP Client.
|
||||
;;;
|
||||
;;; Copyright © 2015 Rohan Prinja <rohan.prinja@gmail.com>
|
||||
;;;
|
||||
;;; This program is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; This program is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#!/usr/local/bin/guile \
|
||||
-e main -s
|
||||
coding: utf-8
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; GNU Guix DHCP Client.
|
||||
;;;
|
||||
;;; Copyright 2015 Free Software Foundation, Inc.
|
||||
;;; Copyright © 2015 Rohan Prinja <rohan.prinja@gmail.com>
|
||||
;;;
|
||||
;;; This program is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; GNU Guix DHCP Client.
|
||||
;;;
|
||||
;;; Copyright 2015 Free Software Foundation, Inc.
|
||||
;;; Copyright © 2015 Rohan Prinja <rohan.prinja@gmail.com>
|
||||
;;;
|
||||
;;; This program is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
3;;; GNU Guix DHCP Client.
|
||||
;;; GNU Guix DHCP Client.
|
||||
;;;
|
||||
;;; Copyright 2015 Free Software Foundation, Inc.
|
||||
;;; Copyright © 2015 Rohan Prinja <rohan.prinja@gmail.com>
|
||||
;;;
|
||||
;;; This program is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
|
@ -100,8 +100,8 @@ simply ignored whilst serializing."
|
|||
(if (eq? #nil opt)
|
||||
(loop (1+ i))
|
||||
(let ((code i)
|
||||
(len (slot-ref opt 'len))
|
||||
(val (slot-ref opt 'val)))
|
||||
(len (dhcp-option-len opt))
|
||||
(val (dhcp-option-val opt)))
|
||||
(begin
|
||||
(if (zero? len)
|
||||
(bytevector-u8-set! dst idx code)
|
||||
|
@ -208,14 +208,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)
|
||||
(slot-ref opt 'code)
|
||||
(dhcp-option-code opt)
|
||||
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 (slot-ref opt 'val)))
|
||||
(val (dhcp-option-val opt)))
|
||||
val))
|
||||
|
||||
; Get the DHCP message type. See Section 9.6, RFC 2132.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; GNU Guix DHCP Client.
|
||||
;;;
|
||||
;;; Copyright 2015 Free Software Foundation, Inc.
|
||||
;;; Copyright © 2015 Rohan Prinja <rohan.prinja@gmail.com>
|
||||
;;;
|
||||
;;; This program is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; GNU Guix DHCP Client.
|
||||
;;;
|
||||
;;; Copyright 2015 Free Software Foundation, Inc.
|
||||
;;; Copyright © 2015 Rohan Prinja <rohan.prinja@gmail.com>
|
||||
;;;
|
||||
;;; This program is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// GNU Guix DHCP Client.
|
||||
///
|
||||
/// Copyright 2015 Free Software Foundation, Inc.
|
||||
/// Copyright © 2015 Rohan Prinja <rohan.prinja@gmail.com>
|
||||
///
|
||||
/// This program is free software; you can redistribute it and/or modify it
|
||||
/// under the terms of the GNU General Public License as published by
|
||||
|
|
Loading…
Reference in New Issue