https://bugs.winehq.org/show_bug.cgi?id=9418
mail@noasakurajin.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mail@noasakurajin.de
--- Comment #11 from mail@noasakurajin.de --- (In reply to documento.em.branco from comment #10)
Still unimplemented on wine-9.19
Does the above solves?
#include <linux/sockios.h> #include <sys/socket.h> #include <net/if_arp.h> #include <sys/ioctl.h> #include <string.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> // struct arpreq { // struct sockaddr arp_pa; /* protocol address */ // struct sockaddr arp_ha; /* hardware address */ // int arp_flags; /* flags */ // struct sockaddr arp_netmask; /* netmask of protocol
address */ // char arp_dev[16]; // };
void setsaddr(struct sockaddr_in *p) { //p->sin_family = ARPHRD_ETHER; p->sin_family=AF_INET; p->sin_addr.s_addr = inet_addr("192.168.1.2"); p->sin_port = htons(1); } int main(int argc, char **argv) { struct arpreq ar; bzero(&ar, sizeof(ar)); int fd = socket(AF_INET, SOCK_DGRAM, 0); setsaddr((struct sockaddr_in *)&ar.arp_pa); strcpy(ar.arp_dev, "tap0"); sendto(fd, 0, 0, 0, &ar.arp_pa, sizeof(struct sockaddr_in)); usleep(1000); if (ioctl(fd, SIOCGARP, &ar, sizeof(ar)) == 0) write(1,&ar.arp_ha.sa_data,6); }
source: https://www.reddit.com/r/AskNetsec/comments/cysfpg/comment/lk24ur6 https://www.reddit.com/user/TheMAP123/ dest: https://gitlab.winehq.org/wine/wine/blob/master/dlls/iphlpapi/iphlpapi_main. c#L3937
I tried implementing this in wine, but could not get the includes working. When I compile the example as standalone C code, gcc can just compile it (without needing any flags) but when I try to include the header in the iphlpapi_main.c file, the compiler can't find them.
If someone could explain how I can include the unix headers in the dll, then I can finish up the patch next week and submit it for everyone to test.