implemented RtlIpv4AddressToStringA/W and made ntdll export them.

svn path=/trunk/; revision=10848
This commit is contained in:
Thomas Bluemel 2004-09-13 20:25:26 +00:00
parent 2161bebe79
commit 09afb31c28
4 changed files with 77 additions and 14 deletions

View file

@ -1,4 +1,4 @@
/* $Id: rtl.h,v 1.33 2004/08/12 06:04:21 ion Exp $ /* $Id: rtl.h,v 1.34 2004/09/13 20:25:25 weiden Exp $
* *
*/ */
#ifndef __DDK_RTL_H #ifndef __DDK_RTL_H
@ -1643,7 +1643,7 @@ NTSTATUS STDCALL
RtlInvertRangeList (OUT PRTL_RANGE_LIST InvertedRangeList, RtlInvertRangeList (OUT PRTL_RANGE_LIST InvertedRangeList,
IN PRTL_RANGE_LIST RangeList); IN PRTL_RANGE_LIST RangeList);
NTSTATUS LPSTR
STDCALL STDCALL
RtlIpv4AddressToStringA( RtlIpv4AddressToStringA(
PULONG IP, PULONG IP,
@ -1659,7 +1659,7 @@ RtlIpv4AddressToStringExA(
PULONG MaxSize PULONG MaxSize
); );
NTSTATUS LPWSTR
STDCALL STDCALL
RtlIpv4AddressToStringW( RtlIpv4AddressToStringW(
PULONG IP, PULONG IP,

View file

@ -1,4 +1,4 @@
; $Id: ntdll.def,v 1.128 2004/09/10 23:29:18 sedwards Exp $ ; $Id: ntdll.def,v 1.129 2004/09/13 20:25:25 weiden Exp $
; ;
; ReactOS Operating System ; ReactOS Operating System
; ;
@ -491,6 +491,22 @@ RtlInitializeSid@12
RtlIntegerToChar@16 RtlIntegerToChar@16
RtlIntegerToUnicodeString@12 RtlIntegerToUnicodeString@12
RtlInvertRangeList@8 RtlInvertRangeList@8
RtlIpv4AddressToStringA@8
RtlIpv4AddressToStringExA@16
RtlIpv4AddressToStringExW@16
RtlIpv4AddressToStringW@8
RtlIpv4StringToAddressA@16
RtlIpv4StringToAddressExA@16
RtlIpv4StringToAddressExW@16
RtlIpv4StringToAddressW@16
RtlIpv6AddressToStringA@8
RtlIpv6AddressToStringExA@16
RtlIpv6AddressToStringExW@16
RtlIpv6AddressToStringW@8
RtlIpv6StringToAddressA@16
RtlIpv6StringToAddressExA@16
RtlIpv6StringToAddressExW@16
RtlIpv6StringToAddressW@16
RtlIsDosDeviceName_U@4 RtlIsDosDeviceName_U@4
RtlIsGenericTableEmpty@4 RtlIsGenericTableEmpty@4
RtlIsNameLegalDOS8Dot3@12 RtlIsNameLegalDOS8Dot3@12

View file

@ -1,4 +1,4 @@
; $Id: ntdll.edf,v 1.118 2004/09/10 23:29:18 sedwards Exp $ ; $Id: ntdll.edf,v 1.119 2004/09/13 20:25:25 weiden Exp $
; ;
; ReactOS Operating System ; ReactOS Operating System
; ;
@ -491,6 +491,22 @@ RtlInt64ToUnicodeString=RtlInt64ToUnicodeString@16
RtlIntegerToChar=RtlIntegerToChar@16 RtlIntegerToChar=RtlIntegerToChar@16
RtlIntegerToUnicodeString=RtlIntegerToUnicodeString@12 RtlIntegerToUnicodeString=RtlIntegerToUnicodeString@12
RtlInvertRangeList=RtlInvertRangeList@8 RtlInvertRangeList=RtlInvertRangeList@8
RtlIpv4AddressToStringA=RtlIpv4AddressToStringA@8
RtlIpv4AddressToStringExA=RtlIpv4AddressToStringExA@16
RtlIpv4AddressToStringExW=RtlIpv4AddressToStringExW@16
RtlIpv4AddressToStringW=RtlIpv4AddressToStringW@8
RtlIpv4StringToAddressA=RtlIpv4StringToAddressA@16
RtlIpv4StringToAddressExA=RtlIpv4StringToAddressExA@16
RtlIpv4StringToAddressExW=RtlIpv4StringToAddressExW@16
RtlIpv4StringToAddressW=RtlIpv4StringToAddressW@16
RtlIpv6AddressToStringA=RtlIpv6AddressToStringA@8
RtlIpv6AddressToStringExA=RtlIpv6AddressToStringExA@16
RtlIpv6AddressToStringExW=RtlIpv6AddressToStringExW@16
RtlIpv6AddressToStringW=RtlIpv6AddressToStringW@8
RtlIpv6StringToAddressA=RtlIpv6StringToAddressA@16
RtlIpv6StringToAddressExA=RtlIpv6StringToAddressExA@16
RtlIpv6StringToAddressExW=RtlIpv6StringToAddressExW@16
RtlIpv6StringToAddressW=RtlIpv6StringToAddressW@16
RtlIsDosDeviceName_U=RtlIsDosDeviceName_U@4 RtlIsDosDeviceName_U=RtlIsDosDeviceName_U@4
;RtlIsGenericTableEmpty ;RtlIsGenericTableEmpty
RtlIsNameLegalDOS8Dot3=RtlIsNameLegalDOS8Dot3@12 RtlIsNameLegalDOS8Dot3=RtlIsNameLegalDOS8Dot3@12

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: network.c,v 1.1 2004/08/05 18:17:37 ion Exp $ /* $Id: network.c,v 1.2 2004/09/13 20:25:26 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -25,23 +25,50 @@
*/ */
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <stdio.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
/* Borrow this from some headers... */
typedef struct
{
union
{
struct { UCHAR s_b1,s_b2,s_b3,s_b4; } S_un_b;
struct { USHORT s_w1,s_w2; } S_un_w;
ULONG S_addr;
} S_un;
} in_addr;
typedef struct
{
union
{
UCHAR _S6_u8[16];
USHORT _S6_u16[8];
ULONG _S6_u32[4];
} S6_un;
} in6_addr;
/* /*
* @unimplemented * @implemented
*/ */
NTSTATUS LPSTR
STDCALL STDCALL
RtlIpv4AddressToStringA( RtlIpv4AddressToStringA(
PULONG IP, PULONG IP,
LPSTR Buffer LPSTR Buffer
) )
{ {
UNIMPLEMENTED; in_addr addr;
return STATUS_NOT_IMPLEMENTED; addr.S_un.S_addr = *IP;
return Buffer + sprintf(Buffer, "%u.%u.%u.%u", addr.S_un.S_un_b.s_b1,
addr.S_un.S_un_b.s_b2,
addr.S_un.S_un_b.s_b3,
addr.S_un.S_un_b.s_b4);
} }
/* /*
@ -61,17 +88,21 @@ RtlIpv4AddressToStringExA(
} }
/* /*
* @unimplemented * @implemented
*/ */
NTSTATUS LPWSTR
STDCALL STDCALL
RtlIpv4AddressToStringW( RtlIpv4AddressToStringW(
PULONG IP, PULONG IP,
LPWSTR Buffer LPWSTR Buffer
) )
{ {
UNIMPLEMENTED; in_addr addr;
return STATUS_NOT_IMPLEMENTED; addr.S_un.S_addr = *IP;
return Buffer + swprintf(Buffer, L"%u.%u.%u.%u", addr.S_un.S_un_b.s_b1,
addr.S_un.S_un_b.s_b2,
addr.S_un.S_un_b.s_b3,
addr.S_un.S_un_b.s_b4);
} }
/* /*