<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi guys,<br><br>I am attempting to modify hostAPd to work with Openflow switches. So I decided to use the WIRED DRIVER implementation as a starting point and modify it. Instead of receiving eapol (user) frames from the interface socket, I would be receiving encapsulated frames from Openflow packets (from a remote switch).<br><br>During initialisation phase of the wired driver, a handler function is registered with eloop (where is goes into eloop readers table) with the <span class="pl-s3">eloop_register_read_sock</span>(drv-&gt;sock, handle_read, drv-&gt;ctx, <span class="pl-c1">NULL</span>).<br><br>When eloop_run() goes into the loop, the socket is listened on and once data is received on the&nbsp; socket, the <span class="pl-en">eloop_sock_table_dispatch() function calls back</span> the handler function, which then reads the data from the socket. The handler function (handle_read() / handle_dhcp()) then calls the <span class="pl-s3">wpa_supplicant_event</span>(eloop_ctx, EVENT_NEW_STA, &amp;event).<br><br>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:<br><br>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 <span class="pl-s3">wpa_supplicant_event(). But my challenge here is how do I include the eloop_ctx and </span><span class="pl-st"></span>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)!<br><br>2. The second option I am considering is to register the callback handler function with <span class="pl-s3">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!<br><br>I think the fundamental piece I am missing that the actual use of eloop_data and user_data! These seem to be used for calling back handler functions (for reading sockets).<br><br>Any help with this would be appreciated!<br><br>Thansk!<br>Sadiq<br></span>                                               </div></body>
</html>