From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 6DCE7BB9A for ; Fri, 7 Oct 2005 05:05:07 +0200 (CEST) Received: from pd5mo1so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j97356Ds001201 for ; Fri, 7 Oct 2005 05:05:07 +0200 Received: from pd3mr7so.prod.shaw.ca (pd3mr7so-qfe3.prod.shaw.ca [10.0.141.23]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0INY009PSZ8HSUA0@l-daemon> for caml-list@yquem.inria.fr; Thu, 06 Oct 2005 21:05:05 -0600 (MDT) Received: from pn2ml6so.prod.shaw.ca ([10.0.121.150]) by pd3mr7so.prod.shaw.ca (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0INY008XNZ8HVPB0@pd3mr7so.prod.shaw.ca> for caml-list@yquem.inria.fr; Thu, 06 Oct 2005 21:05:05 -0600 (MDT) Received: from [192.168.1.103] (S0106001310a179a0.vc.shawcable.net [24.86.115.227]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with ESMTP id <0INY00J0NZ8HYT@l-daemon> for caml-list@yquem.inria.fr; Thu, 06 Oct 2005 21:05:05 -0600 (MDT) Date: Thu, 06 Oct 2005 20:05:47 -0700 From: Taras Subject: Re: [Caml-list] Raw Sockets In-reply-to: <1128632013.24718.4.camel@starlight> To: Jonathan Bryant Cc: caml-list@yquem.inria.fr Message-id: <4345E60B.2050806@shaw.ca> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Accept-Language: en-us, en References: <1128632013.24718.4.camel@starlight> User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050322) X-Miltered: at concorde with ID 4345E5E2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sockets:01 ocaml:01 ocaml:01 stack:01 parsing:01 byte:01 gotchas:01 sockets:01 caml-list:01 beginner's:01 beginners:01 bug:01 wrote:01 structures:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.6 required=5.0 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST,FORGED_RCVD_HELO,SPF_SOFTFAIL autolearn=disabled version=3.0.3 Hi, I don't think you can use SOCK_RAW in pure ocaml. I spent a few minutes on it, but never had time to get very far. http://glek.net/subversion/packetml/ That contains a simple ocaml program(with a c function to setup the socket) that sends a packet out. That has basic ocaml code needed to send a packet and contains functions for making packets too. Code comes from the basic network stack in dst, I just never factored out packet parsing functions properly. Taras Jonathan Bryant wrote: >Does anybody have any information on using SOCK_RAW in OCaml? At this >level, things like byte ordering matter, so I would like to know if >OCaml handles this automatically or not, as well as any other gotchas >involved with using raw sockets in OCaml. Also, are there any >structures for handling Ethernet/IP/TCP headers already written? Maybe >in another library? Or am I going to have to write these myself? > >Thanks, >--Jonathan > >_______________________________________________ >Caml-list mailing list. Subscription management: >http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list >Archives: http://caml.inria.fr >Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >Bug reports: http://caml.inria.fr/bin/caml-bugs > >