ReactOS 0.4.16-dev-311-g9382aa2
arp.c
Go to the documentation of this file.
1/*
2 * ReactOS Win32 Applications
3 * Copyright (C) 2005 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20/*
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS arp utility
23 * FILE: base/applications/network/arp/arp.c
24 * PURPOSE: view and manipulate the ARP cache
25 * PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com)
26 * REVISIONS:
27 * GM 27/06/05 Created
28 *
29 */
30
31#define WIN32_NO_STATUS
32#include <stdarg.h>
33#include <windef.h>
34#include <winbase.h>
35#include <stdio.h>
36#include <stdlib.h>
37#include <tchar.h>
38#define _INC_WINDOWS
39#include <winsock2.h>
40#include <iphlpapi.h>
41
42#include <arp_msg.h>
43
44/*
45 * Globals
46 */
47const char SEPARATOR = '-';
48int _CRT_glob = 0; // stop * from listing dir files in arp -d *
49
50/*
51 * function declarations
52 */
55DWORD DisplayArpEntries(PTCHAR pszInetAddr, PTCHAR pszIfAddr);
56DWORD Addhost(PTCHAR pszInetAddr, PTCHAR pszEthAddr, PTCHAR pszIfAddr);
57DWORD Deletehost(PTCHAR pszInetAddr, PTCHAR pszIfAddr);
59
60/*
61 * convert error code into meaningful message
62 */
64{
65 LPTSTR lpMsgBuf;
66 DWORD RetVal;
67
69
71 {
75 NULL,
77 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
78 (LPTSTR) &lpMsgBuf,
79 0,
80 NULL );
81
82 if (RetVal != 0)
83 {
84 _tprintf(_T("%s"), lpMsgBuf);
85 LocalFree(lpMsgBuf);
86 /* return number of TCHAR's stored in output buffer
87 * excluding '\0' - as FormatMessage does*/
88 return RetVal;
89 }
90 }
91 return 0;
92}
93
94VOID
96 DWORD dwMessage)
97{
98 LPTSTR lpMsgBuf;
99 DWORD RetVal;
100
105 dwMessage,
107 (LPTSTR)&lpMsgBuf,
108 0,
109 NULL);
110 if (RetVal != 0)
111 {
112 _tprintf(_T("%s"), lpMsgBuf);
113 LocalFree(lpMsgBuf);
114 }
115}
116
117VOID
119 DWORD dwMessage,
120 ...)
121{
122 LPTSTR lpMsgBuf;
123 va_list args = NULL;
124 DWORD RetVal;
125
126 va_start(args, dwMessage);
127
130 dwMessage,
132 (LPTSTR)&lpMsgBuf,
133 0,
134 &args);
135 va_end(args);
136
137 if (RetVal != 0)
138 {
139 _tprintf(_T("%s"), lpMsgBuf);
140 LocalFree(lpMsgBuf);
141 }
142}
143
144/*
145 *
146 * Takes an ARP entry and prints the IP address,
147 * the MAC address and the entry type to screen
148 *
149 */
151{
152 IN_ADDR inaddr;
153 TCHAR cMacAddr[20];
154
155 /* print IP addresses */
156 inaddr.S_un.S_addr = pIpAddRow->dwAddr;
157 _tprintf(_T(" %-22s"), inet_ntoa(inaddr));
158
159 /* print MAC address */
160 _stprintf(cMacAddr, _T("%02x-%02x-%02x-%02x-%02x-%02x"),
161 pIpAddRow->bPhysAddr[0],
162 pIpAddRow->bPhysAddr[1],
163 pIpAddRow->bPhysAddr[2],
164 pIpAddRow->bPhysAddr[3],
165 pIpAddRow->bPhysAddr[4],
166 pIpAddRow->bPhysAddr[5]);
167 _tprintf(_T("%-22s"), cMacAddr);
168
169 /* print cache type */
170 switch (pIpAddRow->dwType)
171 {
173 PrintMessage(MSG_ARP_DYNAMIC);
174 break;
175
177 PrintMessage(MSG_ARP_STATIC);
178 break;
179
181 PrintMessage(MSG_ARP_INVALID);
182 break;
183
185 PrintMessage(MSG_ARP_OTHER);
186 break;
187 }
188 _putts(_T(""));
189 return NO_ERROR;
190}
191
192/*
193 *
194 * Takes optional parameters of an internet address and interface address.
195 * Retrieve all entries in the ARP cache. If an internet address is
196 * specified, display the ARP entry relating to that address. If an
197 * interface address is specified, display all entries relating to
198 * that interface.
199 *
200 */
201/* FIXME: allow user to specify an interface address, via pszIfAddr */
202DWORD DisplayArpEntries(PTCHAR pszInetAddr, PTCHAR pszIfAddr)
203{
204 DWORD i, k, dwCount;
205 PMIB_IPNETTABLE pIpNetTable = NULL;
206 PMIB_IPADDRTABLE pIpAddrTable = NULL;
207 ULONG Size = 0;
208 struct in_addr inaddr, inaddr2;
209 PTCHAR pszIpAddr;
210 TCHAR szIntIpAddr[20];
211 DWORD dwError = NO_ERROR;
212
213 /* retrieve the IP-to-physical address mapping table */
214
215 /* get table size */
216 GetIpNetTable(pIpNetTable, &Size, 0);
217
218 /* allocate memory for ARP address table */
219 pIpNetTable = (PMIB_IPNETTABLE)HeapAlloc(GetProcessHeap(), 0, Size);
220 if (pIpNetTable == NULL)
221 {
222 PrintMessage(MSG_ARP_NO_MEMORY);
223 dwError = ERROR_NOT_ENOUGH_MEMORY;
224 goto cleanup;
225 }
226
227 ZeroMemory(pIpNetTable, sizeof(*pIpNetTable));
228
229 dwError = GetIpNetTable(pIpNetTable, &Size, TRUE);
230 if (dwError != NO_ERROR)
231 {
232 _tprintf(_T("GetIpNetTable failed: %lu\n"), dwError);
234 goto cleanup;
235 }
236
237 /* check there are entries in the table */
238 if (pIpNetTable->dwNumEntries == 0)
239 {
240 PrintMessage(MSG_ARP_NO_ENTRIES);
241 goto cleanup;
242 }
243
244 /* Retrieve the interface-to-ip address mapping
245 * table to get the IP address for adapter */
246
247 /* get table size */
248 Size = 0;
249 GetIpAddrTable(pIpAddrTable, &Size, 0);
250
251 pIpAddrTable = (PMIB_IPADDRTABLE)HeapAlloc(GetProcessHeap(), 0, Size);
252 if (pIpAddrTable == NULL)
253 {
254 PrintMessage(MSG_ARP_NO_MEMORY);
255 dwError = ERROR_NOT_ENOUGH_MEMORY;
256 goto cleanup;
257 }
258
259 ZeroMemory(pIpAddrTable, sizeof(*pIpAddrTable));
260
261 dwError = GetIpAddrTable(pIpAddrTable, &Size, TRUE);
262 if (dwError != NO_ERROR)
263 {
264 _tprintf(_T("GetIpAddrTable failed: %lu\n"), dwError);
266 goto cleanup;
267 }
268
269 for (k = 0; k < pIpAddrTable->dwNumEntries; k++)
270 {
271 if (pIpNetTable->table[0].dwIndex == pIpAddrTable->table[k].dwIndex)
272 {
273 //printf("debug print: pIpAddrTable->table[?].dwIndex = %lx\n", pIpNetTable->table[k].dwIndex);
274 inaddr2.s_addr = pIpAddrTable->table[k].dwAddr;
275 pszIpAddr = inet_ntoa(inaddr2);
276 strcpy(szIntIpAddr, pszIpAddr);
277 }
278 }
279
280 /* Count relevant ARP entries */
281 dwCount = 0;
282 for (i = 0; i < pIpNetTable->dwNumEntries; i++)
283 {
284 /* if the user has supplied their own internet address *
285 * only count the arp entry which matches that */
286 if (pszInetAddr)
287 {
288 inaddr.S_un.S_addr = pIpNetTable->table[i].dwAddr;
289 pszIpAddr = inet_ntoa(inaddr);
290
291 /* check if it matches, count it */
292 if (strcmp(pszIpAddr, pszInetAddr) == 0)
293 dwCount++;
294 }
295 else
296 {
297 /* if an address is not supplied, count all entries */
298 dwCount++;
299 }
300 }
301
302 /* Print message and leave if there are no relevant ARP entries */
303 if (dwCount == 0)
304 {
305 PrintMessage(MSG_ARP_NO_ENTRIES);
306 goto cleanup;
307 }
308
309 /* print header, including interface IP address and index number */
310 PrintMessageV(MSG_ARP_INTERFACE, szIntIpAddr, pIpNetTable->table[0].dwIndex);
311
312 /* go through all ARP entries */
313 for (i = 0; i < pIpNetTable->dwNumEntries; i++)
314 {
315
316 /* if the user has supplied their own internet address *
317 * only print the arp entry which matches that */
318 if (pszInetAddr)
319 {
320 inaddr.S_un.S_addr = pIpNetTable->table[i].dwAddr;
321 pszIpAddr = inet_ntoa(inaddr);
322
323 /* check if it matches, print it */
324 if (strcmp(pszIpAddr, pszInetAddr) == 0)
325 PrintEntries(&pIpNetTable->table[i]);
326 }
327 else
328 /* if an address is not supplied, print all entries */
329 PrintEntries(&pIpNetTable->table[i]);
330 }
331
332cleanup:
333 if (pIpNetTable != NULL)
334 HeapFree(GetProcessHeap(), 0, pIpNetTable);
335 if (pIpAddrTable != NULL)
336 HeapFree(GetProcessHeap(), 0, pIpAddrTable);
337
338 return dwError;
339}
340
341/*
342 *
343 * Takes an internet address, a MAC address and an optional interface
344 * address as arguments and checks their validity.
345 * Fill out an MIB_IPNETROW structure and insert the data into the
346 * ARP cache as a static entry.
347 *
348 */
349DWORD Addhost(PTCHAR pszInetAddr, PTCHAR pszEthAddr, PTCHAR pszIfAddr)
350{
351 PMIB_IPNETROW pAddHost = NULL;
352 PMIB_IPNETTABLE pIpNetTable = NULL;
353 DWORD dwIpAddr = 0;
354 ULONG Size = 0;
355 INT i, val, c;
356 DWORD dwError = NO_ERROR;
357
358 /* error checking */
359
360 /* check IP address */
361 if (pszInetAddr == NULL)
362 {
363 Usage();
365 }
366
367 dwIpAddr = inet_addr(pszInetAddr);
368 if (dwIpAddr == INADDR_NONE)
369 {
370 PrintMessageV(MSG_ARP_BAD_IP_ADDRESS, pszInetAddr);
372 }
373
374 /* check MAC address */
375 if (strlen(pszEthAddr) != 17)
376 {
377 PrintMessageV(MSG_ARP_BAD_ARGUMENT, pszEthAddr);
379 }
380
381 for (i = 0; i < 17; i++)
382 {
383 if (pszEthAddr[i] == SEPARATOR)
384 continue;
385
386 if (!isxdigit(pszEthAddr[i]))
387 {
388 PrintMessageV(MSG_ARP_BAD_ARGUMENT, pszEthAddr);
390 }
391 }
392
393 /* We need the IpNetTable to get the adapter index */
394 /* Return required buffer size */
395 GetIpNetTable(pIpNetTable, &Size, 0);
396
397 /* allocate memory for ARP address table */
398 pIpNetTable = (PMIB_IPNETTABLE)HeapAlloc(GetProcessHeap(), 0, Size);
399 if (pIpNetTable == NULL)
400 {
401 PrintMessage(MSG_ARP_NO_MEMORY);
402 dwError = ERROR_NOT_ENOUGH_MEMORY;
403 goto cleanup;
404 }
405
406 ZeroMemory(pIpNetTable, sizeof(*pIpNetTable));
407
408 dwError = GetIpNetTable(pIpNetTable, &Size, TRUE);
409 if (dwError != NO_ERROR)
410 {
411 _tprintf(_T("GetIpNetTable failed: %lu\n"), dwError);
413 goto cleanup;
414 }
415
416 /* reserve memory on heap and zero */
417 pAddHost = (PMIB_IPNETROW)HeapAlloc(GetProcessHeap(), 0, sizeof(MIB_IPNETROW));
418 if (pAddHost == NULL)
419 {
420 PrintMessage(MSG_ARP_NO_MEMORY);
421 dwError = ERROR_NOT_ENOUGH_MEMORY;
422 goto cleanup;
423 }
424
425 ZeroMemory(pAddHost, sizeof(MIB_IPNETROW));
426
427 /* set dwIndex field to the index of a local IP address to
428 * indicate the network on which the ARP entry applies */
429 if (pszIfAddr)
430 {
431 if (sscanf(pszIfAddr, "%lx", &pAddHost->dwIndex) == EOF)
432 {
433 goto cleanup;
434 }
435 }
436 else
437 {
438 //printf("debug print: pIpNetTable->table[0].dwIndex = %lx\n", pIpNetTable->table[0].dwIndex);
439 /* needs testing. I get the correct index on my machine, but need others
440 * to test their card index. Any problems and we can use GetAdaptersInfo instead */
441 pAddHost->dwIndex = pIpNetTable->table[0].dwIndex;
442 }
443
444 /* Set MAC address to 6 bytes (typical) */
445 pAddHost->dwPhysAddrLen = 6;
446
447
448 /* Encode bPhysAddr into correct byte array */
449 for (i = 0; i < 6; i++)
450 {
451 val = 0;
452 c = toupper(pszEthAddr[i * 3]);
453 c = c - (isdigit(c) ? '0' : ('A' - 10));
454 val += c;
455 val = (val << 4);
456 c = toupper(pszEthAddr[i * 3 + 1]);
457 c = c - (isdigit(c) ? '0' : ('A' - 10));
458 val += c;
459 pAddHost->bPhysAddr[i] = (BYTE)val;
460 }
461
462 /* copy converted IP address */
463 pAddHost->dwAddr = dwIpAddr;
464
465
466 /* set type to static */
467 pAddHost->dwType = MIB_IPNET_TYPE_STATIC;
468
469
470 /* Add the ARP entry */
471 dwError = SetIpNetEntry(pAddHost);
472 if (dwError != NO_ERROR)
473 {
475 goto cleanup;
476 }
477
478cleanup:
479 if (pIpNetTable != NULL)
480 HeapFree(GetProcessHeap(), 0, pIpNetTable);
481 if (pAddHost != NULL)
482 HeapFree(GetProcessHeap(), 0, pAddHost);
483
484 return dwError;
485}
486
487/*
488 *
489 * Takes an internet address and an optional interface address as
490 * arguments and checks their validity.
491 * Add the interface number and IP to an MIB_IPNETROW structure
492 * and remove the entry from the ARP cache.
493 *
494 */
495DWORD Deletehost(PTCHAR pszInetAddr, PTCHAR pszIfAddr)
496{
497 PMIB_IPNETROW pDelHost = NULL;
498 PMIB_IPNETTABLE pIpNetTable = NULL;
499 ULONG Size = 0;
500 DWORD dwIpAddr = 0;
501 BOOL bFlushTable = FALSE;
502 DWORD dwError = NO_ERROR;
503
504 /* error checking */
505
506 /* check IP address */
507 if (pszInetAddr == NULL)
508 {
509 Usage();
511 }
512
513 /* if wildcard is given, set flag to delete all hosts */
514 if (strncmp(pszInetAddr, "*", 1) == 0)
515 {
516 bFlushTable = TRUE;
517 }
518 else
519 {
520 dwIpAddr = inet_addr(pszInetAddr);
521 if (dwIpAddr == INADDR_NONE)
522 {
523 PrintMessageV(MSG_ARP_BAD_IP_ADDRESS, pszInetAddr);
525 }
526 }
527
528 /* We need the IpNetTable to get the adapter index */
529 /* Return required buffer size */
530 GetIpNetTable(NULL, &Size, 0);
531
532 /* allocate memory for ARP address table */
533 pIpNetTable = (PMIB_IPNETTABLE) HeapAlloc(GetProcessHeap(), 0, Size);
534 if (pIpNetTable == NULL)
535 {
536 PrintMessage(MSG_ARP_NO_MEMORY);
537 dwError = ERROR_NOT_ENOUGH_MEMORY;
538 goto cleanup;
539 }
540
541 ZeroMemory(pIpNetTable, sizeof(*pIpNetTable));
542
543 dwError = GetIpNetTable(pIpNetTable, &Size, TRUE);
544 if (dwError != NO_ERROR)
545 {
546 _tprintf(_T("GetIpNetTable failed: %lu\n"), dwError);
548 goto cleanup;
549 }
550
551 /* reserve memory on heap and zero */
552 pDelHost = (MIB_IPNETROW *)HeapAlloc(GetProcessHeap(), 0, sizeof(MIB_IPNETROW));
553 if (pDelHost == NULL)
554 {
555 PrintMessage(MSG_ARP_NO_MEMORY);
556 dwError = ERROR_NOT_ENOUGH_MEMORY;
557 goto cleanup;
558 }
559
560 ZeroMemory(pDelHost, sizeof(MIB_IPNETROW));
561
562 /* set dwIndex field to the index of a local IP address to
563 * indicate the network on which the ARP entry applies */
564 if (pszIfAddr)
565 {
566 if (sscanf(pszIfAddr, "%lx", &pDelHost->dwIndex) == EOF)
567 {
568 goto cleanup;
569 }
570 }
571 else
572 {
573 /* needs testing. I get the correct index on my machine, but need others
574 * to test their card index. Any problems and we can use GetAdaptersInfo instead */
575 pDelHost->dwIndex = pIpNetTable->table[0].dwIndex;
576 }
577
578 if (bFlushTable != FALSE)
579 {
580 /* delete arp cache */
581 dwError = FlushIpNetTable(pDelHost->dwIndex);
582 if (dwError != NO_ERROR)
583 {
585 goto cleanup;
586 }
587 }
588 else
589 {
590 /* copy converted IP address */
591 pDelHost->dwAddr = dwIpAddr;
592
593 /* Delete the ARP entry */
594 dwError = DeleteIpNetEntry(pDelHost);
595 if (dwError != NO_ERROR)
596 {
598 goto cleanup;
599 }
600 }
601
602cleanup:
603 if (pIpNetTable != NULL)
604 HeapFree(GetProcessHeap(), 0, pIpNetTable);
605 if (pDelHost != NULL)
606 HeapFree(GetProcessHeap(), 0, pDelHost);
607
608 return dwError;
609}
610
611/*
612 *
613 * print program usage to screen
614 *
615 */
617{
618 PrintMessage(MSG_ARP_SYNTAX);
619}
620
621/*
622 *
623 * Program entry.
624 * Parse command line and call the required function
625 *
626 */
627INT main(int argc, char* argv[])
628{
629 DWORD dwError = NO_ERROR;
630
631 if ((argc < 2) || (argc > 5))
632 {
633 Usage();
634 return EXIT_FAILURE;
635 }
636
637 if (argv[1][0] != '-')
638 {
639 Usage();
640 return EXIT_SUCCESS;
641 }
642
643 switch (argv[1][1])
644 {
645 case 'a': /* fall through */
646 case 'g':
647 if (argc == 2)
648 dwError = DisplayArpEntries(NULL, NULL);
649 else if (argc == 3)
650 dwError = DisplayArpEntries(argv[2], NULL);
651 else if ((argc == 4) && ((strcmp(argv[2], "-N")) == 0))
652 dwError = DisplayArpEntries(NULL, argv[3]);
653 else if ((argc == 5) && ((strcmp(argv[3], "-N")) == 0))
654 dwError = DisplayArpEntries(argv[2], argv[4]);
655 else
656 {
657 Usage();
658 dwError = ERROR_INVALID_PARAMETER;
659 }
660 break;
661
662 case 'd':
663 if (argc == 3)
664 dwError = Deletehost(argv[2], NULL);
665 else if (argc == 4)
666 dwError = Deletehost(argv[2], argv[3]);
667 else
668 {
669 Usage();
670 dwError = ERROR_INVALID_PARAMETER;
671 }
672 break;
673
674 case 's':
675 if (argc == 4)
676 dwError = Addhost(argv[2], argv[3], NULL);
677 else if (argc == 5)
678 dwError = Addhost(argv[2], argv[3], argv[4]);
679 else
680 {
681 Usage();
682 dwError = ERROR_INVALID_PARAMETER;
683 }
684 break;
685
686 default:
687 Usage();
688 dwError = ERROR_INVALID_PARAMETER;
689 break;
690 }
691
692 return (dwError == NO_ERROR) ? EXIT_SUCCESS : EXIT_FAILURE;
693}
static int argc
Definition: ServiceArgs.c:12
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define isdigit(c)
Definition: acclib.h:68
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define isxdigit(c)
Definition: acclib.h:70
int toupper(int c)
Definition: utclib.c:881
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
Definition: addrconv.c:160
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
Definition: addrconv.c:71
#define INADDR_NONE
Definition: tcp.c:42
const char SEPARATOR
Definition: arp.c:47
VOID PrintMessage(DWORD dwMessage)
Definition: arp.c:95
int _CRT_glob
Definition: arp.c:48
DWORD DisplayArpEntries(PTCHAR pszInetAddr, PTCHAR pszIfAddr)
Definition: arp.c:202
VOID PrintMessageV(DWORD dwMessage,...)
Definition: arp.c:118
DWORD DoFormatMessage(VOID)
Definition: arp.c:63
DWORD Addhost(PTCHAR pszInetAddr, PTCHAR pszEthAddr, PTCHAR pszIfAddr)
Definition: arp.c:349
DWORD PrintEntries(PMIB_IPNETROW pIpAddRow)
Definition: arp.c:150
DWORD Deletehost(PTCHAR pszInetAddr, PTCHAR pszIfAddr)
Definition: arp.c:495
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static void cleanup(void)
Definition: main.c:1335
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
int main()
Definition: test.c:6
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
const GLubyte * c
Definition: glext.h:8905
GLuint GLfloat * val
Definition: glext.h:7180
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:384
#define EOF
Definition: stdio.h:24
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define _tprintf
Definition: tchar.h:506
#define _putts
Definition: tchar.h:587
DWORD WINAPI DeleteIpNetEntry(PMIB_IPNETROW pArpEntry)
DWORD WINAPI FlushIpNetTable(DWORD dwIfIndex)
DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOrder)
DWORD WINAPI SetIpNetEntry(PMIB_IPNETROW pArpEntry)
DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder)
struct _MIB_IPNETTABLE * PMIB_IPNETTABLE
struct _MIB_IPNETROW MIB_IPNETROW
@ MIB_IPNET_TYPE_DYNAMIC
Definition: ipmib.h:108
@ MIB_IPNET_TYPE_INVALID
Definition: ipmib.h:107
@ MIB_IPNET_TYPE_STATIC
Definition: ipmib.h:109
@ MIB_IPNET_TYPE_OTHER
Definition: ipmib.h:106
struct _MIB_IPNETROW * PMIB_IPNETROW
struct _MIB_IPADDRTABLE * PMIB_IPADDRTABLE
#define EXIT_FAILURE
Definition: jerror.c:33
#define c
Definition: ke_i.h:80
#define _stprintf
Definition: utility.h:124
int k
Definition: mpi.c:3369
#define argv
Definition: mplay32.c:18
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
char * PTCHAR
Definition: ntbasedef.h:484
#define EXIT_SUCCESS
Definition: rdjpgcom.c:55
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_DEFAULT
Definition: nls.h:168
DWORD dwAddr
Definition: ipmib.h:36
IF_INDEX dwIndex
Definition: ipmib.h:37
MIB_IPADDRROW table[1]
Definition: ipmib.h:48
DWORD dwNumEntries
Definition: ipmib.h:47
DWORD dwPhysAddrLen
Definition: ipmib.h:115
BYTE bPhysAddr[MAXLEN_PHYSADDR]
Definition: ipmib.h:116
DWORD dwAddr
Definition: ipmib.h:117
DWORD dwType
Definition: ipmib.h:120
DWORD dwIndex
Definition: ipmib.h:114
DWORD dwNumEntries
Definition: ipmib.h:127
MIB_IPNETROW table[1]
Definition: ipmib.h:128
Definition: match.c:390
Definition: tcpip.h:126
u_long S_addr
Definition: tcpip.h:131
in_addr_t s_addr
Definition: inet.h:64
union in_addr::@1030 S_un
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define _T(x)
Definition: vfdio.h:22
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define FormatMessage
Definition: winbase.h:3820
#define ZeroMemory
Definition: winbase.h:1737
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:446
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:449
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:445
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:448
char TCHAR
Definition: xmlstorage.h:189
CHAR * LPTSTR
Definition: xmlstorage.h:192
unsigned char BYTE
Definition: xxhash.c:193