Home |
Function xn_add_host_table_entry Function xn_delete_host_table_entry Function xn_interface_open_config Function xn_interface_ethernet_statistics Function xn_interface_statistics Function xn_nat_init Function xn_send_ethernet_frame Function cb_wr_screen_string_fnc Function cb_rs232_connection_lost_fnc |
Function xn_nat_initFunction xn_nat_init initializes RTIP-32's NAT routing. typedef struct nat_unique_addresses { BYTE nat_min_address[4]; BYTE nat_max_address[4]; ... } NAT_UNIQUE_ADDRESSES; void xn_nat_init(PNAT_UNIQUE_ADDRESSES * nat_unique_addr); Parametersnat_unique_addrPointer to a structure with the lowest and highest public IP address in network byte order the NAT router may use. This address range may include the public address of the router. If both addresses are equal to the IP address of the public interface, the router will only use the NATP protocol. Structure nat_unique_addresses contains reserved fields after members nat_min_address and nat_max_address, which should be initialized with zero. The structure continues to be used after the call to function xn_nat_init() has returned, so it is best to allocate the structure as a global or static variable. Example:NAT_UNIQUE_ADDRESSES nat = {0}; ... int main(void) { ... memcpy(nat.nat_min_address, MyIPAddress, 4); memcpy(nat.nat_max_address, MyIPAddress, 4); xn_nat_init(&nat); ...
|