chore: cleanup natTable's api

This commit is contained in:
wwqgtxx
2023-02-18 13:16:07 +08:00
parent 59cd89a9c9
commit fc50392ec7
24 changed files with 47 additions and 85 deletions

View File

@ -82,6 +82,11 @@ func UDPIn() chan<- C.PacketAdapter {
return udpQueue
}
// NatTable return nat table
func NatTable() C.NatTable {
return natTable
}
// Rules return all rules
func Rules() []C.Rule {
return rules
@ -338,8 +343,6 @@ func handleUDPConn(packet C.PacketAdapter) {
oAddr := metadata.DstIP
natTable.Set(key, pc)
packet.SetNatTable(natTable)
packet.SetUdpInChan(udpQueue)
go handleUDPToLocal(packet, pc, key, oAddr, fAddr)