iphlpapi: Implement icmpv6 create function.

This commit is contained in:
Marko Hauptvogel 2014-09-07 19:03:20 +02:00 committed by Alexandre Julliard
parent 3186e72f29
commit f3fa809e50
2 changed files with 32 additions and 1 deletions

View File

@ -147,6 +147,37 @@ static int in_cksum(u_short *addr, int len)
* Exported Routines. * Exported Routines.
*/ */
/***********************************************************************
* Icmp6CreateFile (IPHLPAPI.@)
*/
HANDLE WINAPI Icmp6CreateFile(VOID)
{
icmp_t* icp;
int sid=socket(AF_INET6,SOCK_RAW,IPPROTO_ICMPV6);
if (sid < 0)
{
/* Mac OS X supports non-privileged ICMP via SOCK_DGRAM type. */
sid=socket(AF_INET6,SOCK_DGRAM,IPPROTO_ICMPV6);
}
if (sid < 0) {
ERR_(winediag)("Failed to use ICMPV6 (network ping), this requires special permissions.\n");
SetLastError(ERROR_ACCESS_DENIED);
return INVALID_HANDLE_VALUE;
}
icp=HeapAlloc(GetProcessHeap(), 0, sizeof(*icp));
if (icp==NULL) {
close(sid);
SetLastError(IP_NO_RESOURCES);
return INVALID_HANDLE_VALUE;
}
icp->sid=sid;
icp->default_opts.OptionsSize=IP_OPTS_UNKNOWN;
return (HANDLE)icp;
}
/*********************************************************************** /***********************************************************************
* IcmpCreateFile (IPHLPAPI.@) * IcmpCreateFile (IPHLPAPI.@)
*/ */

View File

@ -150,7 +150,7 @@
#@ stub GetUnicastIpAddressEntry #@ stub GetUnicastIpAddressEntry
#@ stub GetUnicastIpAddressTable #@ stub GetUnicastIpAddressTable
@ stdcall GetUniDirectionalAdapterInfo( ptr ptr ) @ stdcall GetUniDirectionalAdapterInfo( ptr ptr )
#@ stub Icmp6CreateFile @ stdcall Icmp6CreateFile()
#@ stub Icmp6ParseReplies #@ stub Icmp6ParseReplies
#@ stub Icmp6SendEcho2 #@ stub Icmp6SendEcho2
@ stdcall IcmpCloseHandle(ptr) @ stdcall IcmpCloseHandle(ptr)