Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Enumerations | Functions | Variables
nsNotifyAddrListener.cpp File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#include <winsock2.h>
#include <iprtrmib.h>
#include <time.h>
#include "prmem.h"
#include "prthread.h"
#include "plstr.h"
#include "nsEventQueueUtils.h"
#include "nsIObserverService.h"
#include "nsServiceManagerUtils.h"
#include "nsNotifyAddrListener.h"
#include "nsString.h"

Go to the source code of this file.

Classes

struct  _IP_ADAPTER_UNICAST_ADDRESS
struct  _IP_ADAPTER_ANYCAST_ADDRESS
struct  _IP_ADAPTER_MULTICAST_ADDRESS
struct  _IP_ADAPTER_DNS_SERVER_ADDRESS
struct  _IP_ADAPTER_ADDRESSES
struct  IP_ADDRESS_STRING
struct  _IP_ADDR_STRING
struct  _IP_ADAPTER_INFO
union  _IP_ADAPTER_UNICAST_ADDRESS.u
struct  _IP_ADAPTER_UNICAST_ADDRESS.u.s
union  _IP_ADAPTER_ANYCAST_ADDRESS.u
struct  _IP_ADAPTER_ANYCAST_ADDRESS.u.s
union  _IP_ADAPTER_MULTICAST_ADDRESS.u
struct  _IP_ADAPTER_MULTICAST_ADDRESS.u.s
union  _IP_ADAPTER_DNS_SERVER_ADDRESS.u
struct  _IP_ADAPTER_DNS_SERVER_ADDRESS.u.s
union  _IP_ADAPTER_ADDRESSES.u
struct  _IP_ADAPTER_ADDRESSES.u.s

Defines

#define MAX_ADAPTER_DESCRIPTION_LENGTH   128
#define MAX_ADAPTER_NAME_LENGTH   256
#define MAX_ADAPTER_ADDRESS_LENGTH   8
#define GAA_FLAG_SKIP_ANYCAST   0x0002
#define GAA_FLAG_SKIP_MULTICAST   0x0004
#define GAA_FLAG_SKIP_DNS_SERVER   0x0008
#define GAA_FLAG_SKIP_FRIENDLY_NAME   0x0020
#define IF_TYPE_SOFTWARE_LOOPBACK   24

Typedefs

typedef struct
_IP_ADAPTER_UNICAST_ADDRESS 
IP_ADAPTER_UNICAST_ADDRESS
typedef struct
_IP_ADAPTER_UNICAST_ADDRESS
PIP_ADAPTER_UNICAST_ADDRESS
typedef struct
_IP_ADAPTER_ANYCAST_ADDRESS 
IP_ADAPTER_ANYCAST_ADDRESS
typedef struct
_IP_ADAPTER_ANYCAST_ADDRESS
PIP_ADAPTER_ANYCAST_ADDRESS
typedef struct
_IP_ADAPTER_MULTICAST_ADDRESS 
IP_ADAPTER_MULTICAST_ADDRESS
typedef struct
_IP_ADAPTER_MULTICAST_ADDRESS
PIP_ADAPTER_MULTICAST_ADDRESS
typedef struct
_IP_ADAPTER_DNS_SERVER_ADDRESS 
IP_ADAPTER_DNS_SERVER_ADDRESS
typedef struct
_IP_ADAPTER_DNS_SERVER_ADDRESS
PIP_ADAPTER_DNS_SERVER_ADDRESS
typedef struct
_IP_ADAPTER_ADDRESSES 
IP_ADAPTER_ADDRESSES
typedef struct
_IP_ADAPTER_ADDRESSES
PIP_ADAPTER_ADDRESSES
typedef struct IP_ADDRESS_STRINGPIP_ADDRESS_STRING
typedef struct IP_ADDRESS_STRING IP_MASK_STRING
typedef struct IP_ADDRESS_STRINGPIP_MASK_STRING
typedef struct _IP_ADDR_STRING IP_ADDR_STRING
typedef struct _IP_ADDR_STRINGPIP_ADDR_STRING
typedef struct _IP_ADAPTER_INFO IP_ADAPTER_INFO
typedef struct _IP_ADAPTER_INFOPIP_ADAPTER_INFO
typedef DWORD(WINAPI * GetAdaptersAddressesFunc )(ULONG, DWORD, PVOID, PIP_ADAPTER_ADDRESSES, PULONG)
typedef DWORD(WINAPI * GetAdaptersInfoFunc )(PIP_ADAPTER_INFO, PULONG)
typedef DWORD(WINAPI * GetIfEntryFunc )(PMIB_IFROW)
typedef DWORD(WINAPI * GetIpAddrTableFunc )(PMIB_IPADDRTABLE, PULONG, BOOL)
typedef DWORD(WINAPI * NotifyAddrChangeFunc )(PHANDLE, LPOVERLAPPED)

