Browse thread
RAW-sockets
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Oliver Bandel <oliver@f...> |
| Subject: | Re: [Caml-list] RAW-sockets |
Hi,
On Thu, May 18, 2006 at 10:36:25AM -0600, William D. Neumann wrote:
> On Thu, 18 May 2006, Oliver Bandel wrote:
>
> >>how to use Eaw sockets from OCaml?
> >>
> >>As in raw sockets I have to create the IP-header by myself
> >>I'm wondering how.
> >>
> >>IP normally uses 32Bit words, and the parts of it are not
> >>necessarily byte or nibble oriented.
> >>So I have to be able to set some bits directly.
> >>But the OCaml int's is not complete 32 Bits.
> >[...]
> >
> >I have not found in the Unix-module an option for the sockets,
> >that is eaquivalent to the IP_HDRINCL option, as described
> >by Stevens in the Networking Programming Vol. I.
> >
> >Isn't it possible in OCaml to create own IP-headers?
> >So, do I have to go back to C to e.g. write ICMP packets?
>
> No. Just create a string in OCaml and use that. Here's a (possibly
> awful) hunk of code I wrote for creating ICMP packets. Take a look at it
> and see how I did things.
>
> (************************************************************************
> *
> * icmp.ml
> *
> *
> * Created by William D. Neumann on 10 Mar 2006.
> * Copyright (c) 2006 William D. Neumann. All rights reserved.
> *
> ************************************************************************)
>
>
> (*p
> \setlength{\parindent}{0pt}
> \usepackage{amsmath,amsthm}
> \usepackage{amsfonts}
> *)
>
> (*
> This is [icmp.ml]\footnote{Copyright (c) 2006 William D. Neumann. All
> rights reserved.}, an OCaml program that implements a simple library for
> working with ICMP packets.
> *)
[...]
It's nice that you have embedded LaTeX-code in your comments.
With which tool do you generate your documentation?
If there is such a LP-tool I also would use it, if freely available.
Ciao,
Oliver