hostAPd with Openflow

Jouni Malinen j
Sun Dec 14 07:21:50 PST 2014

On Fri, Dec 12, 2014 at 08:49:19PM +0000, Sadiq Yakasai wrote:
> Now, because I am planning on receiving data from an openflow switch, I have a challenge with how the data is relayed to the handler function. These are 2 options I am considering:
> 1. When I receive data from the openflow switch (and decapsulate it) - I then pass it directly to the handler function (handle_openflow_data for example) which then passes it on to the wpa_supplicant_event(). But my challenge here is how do I include the eloop_ctx and sock_ctx information? Since I am by-passing eloop altogether to send the data to the driver function that handles the data. I have attempted to not include these pieces of information and the program crashes (expected)!

How do you receive the data? If that comes with anything that you can
wait for with select() (or poll/epoll), it should be easy to integrate
with eloop. If it is something else, I'd consider converting it to a
socket operation within the process to make this work cleanly with

> 2. The second option I am considering is to register the callback handler function with eloop_register_read_sock (as normally would be done). When data is received from my openflow switch, I then find a way to make eloop callback the handler function (with eloop_ctx and user_data), just as is the case for normal socket reading. But the challenge here is that the socket table, for readers/writers/exception requires an open socket context information passed across, which i dont have because I am not receiving my data from a socket!

So where are you receiving it from? It is a bit difficult to comment on
the best approach without that key point being described in more detail.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list