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
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?
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@xxxxxxxxxxxxxxxxxxxxhttp://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
|