31 lines
578 B
C
Executable File
31 lines
578 B
C
Executable File
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
/**
|
|
* \file sys/ip_windows.c
|
|
*
|
|
* System specific Internet Protocol functionality implementation over Windows.
|
|
*
|
|
* \copyright The DoubleFourteen Code Forge (C) All Rights Reserved
|
|
* \author Lorenzo Cogotti
|
|
*/
|
|
|
|
#include "sys/ip.h"
|
|
|
|
#include <ws2tcpip.h>
|
|
|
|
Judgement Ipv4_StringToAdr(const char *s, Ipv4adr *dest)
|
|
{
|
|
if (InetPtonA(AF_INET, s, dest->bytes) != 1)
|
|
return NG;
|
|
|
|
return OK;
|
|
}
|
|
|
|
Judgement Ipv6_StringToAdr(const char *s, Ipv6adr *dest)
|
|
{
|
|
if (InetPtonA(AF_INET6, s, dest->bytes) != 1)
|
|
return NG;
|
|
|
|
return OK;
|
|
}
|