Method: CiscoAclIntp::AceSrcDstSpec#define_portspec

Defined in:
lib/cisco_acl_intp/acespec_srcdst.rb

#define_portspecAcePortSpec (private)

Set instance variables

Returns:

See Also:



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/cisco_acl_intp/acespec_srcdst.rb', line 113

def define_portspec
  if @options.key?(:port_spec) &&
     @options[:port_spec].is_a?(AcePortSpec)
    @options[:port_spec]
  elsif @options.key?(:operator)
    AcePortSpec.new(
      operator: @options[:operator],
      begin_port: @options[:port] || @options[:begin_port],
      end_port: @options[:end_port]
    )
  else
    # in standard acl, not used port_spec
    # if not specified port spec: default: any port.
    # port spec should be ignored except tcp/udp protocol.
    AcePortSpec.new(operator: 'any')
  end
end