From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rohan Prinja Subject: [GSoC] Progress Report 1 Date: Thu, 11 Jun 2015 13:24:15 +0530 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2xJZ-0005Y1-6v for guix-devel@gnu.org; Thu, 11 Jun 2015 03:54:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2xJY-0007iv-0d for guix-devel@gnu.org; Thu, 11 Jun 2015 03:54:17 -0400 Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]:33772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2xJX-0007im-T5 for guix-devel@gnu.org; Thu, 11 Jun 2015 03:54:15 -0400 Received: by qkhg32 with SMTP id g32so37163259qkh.0 for ; Thu, 11 Jun 2015 00:54:15 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel Hi Guix, Here is my long-overdue first progress report for my Summer of Code project to write a DHCP client in Scheme and integrate it with Guix and dmd. Pre-coding activities completed: 1 Read RFCs (1541+2131 - DHCPv4, 826 - ARP, 5227 - IP address conflict detection through ARP, 1497+1533+2132 - DHCP options, 4039 - Rapid Commit, 3679+3942 - clarifying the usage of some DHCP options) 2 Looked at the source for lwip's implementation of DHCP and ISC's dhclient 3 Revised socket programming and read the Guile manual Code written thus far (the source is at http://git.savannah.gnu.org/cgit/guix/dhcp.git): 1 Wrote classes for DHCP packets, network interfaces, DHCP options and DHCP configuratiion instances. 2 Wrote code to read the system's network interfaces and populate the network-interface instances' fields (name, hwaddr, family). 3 Refactored the above to records on the advice given by Ludo (who pointed out that OOPS is unidiomatic and in any case not really needed here). 4 Wrote incomplete testing code for the the items in 1 (incomplete because the tests did not test the serialisation of DHCP message records into bytevectors). 5 Began writing code to send a bytevector to a specified sockaddr, and began the skeleton of the main client module. Current focus: 1 Test the code to send and receive packets 2 Code to make and send ARP messages on the link layer, and corresponding unit tests 2 Complete the (dhcp client) module (this includes the implementation of the main DHCP client algorithm, and lease storage), and complete the (dhcp *) modules' tests 3 Read the dhcpd server source (this package: http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/admin.scm#n378) to figure out how to have a server for test the client Questions: 1 Ludo: I looked at the implementations of packed structs. DHCP packets are in general variable-length because of the options field, while packed structs require need to have the field lengths known ahead of time. So do you recommended making some changes to the packed structs implementations to accomodate the variable-length options field (I'll have to think about how to do this) or simply refactor the serializer/deserializer I wrote back when the code was in GOOPS to use records? 2 Ludo: please could you clarify exactly what the Copyright header for a source file should look like when it uses code from another project? For example, (dhcp interfaces) copies code from (guix build syscalls) (a couple of variable definitions that (guix build syscalls) didn't export). Thank you, Regards, Rohan