📄 ntddip6.h
字号:
typedef struct ipv6_info_route_cache {
IPV6_QUERY_ROUTE_CACHE Query;
unsigned int Type;
unsigned int Flags;
int Valid; // Boolean - FALSE means it is stale.
#if defined MIPV6 || defined UNDER_CE
IPV6_QUERY_NEIGHBOR_CACHE NextHop;
#else
IPv6Addr SourceAddress;
IPv6Addr NextHopAddress;
unsigned int NextHopInterface;
#endif
unsigned int PathMTU;
unsigned int PMTUProbeTimer; // Time until next PMTU probe (in ms).
unsigned int ICMPLastError; // Time since last ICMP error sent (in ms).
#if defined MIPV6 || defined UNDER_CE
IPV6_QUERY_ROUTE_CACHE CareOfDestination;
IPV6_QUERY_ROUTE_CACHE CareOfSource;
#else
unsigned int BindingSeqNumber;
unsigned int BindingLifetime; // Seconds.
IPv6Addr CareOfAddress;
#endif
} IPV6_INFO_ROUTE_CACHE;
#if defined MIPV6 || defined UNDER_CE
#define RCE_FLAG_CONSTRAINED_NTE 0x0001
#define RCE_FLAG_CONSTRAINED_IF 0x0002
#define RCE_FLAG_CONSTRAINED_ZONE 0x0004
#define RCE_FLAG_BU_NEEDED 0x0100
#define RCE_FLAG_BA_NEEDED 0x0200
#define RCE_FLAG_BR_NEEDED 0x0400
#define RCE_FLAG_HOME_AGENT 0x1000
#else
#define RCE_FLAG_CONSTRAINED_IF 0x1
#define RCE_FLAG_CONSTRAINED_SCOPEID 0x2
#define RCE_FLAG_CONSTRAINED 0x3
#endif
#define RCE_TYPE_COMPUTED 1
#define RCE_TYPE_REDIRECT 2
#if 0 // obsolete
//
// This IOCTL retrieves information from the prefix list.
//
#define IOCTL_IPV6_QUERY_PREFIX_LIST \
_IPV6_CTL_CODE(5, METHOD_BUFFERED, FILE_ANY_ACCESS)
//
// This IOCTL retrieves information from the default router list.
//
#define IOCTL_IPV6_QUERY_ROUTER_LIST \
_IPV6_CTL_CODE(6, METHOD_BUFFERED, FILE_ANY_ACCESS)
//
// This IOCTL adds a multicast group to the desired interface.
//
#define IOCTL_IPV6_ADD_MEMBERSHIP \
_IPV6_CTL_CODE(7, METHOD_BUFFERED, FILE_ANY_ACCESS)
//
// This IOCTL drops a multicast group.
//
#define IOCTL_IPV6_DROP_MEMBERSHIP \
_IPV6_CTL_CODE(8, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
//
// This IOCTL adds an SP to the SP list.
//
#define IOCTL_IPV6_CREATE_SECURITY_POLICY \
_IPV6_CTL_CODE(9, METHOD_BUFFERED, FILE_WRITE_ACCESS)
typedef struct ipv6_create_security_policy {
unsigned long SPIndex; // Index of policy to create.
unsigned int RemoteAddrField;
unsigned int RemoteAddrSelector;
IPv6Addr RemoteAddr; // Remote IP Address.
IPv6Addr RemoteAddrData;
unsigned int LocalAddrField; // Single, range, or wildcard.
unsigned int LocalAddrSelector; // Packet or policy.
IPv6Addr LocalAddr; // Start of range or single value.
IPv6Addr LocalAddrData; // End of range.
unsigned int TransportProtoSelector; // Packet or policy.
unsigned short TransportProto;
unsigned int RemotePortField; // Single, range, or wildcard.
unsigned int RemotePortSelector; // Packet or policy.
unsigned short RemotePort; // Start of range or single value.
unsigned short RemotePortData; // End of range.
unsigned int LocalPortField; // Single, range, or wildcard.
unsigned int LocalPortSelector; // Packet or policy.
unsigned short LocalPort; // Start of range or single value.
unsigned short LocalPortData; // End of range.
unsigned int IPSecProtocol;
unsigned int IPSecMode;
IPv6Addr RemoteSecurityGWAddr;
unsigned int Direction;
unsigned int IPSecAction;
unsigned long SABundleIndex;
unsigned int SPInterface;
} IPV6_CREATE_SECURITY_POLICY;
//
// This IOCTL adds an SA to the SA list.
//
#define IOCTL_IPV6_CREATE_SECURITY_ASSOCIATION \
_IPV6_CTL_CODE(10, METHOD_BUFFERED, FILE_WRITE_ACCESS)
typedef struct ipv6_create_security_association {
unsigned long SAIndex;
unsigned long SPI; // Security Parameter Index.
IPv6Addr SADestAddr;
IPv6Addr DestAddr;
IPv6Addr SrcAddr;
unsigned short TransportProto;
unsigned short DestPort;
unsigned short SrcPort;
unsigned int Direction;
unsigned long SecPolicyIndex;
unsigned int AlgorithmId;
unsigned int RawKeySize;
} IPV6_CREATE_SECURITY_ASSOCIATION;
//
// This IOCTL gets all the SPs from the SP list.
//
#define IOCTL_IPV6_QUERY_SECURITY_POLICY_LIST \
_IPV6_CTL_CODE(11, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef struct ipv6_query_security_policy_list {
unsigned int SPInterface;
unsigned long Index;
} IPV6_QUERY_SECURITY_POLICY_LIST;
typedef struct ipv6_info_security_policy_list {
IPV6_QUERY_SECURITY_POLICY_LIST Query;
unsigned long SPIndex;
unsigned long NextSPIndex;
unsigned int RemoteAddrField;
unsigned int RemoteAddrSelector;
IPv6Addr RemoteAddr; // Remote IP Address.
IPv6Addr RemoteAddrData;
unsigned int LocalAddrField; // Single, range, or wildcard.
unsigned int LocalAddrSelector; // Packet or policy.
IPv6Addr LocalAddr; // Start of range or single value.
IPv6Addr LocalAddrData; // End of range.
unsigned int TransportProtoSelector; // Packet or policy.
unsigned short TransportProto;
unsigned int RemotePortField; // Single, range, or wildcard.
unsigned int RemotePortSelector; // Packet or policy.
unsigned short RemotePort; // Start of range or single value.
unsigned short RemotePortData; // End of range.
unsigned int LocalPortField; // Single, range, or wildcard.
unsigned int LocalPortSelector; // Packet or policy.
unsigned short LocalPort; // Start of range or single value.
unsigned short LocalPortData; // End of range.
unsigned int IPSecProtocol;
unsigned int IPSecMode;
IPv6Addr RemoteSecurityGWAddr;
unsigned int Direction;
unsigned int IPSecAction;
unsigned long SABundleIndex;
unsigned int SPInterface;
} IPV6_INFO_SECURITY_POLICY_LIST;
//
// This IOCTL gets all the SAs from the SA list.
//
#define IOCTL_IPV6_QUERY_SECURITY_ASSOCIATION_LIST \
_IPV6_CTL_CODE(12, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef struct ipv6_query_security_association_list {
unsigned long Index;
} IPV6_QUERY_SECURITY_ASSOCIATION_LIST;
typedef struct ipv6_info_security_association_list {
IPV6_QUERY_SECURITY_ASSOCIATION_LIST Query;
unsigned long SAIndex;
unsigned long NextSAIndex;
unsigned long SPI; // Security Parameter Index.
IPv6Addr SADestAddr;
IPv6Addr DestAddr;
IPv6Addr SrcAddr;
unsigned short TransportProto;
unsigned short DestPort;
unsigned short SrcPort;
unsigned int Direction;
unsigned long SecPolicyIndex;
unsigned int AlgorithmId;
} IPV6_INFO_SECURITY_ASSOCIATION_LIST;
//
// This IOCTL retrieves information from the route table.
// It takes the IPV6_QUERY_ROUTE_TABLE structure
// and returns the IPV6_INFO_ROUTE_TABLE structure.
//
//
#define IOCTL_IPV6_QUERY_ROUTE_TABLE \
_IPV6_CTL_CODE(13, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef struct ipv6_query_route_table {
IPv6Addr Prefix;
unsigned int PrefixLength;
IPV6_QUERY_NEIGHBOR_CACHE Neighbor;
} IPV6_QUERY_ROUTE_TABLE;
typedef struct ipv6_info_route_table {
union {
IPV6_QUERY_ROUTE_TABLE Next; // Non-persistent query results.
IPV6_QUERY_ROUTE_TABLE This; // All other uses.
};
unsigned int SitePrefixLength;
unsigned int ValidLifetime; // Seconds.
unsigned int PreferredLifetime; // Seconds.
unsigned int Preference; // Smaller is better. See below.
unsigned int Type; // See values below.
int Publish; // Boolean.
int Immortal; // Boolean.
} IPV6_INFO_ROUTE_TABLE;
//
// The Type field indicates where the route came from.
// These are RFC 2465 ipv6RouteProtocol values.
// Routing protocols are free to define new values.
//
#define RTE_TYPE_SYSTEM 2
#define RTE_TYPE_MANUAL 3
#define RTE_TYPE_AUTOCONF 4
#define RTE_TYPE_RIP 5
#define RTE_TYPE_OSPF 6
#define RTE_TYPE_BGP 7
#define RTE_TYPE_IDRP 8
#define RTE_TYPE_IGRP 9
//
// Standard route preference values.
// The value zero is reserved for administrative configuration.
//
#define ROUTE_PREF_LOW (16*16*16)
#define ROUTE_PREF_MEDIUM (16*16)
#define ROUTE_PREF_HIGH 16
#define ROUTE_PREF_ON_LINK 8
#define ROUTE_PREF_LOOPBACK 4
#define ROUTE_PREF_HIGHEST 0
//
// This IOCTL retrieves information about a persistent route.
// It takes the IPV6_PERSISTENT_QUERY_ROUTE_TABLE structure
// and returns the IPV6_INFO_ROUTE_TABLE structure.
//
#define IOCTL_IPV6_PERSISTENT_QUERY_ROUTE_TABLE \
_IPV6_CTL_CODE(46, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef struct ipv6_persistent_query_route_table {
IPV6_PERSISTENT_QUERY_INTERFACE IF;
unsigned int RegistryIndex; // -1 means use the parameters below.
IPv6Addr Neighbor;
IPv6Addr Prefix;
unsigned int PrefixLength;
} IPV6_PERSISTENT_QUERY_ROUTE_TABLE;
//
// This IOCTL adds/removes a route in the route table.
// It uses the IPV6_INFO_ROUTE_TABLE structure.
//
#define IOCTL_IPV6_UPDATE_ROUTE_TABLE \
_IPV6_CTL_CODE(14, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_IPV6_PERSISTENT_UPDATE_ROUTE_TABLE \
_IPV6_CTL_CODE(40, METHOD_BUFFERED, FILE_WRITE_ACCESS)
//
// This IOCTL adds/removes an address on an interface.
// It uses the IPV6_UPDATE_ADDRESS structure.
//
#define IOCTL_IPV6_UPDATE_ADDRESS \
_IPV6_CTL_CODE(15, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_IPV6_PERSISTENT_UPDATE_ADDRESS \
_IPV6_CTL_CODE(38, METHOD_BUFFERED, FILE_WRITE_ACCESS)
typedef struct ipv6_update_address {
IPV6_QUERY_ADDRESS This;
unsigned int Type; // Unicast or anycast.
unsigned int PrefixConf;
unsigned int InterfaceIdConf;
unsigned int PreferredLifetime; // Seconds.
unsigned int ValidLifetime; // Seconds.
} IPV6_UPDATE_ADDRESS;
//
// This IOCTL retrieves information from the binding cache.
//
#define IOCTL_IPV6_QUERY_BINDING_CACHE \
_IPV6_CTL_CODE(16, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef struct ipv6_query_binding_cache {
IPv6Addr HomeAddress;
} IPV6_QUERY_BINDING_CACHE;
typedef struct ipv6_info_binding_cache {
IPV6_QUERY_BINDING_CACHE Query;
IPv6Addr HomeAddress;
IPv6Addr CareOfAddress;
unsigned int BindingSeqNumber;
unsigned int BindingLifetime; // Seconds.
#if defined MIPV6 || defined UNDER_CE
int HomeAgent; // Boolean.
#endif //MIPV6
} IPV6_INFO_BINDING_CACHE;
//
// This IOCTL controls some attributes of an interface.
// It uses the IPV6_INFO_INTERFACE structure.
//
#define IOCTL_IPV6_UPDATE_INTERFACE \
_IPV6_CTL_CODE(17, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_IPV6_PERSISTENT_UPDATE_INTERFACE \
_IPV6_CTL_CODE(36, METHOD_BUFFERED, FILE_WRITE_ACCESS)
//
// This IOCTL flushes entries from the neighbor cache.
// It uses the IPV6_QUERY_NEIGHBOR_CACHE structure.
//
#define IOCTL_IPV6_FLUSH_NEIGHBOR_CACHE \
_IPV6_CTL_CODE(18, METHOD_BUFFERED, FILE_WRITE_ACCESS)
//
// This IOCTL flushes entries from the route cache.
// It uses the IPV6_QUERY_ROUTE_CACHE structure.
//
#define IOCTL_IPV6_FLUSH_ROUTE_CACHE \
_IPV6_CTL_CODE(19, METHOD_BUFFERED, FILE_WRITE_ACCESS)
//
// This IOCTL deletes SA entries from the SA list.
// It uses the IPV6_QUERY_SECURITY_ASSOCIATION_LIST structure.
//
#define IOCTL_IPV6_DELETE_SECURITY_ASSOCIATION \
_IPV6_CTL_CODE(20, METHOD_BUFFERED, FILE_WRITE_ACCESS)
//
// This IOCTL deletes SP entries from the SP list.
// It uses the IPV6_QUERY_SECURITY_POLICY_LIST structure.
//
#define IOCTL_IPV6_DELETE_SECURITY_POLICY \
_IPV6_CTL_CODE(21, METHOD_BUFFERED, FILE_WRITE_ACCESS)
//
// This IOCTL deletes an interface.
// It uses the IPV6_QUERY_INTERFACE structure.
//
// The persistent variant, in addition to deleting the runtime interface,
// also keeps the interface from being (re)created persistently.
// However, it does NOT reset or delete any persistent attributes
// of the interface. For example, suppose you have a persisent tunnel
// interface with a persistent attribute, the interface metric.
// If you delete the tunnel interface and reboot, the tunnel interface
// will be recreated with the non-default interface metric.
// If you persistently delete the tunnel interface and reboot,
// the tunnel interface will not be created. But if you then create
// the tunnel interface, it will get the non-default interface metric.
// This is analogous to persistent attributes on removable ethernet interfaces.
//
#define IOCTL_IPV6_DELETE_INTERFACE \
_IPV6_CTL_CODE(22, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_IPV6_PERSISTENT_DELETE_INTERFACE \
_IPV6_CTL_CODE(44, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#if 0 // obsolete
//
// This IOCTL sets the mobility security to either on or off.
// When mobility security is turned on, Binding Cache Updates
// must be protected via IPsec.
//
#define IOCTL_IPV6_SET_MOBILITY_SECURITY \
_IPV6_CTL_CODE(23, METHOD_BUFFERED, FILE_WRITE_ACCESS)
typedef struct ipv6_set_mobility_security {
unsigned int MobilitySecurity; // See MOBILITY_SECURITY values in ipsec.h.
} IPV6_SET_MOBILITY_SECURITY;
#endif
//
// This IOCTL sorts a list of destination addresses.
// The returned list may contain fewer addresses.
// It uses an array of TDI_ADDRESS_IP6 in/out.
//
#define IOCTL_IPV6_SORT_DEST_ADDRS \
_IPV6_CTL_CODE(24, METHOD_BUFFERED, FILE_ANY_ACCESS)
//
// This IOCTL retrieves information from the site prefix table.
//
#define IOCTL_IPV6_QUERY_SITE_PREFIX \
_IPV6_CTL_CODE(25, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef struct ipv6_query_site_prefix {
IPv6Addr Prefix;
unsigned int PrefixLength;
IPV6_QUERY_INTERFACE IF;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -