[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dhcp] 08/12: dhcp: code for sending packets, incomplete, untested
From: |
Rohan Prinja |
Subject: |
[dhcp] 08/12: dhcp: code for sending packets, incomplete, untested |
Date: |
Sat, 06 Jun 2015 18:16:57 +0000 |
wenderen pushed a commit to branch master
in repository dhcp.
commit 39071607f77dcba006db68eea6fc3d602110a0ff
Author: Rohan Prinja <address@hidden>
Date: Sat Jun 6 23:43:46 2015 +0530
dhcp: code for sending packets, incomplete, untested
---
dhcp/send.scm | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/dhcp/send.scm b/dhcp/send.scm
new file mode 100644
index 0000000..f15aaee
--- /dev/null
+++ b/dhcp/send.scm
@@ -0,0 +1,36 @@
+;;; GNU Guix DHCP Client.
+;;;
+;;; Copyright 2015 Free Software Foundation, Inc.
+;;;
+;;; 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/>.
+
+(define-module (dhcp send)
+ #:export (make-dgram-sock
+ make-broadcast-sockaddr
+ *client-in-port*
+ *client-out-port*))
+
+(use-modules (rnrs bytevectors))
+
+(define-syntax-rule (make-dgram-sock)
+ (socket PF_INET SOCK_DGRAM IPPROTO_UDP))
+
+; Constants for the DHCP protocol.
+(define *client-out-port* 67)
+(define *client-in-port* 68)
+
+(define-syntax-rule (make-broadcast-sockaddr port)
+ (make-socket-address AF_INET
+ INADDR_BROADCAST
+ port))
- [dhcp] branch master updated (30d7a60 -> d6b11dd), Rohan Prinja, 2015/06/06
- [dhcp] 02/12: dhcp: tell git to ignore log files, Rohan Prinja, 2015/06/06
- [dhcp] 05/12: dhcp: add in deprecated time-offset option, Rohan Prinja, 2015/06/06
- [dhcp] 01/12: dhcp: arp hardware address identifiers, Rohan Prinja, 2015/06/06
- [dhcp] 04/12: dhcp: change module names to reflect directory structure, Rohan Prinja, 2015/06/06
- [dhcp] 08/12: dhcp: code for sending packets, incomplete, untested,
Rohan Prinja <=
- [dhcp] 10/12: dhcp: source for .so, used by some now-redundant functions in interfaces.scm, Rohan Prinja, 2015/06/06
- [dhcp] 06/12: dhcp: packet objects, untested, Rohan Prinja, 2015/06/06
- [dhcp] 03/12: dhcp: add unused and private-use options, fix some other mistakes, Rohan Prinja, 2015/06/06
- [dhcp] 09/12: dhcp: dhcp configuration objects, Rohan Prinja, 2015/06/06
- [dhcp] 07/12: dhcp: code to read info about network interfaces, untested, Rohan Prinja, 2015/06/06
- [dhcp] 12/12: dhcp: client code, incomplete, Rohan Prinja, 2015/06/06
- [dhcp] 11/12: dhcp: tests for the (dhcp *) modules, incomplete, Rohan Prinja, 2015/06/06