5.8.2.1. AbstractNAT methods

MethodDescription
__init__(self) Constructor to initialize an AbstractNAT instance.
performTranslation(self, session, addrs, nat_type) Function that performs the address translation.

Table 5.66. Method summary

Method __init__(self)

This constructor initializes an AbstractNAT instance. Currently it does nothing, but serves as a placeholder for future extensions.

Method performTranslation(self, session, addrs, nat_type)

This function is called before connecting a session to the destination server. The function returns the address (a SockAddr instance) to bind to before establishing the connection.

Arguments of performTranslation
addrs (unknown)
Default: n/a
tuple of (source, destination) address, any of them can be none in case of the other translation

nat_type (unknown)
Default: n/a
translation type, either NAT_SNAT or NAT_DNAT

session (unknown)
Default: n/a
Session which is about to connect the server.