Enumerations

enum  IP_PREFIX_ORIGIN {
  IpPrefixOriginOther = 0, IpPrefixOriginManual, IpPrefixOriginWellKnown, IpPrefixOriginDhcp,
  IpPrefixOriginRouterAdvertisement
}
enum  IP_SUFFIX_ORIGIN {
  IpSuffixOriginOther = 0, IpSuffixOriginManual, IpSuffixOriginWellKnown, IpSuffixOriginDhcp,
  IpSuffixOriginLinkLayerAddress, IpSuffixOriginRandom
}
enum  IP_DAD_STATE {
  IpDadStateInvalid = 0, IpDadStateTentative, IpDadStateDuplicate, IpDadStateDeprecated,
  IpDadStatePreferred
}
enum  IF_OPER_STATUS {
  IfOperStatusUp = 1, IfOperStatusDown, IfOperStatusTesting, IfOperStatusUnknown,
  IfOperStatusDormant, IfOperStatusNotPresent, IfOperStatusLowerLayerDown
}

Functions

static void InitIPHelperLibrary (void)
static void FreeIPHelperLibrary (void)
 NS_IMPL_THREADSAFE_ISUPPORTS3 (nsNotifyAddrListener, nsINetworkLinkService, nsIRunnable, nsIObserver) nsNotifyAddrListener

Variables

static HMODULE sIPHelper
static GetAdaptersAddressesFunc sGetAdaptersAddresses
static GetAdaptersInfoFunc sGetAdaptersInfo
static GetIfEntryFunc sGetIfEntry
static GetIpAddrTableFunc sGetIpAddrTable
static NotifyAddrChangeFunc sNotifyAddrChange

Class Documentation

struct _IP_ADAPTER_UNICAST_ADDRESS

Definition at line 95 of file nsNotifyAddrListener.cpp.

Collaboration diagram for _IP_ADAPTER_UNICAST_ADDRESS:
Class Members
SOCKET_ADDRESS Address
IP_DAD_STATE DadState
ULONG LeaseLifetime
struct
_IP_ADAPTER_UNICAST_ADDRESS *
Next
ULONG PreferredLifetime
IP_PREFIX_ORIGIN PrefixOrigin
IP_SUFFIX_ORIGIN SuffixOrigin
union _IP_ADAPTER_UNICAST_ADDRESS u
ULONG ValidLifetime
struct _IP_ADAPTER_ANYCAST_ADDRESS

Definition at line 115 of file nsNotifyAddrListener.cpp.

Collaboration diagram for _IP_ADAPTER_ANYCAST_ADDRESS:
Class Members
SOCKET_ADDRESS Address
struct
_IP_ADAPTER_ANYCAST_ADDRESS *
Next
union _IP_ADAPTER_ANYCAST_ADDRESS u
struct _IP_ADAPTER_MULTICAST_ADDRESS

Definition at line 127 of file nsNotifyAddrListener.cpp.

Collaboration diagram for _IP_ADAPTER_MULTICAST_ADDRESS:
Class Members
SOCKET_ADDRESS Address
struct
_IP_ADAPTER_MULTICAST_ADDRESS *
Next
union _IP_ADAPTER_MULTICAST_ADDRESS u
struct _IP_ADAPTER_DNS_SERVER_ADDRESS

Definition at line 139 of file nsNotifyAddrListener.cpp.

Collaboration diagram for _IP_ADAPTER_DNS_SERVER_ADDRESS:
Class Members
SOCKET_ADDRESS Address
struct
_IP_ADAPTER_DNS_SERVER_ADDRESS *
Next
union
_IP_ADAPTER_DNS_SERVER_ADDRESS
u
struct _IP_ADAPTER_ADDRESSES

Definition at line 161 of file nsNotifyAddrListener.cpp.

Collaboration diagram for _IP_ADAPTER_ADDRESSES:
Class Members
PCHAR AdapterName
PWCHAR Description
PWCHAR DnsSuffix
PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress
PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress
PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress
PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress
DWORD Flags
PWCHAR FriendlyName
DWORD IfType
DWORD Mtu
struct _IP_ADAPTER_ADDRESSES * Next
IF_OPER_STATUS OperStatus
BYTE PhysicalAddress
DWORD PhysicalAddressLength
union _IP_ADAPTER_ADDRESSES u
struct IP_ADDRESS_STRING

Definition at line 186 of file nsNotifyAddrListener.cpp.

Class Members
char String
struct _IP_ADDR_STRING

Definition at line 190 of file nsNotifyAddrListener.cpp.

Collaboration diagram for _IP_ADDR_STRING:
Class Members
DWORD Context
IP_ADDRESS_STRING IpAddress
IP_MASK_STRING IpMask
struct _IP_ADDR_STRING * Next
struct _IP_ADAPTER_INFO

Definition at line 197 of file nsNotifyAddrListener.cpp.

Collaboration diagram for _IP_ADAPTER_INFO:
Class Members
char AdapterName
BYTE Address
UINT AddressLength
DWORD ComboIndex
PIP_ADDR_STRING CurrentIpAddress
char Description
UINT DhcpEnabled
IP_ADDR_STRING DhcpServer
IP_ADDR_STRING GatewayList
BOOL HaveWins
DWORD Index
IP_ADDR_STRING IpAddressList
time_t LeaseExpires
time_t LeaseObtained
struct _IP_ADAPTER_INFO * Next
IP_ADDR_STRING PrimaryWinsServer
IP_ADDR_STRING SecondaryWinsServer
UINT Type
union _IP_ADAPTER_UNICAST_ADDRESS.u

Definition at line 96 of file nsNotifyAddrListener.cpp.

Class Members
ULONGLONG Alignment
u s
struct _IP_ADAPTER_UNICAST_ADDRESS.u.s

Definition at line 98 of file nsNotifyAddrListener.cpp.

Class Members
DWORD Flags
ULONG Length
union _IP_ADAPTER_ANYCAST_ADDRESS.u

Definition at line 116 of file nsNotifyAddrListener.cpp.

Class Members
ULONGLONG Alignment
u s
struct _IP_ADAPTER_ANYCAST_ADDRESS.u.s

Definition at line 118 of file nsNotifyAddrListener.cpp.

Class Members
DWORD Flags
ULONG Length
union _IP_ADAPTER_MULTICAST_ADDRESS.u

Definition at line 128 of file nsNotifyAddrListener.cpp.

Class Members
ULONGLONG Alignment
u s
struct _IP_ADAPTER_MULTICAST_ADDRESS.u.s

Definition at line 130 of file nsNotifyAddrListener.cpp.

Class Members
DWORD Flags
ULONG Length
union _IP_ADAPTER_DNS_SERVER_ADDRESS.u

Definition at line 140 of file nsNotifyAddrListener.cpp.

Class Members
ULONGLONG Alignment
u s
struct _IP_ADAPTER_DNS_SERVER_ADDRESS.u.s

Definition at line 142 of file nsNotifyAddrListener.cpp.

Class Members
ULONG Length
DWORD Reserved
union _IP_ADAPTER_ADDRESSES.u

Definition at line 162 of file nsNotifyAddrListener.cpp.

Class Members
ULONGLONG Alignment
u s
struct _IP_ADAPTER_ADDRESSES.u.s

Definition at line 164 of file nsNotifyAddrListener.cpp.

Class Members
DWORD IfIndex
ULONG Length

