⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ntddip6.h

📁 WinCE下的ping源码
💻 H
📖 第 1 页 / 共 3 页
字号:
} IPV6_QUERY_SITE_PREFIX;

typedef struct ipv6_info_site_prefix {
    IPV6_QUERY_SITE_PREFIX Query;

    unsigned int ValidLifetime;  // Seconds.
} IPV6_INFO_SITE_PREFIX;


//
// This IOCTL adds/removes a prefix in the site prefix table.
// It uses the IPV6_INFO_SITE_PREFIX structure.
//
// This ioctl is provided for testing purposes.
// Administrative configuration of site prefixes should never
// be required, because site prefixes are configured from
// Router Advertisements on hosts and from the routing table
// on routers. Hence there is no persistent version of this ioctl.
//
#define IOCTL_IPV6_UPDATE_SITE_PREFIX \
            _IPV6_CTL_CODE(26, METHOD_BUFFERED, FILE_WRITE_ACCESS)


//
// This IOCTL create a new interface.
// It uses the IPV6_INFO_INTERFACE structure,
// with many fields ignored.
//
#define IOCTL_IPV6_CREATE_INTERFACE \
            _IPV6_CTL_CODE(27, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_IPV6_PERSISTENT_CREATE_INTERFACE \
            _IPV6_CTL_CODE(43, METHOD_BUFFERED, FILE_WRITE_ACCESS)


//
// This IOCTL requests a routing change notification.
// It uses the IPV6_RTCHANGE_NOTIFY_REQUEST (input) and
// IPV6_INFO_ROUTE_TABLE (output) structures.
//
// A notification request completes when a route
// that matches is added or deleted.
// A route matches the requested prefix if the route
// prefix and the request prefix intersect.
// So the ::/0 request prefix matches all route updates.
//
#define IOCTL_IPV6_RTCHANGE_NOTIFY_REQUEST \
            _IPV6_CTL_CODE(28, METHOD_BUFFERED, FILE_ANY_ACCESS)

typedef struct ipv6_rtchange_notify_request {
    unsigned int Flags;
    unsigned int PrefixLength;
    unsigned long ScopeId;
    IPv6Addr Prefix;
} IPV6_RTCHANGE_NOTIFY_REQUEST;

#define IPV6_RTCHANGE_NOTIFY_REQUEST_FLAG_SYNCHRONIZE   0x1
                // Only one wakeup per requestor per change.
#define IPV6_RTCHANGE_NOTIFY_REQUEST_FLAG_SUPPRESS_MINE 0x2
                // Ignore route changes from this requestor.


#if 0 // obsolete
//
// This IOCTL retrieves an interface index, given a device name.
// It takes a PWSTR for input, and uses the IPV6_QUERY_INTERFACE structure 
// for output.
//
#define IOCTL_IPV6_QUERY_INTERFACE_INDEX \
            _IPV6_CTL_CODE(29, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif


//
// This IOCTL queries global IPv6 parameters.
// It uses the IPV6_GLOBAL_PARAMETERS structure.
//
// Note that changing these parameters typically does not affect
// existing uses of them. For example changing DefaultCurHopLimit
// will not affect the CurHopLimit of existing interfaces,
// but it will affect the CurHopLimit of new interfaces.
//
#define IOCTL_IPV6_QUERY_GLOBAL_PARAMETERS \
            _IPV6_CTL_CODE(30, METHOD_BUFFERED, FILE_ANY_ACCESS)

#define IOCTL_IPV6_PERSISTENT_QUERY_GLOBAL_PARAMETERS \
            _IPV6_CTL_CODE(49, METHOD_BUFFERED, FILE_ANY_ACCESS)

typedef struct ipv6_global_parameters {
    unsigned int DefaultCurHopLimit;       // -1 means no change.
    unsigned int UseTemporaryAddresses;    // -1 means no change.
    unsigned int MaxTempDADAttempts;       // -1 means no change.
    unsigned int MaxTempValidLifetime;     // -1 means no change.
    unsigned int MaxTempPreferredLifetime; // -1 means no change.
    unsigned int TempRegenerateTime;       // -1 means no change.
    unsigned int MaxTempRandomTime;        // -1 means no change.
    unsigned int TempRandomTime;           // -1 means no change.
    unsigned int NeighborCacheLimit;       // -1 means no change.
    unsigned int RouteCacheLimit;          // -1 means no change.
    unsigned int BindingCacheLimit;        // -1 means no change.
    unsigned int ReassemblyLimit;          // -1 means no change.
    int MobilitySecurity;                  // Boolean, -1 means no change.
    unsigned int BUSecurity;           
    unsigned int BASecurity;         
    unsigned int MobileIPv6Mode;           // -1 means no change.
} IPV6_GLOBAL_PARAMETERS;


//
// Values for the UseTemporaryAddresses field.
//
#define USE_TEMP_NO             0       // Don't use temporary addresses.
#define USE_TEMP_YES            1       // Use them.
#define USE_TEMP_ALWAYS         2       // Always generating random numbers.
#define USE_TEMP_COUNTER        3       // Use them with per-interface counter.

//
// Values for BUSecurity Field
//
#define BU_NONE 0
#define BU_IPSEC 1
#define BU_CAM 2


//
// Values for BASecurity Field
//
#define BA_NONE 0
#define BA_IPSEC 1
// Bits in the MobileIPv6Mode field.
//
#define MOBILE_CORRESPONDENT    0x01
#define MOBILE_MOBILE_NODE      0x02
#define MOBILE_HOME_AGENT       0x04

//
// Initialize the fields of the IPV6_GLOBAL_PARAMETERS structure
// to values that indicate no change.
//
__inline void
IPV6_INIT_GLOBAL_PARAMETERS(IPV6_GLOBAL_PARAMETERS *Params)
{
    Params->DefaultCurHopLimit = (unsigned int) -1;
    Params->UseTemporaryAddresses = (unsigned int) -1;
    Params->MaxTempDADAttempts = (unsigned int) -1;
    Params->MaxTempValidLifetime = (unsigned int) -1;
    Params->MaxTempPreferredLifetime = (unsigned int) -1;
    Params->TempRegenerateTime = (unsigned int) -1;
    Params->MaxTempRandomTime = (unsigned int) -1;
    Params->TempRandomTime = (unsigned int) -1;
    Params->NeighborCacheLimit = (unsigned int) -1;
    Params->RouteCacheLimit = (unsigned int) -1;
    Params->BindingCacheLimit = (unsigned int) -1;
    Params->ReassemblyLimit = (unsigned int) -1;
    Params->MobilitySecurity = -1;
    Params->BUSecurity = (unsigned int) -1;
    Params->MobileIPv6Mode = (unsigned int) -1;
    Params->BASecurity = (unsigned int) -1;
}


//
// This IOCTL sets global IPv6 parameters.
// It uses the IPV6_GLOBAL_PARAMETERS structure.
//
// Note that changing these parameters typically does not affect
// existing uses of them. For example changing DefaultCurHopLimit
// will not affect the CurHopLimit of existing interfaces,
// but it will affect the CurHopLimit of new interfaces.
//
#define IOCTL_IPV6_UPDATE_GLOBAL_PARAMETERS \
            _IPV6_CTL_CODE(31, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_IPV6_PERSISTENT_UPDATE_GLOBAL_PARAMETERS \
            _IPV6_CTL_CODE(37, METHOD_BUFFERED, FILE_WRITE_ACCESS)


//
// This IOCTL retrieves information from the prefix policy table.
// It takes as input an IPV6_QUERY_PREFIX_POLICY structure
// and returns as output an IPV6_INFO_PREFIX_POLICY structure.
// To perform an iteration, start with PrefixLength set to -1, in which case
// only an IPV6_QUERY_PREFIX_POLICY is returned, for the first policy.
// If there are no more policies, then the PrefixLength in the returned
// IPV6_QUERY_PREFIX_POLICY will be -1.
//
#define IOCTL_IPV6_QUERY_PREFIX_POLICY \
            _IPV6_CTL_CODE(32, METHOD_BUFFERED, FILE_ANY_ACCESS)

typedef struct ipv6_query_prefix_policy {
    IPv6Addr Prefix;
    unsigned int PrefixLength;
} IPV6_QUERY_PREFIX_POLICY;

typedef struct ipv6_info_prefix_policy {
    IPV6_QUERY_PREFIX_POLICY Next;      // For non-persistent queries only.
    IPV6_QUERY_PREFIX_POLICY This;

    unsigned int Precedence;
    unsigned int SrcLabel;
    unsigned int DstLabel;
} IPV6_INFO_PREFIX_POLICY;


//
// This IOCTL retrieves information about persisted prefix policies.
// It takes as input an IPV6_PERSISTENT_QUERY_PREFIX_POLICY structure
// and returns as output an IPV6_INFO_PREFIX_POLICY structure.
// (The Next field is not returned.)
// To perform an iteration, start with index 0 and increment
// until getting STATUS_NO_MORE_ENTRIES / ERROR_NO_MORE_ITEMS.
//
// An IOCTL to retrieve persisted prefix policies via prefix
// (like IPV6_QUERY_PREFIX_POLICY) is conceivable but not supported.
//
#define IOCTL_IPV6_PERSISTENT_QUERY_PREFIX_POLICY \
            _IPV6_CTL_CODE(50, METHOD_BUFFERED, FILE_ANY_ACCESS)

typedef struct ipv6_persistent_query_prefix_policy {
    unsigned int RegistryIndex;
} IPV6_PERSISTENT_QUERY_PREFIX_POLICY;


//
// This IOCTL adds a prefix to the prefix policy table,
// or updates an existing prefix policy.
// It uses the IPV6_INFO_PREFIX_POLICY structure.
// (The Next field is ignored.)
//
#define IOCTL_IPV6_UPDATE_PREFIX_POLICY \
            _IPV6_CTL_CODE(33, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_IPV6_PERSISTENT_UPDATE_PREFIX_POLICY \
            _IPV6_CTL_CODE(41, METHOD_BUFFERED, FILE_WRITE_ACCESS)


//
// This IOCTL removes a prefix from the prefix policy table.
// It uses the IPV6_QUERY_PREFIX_POLICY structure.
//
#define IOCTL_IPV6_DELETE_PREFIX_POLICY \
            _IPV6_CTL_CODE(34, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_IPV6_PERSISTENT_DELETE_PREFIX_POLICY \
            _IPV6_CTL_CODE(42, METHOD_BUFFERED, FILE_WRITE_ACCESS)


//
// This IOCTL deletes all manual configuration.
//
#define IOCTL_IPV6_RESET \
            _IPV6_CTL_CODE(39, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_IPV6_PERSISTENT_RESET \
            _IPV6_CTL_CODE(45, METHOD_BUFFERED, FILE_WRITE_ACCESS)


//
// This IOCTL sets the link-layer address of a default router
// on a non-broadcast multi-access (NBMA) link, such as the ISATAP
// link, where Router Solicitations, Router Advertistments, and
// Redirects are desired.
//
// There is no persistent version of this ioctl because
// 6to4svc always configures this information dynamically.
//
#define IOCTL_IPV6_UPDATE_ROUTER_LL_ADDRESS \
            _IPV6_CTL_CODE(35, METHOD_BUFFERED, FILE_WRITE_ACCESS)

typedef struct ipv6_update_router_ll_address {
    IPV6_QUERY_INTERFACE IF;
    // Following this structure in memory are:
    //   Own link-layer address to use for EUI-64 creation.
    //   Link-layer address of router.
} IPV6_UPDATE_ROUTER_LL_ADDRESS;


//
// This IOCTL renews an interface, meaning that all
// auto-configured state is thrown away and regenerated.
// Same behavior as reconnecting the interface to a link.
// It uses the IPV6_QUERY_INTERFACE structure.
//
#define IOCTL_IPV6_RENEW_INTERFACE \
            _IPV6_CTL_CODE(51, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#if defined MIPV6 || defined UNDER_CE
//
// This IOCTL discovers a home address/home agent pair of a mobile node. 
//
#define IOCTL_IPV6_QUERY_HOME_ADDRESS \
            _IPV6_CTL_CODE(52, METHOD_BUFFERED, FILE_ANY_ACCESS) 

typedef struct ipv6_query_home_address {
    IPv6Addr Address;
} IPV6_QUERY_HOME_ADDRESS;

//
// This IOCTL assigns a home address/home agent pair to a mobile node. 
//
#define IOCTL_IPV6_UPDATE_HOME_ADDRESS \
            _IPV6_CTL_CODE(53, METHOD_BUFFERED, FILE_WRITE_ACCESS) 
typedef struct ipv6_info_home_address {
    IPV6_QUERY_HOME_ADDRESS Next;
    IPV6_QUERY_HOME_ADDRESS This;

    IPv6Addr HomeAgent;
    unsigned int Flags;
} IPV6_INFO_HOME_ADDRESS;

#define IPV6_HA_INFO_AT_HOME            0x01    // Set if HAE is on-link
#define IPV6_HA_INFO_NO_BA_AUTH         0x04    // Set if HA cannot use IPSEC. 
#define IPV6_HA_INFO_CAM_ENABLED        0x08  //Set if HA is derived using CAM  

//
// This IOCTL plumbs the Public/Private key pair to be used for CAM
//

typedef struct ipv6_info_cam_key {
    unsigned char *Private;
    unsigned int PrivateLen;
    unsigned char *Public;
    unsigned int PublicLen;
} IPV6_INFO_CAM_KEY;

#define IOCTL_IPV6_INIT_CAM_KEY \
            _IPV6_CTL_CODE(64, METHOD_BUFFERED, FILE_WRITE_ACCESS)



//
// This IOCTL queries the binding update list 
//
#define IOCTL_IPV6_QUERY_BINDING_LIST \
            _IPV6_CTL_CODE(54, METHOD_BUFFERED, FILE_ANY_ACCESS) 

typedef struct ipv6_query_binding_list {
    IPV6_QUERY_HOME_ADDRESS HomeAddress;
    IPv6Addr Correspondent;
} IPV6_QUERY_BINDING_LIST;

typedef struct ipv6_info_binding_list {
    IPV6_QUERY_BINDING_LIST Next;
    IPV6_QUERY_BINDING_LIST This;

    unsigned int Flags;
    unsigned int Lifetime;      // Milliseconds.
    unsigned int LastSend;      // Milliseconds, 0 means never.
    unsigned int LastSeq;
    IPV6_QUERY_ROUTE_CACHE Route;
} IPV6_INFO_BINDING_LIST;

#define IPV6_BLE_INFO_IS_HOME_AGENT     0x01
#define IPV6_BLE_INFO_IS_AWAITING_ACK   0x02

//
// This IOCTL queries the current Mobile IPv6 mode 
//
#define IOCTL_IPV6_QUERY_MOBILE_MODE \
            _IPV6_CTL_CODE(55, METHOD_BUFFERED, FILE_ANY_ACCESS) 
typedef struct ipv6_query_mobile_mode {
    unsigned int    Correspondent;
    unsigned int    Mobile;
    unsigned int    HomeAgent;
} IPV6_QUERY_MOBILE_MODE;

//
// This IOCTL sets the current Mobile IPv6 mode 
//
#define IOCTL_IPV6_UPDATE_MOBILE_MODE \
            _IPV6_CTL_CODE(56, METHOD_BUFFERED, FILE_ANY_ACCESS) 

#if 0 // obsolete
//
// This IOCTL queries the current preferred home address
//
#define IOCTL_IPV6_QUERY_PREF_HOME_ADDRESS \
            _IPV6_CTL_CODE(57, METHOD_BUFFERED, FILE_ANY_ACCESS) 

//
// This IOCTL updates the current preferred home address
//
#define IOCTL_IPV6_UPDATE_PREF_HOME_ADDRESS \
            _IPV6_CTL_CODE(58, METHOD_BUFFERED, FILE_ANY_ACCESS) 
#endif

#endif //MIPV6

#ifdef UNDER_CE
//
// This IOCTL reinitializes the stack, achieving the same result
// as unloading and then reloading the driver.
//
#define IOCTL_IPV6_RESTART \
            _IPV6_CTL_CODE(60, METHOD_BUFFERED, FILE_ANY_ACCESS) 
#endif // UNDER_CE

#if defined MIPV6 || defined UNDER_CE
//
// This IOCTL requests a home-agent prefix notification.
// It uses the IPV6_INFO_HA_ADV structure for output.
// IPV6_INFO_ROUTE_TABLE (output) structures.
//
// A notification request completes when the stack receives
// a prefix information option from a home agent router.
//
#define IOCTL_IPV6_HA_ADVERT_NOTIFY_REQUEST \
            _IPV6_CTL_CODE(61, METHOD_BUFFERED, FILE_ANY_ACCESS) 

typedef struct ipv6_info_ha_adv {
    IPV6_QUERY_INTERFACE Interface;
    IPv6Addr HomeAgent;
    unsigned int PrefixLength;
} IPV6_INFO_HA_ADV;

//
// This IOCTL queries the list of recently seen home agents. Provide no
// input data to find the first in the list. Provide the returned
// IPV6_INFO_HA_HISTORY as input to return the next in the list. Returns
// nothing when there are no more entries.
//
#define IOCTL_IPV6_QUERY_HA_HISTORY \
            _IPV6_CTL_CODE(62, METHOD_BUFFERED, FILE_ANY_ACCESS) 

typedef struct ipv6_info_ha_history {
    IPV6_QUERY_INTERFACE Interface;
    IPv6Addr HomeAgent;
    unsigned int PrefixLength;
    unsigned int LastAdvert;            // Seconds since the last RA.
} IPV6_INFO_HA_HISTORY;

#endif // MIPV6

#pragma warning(pop)
#endif  // ifndef _NTDDIP6_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -