src/windows/native/java/net/NetworkInterface.h

Print this page




  44     char *displayName;
  45     DWORD dwIndex;              /* Internal index */
  46     DWORD ifType;               /* Interface type */
  47     int index;                  /* Friendly index */
  48     struct _netif *next;
  49 
  50     /* Following fields used on Windows XP when IPv6 is used only */
  51     jboolean hasIpv6Address;    /* true when following fields valid */
  52     jboolean dNameIsUnicode;    /* Display Name is Unicode */
  53     int naddrs;                 /* Number of addrs */
  54     DWORD ipv6Index;
  55     struct _netaddr *addrs;     /* addr list for interfaces */
  56 } netif;
  57 
  58 extern void free_netif(netif *netifP);
  59 extern void free_netaddr(netaddr *netaddrP);
  60 
  61 /* various JNI ids */
  62 extern jclass ni_class;             /* NetworkInterface */
  63 
  64 extern jmethodID ni_ctor;           /* NetworkInterface() */
  65 
  66 extern jfieldID ni_indexID;         /* NetworkInterface.index */
  67 extern jfieldID ni_addrsID;         /* NetworkInterface.addrs */
  68 extern jfieldID ni_bindsID;         /* NetworkInterface.bindings */
  69 extern jfieldID ni_nameID;          /* NetworkInterface.name */
  70 extern jfieldID ni_displayNameID;   /* NetworkInterface.displayName */
  71 extern jfieldID ni_childsID;        /* NetworkInterface.childs */
  72 
  73 extern jclass ni_iacls;             /* InetAddress */
  74 extern jfieldID ni_iaAddr;          /* InetAddress.address */
  75 
  76 extern jclass ni_ia4cls;            /* Inet4Address */
  77 extern jmethodID ni_ia4Ctor;        /* Inet4Address() */
  78 
  79 extern jclass ni_ia6cls;            /* Inet6Address */
  80 extern jmethodID ni_ia6ctrID;       /* Inet6Address() */
  81 extern jfieldID ni_ia6ipaddressID;
  82 extern jfieldID ni_ia6ipaddressID;
  83 
  84 extern jclass ni_ibcls;             /* InterfaceAddress */
  85 extern jmethodID ni_ibctrID;        /* InterfaceAddress() */
  86 extern jfieldID ni_ibaddressID;     /* InterfaceAddress.address */
  87 extern jfieldID ni_ibbroadcastID;   /* InterfaceAddress.broadcast */
  88 extern jfieldID ni_ibmaskID;        /* InterfaceAddress.maskLength */
  89 
  90 int enumInterfaces_win(JNIEnv *env, netif **netifPP);
  91 
  92 /* We have included iphlpapi.h which includes iptypes.h which has the definition
  93  * for MAX_ADAPTER_DESCRIPTION_LENGTH (along with the other definitions in this
  94  * ifndef block). Therefore if MAX_ADAPTER_DESCRIPTION_LENGTH is defined we can
  95  * be sure that the other definitions are also defined */
  96 #ifndef MAX_ADAPTER_DESCRIPTION_LENGTH
  97 
  98 /*
  99  * Following includes come from iptypes.h
 100  */
 101 
 102 #pragma warning(push)
 103 #pragma warning(disable:4201)




  44     char *displayName;
  45     DWORD dwIndex;              /* Internal index */
  46     DWORD ifType;               /* Interface type */
  47     int index;                  /* Friendly index */
  48     struct _netif *next;
  49 
  50     /* Following fields used on Windows XP when IPv6 is used only */
  51     jboolean hasIpv6Address;    /* true when following fields valid */
  52     jboolean dNameIsUnicode;    /* Display Name is Unicode */
  53     int naddrs;                 /* Number of addrs */
  54     DWORD ipv6Index;
  55     struct _netaddr *addrs;     /* addr list for interfaces */
  56 } netif;
  57 
  58 extern void free_netif(netif *netifP);
  59 extern void free_netaddr(netaddr *netaddrP);
  60 
  61 /* various JNI ids */
  62 extern jclass ni_class;             /* NetworkInterface */
  63 
  64 extern jmethodID ni_ctrID;           /* NetworkInterface() */
  65 
  66 extern jfieldID ni_indexID;         /* NetworkInterface.index */
  67 extern jfieldID ni_addrsID;         /* NetworkInterface.addrs */
  68 extern jfieldID ni_bindsID;         /* NetworkInterface.bindings */
  69 extern jfieldID ni_nameID;          /* NetworkInterface.name */
  70 extern jfieldID ni_displayNameID;   /* NetworkInterface.displayName */
  71 extern jfieldID ni_childsID;        /* NetworkInterface.childs */
  72 











  73 extern jclass ni_ibcls;             /* InterfaceAddress */
  74 extern jmethodID ni_ibctrID;        /* InterfaceAddress() */
  75 extern jfieldID ni_ibaddressID;     /* InterfaceAddress.address */
  76 extern jfieldID ni_ibbroadcastID;   /* InterfaceAddress.broadcast */
  77 extern jfieldID ni_ibmaskID;        /* InterfaceAddress.maskLength */
  78 
  79 int enumInterfaces_win(JNIEnv *env, netif **netifPP);
  80 
  81 /* We have included iphlpapi.h which includes iptypes.h which has the definition
  82  * for MAX_ADAPTER_DESCRIPTION_LENGTH (along with the other definitions in this
  83  * ifndef block). Therefore if MAX_ADAPTER_DESCRIPTION_LENGTH is defined we can
  84  * be sure that the other definitions are also defined */
  85 #ifndef MAX_ADAPTER_DESCRIPTION_LENGTH
  86 
  87 /*
  88  * Following includes come from iptypes.h
  89  */
  90 
  91 #pragma warning(push)
  92 #pragma warning(disable:4201)