-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
Brief overview
Adding the following structs and functions:
- WSAQUERYSET The parameter of the following functions. It has other functions in this function which is not linked individually.
- WSALookupServiceBegin
- WSALookupServiceNext
- WSALookupServiceEnd
Implementation proposal
I started to wrap up a possible implementation. I wrote everything in C first and after I implemented the same functionality and structs in Go.
Exact functionality and structs
- structs - this implements the WSAQUERYSET and structs belongs to it. (Proofs can be found below)
- lookup functions - these are the wrappers of the lookup functions.
Testing environment
- test implementation - this creates a Scan function which using the implemented functionality
- go test - this is a go test for the test implementation
- main - a main package to build and run the implementation
Proofs of memory layout
There are proofs, that the WSAQUERYSET and other functions memory layout and data alignment are the same as the syscall can accept it.
- types test - these are the test files which prints the memory layout and data alignment
- memory layout - this file contains the comparison between C and Go memory layout and data alignment.
C implementation
- file - this is the c implementation and investigation of the functionality implemented above
Current issue what I run into
The implementation works fine, prints the device what I expect, but at the and of the Scan function in the discover.go I just get something like a panic, which says runtime: unknown pc 0x0
. I couldn't solve this issue yet. The detailed view shows that it's printing the devices and it's MAC addresses and the debug lines as well, and right after dies. It seems like the closing }
wants to free some memory which doesn't exists or I don't know.