hannes changed the topic of #mirage to: https://mirage.io - https://github.com/mirage/mirage-www/wiki/Call-Agenda - this channel is logged at http://irclog.whitequark.org/mirage/ - MirageOS 3.5.0 is released - happy hacking!
Haudegen has joined #mirage
_whitelogger has joined #mirage
_whitelogger has joined #mirage
jnavila has joined #mirage
jnavila has quit [Ping timeout: 246 seconds]
Nikkel has quit [Ping timeout: 264 seconds]
Nikkel has joined #mirage
<ehirdoy> Does anyone know how to get a C pointer to a buffer from Cstruct.t? https://mirage.github.io/ocaml-cstruct/cstruct/Cstruct/index.html#type-buffer
<ehirdoy> I meant, 'raw buffer' in the above.
<hannes> ehirdoy: you may want to look at https://github.com/mirage/mirage-solo5/blob/master/lib/bindings/solo5_net_stubs.c which is used by https://github.com/mirage/mirage-net-solo5/blob/master/src/netif.ml passing a cstruct.t from OCaml to C (if i understand your question correctly)
<hannes> (the mirage_solo5_net_read_2 / write)
<ehirdoy> @hannes Cool!! Also where can I find the OCaml caller of mirage_solo5_net_read_2?
<ehirdoy> freestanding?
<hannes> ehirdoy: in mirage-net-solo5, the second URL i posted.
<hannes> external solo5_net_read:
<hannes> Cstruct.buffer -> int -> int -> solo5_result * int = "mirage_solo5_net_read_2"
<hannes> (and then solo5_net_read is called in https://github.com/mirage/mirage-net-solo5/blob/master/src/netif.ml#L81)
<ehirdoy> true. I need more coffee ;)
<apache2> ehirdoy: pointers are usually not exposed, are you writing C or OCaml?
<apache2> from the OCaml side there's Io_page.get_addr
Haudegen has quit [Quit: Bin weg.]
Haudegen has joined #mirage
jnavila has joined #mirage
<ehirdoy> apache2: I'm passing a Cstruct buffer from 'TCPV4.read flow' to a C function/framework. So there's no way to avoid Cstruct here, then ;)
pie_ has quit [Ping timeout: 240 seconds]
pie_ has joined #mirage
jnavila has quit [Ping timeout: 276 seconds]