12 lines
317 B
Nim
12 lines
317 B
Nim
|
from net import Port
|
||
|
|
||
|
proc predictPortRange*(dstPorts: seq[Port]): seq[Port] =
|
||
|
# TODO: do real port prediction
|
||
|
result = newSeq[Port](1)
|
||
|
let basePort = min(dstPorts[1].uint16,
|
||
|
uint16.high - (result.len - 1).uint16)
|
||
|
for i in 0 .. result.len - 1:
|
||
|
result[i] = Port(basePort + i.uint16)
|
||
|
|
||
|
|