UDP use SIO_QUERY_WFP_CONNECTION_REDIRECT_RECORDS
Hello, I'm developing WFP call out driver and proxy.
FWPM_LAYER_ALE_CONNECT_REDIRECT_V4 redirects UDP connections to a local proxy.
The redirect was successful, but I want to get the original remote address with the SIO_QUERY_WFP_CONNECTION_REDIRECT_RECORDS control code.
But IOCTRL gives a WSAEOPNOTSUPP error. How can I get a remote address with UDP?
this is the code.
addrinfo baseInfo = { 0 };
addrinfo* svrInfo = NULL;
baseInfo.ai_family = AF_INET;
baseInfo.ai_socktype = SOCK_DGRAM;
baseInfo.ai_protocol = IPPROTO_UDP;
baseInfo.ai_flags = AI_PASSIVE;
listenSocket = socket(svrInfo->ai_family, svrInfo->ai_socktype, svrInfo->ai_protocol);
bind(listenSocket, svrInfo->ai_addr, (int)svrInfo->ai_addrlen);
char recv_buff[512];
recvfrom(ListenSocket, recv_buff, 512 , 0, (struct sockaddr*)&sin, &len);
status = WSAIoctl(listenSocket,
SIO_QUERY_WFP_CONNECTION_REDIRECT_RECORDS,
0,
0,
pRecords,
REDIRECT_RECORDS_SIZE,
(LPDWORD)&recordsSize,
0,
// status error
thank you.