guix-commits
[Top][All Lists]
Advanced

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]