Define Documentation

Definition at line 63 of file nsNotifyAddrListener.cpp.

Definition at line 65 of file nsNotifyAddrListener.cpp.

Definition at line 66 of file nsNotifyAddrListener.cpp.

Definition at line 64 of file nsNotifyAddrListener.cpp.

Definition at line 68 of file nsNotifyAddrListener.cpp.

Definition at line 61 of file nsNotifyAddrListener.cpp.

Definition at line 59 of file nsNotifyAddrListener.cpp.

Definition at line 60 of file nsNotifyAddrListener.cpp.


Typedef Documentation

typedef DWORD(WINAPI * GetAdaptersAddressesFunc)(ULONG, DWORD, PVOID, PIP_ADAPTER_ADDRESSES, PULONG)

Definition at line 218 of file nsNotifyAddrListener.cpp.

typedef DWORD(WINAPI * GetAdaptersInfoFunc)(PIP_ADAPTER_INFO, PULONG)

Definition at line 221 of file nsNotifyAddrListener.cpp.

typedef DWORD(WINAPI * GetIfEntryFunc)(PMIB_IFROW)

Definition at line 222 of file nsNotifyAddrListener.cpp.

typedef DWORD(WINAPI * GetIpAddrTableFunc)(PMIB_IPADDRTABLE, PULONG, BOOL)

Definition at line 223 of file nsNotifyAddrListener.cpp.

typedef DWORD(WINAPI * NotifyAddrChangeFunc)(PHANDLE, LPOVERLAPPED)

Definition at line 224 of file nsNotifyAddrListener.cpp.

typedef struct _IP_ADDR_STRING * PIP_ADDR_STRING

Enumeration Type Documentation

Enumerator:
IfOperStatusUp 
IfOperStatusDown 
IfOperStatusTesting 
IfOperStatusUnknown 
IfOperStatusDormant 
IfOperStatusNotPresent 
IfOperStatusLowerLayerDown 

Definition at line 151 of file nsNotifyAddrListener.cpp.

Enumerator:
IpDadStateInvalid 
IpDadStateTentative 
IpDadStateDuplicate 
IpDadStateDeprecated 
IpDadStatePreferred 

Definition at line 87 of file nsNotifyAddrListener.cpp.

Enumerator:
IpPrefixOriginOther 
IpPrefixOriginManual 
IpPrefixOriginWellKnown 
IpPrefixOriginDhcp 
IpPrefixOriginRouterAdvertisement 

Definition at line 70 of file nsNotifyAddrListener.cpp.

Enumerator:
IpSuffixOriginOther 
IpSuffixOriginManual 
IpSuffixOriginWellKnown 
IpSuffixOriginDhcp 
IpSuffixOriginLinkLayerAddress 
IpSuffixOriginRandom 

Definition at line 78 of file nsNotifyAddrListener.cpp.


Function Documentation

static void FreeIPHelperLibrary ( void  ) [static]

Definition at line 254 of file nsNotifyAddrListener.cpp.

Here is the caller graph for this function:

static void InitIPHelperLibrary ( void  ) [static]

Definition at line 233 of file nsNotifyAddrListener.cpp.

Here is the caller graph for this function:

Definition at line 269 of file nsNotifyAddrListener.cpp.

    : mLinkUp(PR_TRUE)  // assume true by default
    , mStatusKnown(PR_FALSE)
    , mThread(0)
    , mShutdownEvent(nsnull)
{
    mOSVerInfo.dwOSVersionInfoSize = sizeof(mOSVerInfo);
    GetVersionEx(&mOSVerInfo);
    InitIPHelperLibrary();
}

Here is the call graph for this function:


Variable Documentation

Definition at line 227 of file nsNotifyAddrListener.cpp.

Definition at line 228 of file nsNotifyAddrListener.cpp.

Definition at line 229 of file nsNotifyAddrListener.cpp.

Definition at line 230 of file nsNotifyAddrListener.cpp.

HMODULE sIPHelper [static]

Definition at line 226 of file nsNotifyAddrListener.cpp.

Definition at line 231 of file nsNotifyAddrListener.cpp.