Commit f3fa809e authored by Marko Hauptvogel's avatar Marko Hauptvogel Committed by Alexandre Julliard

iphlpapi: Implement icmpv6 create function.

parent 3186e72f
...@@ -148,6 +148,37 @@ static int in_cksum(u_short *addr, int len) ...@@ -148,6 +148,37 @@ static int in_cksum(u_short *addr, int len)
*/ */
/*********************************************************************** /***********************************************************************
* 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.@)
*/ */
HANDLE WINAPI IcmpCreateFile(VOID) HANDLE WINAPI IcmpCreateFile(VOID)
......
...@@ -150,7 +150,7 @@ ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment