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

Re: [MirageOS-devel] extracting mac address from stack



STACKV4 may be the wrong interface to use if you want to access the low-level MAC address information.  There are two options:

- extend all the STACKV4 implementations to support the exposure of MAC (including the Unix socket backend, which would require some ioctls)
- manually assemble an Ethernet -> TCP/IP by applying the functors yourself.  See the manual examples of this in the mirage-skeleton repository.

The latter is pretty easy as it's just a few functor applications, but I guess it depends on what your use case is.

-anil

On 13 Jan 2015, at 11:27, Ania Skorupa <ania.skorupa@xxxxxxxxx> wrote:

thanks Nikolas.

as STACKV4 is a type, I can change your code to

Eth.mac (S.IPV4.id (S.ipv4 s))

again, the problem is that I have to pass tap0 as a parameter of type NETWORK to Main and create ethernet interface Eth = Ethif.Make(N), and still receive the error message:

Error: This _expression_ has type S.IPV4.ethif
       but an _expression_ was expected of type Eth.t = Ethif.Make(N).t

any suggestion?


On Saturday, January 10, 2015 12:39 PM, Nicolas Ojeda Bar <no263@xxxxxxxxxxxxxxx> wrote:


You can use the ETHIF.mac (STACKV4.IPV4.id s) (where s is the stack).
The `DEVICE.id` type should probably be abstract, but this works for
now.

Cheers,
Nicolas

On Thu, Jan 8, 2015 at 12:00 PM, Ania Skorupa <ania.skorupa@xxxxxxxxx> wrote:
> hi,
>
> in stackv4 example in mirage-skeleton, is there any simple way to extract
> mac address of tap0 in unikernel.ml?
>
> The other way that I can think of is to pass tap0 as another parameter to
> the unikernel, but it doesn't look a neat solution.
>
> thanks.

>
> _______________________________________________
> MirageOS-devel mailing list
> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

>


_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

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