Class: CiscoAclIntp::AceUdpProtoSpec

Inherits:
AceTcpUdpProtoSpec show all
Defined in:
lib/cisco_acl_intp/acespec_proto.rb

Overview

UDP protocol number/name container

Constant Summary collapse

UDP_PROTO_TABLE =

convert table of UDP port/name

{
  'biff' => 512,
  'bootpc' => 68,
  'bootps' => 67,
  'discard' => 9,
  'dnsix' => 195,
  'domain' => 53,
  'echo' => 7,
  'isakmp' => 500,
  'mobile-ip' => 434,
  'nameserver' => 42,
  'netbios-dgm' => 138,
  'netbios-ns' => 137,
  'netbios-ss' => 139,
  'non500-isakmp' => 4500,
  'ntp' => 123,
  'pim-auto-rp' => 496,
  'rip' => 520,
  'snmp' => 161,
  'snmptrap' => 162,
  'sunrpc' => 111,
  'syslog' => 514,
  'tacacs' => 49,
  'talk' => 517,
  'tftp' => 69,
  'time' => 37,
  'who' => 513,
  'xdmcp' => 177
}.freeze

Constants inherited from AceProtoSpecBase

CiscoAclIntp::AceProtoSpecBase::DUMMY_PROTO_TABLE

Constants inherited from AccessControlContainer

CiscoAclIntp::AccessControlContainer::TERM_COLOR_TABLE

Instance Attribute Summary

Attributes inherited from AceProtoSpecBase

#max_num, #name, #number, #protocol

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AceProtoSpecBase

#<=>, #==, #define_param_by_integer, #define_param_by_string, #max?, #min?, #name_to_number, #number_to_name, #to_i, #to_s, #valid_name?, #valid_range?

Methods inherited from AccessControlContainer

#clean_acl_string, disable_color, #generate_tag_footer, #generate_tag_header, #generate_tagged_str, #method_missing, #to_s

Constructor Details

#initialize(proto_id = nil) ⇒ AceUdpProtoSpec

Constructor

Parameters:

  • proto_id (String, Integer) (defaults to: nil)

    Protocol ID (No. or Name)



187
188
189
190
# File 'lib/cisco_acl_intp/acespec_proto.rb', line 187

def initialize(proto_id = nil)
  super
  @protocol = :udp
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CiscoAclIntp::AccessControlContainer

Class Method Details

.valid_name?(name) ⇒ Boolean

Check the port name is known or not.

Parameters:

  • name (String)

    IP/TCP/UDP port/protocol name

Returns:

  • (Boolean)


201
202
203
# File 'lib/cisco_acl_intp/acespec_proto.rb', line 201

def self.valid_name?(name)
  UDP_PROTO_TABLE.key?(name)
end

Instance Method Details

#proto_tableHash

Protocol Table

Returns:

  • (Hash)

    Protocol table



194
195
196
# File 'lib/cisco_acl_intp/acespec_proto.rb', line 194

def proto_table
  UDP_PROTO_TABLE
end