You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
371 B
Crystal
15 lines
371 B
Crystal
require "../modules/command_runner"
|
|
require "../records/nat_record"
|
|
|
|
class NatOperator
|
|
def initialize(nat_data = "")
|
|
if nat_data.empty?
|
|
nat_data = CommandRunner.run_nat
|
|
end
|
|
records = nat_data.each_line
|
|
records = records.each.select(/^tcp/)
|
|
@nat_records = Array(NatRecord).new
|
|
records.each { |s| @nat_records << NatRecord.new s }
|
|
end
|
|
end
|