1#if !defined(AFX_NATIFY_H__B8FF4369_8789_4674_8569_3D52CE8CA890__INCLUDED_)
2#define AFX_NATIFY_H__B8FF4369_8789_4674_8569_3D52CE8CA890__INCLUDED_
9#define NATIFY_COOKIE 777
10#define NATIFY_TIMEOUT 10000
11#define NATIFY_STATUS_STEPS (NATIFY_TIMEOUT / 1000) + 7
13typedef enum { packet_map1a, packet_map2, packet_map3, packet_map1b, NUM_PACKETS } NatifyPacket;
14typedef enum { no_nat, firewall_only, full_cone, restricted_cone, port_restricted_cone, symmetric, unknown, NUM_NAT_TYPES } NatType;
15typedef enum { promiscuous, not_promiscuous, port_promiscuous, ip_promiscuous, promiscuity_not_applicable, NUM_PROMISCUITY_TYPES } NatPromiscuity;
16typedef enum { unrecognized, private_as_public, consistent_port, incremental, mixed, NUM_MAPPING_SCHEMES } NatMappingScheme;
19 unsigned int privateIp;
20 unsigned short privatePort;
21 unsigned int publicIp;
22 unsigned short publicPort;
29 gsi_bool ipRestricted;
30 gsi_bool portRestricted;
31 NatPromiscuity promiscuity;
33 NatMappingScheme mappingScheme;
34 AddressMapping mappings[4];
35 gsi_bool qr2Compatible;
38int DiscoverReachability(SOCKET sock,
unsigned int ip,
unsigned short port,
int portType);
39int DiscoverMapping(SOCKET sock,
unsigned int ip,
unsigned short port,
int portType,
int id);
40int NatifyThink(SOCKET sock, NAT * nat);
41gsi_bool DetermineNatType(NAT * nat);
42void OutputMapping(
const AddressMapping * theMap);