[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Net.Manager






On 27 March 2013 11:15, Vincent Bernardoff <vb@xxxxxxxxxxxxxx> wrote:
On 22/03/2013 16:24, Haris Rotsos wrote:
Sorry, this makes little sense now that I am reading it again. The
example I am thinking of is a user level network bridge that I am
working on and this approach I think will make my life a bit difficult.
For normal mirage apps the bridging approach should be ok.

Hi,

Now it is me that understand what you need. I was really confused about that surprisingly, but now it makes sense.

Sorry if I made things more complicated than they really are.Â
Â

To be really clear, we were talking about two different problems:

1. To handle the creation of virtual ethernet interfaces (TAP) for Mirage. In Linux, it is possible to create such devices or attach to them if they are persistent. In Mac, the only option is to create them.

2. To sniff frames from existing real network interfaces. Indeed, standard linux bridging is probably not providing this feature. For that, there is Harris code in Mirage for Macs, and nothing for Linux yet. For Linux, possibilities include the raw ethernet socket, or bridging+promiscuous mode.

A quick and simple solution for this one I think to have a mechanic that will tell us in the ocaml level whether the underline architecture is Linux or Darwin. For Darwin you need to read a frame, remove the first bytes which contain the pcap header and then push it up the stack. For Linux using raw ethernet socket you need to have the same code without the pcap header triming functionality (and add a bit of c code that will open the raw socket fd). Would it be ok to have a prepocessor command together with an option on the compiler? I know that the caml4p already has the Pa_macro extension that exposes some form of prepocessor commands. You only need later to expose a ppopt parameter to the compiler. This technique is already used in the code of the tap_stubs.Â
Â



Iâm currently only working on problem 1.

Iâll keep you updated

Cheers,

Vincent




--
Charalampos Rotsos
PhD student
The University of Cambridge
Computer Laboratory
William Gates Building
JJ Thomson Avenue
Cambridge
CB3 0FD

Phone: +44-(0) 1223 767032
Email: cr409@xxxxxxxxxxxx

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.