[RTL]
[reactos.git] / reactos / lib / rtl / network.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Runtime Library
4 * PURPOSE: Network Address Translation implementation
5 * PROGRAMMER: Alex Ionescu (alexi@tinykrnl.org)
6 */
7
8 /* INCLUDES *****************************************************************/
9
10 #include <rtl.h>
11
12 #define NDEBUG
13 #include <debug.h>
14
15 /* FUNCTIONS ***************************************************************/
16
17 /*
18 * @implemented
19 */
20 LPSTR
21 NTAPI
22 RtlIpv4AddressToStringA(IN struct in_addr *Addr,
23 OUT PCHAR S)
24 {
25 CHAR Buffer[sizeof("255.255.255.255")];
26 INT Length;
27 Length = sprintf(Buffer, "%u.%u.%u.%u", Addr->S_un.S_un_b.s_b1,
28 Addr->S_un.S_un_b.s_b2,
29 Addr->S_un.S_un_b.s_b3,
30 Addr->S_un.S_un_b.s_b4);
31 if (S)
32 strcpy(S, Buffer);
33 return S + Length;
34 }
35
36 /*
37 * @unimplemented
38 */
39 NTSTATUS
40 NTAPI
41 RtlIpv4AddressToStringExA(IN struct in_addr *Address,
42 IN USHORT Port,
43 OUT PCHAR AddressString,
44 IN OUT PULONG AddressStringLength)
45 {
46 UNIMPLEMENTED;
47 return STATUS_NOT_IMPLEMENTED;
48 }
49
50 /*
51 * @implemented
52 */
53 LPWSTR
54 NTAPI
55 RtlIpv4AddressToStringW(IN struct in_addr *Addr,
56 OUT PWCHAR S)
57 {
58 return S + swprintf(S, L"%u.%u.%u.%u", Addr->S_un.S_un_b.s_b1,
59 Addr->S_un.S_un_b.s_b2,
60 Addr->S_un.S_un_b.s_b3,
61 Addr->S_un.S_un_b.s_b4);
62 }
63
64 /*
65 * @unimplemented
66 */
67 NTSTATUS
68 NTAPI
69 RtlIpv4AddressToStringExW(IN struct in_addr *Address,
70 IN USHORT Port,
71 OUT PWCHAR AddressString,
72 IN OUT PULONG AddressStringLength)
73 {
74 UNIMPLEMENTED;
75 return STATUS_NOT_IMPLEMENTED;
76 }
77
78 /*
79 * @unimplemented
80 */
81 NTSTATUS
82 NTAPI
83 RtlIpv4StringToAddressA(IN PCHAR String,
84 IN BOOLEAN Strict,
85 OUT PCHAR *Terminator,
86 OUT struct in_addr *Addr)
87 {
88 UNIMPLEMENTED;
89 return STATUS_NOT_IMPLEMENTED;
90 }
91
92 /*
93 * @unimplemented
94 */
95 NTSTATUS
96 NTAPI
97 RtlIpv4StringToAddressExA(IN PCHAR AddressString,
98 IN BOOLEAN Strict,
99 OUT struct in_addr *Address,
100 IN PUSHORT Port)
101 {
102 UNIMPLEMENTED;
103 return STATUS_NOT_IMPLEMENTED;
104 }
105
106 /*
107 * @unimplemented
108 */
109 NTSTATUS
110 NTAPI
111 RtlIpv4StringToAddressW(IN PCWSTR String,
112 IN BOOLEAN Strict,
113 OUT LPWSTR *Terminator,
114 OUT struct in_addr *Addr)
115 {
116 UNIMPLEMENTED;
117 return STATUS_NOT_IMPLEMENTED;
118 }
119
120 /*
121 * @unimplemented
122 */
123 NTSTATUS
124 NTAPI
125 RtlIpv4StringToAddressExW(IN PWCHAR AddressString,
126 IN BOOLEAN Strict,
127 OUT struct in_addr *Address,
128 OUT PUSHORT Port)
129 {
130 UNIMPLEMENTED;
131 return STATUS_NOT_IMPLEMENTED;
132 }
133
134 /*
135 * @unimplemented
136 */
137 NTSTATUS
138 NTAPI
139 RtlIpv6AddressToStringA(IN struct in6_addr *Addr,
140 OUT PCHAR S)
141 {
142 UNIMPLEMENTED;
143 return STATUS_NOT_IMPLEMENTED;
144 }
145
146 /*
147 * @unimplemented
148 */
149 NTSTATUS
150 NTAPI
151 RtlIpv6AddressToStringExA(IN struct in6_addr *Address,
152 IN ULONG ScopeId,
153 IN ULONG Port,
154 OUT PCHAR AddressString,
155 IN OUT PULONG AddressStringLength)
156 {
157 UNIMPLEMENTED;
158 return STATUS_NOT_IMPLEMENTED;
159 }
160
161 /*
162 * @unimplemented
163 */
164 NTSTATUS
165 NTAPI
166 RtlIpv6AddressToStringW(IN struct in6_addr *Addr,
167 OUT PWCHAR S)
168 {
169 UNIMPLEMENTED;
170 return STATUS_NOT_IMPLEMENTED;
171 }
172
173 /*
174 * @unimplemented
175 */
176 NTSTATUS
177 NTAPI
178 RtlIpv6AddressToStringExW(IN struct in6_addr *Address,
179 IN ULONG ScopeId,
180 IN USHORT Port,
181 IN OUT PWCHAR AddressString,
182 IN OUT PULONG AddressStringLength)
183 {
184 UNIMPLEMENTED;
185 return STATUS_NOT_IMPLEMENTED;
186 }
187
188 /*
189 * @unimplemented
190 */
191 NTSTATUS
192 NTAPI
193 RtlIpv6StringToAddressA(IN PCHAR Name,
194 OUT PCHAR *Terminator,
195 OUT struct in6_addr *Addr)
196 {
197 UNIMPLEMENTED;
198 return STATUS_NOT_IMPLEMENTED;
199 }
200
201 /*
202 * @unimplemented
203 */
204 NTSTATUS
205 NTAPI
206 RtlIpv6StringToAddressExA(IN PCHAR AddressString,
207 OUT struct in6_addr *Address,
208 OUT PULONG ScopeId,
209 OUT PUSHORT Port)
210 {
211 UNIMPLEMENTED;
212 return STATUS_NOT_IMPLEMENTED;
213 }
214
215 /*
216 * @unimplemented
217 */
218 NTSTATUS
219 NTAPI
220 RtlIpv6StringToAddressW(IN PWCHAR Name,
221 OUT PCHAR *Terminator,
222 OUT struct in6_addr *Addr)
223 {
224 UNIMPLEMENTED;
225 return STATUS_NOT_IMPLEMENTED;
226 }
227
228 /*
229 * @unimplemented
230 */
231 NTSTATUS
232 NTAPI
233 RtlIpv6StringToAddressExW(IN PWCHAR AddressName,
234 OUT struct in6_addr *Address,
235 OUT PULONG ScopeId,
236 OUT PUSHORT Port)
237 {
238 UNIMPLEMENTED;
239 return STATUS_NOT_IMPLEMENTED;
240 }
241
242 /* EOF */