natp - Network Address Port Translation (under development)#
Adapted Air780EP
Note
This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!
Example
-- In development, please pay attention https://github.com/wendal/xt804-spinet
napt.init(adapter)#
Initialization NAPT
Parameters
Incoming Value Type |
Explanation |
---|---|
int |
adapter The target NIC index. The default value is socket.LWIP_AP, which refers to the intranet. |
Return Value
return value type |
explanation |
---|---|
nil |
No return value |
Examples
None
napt.rebuild(buff, is_inet, adapter)#
Rebuild MAC Packet
Parameters
Incoming Value Type |
Explanation |
---|---|
userdata |
MAC packet to be processed, which must be a zbuff object |
bool |
Is the source intranet |
int |
The index of the destination network adapter, such socket.LWIP_GP |
Return Value
return value type |
explanation |
---|---|
bool |
Returns true on success and true on failure false |
Examples
None
napt.check()#
Check and clean up NAT tables
Parameters
Incoming Value Type |
Explanation |
---|---|
return |
nil |
Return Value
None
Examples
-- There is no data packet mapping record between the two check, it will be cleaned up