~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/iphlpapi/ifenum.h

Version: ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /* ifenum.h
  2  * Copyright (C) 2003,2006 Juan Lang
  3  *
  4  * This library is free software; you can redistribute it and/or
  5  * modify it under the terms of the GNU Lesser General Public
  6  * License as published by the Free Software Foundation; either
  7  * version 2.1 of the License, or (at your option) any later version.
  8  *
  9  * This library is distributed in the hope that it will be useful,
 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 12  * Lesser General Public License for more details.
 13  *
 14  * You should have received a copy of the GNU Lesser General Public
 15  * License along with this library; if not, write to the Free Software
 16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 17  *
 18  * This module implements network interface and address enumeration.  It's
 19  * meant to hide some problematic defines like socket(), and make iphlpapi
 20  * more portable.
 21  *
 22  * Like Windows, it uses a numeric index to identify an interface uniquely.
 23  * As implemented, an interface represents a UNIX network interface, virtual
 24  * or real, and thus can have 0 or 1 IP addresses associated with it.  (This
 25  * only supports IPv4.)
 26  * The indexes returned are not guaranteed to be contiguous, so don't call
 27  * getNumInterfaces() and assume the values [0,getNumInterfaces() - 1] will be
 28  * valid indexes; use getInterfaceIndexTable() instead.
 29  *
 30  * See also the companion file, ipstats.h, for functions related to getting
 31  * statistics.
 32  */
 33 #ifndef WINE_IFENUM_H_
 34 #define WINE_IFENUM_H_
 35 
 36 #include <stdarg.h>
 37 
 38 #include "windef.h"
 39 #include "winbase.h"
 40 #include "iprtrmib.h"
 41 
 42 #define MAX_INTERFACE_PHYSADDR    8
 43 #define MAX_INTERFACE_DESCRIPTION 256
 44 
 45 DWORD getNumInterfaces(void);
 46 DWORD getNumNonLoopbackInterfaces(void);
 47 
 48 /* A table of interface indexes, see get*InterfaceTable(). */
 49 typedef struct _InterfaceIndexTable {
 50   DWORD numIndexes;
 51   DWORD indexes[1];
 52 } InterfaceIndexTable;
 53 
 54 /* Returns a table with all known interface indexes, or NULL if one could not
 55  * be allocated.  HeapFree() the returned table.
 56  */
 57 InterfaceIndexTable *getInterfaceIndexTable(void);
 58 
 59 /* Like getInterfaceIndexTable, but filters out loopback interfaces. */
 60 InterfaceIndexTable *getNonLoopbackInterfaceIndexTable(void);
 61 
 62 /* ByName/ByIndex versions of various getter functions. */
 63 
 64 /* can be used as quick check to see if you've got a valid index, returns NULL
 65  * if not.  Overwrites your buffer, which should be at least of size
 66  * MAX_ADAPTER_NAME.
 67  */
 68 char *getInterfaceNameByIndex(DWORD index, char *name);
 69 
 70 /* Fills index with the index of name, if found.  Returns
 71  * ERROR_INVALID_PARAMETER if name or index is NULL, ERROR_INVALID_DATA if name
 72  * is not found, and NO_ERROR on success.
 73  */
 74 DWORD getInterfaceIndexByName(const char *name, PDWORD index);
 75 
 76 /* Gets a few physical characteristics of a device:  MAC addr len, MAC addr,
 77  * and type as one of the MIB_IF_TYPEs.
 78  * len's in-out: on in, needs to say how many bytes are available in addr,
 79  * which to be safe should be MAX_INTERFACE_PHYSADDR.  On out, it's how many
 80  * bytes were set, or how many were required if addr isn't big enough.
 81  * Returns ERROR_INVALID_PARAMETER if name, len, addr, or type is NULL.
 82  * Returns ERROR_INVALID_DATA if name/index isn't valid.
 83  * Returns ERROR_INSUFFICIENT_BUFFER if addr isn't large enough for the
 84  * physical address; *len will contain the required size.
 85  * May return other errors, e.g. ERROR_OUTOFMEMORY or ERROR_NO_MORE_FILES,
 86  * if internal errors occur.
 87  * Returns NO_ERROR on success.
 88  */
 89 DWORD getInterfacePhysicalByIndex(DWORD index, PDWORD len, PBYTE addr,
 90  PDWORD type);
 91 
 92 /* Fills in the MIB_IFROW by name.  Doesn't fill in interface statistics,
 93  * see ipstats.h for that.
 94  * Returns ERROR_INVALID_PARAMETER if name is NULL, ERROR_INVALID_DATA
 95  * if name isn't valid, and NO_ERROR otherwise.
 96  */
 97 DWORD getInterfaceEntryByName(const char *name, PMIB_IFROW entry);
 98 
 99 DWORD getNumIPAddresses(void);
100 
101 /* Gets the configured IP addresses for the system, and sets *ppIpAddrTable to
102  * a table of them allocated from heap, or NULL if out of memory.  Returns
103  * NO_ERROR on success, something else on failure.  Note there may be more than
104  * one IP address may exist per interface.
105  */
106 DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags);
107 
108 /* Converts the network-order bytes in addr to a printable string.  Returns
109  * string.
110  */
111 char *toIPAddressString(unsigned int addr, char string[16]);
112 
113 DWORD getInterfaceMtuByName(const char *name, PDWORD mtu);
114 DWORD getInterfaceStatusByName(const char *name, PDWORD status);
115 
116 #endif /* ndef WINE_IFENUM_H_ */
117 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.