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 42AFCBB9A for ; Fri, 7 Oct 2005 19:30:03 +0200 (CEST) Received: from smtp1-g19.free.fr (smtp1-g19.free.fr [212.27.42.27]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j97HU2p4029064 for ; Fri, 7 Oct 2005 19:30:02 +0200 Received: from warp (che33-2-82-225-176-25.fbx.proxad.net [82.225.176.25]) by smtp1-g19.free.fr (Postfix) with SMTP id 442924DCBF; Fri, 7 Oct 2005 19:30:01 +0200 (CEST) Message-ID: <003901c5cb65$59f91a40$0100a8c0@warp> From: "Nicolas Cannasse" To: "Jonathan Bryant" , References: <1128632013.24718.4.camel@starlight> Subject: Re: [Caml-list] Raw Sockets Date: Fri, 7 Oct 2005 19:34:20 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Miltered: at concorde with ID 4346B09A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; cannasse:01 warplayer:01 caml-list:01 sockets:01 ocaml:01 byte:01 ocaml:01 gotchas:01 sockets:01 byte:01 apis:01 integers:01 sourceforge:01 structures:01 nicolas:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 > 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 One possibility to deal with byte ordering would be to wrap your socket accesses with an ExtLib IO since it has all the APIs for reading and writing multibyte integers (see http://ocaml-lib.sourceforge.net/doc/IO.html ) Nicolas