Class: Cisco::RouteMap

Inherits:
NodeUtil show all
Defined in:
lib/cisco_node_utils/route_map.rb

Overview

node_utils class for route_map

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NodeUtil

client, #client, config_get, #config_get, #config_get_default, config_get_default, config_set, #config_set, #get, #ios_xr?, #nexus?, #node, node, platform, #platform, supports?, #supports?

Constructor Details

#initialize(map_name, sequence, action, instantiate = true) ⇒ RouteMap

Returns a new instance of RouteMap.



25
26
27
28
29
30
31
32
33
34
# File 'lib/cisco_node_utils/route_map.rb', line 25

def initialize(map_name, sequence, action, instantiate=true)
  fail TypeError unless map_name.is_a?(String)
  fail ArgumentError unless action[/permit|deny/]
  @name = map_name
  @seq = sequence
  @action = action

  set_args_keys_default
  create if instantiate
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



23
24
25
# File 'lib/cisco_node_utils/route_map.rb', line 23

def action
  @action
end

#nameObject (readonly)

Returns the value of attribute name.



23
24
25
# File 'lib/cisco_node_utils/route_map.rb', line 23

def name
  @name
end

#seqObject (readonly)

Returns the value of attribute seq.



23
24
25
# File 'lib/cisco_node_utils/route_map.rb', line 23

def seq
  @seq
end

Class Method Details

.mapsObject



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/cisco_node_utils/route_map.rb', line 36

def self.maps
  hash = {}
  maps = config_get('route_map', 'all_route_maps')
  return hash if maps.nil?
  maps.each do |name, action, seq|
    hash[name] ||= {}
    hash[name][seq] ||= {}
    hash[name][seq][action] = RouteMap.new(name, seq, action, false)
  end
  hash
end

Instance Method Details

#createObject

Create one route map instance



61
62
63
# File 'lib/cisco_node_utils/route_map.rb', line 61

def create
  config_set('route_map', 'create', @set_args)
end

#default_descriptionObject



151
152
153
# File 'lib/cisco_node_utils/route_map.rb', line 151

def default_description
  config_get_default('route_map', 'description')
end

#default_match_as_numberObject



106
107
108
# File 'lib/cisco_node_utils/route_map.rb', line 106

def default_match_as_number
  config_get_default('route_map', 'match_as_number')
end

#default_match_as_number_as_path_listObject



136
137
138
# File 'lib/cisco_node_utils/route_map.rb', line 136

def default_match_as_number_as_path_list
  config_get_default('route_map', 'match_as_number_as_path_list')
end

#default_match_communityObject



188
189
190
# File 'lib/cisco_node_utils/route_map.rb', line 188

def default_match_community
  config_get_default('route_map', 'match_community')
end

#default_match_community_exact_matchObject



198
199
200
# File 'lib/cisco_node_utils/route_map.rb', line 198

def default_match_community_exact_match
  config_get_default('route_map', 'match_community_exact_match')
end

#default_match_evpn_route_type_1Object



1251
1252
1253
# File 'lib/cisco_node_utils/route_map.rb', line 1251

def default_match_evpn_route_type_1
  config_get_default('route_map', 'match_evpn_route_type_1')
end

#default_match_evpn_route_type_2_allObject



1341
1342
1343
# File 'lib/cisco_node_utils/route_map.rb', line 1341

def default_match_evpn_route_type_2_all
  config_get_default('route_map', 'match_evpn_route_type_2_all')
end

#default_match_evpn_route_type_2_mac_ipObject



1356
1357
1358
# File 'lib/cisco_node_utils/route_map.rb', line 1356

def default_match_evpn_route_type_2_mac_ip
  config_get_default('route_map', 'match_evpn_route_type_2_mac_ip')
end

#default_match_evpn_route_type_2_mac_onlyObject



1371
1372
1373
# File 'lib/cisco_node_utils/route_map.rb', line 1371

def default_match_evpn_route_type_2_mac_only
  config_get_default('route_map', 'match_evpn_route_type_2_mac_only')
end

#default_match_evpn_route_type_3Object



1266
1267
1268
# File 'lib/cisco_node_utils/route_map.rb', line 1266

def default_match_evpn_route_type_3
  config_get_default('route_map', 'match_evpn_route_type_3')
end

#default_match_evpn_route_type_4Object



1281
1282
1283
# File 'lib/cisco_node_utils/route_map.rb', line 1281

def default_match_evpn_route_type_4
  config_get_default('route_map', 'match_evpn_route_type_4')
end

#default_match_evpn_route_type_5Object



1296
1297
1298
# File 'lib/cisco_node_utils/route_map.rb', line 1296

def default_match_evpn_route_type_5
  config_get_default('route_map', 'match_evpn_route_type_5')
end

#default_match_evpn_route_type_6Object



1311
1312
1313
# File 'lib/cisco_node_utils/route_map.rb', line 1311

def default_match_evpn_route_type_6
  config_get_default('route_map', 'match_evpn_route_type_6')
end

#default_match_evpn_route_type_allObject



1326
1327
1328
# File 'lib/cisco_node_utils/route_map.rb', line 1326

def default_match_evpn_route_type_all
  config_get_default('route_map', 'match_evpn_route_type_all')
end

#default_match_ext_communityObject



234
235
236
# File 'lib/cisco_node_utils/route_map.rb', line 234

def default_match_ext_community
  config_get_default('route_map', 'match_ext_community')
end

#default_match_ext_community_exact_matchObject



243
244
245
# File 'lib/cisco_node_utils/route_map.rb', line 243

def default_match_ext_community_exact_match
  config_get_default('route_map', 'match_ext_community_exact_match')
end

#default_match_interfaceObject



275
276
277
# File 'lib/cisco_node_utils/route_map.rb', line 275

def default_match_interface
  config_get_default('route_map', 'match_interface')
end

#default_match_ipv4_addr_access_listObject



360
361
362
# File 'lib/cisco_node_utils/route_map.rb', line 360

def default_match_ipv4_addr_access_list
  config_get_default('route_map', 'match_ipv4_addr_access_list')
end

#default_match_ipv4_addr_prefix_listObject



390
391
392
# File 'lib/cisco_node_utils/route_map.rb', line 390

def default_match_ipv4_addr_prefix_list
  config_get_default('route_map', 'match_ipv4_addr_prefix_list')
end

#default_match_ipv4_multicast_enableObject



568
569
570
# File 'lib/cisco_node_utils/route_map.rb', line 568

def default_match_ipv4_multicast_enable
  config_get_default('route_map', 'match_ipv4_multicast_enable')
end

#default_match_ipv4_multicast_group_addrObject



496
497
498
# File 'lib/cisco_node_utils/route_map.rb', line 496

def default_match_ipv4_multicast_group_addr
  config_get_default('route_map', 'match_ipv4_multicast_group_addr')
end

#default_match_ipv4_multicast_group_range_begin_addrObject



512
513
514
515
# File 'lib/cisco_node_utils/route_map.rb', line 512

def default_match_ipv4_multicast_group_range_begin_addr
  config_get_default('route_map',
                     'match_ipv4_multicast_group_range_begin_addr')
end

#default_match_ipv4_multicast_group_range_end_addrObject



527
528
529
530
# File 'lib/cisco_node_utils/route_map.rb', line 527

def default_match_ipv4_multicast_group_range_end_addr
  config_get_default('route_map',
                     'match_ipv4_multicast_group_range_end_addr')
end

#default_match_ipv4_multicast_rp_addrObject



542
543
544
# File 'lib/cisco_node_utils/route_map.rb', line 542

def default_match_ipv4_multicast_rp_addr
  config_get_default('route_map', 'match_ipv4_multicast_rp_addr')
end

#default_match_ipv4_multicast_rp_typeObject



556
557
558
# File 'lib/cisco_node_utils/route_map.rb', line 556

def default_match_ipv4_multicast_rp_type
  config_get_default('route_map', 'match_ipv4_multicast_rp_type')
end

#default_match_ipv4_multicast_src_addrObject



482
483
484
# File 'lib/cisco_node_utils/route_map.rb', line 482

def default_match_ipv4_multicast_src_addr
  config_get_default('route_map', 'match_ipv4_multicast_src_addr')
end

#default_match_ipv4_next_hop_prefix_listObject



421
422
423
# File 'lib/cisco_node_utils/route_map.rb', line 421

def default_match_ipv4_next_hop_prefix_list
  config_get_default('route_map', 'match_ipv4_next_hop_prefix_list')
end

#default_match_ipv4_route_src_prefix_listObject



452
453
454
# File 'lib/cisco_node_utils/route_map.rb', line 452

def default_match_ipv4_route_src_prefix_list
  config_get_default('route_map', 'match_ipv4_route_src_prefix_list')
end

#default_match_ipv6_addr_access_listObject



610
611
612
# File 'lib/cisco_node_utils/route_map.rb', line 610

def default_match_ipv6_addr_access_list
  config_get_default('route_map', 'match_ipv6_addr_access_list')
end

#default_match_ipv6_addr_prefix_listObject



646
647
648
# File 'lib/cisco_node_utils/route_map.rb', line 646

def default_match_ipv6_addr_prefix_list
  config_get_default('route_map', 'match_ipv6_addr_prefix_list')
end

#default_match_ipv6_multicast_enableObject



825
826
827
# File 'lib/cisco_node_utils/route_map.rb', line 825

def default_match_ipv6_multicast_enable
  config_get_default('route_map', 'match_ipv6_multicast_enable')
end

#default_match_ipv6_multicast_group_addrObject



753
754
755
# File 'lib/cisco_node_utils/route_map.rb', line 753

def default_match_ipv6_multicast_group_addr
  config_get_default('route_map', 'match_ipv6_multicast_group_addr')
end

#default_match_ipv6_multicast_group_range_begin_addrObject



769
770
771
772
# File 'lib/cisco_node_utils/route_map.rb', line 769

def default_match_ipv6_multicast_group_range_begin_addr
  config_get_default('route_map',
                     'match_ipv6_multicast_group_range_begin_addr')
end

#default_match_ipv6_multicast_group_range_end_addrObject



784
785
786
787
# File 'lib/cisco_node_utils/route_map.rb', line 784

def default_match_ipv6_multicast_group_range_end_addr
  config_get_default('route_map',
                     'match_ipv6_multicast_group_range_end_addr')
end

#default_match_ipv6_multicast_rp_addrObject



799
800
801
# File 'lib/cisco_node_utils/route_map.rb', line 799

def default_match_ipv6_multicast_rp_addr
  config_get_default('route_map', 'match_ipv6_multicast_rp_addr')
end

#default_match_ipv6_multicast_rp_typeObject



813
814
815
# File 'lib/cisco_node_utils/route_map.rb', line 813

def default_match_ipv6_multicast_rp_type
  config_get_default('route_map', 'match_ipv6_multicast_rp_type')
end

#default_match_ipv6_multicast_src_addrObject



739
740
741
# File 'lib/cisco_node_utils/route_map.rb', line 739

def default_match_ipv6_multicast_src_addr
  config_get_default('route_map', 'match_ipv6_multicast_src_addr')
end

#default_match_ipv6_next_hop_prefix_listObject



683
684
685
# File 'lib/cisco_node_utils/route_map.rb', line 683

def default_match_ipv6_next_hop_prefix_list
  config_get_default('route_map', 'match_ipv6_next_hop_prefix_list')
end

#default_match_ipv6_route_src_prefix_listObject



713
714
715
# File 'lib/cisco_node_utils/route_map.rb', line 713

def default_match_ipv6_route_src_prefix_list
  config_get_default('route_map', 'match_ipv6_route_src_prefix_list')
end

#default_match_lengthObject



1184
1185
1186
# File 'lib/cisco_node_utils/route_map.rb', line 1184

def default_match_length
  config_get_default('route_map', 'match_length')
end

#default_match_mac_listObject



1166
1167
1168
# File 'lib/cisco_node_utils/route_map.rb', line 1166

def default_match_mac_list
  config_get_default('route_map', 'match_mac_list')
end

#default_match_metricObject



900
901
902
# File 'lib/cisco_node_utils/route_map.rb', line 900

def default_match_metric
  config_get_default('route_map', 'match_metric')
end

#default_match_ospf_areaObject



1134
1135
1136
# File 'lib/cisco_node_utils/route_map.rb', line 1134

def default_match_ospf_area
  config_get_default('route_map', 'match_ospf_area')
end

#default_match_route_type_externalObject



985
986
987
# File 'lib/cisco_node_utils/route_map.rb', line 985

def default_match_route_type_external
  config_get_default('route_map', 'match_route_type_external')
end

#default_match_route_type_inter_areaObject



998
999
1000
# File 'lib/cisco_node_utils/route_map.rb', line 998

def default_match_route_type_inter_area
  config_get_default('route_map', 'match_route_type_inter_area')
end

#default_match_route_type_internalObject



1011
1012
1013
# File 'lib/cisco_node_utils/route_map.rb', line 1011

def default_match_route_type_internal
  config_get_default('route_map', 'match_route_type_internal')
end

#default_match_route_type_intra_areaObject



1024
1025
1026
# File 'lib/cisco_node_utils/route_map.rb', line 1024

def default_match_route_type_intra_area
  config_get_default('route_map', 'match_route_type_intra_area')
end

#default_match_route_type_level_1Object



1037
1038
1039
# File 'lib/cisco_node_utils/route_map.rb', line 1037

def default_match_route_type_level_1
  config_get_default('route_map', 'match_route_type_level_1')
end

#default_match_route_type_level_2Object



1050
1051
1052
# File 'lib/cisco_node_utils/route_map.rb', line 1050

def default_match_route_type_level_2
  config_get_default('route_map', 'match_route_type_level_2')
end

#default_match_route_type_localObject



1063
1064
1065
# File 'lib/cisco_node_utils/route_map.rb', line 1063

def default_match_route_type_local
  config_get_default('route_map', 'match_route_type_local')
end

#default_match_route_type_nssa_externalObject



1076
1077
1078
# File 'lib/cisco_node_utils/route_map.rb', line 1076

def default_match_route_type_nssa_external
  config_get_default('route_map', 'match_route_type_nssa_external')
end

#default_match_route_type_type_1Object



1089
1090
1091
# File 'lib/cisco_node_utils/route_map.rb', line 1089

def default_match_route_type_type_1
  config_get_default('route_map', 'match_route_type_type_1')
end

#default_match_route_type_type_2Object



1102
1103
1104
# File 'lib/cisco_node_utils/route_map.rb', line 1102

def default_match_route_type_type_2
  config_get_default('route_map', 'match_route_type_type_2')
end

#default_match_src_protoObject



335
336
337
# File 'lib/cisco_node_utils/route_map.rb', line 335

def default_match_src_proto
  config_get_default('route_map', 'match_src_proto')
end

#default_match_tagObject



305
306
307
# File 'lib/cisco_node_utils/route_map.rb', line 305

def default_match_tag
  config_get_default('route_map', 'match_tag')
end

#default_match_vlanObject



1205
1206
1207
# File 'lib/cisco_node_utils/route_map.rb', line 1205

def default_match_vlan
  config_get_default('route_map', 'match_vlan')
end

#default_set_as_path_prependObject



1816
1817
1818
# File 'lib/cisco_node_utils/route_map.rb', line 1816

def default_set_as_path_prepend
  config_get_default('route_map', 'set_as_path_prepend')
end

#default_set_as_path_prepend_last_asObject



1774
1775
1776
# File 'lib/cisco_node_utils/route_map.rb', line 1774

def default_set_as_path_prepend_last_as
  config_get_default('route_map', 'set_as_path_prepend_last_as')
end

#default_set_as_path_tagObject



1788
1789
1790
# File 'lib/cisco_node_utils/route_map.rb', line 1788

def default_set_as_path_tag
  config_get_default('route_map', 'set_as_path_tag')
end

#default_set_comm_listObject



1386
1387
1388
# File 'lib/cisco_node_utils/route_map.rb', line 1386

def default_set_comm_list
  config_get_default('route_map', 'set_comm_list')
end

#default_set_community_additiveObject



2214
2215
2216
# File 'lib/cisco_node_utils/route_map.rb', line 2214

def default_set_community_additive
  config_get_default('route_map', 'set_community_additive')
end

#default_set_community_asnObject



2275
2276
2277
# File 'lib/cisco_node_utils/route_map.rb', line 2275

def default_set_community_asn
  config_get_default('route_map', 'set_community_asn')
end

#default_set_community_internetObject



2223
2224
2225
# File 'lib/cisco_node_utils/route_map.rb', line 2223

def default_set_community_internet
  config_get_default('route_map', 'set_community_internet')
end

#default_set_community_local_asObject



2232
2233
2234
# File 'lib/cisco_node_utils/route_map.rb', line 2232

def default_set_community_local_as
  config_get_default('route_map', 'set_community_local_as')
end

#default_set_community_no_advtertiseObject



2241
2242
2243
# File 'lib/cisco_node_utils/route_map.rb', line 2241

def default_set_community_no_advtertise
  config_get_default('route_map', 'set_community_no_advtertise')
end

#default_set_community_no_exportObject



2250
2251
2252
# File 'lib/cisco_node_utils/route_map.rb', line 2250

def default_set_community_no_export
  config_get_default('route_map', 'set_community_no_export')
end

#default_set_community_noneObject



2259
2260
2261
# File 'lib/cisco_node_utils/route_map.rb', line 2259

def default_set_community_none
  config_get_default('route_map', 'set_community_none')
end

#default_set_dampening_half_lifeObject



1679
1680
1681
# File 'lib/cisco_node_utils/route_map.rb', line 1679

def default_set_dampening_half_life
  config_get_default('route_map', 'set_dampening_half_life')
end

#default_set_dampening_max_duationObject



1706
1707
1708
# File 'lib/cisco_node_utils/route_map.rb', line 1706

def default_set_dampening_max_duation
  config_get_default('route_map', 'set_dampening_max_duation')
end

#default_set_dampening_reuseObject



1688
1689
1690
# File 'lib/cisco_node_utils/route_map.rb', line 1688

def default_set_dampening_reuse
  config_get_default('route_map', 'set_dampening_reuse')
end

#default_set_dampening_suppressObject



1697
1698
1699
# File 'lib/cisco_node_utils/route_map.rb', line 1697

def default_set_dampening_suppress
  config_get_default('route_map', 'set_dampening_suppress')
end

#default_set_distance_igp_ebgpObject



1741
1742
1743
# File 'lib/cisco_node_utils/route_map.rb', line 1741

def default_set_distance_igp_ebgp
  config_get_default('route_map', 'set_distance_igp_ebgp')
end

#default_set_distance_internalObject



1759
1760
1761
# File 'lib/cisco_node_utils/route_map.rb', line 1759

def default_set_distance_internal
  config_get_default('route_map', 'set_distance_internal')
end

#default_set_distance_localObject



1750
1751
1752
# File 'lib/cisco_node_utils/route_map.rb', line 1750

def default_set_distance_local
  config_get_default('route_map', 'set_distance_local')
end

#default_set_extcomm_listObject



1401
1402
1403
# File 'lib/cisco_node_utils/route_map.rb', line 1401

def default_set_extcomm_list
  config_get_default('route_map', 'set_extcomm_list')
end

#default_set_extcommunity_4bytes_additiveObject



2308
2309
2310
# File 'lib/cisco_node_utils/route_map.rb', line 2308

def default_set_extcommunity_4bytes_additive
  config_get_default('route_map', 'set_extcommunity_4bytes_additive')
end

#default_set_extcommunity_4bytes_non_transitiveObject



2337
2338
2339
# File 'lib/cisco_node_utils/route_map.rb', line 2337

def default_set_extcommunity_4bytes_non_transitive
  config_get_default('route_map', 'set_extcommunity_4bytes_non_transitive')
end

#default_set_extcommunity_4bytes_noneObject



2317
2318
2319
# File 'lib/cisco_node_utils/route_map.rb', line 2317

def default_set_extcommunity_4bytes_none
  config_get_default('route_map', 'set_extcommunity_4bytes_none')
end

#default_set_extcommunity_4bytes_transitiveObject



2356
2357
2358
# File 'lib/cisco_node_utils/route_map.rb', line 2356

def default_set_extcommunity_4bytes_transitive
  config_get_default('route_map', 'set_extcommunity_4bytes_transitive')
end

#default_set_extcommunity_cost_igpObject



2440
2441
2442
# File 'lib/cisco_node_utils/route_map.rb', line 2440

def default_set_extcommunity_cost_igp
  config_get_default('route_map', 'set_extcommunity_cost_igp')
end

#default_set_extcommunity_cost_pre_bestpathObject



2464
2465
2466
# File 'lib/cisco_node_utils/route_map.rb', line 2464

def default_set_extcommunity_cost_pre_bestpath
  config_get_default('route_map', 'set_extcommunity_cost_pre_bestpath')
end

#default_set_extcommunity_rt_additiveObject



2388
2389
2390
# File 'lib/cisco_node_utils/route_map.rb', line 2388

def default_set_extcommunity_rt_additive
  config_get_default('route_map', 'set_extcommunity_rt_additive')
end

#default_set_extcommunity_rt_asnObject



2399
2400
2401
# File 'lib/cisco_node_utils/route_map.rb', line 2399

def default_set_extcommunity_rt_asn
  config_get_default('route_map', 'set_extcommunity_rt_asn')
end

#default_set_forwarding_addrObject



1415
1416
1417
# File 'lib/cisco_node_utils/route_map.rb', line 1415

def default_set_forwarding_addr
  config_get_default('route_map', 'set_forwarding_addr')
end

#default_set_interfaceObject



1835
1836
1837
# File 'lib/cisco_node_utils/route_map.rb', line 1835

def default_set_interface
  config_get_default('route_map', 'set_interface')
end

#default_set_ipv4_default_next_hopObject



1905
1906
1907
# File 'lib/cisco_node_utils/route_map.rb', line 1905

def default_set_ipv4_default_next_hop
  config_get_default('route_map', 'set_ipv4_default_next_hop')
end

#default_set_ipv4_default_next_hop_load_shareObject



1917
1918
1919
# File 'lib/cisco_node_utils/route_map.rb', line 1917

def default_set_ipv4_default_next_hop_load_share
  config_get_default('route_map', 'set_ipv4_default_next_hop_load_share')
end

#default_set_ipv4_next_hopObject



1957
1958
1959
# File 'lib/cisco_node_utils/route_map.rb', line 1957

def default_set_ipv4_next_hop
  config_get_default('route_map', 'set_ipv4_next_hop')
end

#default_set_ipv4_next_hop_load_shareObject



1973
1974
1975
# File 'lib/cisco_node_utils/route_map.rb', line 1973

def default_set_ipv4_next_hop_load_share
  config_get_default('route_map', 'set_ipv4_next_hop_load_share')
end

#default_set_ipv4_next_hop_peer_addrObject



1987
1988
1989
# File 'lib/cisco_node_utils/route_map.rb', line 1987

def default_set_ipv4_next_hop_peer_addr
  config_get_default('route_map', 'set_ipv4_next_hop_peer_addr')
end

#default_set_ipv4_next_hop_redistObject



2001
2002
2003
# File 'lib/cisco_node_utils/route_map.rb', line 2001

def default_set_ipv4_next_hop_redist
  config_get_default('route_map', 'set_ipv4_next_hop_redist')
end

#default_set_ipv4_next_hop_unchangedObject



2015
2016
2017
# File 'lib/cisco_node_utils/route_map.rb', line 2015

def default_set_ipv4_next_hop_unchanged
  config_get_default('route_map', 'set_ipv4_next_hop_unchanged')
end

#default_set_ipv4_precedenceObject



1865
1866
1867
# File 'lib/cisco_node_utils/route_map.rb', line 1865

def default_set_ipv4_precedence
  config_get_default('route_map', 'set_ipv4_precedence')
end

#default_set_ipv4_prefixObject



1850
1851
1852
# File 'lib/cisco_node_utils/route_map.rb', line 1850

def default_set_ipv4_prefix
  config_get_default('route_map', 'set_ipv4_prefix')
end

#default_set_ipv6_default_next_hopObject



2092
2093
2094
# File 'lib/cisco_node_utils/route_map.rb', line 2092

def default_set_ipv6_default_next_hop
  config_get_default('route_map', 'set_ipv6_default_next_hop')
end

#default_set_ipv6_default_next_hop_load_shareObject



2104
2105
2106
# File 'lib/cisco_node_utils/route_map.rb', line 2104

def default_set_ipv6_default_next_hop_load_share
  config_get_default('route_map', 'set_ipv6_default_next_hop_load_share')
end

#default_set_ipv6_next_hopObject



2144
2145
2146
# File 'lib/cisco_node_utils/route_map.rb', line 2144

def default_set_ipv6_next_hop
  config_get_default('route_map', 'set_ipv6_next_hop')
end

#default_set_ipv6_next_hop_load_shareObject



2160
2161
2162
# File 'lib/cisco_node_utils/route_map.rb', line 2160

def default_set_ipv6_next_hop_load_share
  config_get_default('route_map', 'set_ipv6_next_hop_load_share')
end

#default_set_ipv6_next_hop_peer_addrObject



2174
2175
2176
# File 'lib/cisco_node_utils/route_map.rb', line 2174

def default_set_ipv6_next_hop_peer_addr
  config_get_default('route_map', 'set_ipv6_next_hop_peer_addr')
end

#default_set_ipv6_next_hop_redistObject



2188
2189
2190
# File 'lib/cisco_node_utils/route_map.rb', line 2188

def default_set_ipv6_next_hop_redist
  config_get_default('route_map', 'set_ipv6_next_hop_redist')
end

#default_set_ipv6_next_hop_unchangedObject



2202
2203
2204
# File 'lib/cisco_node_utils/route_map.rb', line 2202

def default_set_ipv6_next_hop_unchanged
  config_get_default('route_map', 'set_ipv6_next_hop_unchanged')
end

#default_set_ipv6_precedenceObject



2045
2046
2047
# File 'lib/cisco_node_utils/route_map.rb', line 2045

def default_set_ipv6_precedence
  config_get_default('route_map', 'set_ipv6_precedence')
end

#default_set_ipv6_prefixObject



2030
2031
2032
# File 'lib/cisco_node_utils/route_map.rb', line 2030

def default_set_ipv6_prefix
  config_get_default('route_map', 'set_ipv6_prefix')
end

#default_set_levelObject



1430
1431
1432
# File 'lib/cisco_node_utils/route_map.rb', line 1430

def default_set_level
  config_get_default('route_map', 'set_level')
end

#default_set_local_preferenceObject



1445
1446
1447
# File 'lib/cisco_node_utils/route_map.rb', line 1445

def default_set_local_preference
  config_get_default('route_map', 'set_local_preference')
end

#default_set_metric_additiveObject



1598
1599
1600
# File 'lib/cisco_node_utils/route_map.rb', line 1598

def default_set_metric_additive
  config_get_default('route_map', 'set_metric_additive')
end

#default_set_metric_bandwidthObject



1607
1608
1609
# File 'lib/cisco_node_utils/route_map.rb', line 1607

def default_set_metric_bandwidth
  config_get_default('route_map', 'set_metric_bandwidth')
end

#default_set_metric_delayObject



1616
1617
1618
# File 'lib/cisco_node_utils/route_map.rb', line 1616

def default_set_metric_delay
  config_get_default('route_map', 'set_metric_delay')
end

#default_set_metric_effective_bandwidthObject



1634
1635
1636
# File 'lib/cisco_node_utils/route_map.rb', line 1634

def default_set_metric_effective_bandwidth
  config_get_default('route_map', 'set_metric_effective_bandwidth')
end

#default_set_metric_mtuObject



1643
1644
1645
# File 'lib/cisco_node_utils/route_map.rb', line 1643

def default_set_metric_mtu
  config_get_default('route_map', 'set_metric_mtu')
end

#default_set_metric_reliabilityObject



1625
1626
1627
# File 'lib/cisco_node_utils/route_map.rb', line 1625

def default_set_metric_reliability
  config_get_default('route_map', 'set_metric_reliability')
end

#default_set_metric_typeObject



1460
1461
1462
# File 'lib/cisco_node_utils/route_map.rb', line 1460

def default_set_metric_type
  config_get_default('route_map', 'set_metric_type')
end

#default_set_nssa_onlyObject



1474
1475
1476
# File 'lib/cisco_node_utils/route_map.rb', line 1474

def default_set_nssa_only
  config_get_default('route_map', 'set_nssa_only')
end

#default_set_originObject



1489
1490
1491
# File 'lib/cisco_node_utils/route_map.rb', line 1489

def default_set_origin
  config_get_default('route_map', 'set_origin')
end

#default_set_path_selectionObject



1503
1504
1505
# File 'lib/cisco_node_utils/route_map.rb', line 1503

def default_set_path_selection
  config_get_default('route_map', 'set_path_selection')
end

#default_set_tagObject



1518
1519
1520
# File 'lib/cisco_node_utils/route_map.rb', line 1518

def default_set_tag
  config_get_default('route_map', 'set_tag')
end

#default_set_vrfObject



1535
1536
1537
# File 'lib/cisco_node_utils/route_map.rb', line 1535

def default_set_vrf
  config_get_default('route_map', 'set_vrf')
end

#default_set_weightObject



1550
1551
1552
# File 'lib/cisco_node_utils/route_map.rb', line 1550

def default_set_weight
  config_get_default('route_map', 'set_weight')
end

#descriptionObject



140
141
142
# File 'lib/cisco_node_utils/route_map.rb', line 140

def description
  config_get('route_map', 'description', @get_args)
end

#description=(val) ⇒ Object



144
145
146
147
148
149
# File 'lib/cisco_node_utils/route_map.rb', line 144

def description=(val)
  state = val ? '' : 'no'
  desc = val ? val : ''
  set_args_keys(state: state, desc: desc)
  config_set('route_map', 'description', @set_args)
end

#destroyObject



65
66
67
# File 'lib/cisco_node_utils/route_map.rb', line 65

def destroy
  config_set('route_map', 'destroy', @set_args)
end

#match_as_numberObject

match as-number 12, 13-23, 45



74
75
76
77
78
79
80
81
82
# File 'lib/cisco_node_utils/route_map.rb', line 74

def match_as_number
  arr = []
  match_array = config_get('route_map', 'match_as_number', @get_args)
  match_array.each do |line|
    next if line.include?('as-path-list')
    arr = line.strip.split(', ')
  end
  arr
end

#match_as_number=(list) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/cisco_node_utils/route_map.rb', line 84

def match_as_number=(list)
  carr = match_as_number
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ', ')
  end
  unless cstr.empty?
    cstr.chomp!(', ')
    set_args_keys(state: 'no', num: cstr)
    # reset the current config
    config_set('route_map', 'match_as_number', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ', ')
  end
  return if nstr.empty?
  nstr.chomp!(', ')
  set_args_keys(state: '', num: nstr)
  config_set('route_map', 'match_as_number', @set_args)
end

#match_as_number_as_path_listObject

match as-number as-path-list abc xyz



111
112
113
114
# File 'lib/cisco_node_utils/route_map.rb', line 111

def match_as_number_as_path_list
  str = config_get('route_map', 'match_as_number_as_path_list', @get_args)
  str.empty? ? default_match_as_number_as_path_list : str.split
end

#match_as_number_as_path_list=(list) ⇒ Object



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/cisco_node_utils/route_map.rb', line 116

def match_as_number_as_path_list=(list)
  carr = match_as_number_as_path_list
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', list: cstr)
    # reset the current config
    config_set('route_map', 'match_as_number_as_path_list', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', list: nstr)
  config_set('route_map', 'match_as_number_as_path_list', @set_args)
end

#match_communityObject

match community public private exact-match



156
157
158
159
160
161
162
163
164
165
# File 'lib/cisco_node_utils/route_map.rb', line 156

def match_community
  str = config_get('route_map', 'match_community', @get_args)
  if str.empty?
    val = default_match_community
  else
    val = str.split
    val.delete('exact-match')
  end
  val
end

#match_community_exact_matchObject

match extcommunity public private exact-match



193
194
195
196
# File 'lib/cisco_node_utils/route_map.rb', line 193

def match_community_exact_match
  config_get('route_map', 'match_community',
             @get_args).include?('exact-match')
end

#match_community_set(list, exact) ⇒ Object



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/cisco_node_utils/route_map.rb', line 167

def match_community_set(list, exact)
  carr = match_community
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', comm: cstr)
    # reset the current config
    config_set('route_map', 'match_community', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  nstr.concat('exact-match') if exact
  set_args_keys(state: '', comm: nstr)
  config_set('route_map', 'match_community', @set_args)
end

#match_evpn_route_type_1Object



1240
1241
1242
1243
# File 'lib/cisco_node_utils/route_map.rb', line 1240

def match_evpn_route_type_1
  hash = match_evpn_route_type_get
  hash.nil? ? nil : hash[:type1]
end

#match_evpn_route_type_1=(val) ⇒ Object



1245
1246
1247
1248
1249
# File 'lib/cisco_node_utils/route_map.rb', line 1245

def match_evpn_route_type_1=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state, type: '1')
  config_set('route_map', 'match_evpn_route_type', @set_args)
end

#match_evpn_route_type_2_allObject



1330
1331
1332
1333
# File 'lib/cisco_node_utils/route_map.rb', line 1330

def match_evpn_route_type_2_all
  hash = match_evpn_route_type_get
  hash.nil? ? nil : hash[:type2_all]
end

#match_evpn_route_type_2_all=(val) ⇒ Object



1335
1336
1337
1338
1339
# File 'lib/cisco_node_utils/route_map.rb', line 1335

def match_evpn_route_type_2_all=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state, type: '2 all')
  config_set('route_map', 'match_evpn_route_type', @set_args)
end

#match_evpn_route_type_2_mac_ipObject



1345
1346
1347
1348
# File 'lib/cisco_node_utils/route_map.rb', line 1345

def match_evpn_route_type_2_mac_ip
  hash = match_evpn_route_type_get
  hash.nil? ? nil : hash[:type2_mac_ip]
end

#match_evpn_route_type_2_mac_ip=(val) ⇒ Object



1350
1351
1352
1353
1354
# File 'lib/cisco_node_utils/route_map.rb', line 1350

def match_evpn_route_type_2_mac_ip=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state, type: '2 mac-ip')
  config_set('route_map', 'match_evpn_route_type', @set_args)
end

#match_evpn_route_type_2_mac_onlyObject



1360
1361
1362
1363
# File 'lib/cisco_node_utils/route_map.rb', line 1360

def match_evpn_route_type_2_mac_only
  hash = match_evpn_route_type_get
  hash.nil? ? nil : hash[:type2_mac_only]
end

#match_evpn_route_type_2_mac_only=(val) ⇒ Object



1365
1366
1367
1368
1369
# File 'lib/cisco_node_utils/route_map.rb', line 1365

def match_evpn_route_type_2_mac_only=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state, type: '2 mac-only')
  config_set('route_map', 'match_evpn_route_type', @set_args)
end

#match_evpn_route_type_3Object



1255
1256
1257
1258
# File 'lib/cisco_node_utils/route_map.rb', line 1255

def match_evpn_route_type_3
  hash = match_evpn_route_type_get
  hash.nil? ? nil : hash[:type3]
end

#match_evpn_route_type_3=(val) ⇒ Object



1260
1261
1262
1263
1264
# File 'lib/cisco_node_utils/route_map.rb', line 1260

def match_evpn_route_type_3=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state, type: '3')
  config_set('route_map', 'match_evpn_route_type', @set_args)
end

#match_evpn_route_type_4Object



1270
1271
1272
1273
# File 'lib/cisco_node_utils/route_map.rb', line 1270

def match_evpn_route_type_4
  hash = match_evpn_route_type_get
  hash.nil? ? nil : hash[:type4]
end

#match_evpn_route_type_4=(val) ⇒ Object



1275
1276
1277
1278
1279
# File 'lib/cisco_node_utils/route_map.rb', line 1275

def match_evpn_route_type_4=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state, type: '4')
  config_set('route_map', 'match_evpn_route_type', @set_args)
end

#match_evpn_route_type_5Object



1285
1286
1287
1288
# File 'lib/cisco_node_utils/route_map.rb', line 1285

def match_evpn_route_type_5
  hash = match_evpn_route_type_get
  hash.nil? ? nil : hash[:type5]
end

#match_evpn_route_type_5=(val) ⇒ Object



1290
1291
1292
1293
1294
# File 'lib/cisco_node_utils/route_map.rb', line 1290

def match_evpn_route_type_5=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state, type: '5')
  config_set('route_map', 'match_evpn_route_type', @set_args)
end

#match_evpn_route_type_6Object



1300
1301
1302
1303
# File 'lib/cisco_node_utils/route_map.rb', line 1300

def match_evpn_route_type_6
  hash = match_evpn_route_type_get
  hash.nil? ? nil : hash[:type6]
end

#match_evpn_route_type_6=(val) ⇒ Object



1305
1306
1307
1308
1309
# File 'lib/cisco_node_utils/route_map.rb', line 1305

def match_evpn_route_type_6=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state, type: '6')
  config_set('route_map', 'match_evpn_route_type', @set_args)
end

#match_evpn_route_type_allObject



1315
1316
1317
1318
# File 'lib/cisco_node_utils/route_map.rb', line 1315

def match_evpn_route_type_all
  hash = match_evpn_route_type_get
  hash.nil? ? nil : hash[:type_all]
end

#match_evpn_route_type_all=(val) ⇒ Object



1320
1321
1322
1323
1324
# File 'lib/cisco_node_utils/route_map.rb', line 1320

def match_evpn_route_type_all=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state, type: 'all')
  config_set('route_map', 'match_evpn_route_type', @set_args)
end

#match_evpn_route_type_getObject

match evpn route-type 1 match evpn route-type 2 all match evpn route-type 2 mac-ip match evpn route-type 2 mac-only match evpn route-type 3 etc.



1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
# File 'lib/cisco_node_utils/route_map.rb', line 1214

def match_evpn_route_type_get
  arr = config_get('route_map', 'match_evpn_route_type', @get_args)
  return nil if arr.nil?
  hash = {}
  hash[:type1] = false
  hash[:type3] = false
  hash[:type4] = false
  hash[:type5] = false
  hash[:type6] = false
  hash[:type_all] = false
  hash[:type2_all] = false
  hash[:type2_mac_ip] = false
  hash[:type2_mac_only] = false
  return hash if arr.empty?
  hash[:type1] = true if arr.include?('1')
  hash[:type3] = true if arr.include?('3')
  hash[:type4] = true if arr.include?('4')
  hash[:type5] = true if arr.include?('5')
  hash[:type6] = true if arr.include?('6')
  hash[:type_all] = true if arr.include?('all')
  hash[:type2_all] = true if arr.include?('2 all')
  hash[:type2_mac_ip] = true if arr.include?('2 mac-ip')
  hash[:type2_mac_only] = true if arr.include?('2 mac-only')
  hash
end

#match_ext_communityObject



202
203
204
205
206
207
208
209
210
211
# File 'lib/cisco_node_utils/route_map.rb', line 202

def match_ext_community
  str = config_get('route_map', 'match_ext_community', @get_args)
  if str.empty?
    val = default_match_ext_community
  else
    val = str.split
    val.delete('exact-match')
  end
  val
end

#match_ext_community_exact_matchObject



238
239
240
241
# File 'lib/cisco_node_utils/route_map.rb', line 238

def match_ext_community_exact_match
  config_get('route_map', 'match_ext_community',
             @get_args).include?('exact-match')
end

#match_ext_community_set(list, exact) ⇒ Object



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/cisco_node_utils/route_map.rb', line 213

def match_ext_community_set(list, exact)
  carr = match_ext_community
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', comm: cstr)
    # reset the current config
    config_set('route_map', 'match_ext_community', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  nstr.concat('exact-match') if exact
  set_args_keys(state: '', comm: nstr)
  config_set('route_map', 'match_ext_community', @set_args)
end

#match_interfaceObject

match interface port-channel1 Null0 (and so on)



248
249
250
251
252
253
# File 'lib/cisco_node_utils/route_map.rb', line 248

def match_interface
  str = config_get('route_map', 'match_interface', @get_args)
  intf = str.empty? ? default_match_interface : str.split
  # Normalize by downcasing
  intf.map!(&:downcase)
end

#match_interface=(list) ⇒ Object



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/cisco_node_utils/route_map.rb', line 255

def match_interface=(list)
  carr = match_interface
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', int: cstr)
    # reset the current config
    config_set('route_map', 'match_interface', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', int: nstr)
  config_set('route_map', 'match_interface', @set_args)
end

#match_ip_addr_access_list(v4, v6) ⇒ Object



614
615
616
617
618
619
# File 'lib/cisco_node_utils/route_map.rb', line 614

def match_ip_addr_access_list(v4, v6)
  match_ipv4_addr_access_list_set(default_match_ipv4_addr_access_list)
  match_ipv6_addr_access_list_set(default_match_ipv6_addr_access_list)
  match_ipv4_addr_access_list_set(v4)
  match_ipv6_addr_access_list_set(v6)
end

#match_ip_addr_prefix_list(v4, v6) ⇒ Object



650
651
652
653
654
655
# File 'lib/cisco_node_utils/route_map.rb', line 650

def match_ip_addr_prefix_list(v4, v6)
  match_ipv4_addr_prefix_list_set(default_match_ipv4_addr_prefix_list)
  match_ipv6_addr_prefix_list_set(default_match_ipv6_addr_prefix_list)
  match_ipv4_addr_prefix_list_set(v4)
  match_ipv6_addr_prefix_list_set(v6)
end

#match_ipv4_addr_access_listObject



339
340
341
342
343
344
345
346
347
348
349
# File 'lib/cisco_node_utils/route_map.rb', line 339

def match_ipv4_addr_access_list
  val = default_match_ipv4_addr_access_list
  arr = config_get('route_map', 'match_ipv4_addr_access_list', @get_args)
  if arr
    arr.each do |line|
      next if line.include?('prefix-list')
      val = line.strip
    end
  end
  val
end

#match_ipv4_addr_access_list_set(val) ⇒ Object



351
352
353
354
355
356
357
358
# File 'lib/cisco_node_utils/route_map.rb', line 351

def match_ipv4_addr_access_list_set(val)
  cval = match_ipv4_addr_access_list
  return if val == cval
  state = val ? '' : 'no'
  al = val ? val : cval
  set_args_keys(state: state, access: al)
  config_set('route_map', 'match_ipv4_addr_access_list', @set_args)
end

#match_ipv4_addr_prefix_listObject

match ip address prefix-list pre1 pre2



365
366
367
368
# File 'lib/cisco_node_utils/route_map.rb', line 365

def match_ipv4_addr_prefix_list
  str = config_get('route_map', 'match_ipv4_addr_prefix_list', @get_args)
  str.empty? ? default_match_ipv4_addr_prefix_list : str.split
end

#match_ipv4_addr_prefix_list_set(list) ⇒ Object



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/cisco_node_utils/route_map.rb', line 370

def match_ipv4_addr_prefix_list_set(list)
  carr = match_ipv4_addr_prefix_list
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', prefix: cstr)
    # reset the current config
    config_set('route_map', 'match_ipv4_addr_prefix_list', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', prefix: nstr)
  config_set('route_map', 'match_ipv4_addr_prefix_list', @set_args)
end

#match_ipv4_multicast_enableObject



560
561
562
# File 'lib/cisco_node_utils/route_map.rb', line 560

def match_ipv4_multicast_enable
  match_ipv4_multicast_get.nil? ? default_match_ipv4_multicast_enable : true
end

#match_ipv4_multicast_enable=(enable) ⇒ Object



564
565
566
# File 'lib/cisco_node_utils/route_map.rb', line 564

def match_ipv4_multicast_enable=(enable)
  @set_args[:state] = enable ? '' : 'no'
end

#match_ipv4_multicast_getObject

match ip multicast source 242.1.1.1/32 group 239.2.2.2/32 rp 242.1.1.1/32

rp-type ASM

match ip multicast source 242.1.1.1/32 group-range

239.1.1.1 to 239.2.2.2 rp 242.1.1.1/32 rp-type Bidir


460
461
462
463
464
465
466
467
468
469
470
# File 'lib/cisco_node_utils/route_map.rb', line 460

def match_ipv4_multicast_get
  str = config_get('route_map', 'match_ipv4_multicast', @get_args)
  return nil if str.nil?
  regexp = Regexp.new('match ip multicast *(?<src>source \S+)?'\
                      ' *(?<grp>group \S+)?'\
                      ' *(?<grp_range_start>group-range \S+)?'\
                      ' *(?<grp_range_end>to \S+)?'\
                      ' *(?<rp>rp \S+)?'\
                      ' *(?<rp_type>rp-type \S+)?')
  regexp.match(str)
end

#match_ipv4_multicast_group_addrObject



486
487
488
489
490
# File 'lib/cisco_node_utils/route_map.rb', line 486

def match_ipv4_multicast_group_addr
  val = Utils.extract_value(match_ipv4_multicast_get, 'grp', 'group')
  return default_match_ipv4_multicast_group_addr if val.nil?
  val
end

#match_ipv4_multicast_group_addr=(grp_addr) ⇒ Object



492
493
494
# File 'lib/cisco_node_utils/route_map.rb', line 492

def match_ipv4_multicast_group_addr=(grp_addr)
  @set_args[:group] = Utils.attach_prefix(grp_addr, :group)
end

#match_ipv4_multicast_group_range_begin_addrObject



500
501
502
503
504
505
# File 'lib/cisco_node_utils/route_map.rb', line 500

def match_ipv4_multicast_group_range_begin_addr
  val = Utils.extract_value(match_ipv4_multicast_get,
                            'grp_range_start', 'group-range')
  return default_match_ipv4_multicast_group_range_begin_addr if val.nil?
  val
end

#match_ipv4_multicast_group_range_begin_addr=(begin_addr) ⇒ Object



507
508
509
510
# File 'lib/cisco_node_utils/route_map.rb', line 507

def match_ipv4_multicast_group_range_begin_addr=(begin_addr)
  @set_args[:group_range] =
      Utils.attach_prefix(begin_addr, :group_range, :'group-range')
end

#match_ipv4_multicast_group_range_end_addrObject



517
518
519
520
521
# File 'lib/cisco_node_utils/route_map.rb', line 517

def match_ipv4_multicast_group_range_end_addr
  val = Utils.extract_value(match_ipv4_multicast_get, 'grp_range_end', 'to')
  return default_match_ipv4_multicast_group_range_end_addr if val.nil?
  val
end

#match_ipv4_multicast_group_range_end_addr=(end_addr) ⇒ Object



523
524
525
# File 'lib/cisco_node_utils/route_map.rb', line 523

def match_ipv4_multicast_group_range_end_addr=(end_addr)
  @set_args[:to] = Utils.attach_prefix(end_addr, :to)
end

#match_ipv4_multicast_rp_addrObject



532
533
534
535
536
# File 'lib/cisco_node_utils/route_map.rb', line 532

def match_ipv4_multicast_rp_addr
  val = Utils.extract_value(match_ipv4_multicast_get, 'rp')
  return default_match_ipv4_multicast_rp_addr if val.nil?
  val
end

#match_ipv4_multicast_rp_addr=(rp_addr) ⇒ Object



538
539
540
# File 'lib/cisco_node_utils/route_map.rb', line 538

def match_ipv4_multicast_rp_addr=(rp_addr)
  @set_args[:rp] = Utils.attach_prefix(rp_addr, :rp)
end

#match_ipv4_multicast_rp_typeObject



546
547
548
549
550
# File 'lib/cisco_node_utils/route_map.rb', line 546

def match_ipv4_multicast_rp_type
  val = Utils.extract_value(match_ipv4_multicast_get, 'rp_type', 'rp-type')
  return default_match_ipv4_multicast_rp_type if val.nil?
  val
end

#match_ipv4_multicast_rp_type=(type) ⇒ Object



552
553
554
# File 'lib/cisco_node_utils/route_map.rb', line 552

def match_ipv4_multicast_rp_type=(type)
  @set_args[:rp_type] = Utils.attach_prefix(type, :rp_type, :'rp-type')
end

#match_ipv4_multicast_set(attrs) ⇒ Object



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/cisco_node_utils/route_map.rb', line 572

def match_ipv4_multicast_set(attrs)
  set_args_keys(attrs)
  [:match_ipv4_multicast_src_addr,
   :match_ipv4_multicast_group_addr,
   :match_ipv4_multicast_group_range_begin_addr,
   :match_ipv4_multicast_group_range_end_addr,
   :match_ipv4_multicast_rp_addr,
   :match_ipv4_multicast_rp_type,
   :match_ipv4_multicast_enable,
  ].each do |p|
    attrs[p] = '' if attrs[p].nil?
    send(p.to_s + '=', attrs[p])
  end
  @get_args = @set_args
  config_set('route_map', 'match_ipv4_multicast', @set_args)
end

#match_ipv4_multicast_src_addrObject



472
473
474
475
476
# File 'lib/cisco_node_utils/route_map.rb', line 472

def match_ipv4_multicast_src_addr
  val = Utils.extract_value(match_ipv4_multicast_get, 'src', 'source')
  return default_match_ipv4_multicast_src_addr if val.nil?
  val
end

#match_ipv4_multicast_src_addr=(src_addr) ⇒ Object



478
479
480
# File 'lib/cisco_node_utils/route_map.rb', line 478

def match_ipv4_multicast_src_addr=(src_addr)
  @set_args[:source] = Utils.attach_prefix(src_addr, :source)
end

#match_ipv4_next_hop_prefix_listObject

match ip next-hop prefix-list nhop1 nhop2



395
396
397
398
399
# File 'lib/cisco_node_utils/route_map.rb', line 395

def match_ipv4_next_hop_prefix_list
  str = config_get('route_map', 'match_ipv4_next_hop_prefix_list',
                   @get_args)
  str.empty? ? default_match_ipv4_next_hop_prefix_list : str.split
end

#match_ipv4_next_hop_prefix_list=(list) ⇒ Object



401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/cisco_node_utils/route_map.rb', line 401

def match_ipv4_next_hop_prefix_list=(list)
  carr = match_ipv4_next_hop_prefix_list
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', prefix: cstr)
    # reset the current config
    config_set('route_map', 'match_ipv4_next_hop_prefix_list', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', prefix: nstr)
  config_set('route_map', 'match_ipv4_next_hop_prefix_list', @set_args)
end

#match_ipv4_route_src_prefix_listObject

match ip route-source prefix-list rs1 rs2



426
427
428
429
430
# File 'lib/cisco_node_utils/route_map.rb', line 426

def match_ipv4_route_src_prefix_list
  str = config_get('route_map', 'match_ipv4_route_src_prefix_list',
                   @get_args)
  str.empty? ? default_match_ipv4_route_src_prefix_list : str.split
end

#match_ipv4_route_src_prefix_list=(list) ⇒ Object



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/cisco_node_utils/route_map.rb', line 432

def match_ipv4_route_src_prefix_list=(list)
  carr = match_ipv4_route_src_prefix_list
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', prefix: cstr)
    # reset the current config
    config_set('route_map', 'match_ipv4_route_src_prefix_list', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', prefix: nstr)
  config_set('route_map', 'match_ipv4_route_src_prefix_list', @set_args)
end

#match_ipv6_addr_access_listObject



589
590
591
592
593
594
595
596
597
598
599
# File 'lib/cisco_node_utils/route_map.rb', line 589

def match_ipv6_addr_access_list
  val = default_match_ipv6_addr_access_list
  arr = config_get('route_map', 'match_ipv6_addr_access_list', @get_args)
  if arr
    arr.each do |line|
      next if line.include?('prefix-list')
      val = line.strip
    end
  end
  val
end

#match_ipv6_addr_access_list_set(val) ⇒ Object



601
602
603
604
605
606
607
608
# File 'lib/cisco_node_utils/route_map.rb', line 601

def match_ipv6_addr_access_list_set(val)
  cval = match_ipv6_addr_access_list
  return if val == cval
  state = val ? '' : 'no'
  al = val ? val : cval
  set_args_keys(state: state, access: al)
  config_set('route_map', 'match_ipv6_addr_access_list', @set_args)
end

#match_ipv6_addr_prefix_listObject



621
622
623
624
# File 'lib/cisco_node_utils/route_map.rb', line 621

def match_ipv6_addr_prefix_list
  str = config_get('route_map', 'match_ipv6_addr_prefix_list', @get_args)
  str.empty? ? default_match_ipv6_addr_prefix_list : str.split
end

#match_ipv6_addr_prefix_list_set(list) ⇒ Object



626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/cisco_node_utils/route_map.rb', line 626

def match_ipv6_addr_prefix_list_set(list)
  carr = match_ipv6_addr_prefix_list
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', prefix: cstr)
    # reset the current config
    config_set('route_map', 'match_ipv6_addr_prefix_list', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', prefix: nstr)
  config_set('route_map', 'match_ipv6_addr_prefix_list', @set_args)
end

#match_ipv6_multicast_enableObject



817
818
819
# File 'lib/cisco_node_utils/route_map.rb', line 817

def match_ipv6_multicast_enable
  match_ipv6_multicast_get.nil? ? default_match_ipv6_multicast_enable : true
end

#match_ipv6_multicast_enable=(enable) ⇒ Object



821
822
823
# File 'lib/cisco_node_utils/route_map.rb', line 821

def match_ipv6_multicast_enable=(enable)
  @set_args[:state] = enable ? '' : 'no'
end

#match_ipv6_multicast_getObject



717
718
719
720
721
722
723
724
725
726
727
# File 'lib/cisco_node_utils/route_map.rb', line 717

def match_ipv6_multicast_get
  str = config_get('route_map', 'match_ipv6_multicast', @get_args)
  return nil if str.nil?
  regexp = Regexp.new('match ipv6 multicast *(?<src>source \S+)?'\
                      ' *(?<grp>group \S+)?'\
                      ' *(?<grp_range_start>group-range \S+)?'\
                      ' *(?<grp_range_end>to \S+)?'\
                      ' *(?<rp>rp \S+)?'\
                      ' *(?<rp_type>rp-type \S+)?')
  regexp.match(str)
end

#match_ipv6_multicast_group_addrObject



743
744
745
746
747
# File 'lib/cisco_node_utils/route_map.rb', line 743

def match_ipv6_multicast_group_addr
  val = Utils.extract_value(match_ipv6_multicast_get, 'grp', 'group')
  return default_match_ipv6_multicast_group_addr if val.nil?
  val
end

#match_ipv6_multicast_group_addr=(grp_addr) ⇒ Object



749
750
751
# File 'lib/cisco_node_utils/route_map.rb', line 749

def match_ipv6_multicast_group_addr=(grp_addr)
  @set_args[:group] = Utils.attach_prefix(grp_addr, :group)
end

#match_ipv6_multicast_group_range_begin_addrObject



757
758
759
760
761
762
# File 'lib/cisco_node_utils/route_map.rb', line 757

def match_ipv6_multicast_group_range_begin_addr
  val = Utils.extract_value(match_ipv6_multicast_get,
                            'grp_range_start', 'group-range')
  return default_match_ipv6_multicast_group_range_begin_addr if val.nil?
  val
end

#match_ipv6_multicast_group_range_begin_addr=(begin_addr) ⇒ Object



764
765
766
767
# File 'lib/cisco_node_utils/route_map.rb', line 764

def match_ipv6_multicast_group_range_begin_addr=(begin_addr)
  @set_args[:group_range] =
      Utils.attach_prefix(begin_addr, :group_range, :'group-range')
end

#match_ipv6_multicast_group_range_end_addrObject



774
775
776
777
778
# File 'lib/cisco_node_utils/route_map.rb', line 774

def match_ipv6_multicast_group_range_end_addr
  val = Utils.extract_value(match_ipv6_multicast_get, 'grp_range_end', 'to')
  return default_match_ipv6_multicast_group_range_end_addr if val.nil?
  val
end

#match_ipv6_multicast_group_range_end_addr=(end_addr) ⇒ Object



780
781
782
# File 'lib/cisco_node_utils/route_map.rb', line 780

def match_ipv6_multicast_group_range_end_addr=(end_addr)
  @set_args[:to] = Utils.attach_prefix(end_addr, :to)
end

#match_ipv6_multicast_rp_addrObject



789
790
791
792
793
# File 'lib/cisco_node_utils/route_map.rb', line 789

def match_ipv6_multicast_rp_addr
  val = Utils.extract_value(match_ipv6_multicast_get, 'rp')
  return default_match_ipv6_multicast_rp_addr if val.nil?
  val
end

#match_ipv6_multicast_rp_addr=(rp_addr) ⇒ Object



795
796
797
# File 'lib/cisco_node_utils/route_map.rb', line 795

def match_ipv6_multicast_rp_addr=(rp_addr)
  @set_args[:rp] = Utils.attach_prefix(rp_addr, :rp)
end

#match_ipv6_multicast_rp_typeObject



803
804
805
806
807
# File 'lib/cisco_node_utils/route_map.rb', line 803

def match_ipv6_multicast_rp_type
  val = Utils.extract_value(match_ipv6_multicast_get, 'rp_type', 'rp-type')
  return default_match_ipv6_multicast_rp_type if val.nil?
  val
end

#match_ipv6_multicast_rp_type=(type) ⇒ Object



809
810
811
# File 'lib/cisco_node_utils/route_map.rb', line 809

def match_ipv6_multicast_rp_type=(type)
  @set_args[:rp_type] = Utils.attach_prefix(type, :rp_type, :'rp-type')
end

#match_ipv6_multicast_set(attrs) ⇒ Object



829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'lib/cisco_node_utils/route_map.rb', line 829

def match_ipv6_multicast_set(attrs)
  set_args_keys(attrs)
  [:match_ipv6_multicast_src_addr,
   :match_ipv6_multicast_group_addr,
   :match_ipv6_multicast_group_range_begin_addr,
   :match_ipv6_multicast_group_range_end_addr,
   :match_ipv6_multicast_rp_addr,
   :match_ipv6_multicast_rp_type,
   :match_ipv6_multicast_enable,
  ].each do |p|
    attrs[p] = '' if attrs[p].nil?
    send(p.to_s + '=', attrs[p])
  end
  @get_args = @set_args
  config_set('route_map', 'match_ipv6_multicast', @set_args)
end

#match_ipv6_multicast_src_addrObject



729
730
731
732
733
# File 'lib/cisco_node_utils/route_map.rb', line 729

def match_ipv6_multicast_src_addr
  val = Utils.extract_value(match_ipv6_multicast_get, 'src', 'source')
  return default_match_ipv6_multicast_src_addr if val.nil?
  val
end

#match_ipv6_multicast_src_addr=(src_addr) ⇒ Object



735
736
737
# File 'lib/cisco_node_utils/route_map.rb', line 735

def match_ipv6_multicast_src_addr=(src_addr)
  @set_args[:source] = Utils.attach_prefix(src_addr, :source)
end

#match_ipv6_next_hop_prefix_listObject



657
658
659
660
661
# File 'lib/cisco_node_utils/route_map.rb', line 657

def match_ipv6_next_hop_prefix_list
  str = config_get('route_map', 'match_ipv6_next_hop_prefix_list',
                   @get_args)
  str.empty? ? default_match_ipv6_next_hop_prefix_list : str.split
end

#match_ipv6_next_hop_prefix_list=(list) ⇒ Object



663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
# File 'lib/cisco_node_utils/route_map.rb', line 663

def match_ipv6_next_hop_prefix_list=(list)
  carr = match_ipv6_next_hop_prefix_list
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', prefix: cstr)
    # reset the current config
    config_set('route_map', 'match_ipv6_next_hop_prefix_list', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', prefix: nstr)
  config_set('route_map', 'match_ipv6_next_hop_prefix_list', @set_args)
end

#match_ipv6_route_src_prefix_listObject



687
688
689
690
691
# File 'lib/cisco_node_utils/route_map.rb', line 687

def match_ipv6_route_src_prefix_list
  str = config_get('route_map', 'match_ipv6_route_src_prefix_list',
                   @get_args)
  str.empty? ? default_match_ipv6_route_src_prefix_list : str.split
end

#match_ipv6_route_src_prefix_list=(list) ⇒ Object



693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
# File 'lib/cisco_node_utils/route_map.rb', line 693

def match_ipv6_route_src_prefix_list=(list)
  carr = match_ipv6_route_src_prefix_list
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', prefix: cstr)
    # reset the current config
    config_set('route_map', 'match_ipv6_route_src_prefix_list', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', prefix: nstr)
  config_set('route_map', 'match_ipv6_route_src_prefix_list', @set_args)
end

#match_lengthObject

match length 45 300



1171
1172
1173
# File 'lib/cisco_node_utils/route_map.rb', line 1171

def match_length
  config_get('route_map', 'match_length', @get_args)
end

#match_length=(array) ⇒ Object



1175
1176
1177
1178
1179
1180
1181
1182
# File 'lib/cisco_node_utils/route_map.rb', line 1175

def match_length=(array)
  if array.empty?
    set_args_keys(state: 'no', min: '', max: '')
  else
    set_args_keys(state: '', min: array[0], max: array[1])
  end
  config_set('route_map', 'match_length', @set_args)
end

#match_mac_listObject

match mac-list m1 m2



1139
1140
1141
1142
1143
# File 'lib/cisco_node_utils/route_map.rb', line 1139

def match_mac_list
  str = config_get('route_map', 'match_mac_list', @get_args)
  return if str.nil?
  str.empty? ? default_match_mac_list : str.split
end

#match_mac_list=(list) ⇒ Object



1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/cisco_node_utils/route_map.rb', line 1145

def match_mac_list=(list)
  carr = match_mac_list
  config_set('route_map', 'match_mac_list', @set_args) if carr.nil?
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', mac: cstr)
    # reset the current config
    config_set('route_map', 'match_mac_list', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', mac: nstr)
  config_set('route_map', 'match_mac_list', @set_args)
end

#match_metricObject

match metric 1 8 224 - 9 23 5 - 8 6



847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
# File 'lib/cisco_node_utils/route_map.rb', line 847

def match_metric
  str = config_get('route_map', 'match_metric', @get_args)
  return default_match_metric if str.empty?
  rarr = []
  larr = []
  metrics = str.split
  deviation = false
  metrics.each do |metric|
    deviation = true if metric == '+-'
    if !larr.empty? && !deviation
      larr << '0'
      rarr << larr
      larr = []
    end
    next if metric == '+-'
    if !larr.empty? && deviation
      larr << metric
      rarr << larr
      larr = []
      deviation = false
      next
    end
    larr << metric if larr.empty?
  end
  unless larr.empty?
    larr << '0'
    rarr << larr
  end
  rarr
end

#match_metric=(list) ⇒ Object



878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
# File 'lib/cisco_node_utils/route_map.rb', line 878

def match_metric=(list)
  clist = match_metric
  # reset first
  unless clist.empty?
    str = ''
    clist.each do |metric, deviation|
      str.concat(metric + ' ')
      str.concat('+ ' + deviation + ' ') unless deviation == '0'
    end
    set_args_keys(state: 'no', metric: str)
    config_set('route_map', 'match_metric', @set_args)
  end
  return if list.empty?
  str = ''
  list.each do |metric, deviation|
    str.concat(metric + ' ')
    str.concat('+ ' + deviation + ' ') unless deviation == '0'
  end
  set_args_keys(state: '', metric: str)
  config_set('route_map', 'match_metric', @set_args)
end

#match_ospf_areaObject

match ospf-area 10 7



1107
1108
1109
1110
1111
# File 'lib/cisco_node_utils/route_map.rb', line 1107

def match_ospf_area
  str = config_get('route_map', 'match_ospf_area', @get_args)
  return if str.nil?
  str.empty? ? default_match_ospf_area : str.split
end

#match_ospf_area=(list) ⇒ Object



1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
# File 'lib/cisco_node_utils/route_map.rb', line 1113

def match_ospf_area=(list)
  carr = match_ospf_area
  config_set('route_map', 'match_ospf_area', @set_args) if carr.nil?
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', area: cstr)
    # reset the current config
    config_set('route_map', 'match_ospf_area', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', area: nstr)
  config_set('route_map', 'match_ospf_area', @set_args)
end

#match_route_type_externalObject



976
977
978
979
# File 'lib/cisco_node_utils/route_map.rb', line 976

def match_route_type_external
  hash = match_route_type_get
  hash[:external]
end

#match_route_type_external=(val) ⇒ Object



981
982
983
# File 'lib/cisco_node_utils/route_map.rb', line 981

def match_route_type_external=(val)
  @set_args[:external] = val ? 'external' : ''
end

#match_route_type_getObject

match route-type external internal (and so on) or in some platforms match route-type external match route-type internal etc.



909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
# File 'lib/cisco_node_utils/route_map.rb', line 909

def match_route_type_get
  hash = {}
  hash[:external] = false
  hash[:inter_area] = false
  hash[:internal] = false
  hash[:intra_area] = false
  hash[:level_1] = false
  hash[:level_2] = false
  hash[:local] = false
  hash[:nssa_external] = false
  hash[:type_1] = false
  hash[:type_2] = false
  str = config_get('route_map', 'match_route_type', @get_args)
  return hash if str.nil?
  str = str[0] if str.length == 1
  hash[:external] = true if str.include?('external')
  hash[:inter_area] = true if str.include?('inter-area')
  hash[:internal] = true if str.include?('internal')
  hash[:intra_area] = true if str.include?('intra-area')
  hash[:level_1] = true if str.include?('level-1')
  hash[:level_2] = true if str.include?('level-2')
  hash[:local] = true if str.include?('local')
  hash[:nssa_external] = true if str.include?('nssa-external')
  hash[:type_1] = true if str.include?('type-1')
  hash[:type_2] = true if str.include?('type-2')
  hash
end

#match_route_type_inter_areaObject



989
990
991
992
# File 'lib/cisco_node_utils/route_map.rb', line 989

def match_route_type_inter_area
  hash = match_route_type_get
  hash[:inter_area]
end

#match_route_type_inter_area=(val) ⇒ Object



994
995
996
# File 'lib/cisco_node_utils/route_map.rb', line 994

def match_route_type_inter_area=(val)
  @set_args[:inter_area] = val ? 'inter-area' : ''
end

#match_route_type_internalObject



1002
1003
1004
1005
# File 'lib/cisco_node_utils/route_map.rb', line 1002

def match_route_type_internal
  hash = match_route_type_get
  hash[:internal]
end

#match_route_type_internal=(val) ⇒ Object



1007
1008
1009
# File 'lib/cisco_node_utils/route_map.rb', line 1007

def match_route_type_internal=(val)
  @set_args[:internal] = val ? 'internal' : ''
end

#match_route_type_intra_areaObject



1015
1016
1017
1018
# File 'lib/cisco_node_utils/route_map.rb', line 1015

def match_route_type_intra_area
  hash = match_route_type_get
  hash[:intra_area]
end

#match_route_type_intra_area=(val) ⇒ Object



1020
1021
1022
# File 'lib/cisco_node_utils/route_map.rb', line 1020

def match_route_type_intra_area=(val)
  @set_args[:intra_area] = val ? 'intra-area' : ''
end

#match_route_type_level_1Object



1028
1029
1030
1031
# File 'lib/cisco_node_utils/route_map.rb', line 1028

def match_route_type_level_1
  hash = match_route_type_get
  hash[:level_1]
end

#match_route_type_level_1=(val) ⇒ Object



1033
1034
1035
# File 'lib/cisco_node_utils/route_map.rb', line 1033

def match_route_type_level_1=(val)
  @set_args[:level_1] = val ? 'level-1' : ''
end

#match_route_type_level_2Object



1041
1042
1043
1044
# File 'lib/cisco_node_utils/route_map.rb', line 1041

def match_route_type_level_2
  hash = match_route_type_get
  hash[:level_2]
end

#match_route_type_level_2=(val) ⇒ Object



1046
1047
1048
# File 'lib/cisco_node_utils/route_map.rb', line 1046

def match_route_type_level_2=(val)
  @set_args[:level_2] = val ? 'level-2' : ''
end

#match_route_type_localObject



1054
1055
1056
1057
# File 'lib/cisco_node_utils/route_map.rb', line 1054

def match_route_type_local
  hash = match_route_type_get
  hash[:local]
end

#match_route_type_local=(val) ⇒ Object



1059
1060
1061
# File 'lib/cisco_node_utils/route_map.rb', line 1059

def match_route_type_local=(val)
  @set_args[:local] = val ? 'local' : ''
end

#match_route_type_nssa_externalObject



1067
1068
1069
1070
# File 'lib/cisco_node_utils/route_map.rb', line 1067

def match_route_type_nssa_external
  hash = match_route_type_get
  hash[:nssa_external]
end

#match_route_type_nssa_external=(val) ⇒ Object



1072
1073
1074
# File 'lib/cisco_node_utils/route_map.rb', line 1072

def match_route_type_nssa_external=(val)
  @set_args[:nssa_external] = val ? 'nssa-external' : ''
end

#match_route_type_set(attrs) ⇒ Object



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
# File 'lib/cisco_node_utils/route_map.rb', line 937

def match_route_type_set(attrs)
  # reset first
  set_args_keys(
    state:         'no',
    external:      'external',
    inter_area:    'inter-area',
    internal:      'internal',
    intra_area:    'intra-area',
    level_1:       'level-1',
    level_2:       'level-2',
    local:         'local',
    nssa_external: 'nssa-external',
    type_1:        'type-1',
    type_2:        'type-2')
  config_set('route_map', 'match_route_type', @set_args)

  to_set = false
  set_args_keys(attrs)
  [:match_route_type_external,
   :match_route_type_inter_area,
   :match_route_type_internal,
   :match_route_type_intra_area,
   :match_route_type_level_1,
   :match_route_type_level_2,
   :match_route_type_local,
   :match_route_type_nssa_external,
   :match_route_type_type_1,
   :match_route_type_type_2,
  ].each do |p|
    attrs[p] = false if attrs[p].nil?
    send(p.to_s + '=', attrs[p])
    to_set = true if attrs[p] && !to_set
  end
  return unless to_set
  @set_args[:state] = ''
  @get_args = @set_args
  config_set('route_map', 'match_route_type', @set_args)
end

#match_route_type_type_1Object



1080
1081
1082
1083
# File 'lib/cisco_node_utils/route_map.rb', line 1080

def match_route_type_type_1
  hash = match_route_type_get
  hash[:type_1]
end

#match_route_type_type_1=(val) ⇒ Object



1085
1086
1087
# File 'lib/cisco_node_utils/route_map.rb', line 1085

def match_route_type_type_1=(val)
  @set_args[:type_1] = val ? 'type-1' : ''
end

#match_route_type_type_2Object



1093
1094
1095
1096
# File 'lib/cisco_node_utils/route_map.rb', line 1093

def match_route_type_type_2
  hash = match_route_type_get
  hash[:type_2]
end

#match_route_type_type_2=(val) ⇒ Object



1098
1099
1100
# File 'lib/cisco_node_utils/route_map.rb', line 1098

def match_route_type_type_2=(val)
  @set_args[:type_2] = val ? 'type-2' : ''
end

#match_src_protoObject

match source-protocol tcp udp



310
311
312
313
# File 'lib/cisco_node_utils/route_map.rb', line 310

def match_src_proto
  str = config_get('route_map', 'match_src_proto', @get_args)
  str.empty? ? default_match_src_proto : str.split.sort
end

#match_src_proto=(list) ⇒ Object



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/cisco_node_utils/route_map.rb', line 315

def match_src_proto=(list)
  carr = match_src_proto
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', proto: cstr)
    # reset the current config
    config_set('route_map', 'match_src_proto', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', proto: nstr)
  config_set('route_map', 'match_src_proto', @set_args)
end

#match_tagObject

match tag 11 5 28



280
281
282
283
# File 'lib/cisco_node_utils/route_map.rb', line 280

def match_tag
  str = config_get('route_map', 'match_tag', @get_args)
  str.empty? ? default_match_tag : str.split
end

#match_tag=(list) ⇒ Object



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/cisco_node_utils/route_map.rb', line 285

def match_tag=(list)
  carr = match_tag
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  unless cstr.empty?
    set_args_keys(state: 'no', tag: cstr)
    # reset the current config
    config_set('route_map', 'match_tag', @set_args)
  end
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  return if nstr.empty?
  set_args_keys(state: '', tag: nstr)
  config_set('route_map', 'match_tag', @set_args)
end

#match_vlanObject



1188
1189
1190
1191
# File 'lib/cisco_node_utils/route_map.rb', line 1188

def match_vlan
  ret = config_get('route_map', 'match_vlan', @get_args)
  ret.strip if ret
end

#match_vlan=(val) ⇒ Object



1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
# File 'lib/cisco_node_utils/route_map.rb', line 1193

def match_vlan=(val)
  cval = match_vlan
  # reset first
  unless cval.nil? || cval.empty?
    set_args_keys(state: 'no', range: cval)
    config_set('route_map', 'match_vlan', @set_args)
  end
  return if val.empty?
  set_args_keys(state: '', range: val)
  config_set('route_map', 'match_vlan', @set_args)
end

#set_args_keys(hash = {}) ⇒ Object

rubocop:disable Style/AccessorMethodName



55
56
57
58
# File 'lib/cisco_node_utils/route_map.rb', line 55

def set_args_keys(hash={})
  set_args_keys_default
  @set_args = @get_args.merge!(hash) unless hash.empty?
end

#set_args_keys_defaultObject

Helper method to delete @set_args hash keys



49
50
51
52
# File 'lib/cisco_node_utils/route_map.rb', line 49

def set_args_keys_default
  @set_args = { name: @name, action: @action, seq: @seq }
  @get_args = @set_args
end

#set_as_path_prependObject

set as-path prepend 55.77 44 33.5 set as-path prepend last-as 1



1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
# File 'lib/cisco_node_utils/route_map.rb', line 1794

def set_as_path_prepend
  arr = []
  match = config_get('route_map', 'set_as_path_prepend', @get_args)
  if arr
    match.each do |line|
      next if line.include?('last-as')
      arr = line.strip.split
    end
  end
  arr
end

#set_as_path_prepend=(list) ⇒ Object



1806
1807
1808
1809
1810
1811
1812
1813
1814
# File 'lib/cisco_node_utils/route_map.rb', line 1806

def set_as_path_prepend=(list)
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  state = nstr.empty? ? 'no' : ''
  set_args_keys(state: state, asnum: nstr)
  config_set('route_map', 'set_as_path_prepend', @set_args)
end

#set_as_path_prepend_last_asObject



1763
1764
1765
# File 'lib/cisco_node_utils/route_map.rb', line 1763

def set_as_path_prepend_last_as
  config_get('route_map', 'set_as_path_prepend_last_as', @get_args)
end

#set_as_path_prepend_last_as=(val) ⇒ Object



1767
1768
1769
1770
1771
1772
# File 'lib/cisco_node_utils/route_map.rb', line 1767

def set_as_path_prepend_last_as=(val)
  state = val ? '' : 'no'
  as = val ? val : ''
  set_args_keys(state: state, as: as)
  config_set('route_map', 'set_as_path_prepend_last_as', @set_args)
end

#set_as_path_tagObject



1778
1779
1780
# File 'lib/cisco_node_utils/route_map.rb', line 1778

def set_as_path_tag
  config_get('route_map', 'set_as_path_tag', @get_args)
end

#set_as_path_tag=(val) ⇒ Object



1782
1783
1784
1785
1786
# File 'lib/cisco_node_utils/route_map.rb', line 1782

def set_as_path_tag=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_as_path_tag', @set_args)
end

#set_comm_listObject



1375
1376
1377
# File 'lib/cisco_node_utils/route_map.rb', line 1375

def set_comm_list
  config_get('route_map', 'set_comm_list', @get_args)
end

#set_comm_list=(val) ⇒ Object



1379
1380
1381
1382
1383
1384
# File 'lib/cisco_node_utils/route_map.rb', line 1379

def set_comm_list=(val)
  state = val ? '' : 'no'
  list = val ? val : set_comm_list
  set_args_keys(state: state, list: list)
  config_set('route_map', 'set_comm_list', @set_args)
end

#set_community_additiveObject



2206
2207
2208
2209
2210
2211
2212
# File 'lib/cisco_node_utils/route_map.rb', line 2206

def set_community_additive
  str = config_get('route_map', 'set_community', @get_args)
  add = false
  return add if str.nil?
  add = true if str.include?('additive') || str == 'set community '
  add
end

#set_community_asnObject



2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
# File 'lib/cisco_node_utils/route_map.rb', line 2263

def set_community_asn
  str = config_get('route_map', 'set_community', @get_args)
  return default_set_community_asn if str.nil? || !str.include?(':')
  str.sub!('set community', '')
  str.sub!('internet', '')
  str.sub!('additive', '')
  str.sub!('local-AS', '')
  str.sub!('no-export', '')
  str.sub!('no-advertise', '')
  str.split
end

#set_community_internetObject



2218
2219
2220
2221
# File 'lib/cisco_node_utils/route_map.rb', line 2218

def set_community_internet
  str = config_get('route_map', 'set_community', @get_args)
  str.nil? ? false : str.include?('internet')
end

#set_community_local_asObject



2227
2228
2229
2230
# File 'lib/cisco_node_utils/route_map.rb', line 2227

def set_community_local_as
  str = config_get('route_map', 'set_community', @get_args)
  str.nil? ? false : str.include?('local-AS')
end

#set_community_no_advtertiseObject



2236
2237
2238
2239
# File 'lib/cisco_node_utils/route_map.rb', line 2236

def set_community_no_advtertise
  str = config_get('route_map', 'set_community', @get_args)
  str.nil? ? false : str.include?('no-advertise')
end

#set_community_no_exportObject



2245
2246
2247
2248
# File 'lib/cisco_node_utils/route_map.rb', line 2245

def set_community_no_export
  str = config_get('route_map', 'set_community', @get_args)
  str.nil? ? false : str.include?('no-export')
end

#set_community_noneObject



2254
2255
2256
2257
# File 'lib/cisco_node_utils/route_map.rb', line 2254

def set_community_none
  str = config_get('route_map', 'set_community', @get_args)
  str.nil? ? false : str.include?('none')
end

#set_community_set(none, noadv, noexp, add, local, inter, asn) ⇒ Object

set community none set community (if only additive is configured) set internet 11:22 22:33 local-AS no-advertise no-export additive and combinations of the above



2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
# File 'lib/cisco_node_utils/route_map.rb', line 2283

def set_community_set(none, noadv, noexp, add, local, inter, asn)
  str = ''
  # reset first
  set_args_keys(state: 'no', string: str)
  config_set('route_map', 'set_community', @set_args)
  return unless none || noadv || noexp || add ||
                local || inter || !asn.empty?
  str.concat('internet ') if inter
  asn.each do |elem|
    str.concat(elem + ' ')
  end
  str.concat('no-export ') if noexp
  str.concat('no-advertise ') if noadv
  str.concat('local-AS ') if local
  str.concat('additive ') if add
  str.concat('none') if none
  set_args_keys(state: '', string: str)
  config_set('route_map', 'set_community', @set_args)
end

#set_dampening_getObject

set dampening 6 22 44 55



1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
# File 'lib/cisco_node_utils/route_map.rb', line 1648

def set_dampening_get
  hash = {}
  hash[:half_life] = false
  hash[:reuse] = false
  hash[:suppress] = false
  hash[:max] = false
  str = config_get('route_map', 'set_dampening', @get_args)
  return hash if str.nil?
  arr = str.split
  hash[:half_life] = arr[0].to_i
  hash[:reuse] = arr[1].to_i
  hash[:suppress] = arr[2].to_i
  hash[:max] = arr[3].to_i
  hash
end

#set_dampening_half_lifeObject



1674
1675
1676
1677
# File 'lib/cisco_node_utils/route_map.rb', line 1674

def set_dampening_half_life
  hash = set_dampening_get
  hash[:half_life]
end

#set_dampening_max_duationObject



1701
1702
1703
1704
# File 'lib/cisco_node_utils/route_map.rb', line 1701

def set_dampening_max_duation
  hash = set_dampening_get
  hash[:max]
end

#set_dampening_reuseObject



1683
1684
1685
1686
# File 'lib/cisco_node_utils/route_map.rb', line 1683

def set_dampening_reuse
  hash = set_dampening_get
  hash[:reuse]
end

#set_dampening_set(half_life, reuse, supp, md) ⇒ Object



1664
1665
1666
1667
1668
1669
1670
1671
1672
# File 'lib/cisco_node_utils/route_map.rb', line 1664

def set_dampening_set(half_life, reuse, supp, md)
  if half_life
    set_args_keys(state: '', hl: half_life, reuse: reuse, supp: supp,
                  max: md)
  else
    set_args_keys(state: 'no', hl: '', reuse: '', supp: '', max: '')
  end
  config_set('route_map', 'set_dampening', @set_args)
end

#set_dampening_suppressObject



1692
1693
1694
1695
# File 'lib/cisco_node_utils/route_map.rb', line 1692

def set_dampening_suppress
  hash = set_dampening_get
  hash[:suppress]
end

#set_distance_getObject

set distance 1 2 3 set distance 1 2 set distance 1



1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
# File 'lib/cisco_node_utils/route_map.rb', line 1713

def set_distance_get
  hash = {}
  hash[:igp] = false
  hash[:internal] = false
  hash[:local] = false
  str = config_get('route_map', 'set_distance', @get_args)
  return hash if str.nil?
  arr = str.split
  hash[:igp] = arr[0].to_i
  hash[:internal] = arr[1].to_i if arr[1]
  hash[:local] = arr[2].to_i if arr[2]
  hash
end

#set_distance_igp_ebgpObject



1736
1737
1738
1739
# File 'lib/cisco_node_utils/route_map.rb', line 1736

def set_distance_igp_ebgp
  hash = set_distance_get
  hash[:igp]
end

#set_distance_internalObject



1754
1755
1756
1757
# File 'lib/cisco_node_utils/route_map.rb', line 1754

def set_distance_internal
  hash = set_distance_get
  hash[:internal]
end

#set_distance_localObject



1745
1746
1747
1748
# File 'lib/cisco_node_utils/route_map.rb', line 1745

def set_distance_local
  hash = set_distance_get
  hash[:local]
end

#set_distance_set(igp, internal, local) ⇒ Object



1727
1728
1729
1730
1731
1732
1733
1734
# File 'lib/cisco_node_utils/route_map.rb', line 1727

def set_distance_set(igp, internal, local)
  state = igp ? '' : 'no'
  igp_ebgp = igp ? igp : ''
  int = internal ? internal : ''
  loc = local ? local : ''
  set_args_keys(state: state, igp: igp_ebgp, internal: int, local: loc)
  config_set('route_map', 'set_distance', @set_args)
end

#set_extcomm_listObject



1390
1391
1392
# File 'lib/cisco_node_utils/route_map.rb', line 1390

def set_extcomm_list
  config_get('route_map', 'set_extcomm_list', @get_args)
end

#set_extcomm_list=(val) ⇒ Object



1394
1395
1396
1397
1398
1399
# File 'lib/cisco_node_utils/route_map.rb', line 1394

def set_extcomm_list=(val)
  state = val ? '' : 'no'
  list = val ? val : set_extcomm_list
  set_args_keys(state: state, list: list)
  config_set('route_map', 'set_extcomm_list', @set_args)
end

#set_extcommunity_4bytes_additiveObject



2303
2304
2305
2306
# File 'lib/cisco_node_utils/route_map.rb', line 2303

def set_extcommunity_4bytes_additive
  str = config_get('route_map', 'set_extcommunity_4bytes', @get_args)
  str.nil? ? false : str.include?('additive')
end

#set_extcommunity_4bytes_non_transitiveObject



2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
# File 'lib/cisco_node_utils/route_map.rb', line 2321

def set_extcommunity_4bytes_non_transitive
  str = config_get('route_map', 'set_extcommunity_4bytes', @get_args)
  return default_set_extcommunity_4bytes_non_transitive if
    str.nil? || !str.include?('non-transitive')
  arr = str.split
  ret_arr = []
  index = arr.index('non-transitive')
  while index
    ret_arr << arr[index + 1]
    arr.delete_at(index)
    arr.delete_at(index)
    index = arr.index('non-transitive')
  end
  ret_arr
end

#set_extcommunity_4bytes_noneObject



2312
2313
2314
2315
# File 'lib/cisco_node_utils/route_map.rb', line 2312

def set_extcommunity_4bytes_none
  str = config_get('route_map', 'set_extcommunity_4bytes', @get_args)
  str.nil? ? false : str.include?('none')
end

#set_extcommunity_4bytes_set(none, transit, non_transit, add) ⇒ Object

set extcommunity 4byteas-generic none set extcommunity 4byteas-generic additive set extcommunity 4byteas-generic transitive 11:22 transitive 22:33 set extcommunity 4byteas-generic non-transitive 11:22 set extcommunity 4byteas-generic transitive 22:33 non-transitive 11:22



2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
# File 'lib/cisco_node_utils/route_map.rb', line 2365

def set_extcommunity_4bytes_set(none, transit, non_transit, add)
  str = ''
  # reset first
  set_args_keys(state: 'no', string: str)
  config_set('route_map', 'set_extcommunity_4bytes', @set_args)
  return unless none || add || !transit.empty? || !non_transit.empty?
  str.concat('none') if none
  transit.each do |elem|
    str.concat('transitive ' + elem + ' ')
  end
  non_transit.each do |elem|
    str.concat('non-transitive ' + elem + ' ')
  end
  str.concat('additive') if add
  set_args_keys(state: '', string: str)
  config_set('route_map', 'set_extcommunity_4bytes', @set_args)
end

#set_extcommunity_4bytes_transitiveObject



2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
# File 'lib/cisco_node_utils/route_map.rb', line 2341

def set_extcommunity_4bytes_transitive
  str = config_get('route_map', 'set_extcommunity_4bytes', @get_args)
  return default_set_extcommunity_4bytes_transitive if str.nil?
  arr = str.split
  ret_arr = []
  index = arr.index('transitive')
  while index
    ret_arr << arr[index + 1]
    arr.delete_at(index)
    arr.delete_at(index)
    index = arr.index('transitive')
  end
  ret_arr
end

#set_extcommunity_cost_deviceObject



2468
2469
2470
# File 'lib/cisco_node_utils/route_map.rb', line 2468

def set_extcommunity_cost_device
  config_get('route_map', 'set_extcommunity_cost_device', @get_args)
end

#set_extcommunity_cost_igpObject



2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
# File 'lib/cisco_node_utils/route_map.rb', line 2420

def set_extcommunity_cost_igp
  str = config_get('route_map', 'set_extcommunity_cost', @get_args)
  return default_set_extcommunity_cost_igp if
    str.nil? || !str.include?('igp')
  arr = str.split
  ret_arr = []
  index = arr.index('igp')
  while index
    larr = []
    larr << arr[index + 1]
    larr << arr[index + 2]
    ret_arr << larr
    arr.delete_at(index)
    arr.delete_at(index)
    arr.delete_at(index)
    index = arr.index('igp')
  end
  ret_arr
end

#set_extcommunity_cost_pre_bestpathObject



2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
# File 'lib/cisco_node_utils/route_map.rb', line 2444

def set_extcommunity_cost_pre_bestpath
  str = config_get('route_map', 'set_extcommunity_cost', @get_args)
  return default_set_extcommunity_cost_pre_bestpath if
    str.nil? || !str.include?('pre-bestpath')
  arr = str.split
  ret_arr = []
  index = arr.index('pre-bestpath')
  while index
    larr = []
    larr << arr[index + 1]
    larr << arr[index + 2]
    ret_arr << larr
    arr.delete_at(index)
    arr.delete_at(index)
    arr.delete_at(index)
    index = arr.index('pre-bestpath')
  end
  ret_arr
end

#set_extcommunity_cost_set(igp, pre) ⇒ Object

set extcommunity cost igp 0 22 igp 3 23 set extcommunity cost pre-bestpath 1 222 pre-bestpath 2 54 set extcommunity cost pre-bestpath 1 222 pre-bestpath 2 54 igp 0 22



2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
# File 'lib/cisco_node_utils/route_map.rb', line 2475

def set_extcommunity_cost_set(igp, pre)
  str = ''
  # reset first
  if set_extcommunity_cost_device
    cpre = set_extcommunity_cost_pre_bestpath
    cigp = set_extcommunity_cost_igp
    cpre.each do |id, val|
      str.concat('pre-bestpath ' + id.to_s + ' ' + val.to_s + ' ')
    end
    cigp.each do |id, val|
      str.concat('igp ' + id.to_s + ' ' + val.to_s + ' ')
    end
  end
  set_args_keys(state: 'no', string: str)
  config_set('route_map', 'set_extcommunity_cost', @set_args)
  return if igp.empty? && pre.empty?
  str = ''
  pre.each do |id, val|
    str.concat('pre-bestpath ' + id.to_s + ' ' + val.to_s + ' ')
  end
  igp.each do |id, val|
    str.concat('igp ' + id.to_s + ' ' + val.to_s + ' ')
  end
  set_args_keys(state: '', string: str)
  config_set('route_map', 'set_extcommunity_cost', @set_args)
end

#set_extcommunity_rt_additiveObject



2383
2384
2385
2386
# File 'lib/cisco_node_utils/route_map.rb', line 2383

def set_extcommunity_rt_additive
  str = config_get('route_map', 'set_extcommunity_rt', @get_args)
  str.nil? ? false : str.include?('additive')
end

#set_extcommunity_rt_asnObject



2392
2393
2394
2395
2396
2397
# File 'lib/cisco_node_utils/route_map.rb', line 2392

def set_extcommunity_rt_asn
  str = config_get('route_map', 'set_extcommunity_rt', @get_args)
  return default_set_extcommunity_rt_asn if str.nil?
  str.delete!('additive')
  str.split
end

#set_extcommunity_rt_set(asn, add) ⇒ Object

set extcommunity rt additive set extcommunity rt 11:22 12.22.22.22:12 123.256:543 set extcommunity rt 11:22 12.22.22.22:12 123.256:543 additive



2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
# File 'lib/cisco_node_utils/route_map.rb', line 2406

def set_extcommunity_rt_set(asn, add)
  str = ''
  # reset first
  set_args_keys(state: 'no', string: str)
  config_set('route_map', 'set_extcommunity_rt', @set_args)
  return unless add || !asn.empty?
  asn.each do |elem|
    str.concat(elem + ' ')
  end
  str.concat('additive') if add
  set_args_keys(state: '', string: str)
  config_set('route_map', 'set_extcommunity_rt', @set_args)
end

#set_forwarding_addrObject



1405
1406
1407
# File 'lib/cisco_node_utils/route_map.rb', line 1405

def set_forwarding_addr
  config_get('route_map', 'set_forwarding_addr', @get_args)
end

#set_forwarding_addr=(val) ⇒ Object



1409
1410
1411
1412
1413
# File 'lib/cisco_node_utils/route_map.rb', line 1409

def set_forwarding_addr=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_forwarding_addr', @set_args)
end

#set_interfaceObject

set interface Null0



1821
1822
1823
1824
# File 'lib/cisco_node_utils/route_map.rb', line 1821

def set_interface
  str = config_get('route_map', 'set_interface', @get_args)
  str ? str.strip : default_set_interface
end

#set_interface_set(val) ⇒ Object



1826
1827
1828
1829
1830
1831
1832
1833
# File 'lib/cisco_node_utils/route_map.rb', line 1826

def set_interface_set(val)
  cint = set_interface
  return if cint == val
  state = val ? '' : 'no'
  int = val ? val : cint
  set_args_keys(state: state, int: int)
  config_set('route_map', 'set_interface', @set_args)
end

#set_ip_next_hop_reset(attrs) ⇒ Object



2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
# File 'lib/cisco_node_utils/route_map.rb', line 2502

def set_ip_next_hop_reset(attrs)
  set_interface_set(default_set_interface)
  v4ls = default_set_ipv4_default_next_hop_load_share
  set_ipv4_def_next_hop_set(default_set_ipv4_default_next_hop, v4ls) unless
                            default_set_ipv4_default_next_hop.nil?
  default_set_ipv4_default_next_hop.nil?
  set_ipv4_next_hop_set(default_set_ipv4_next_hop)
  set_ipv4_next_hop_peer_addr_set(default_set_ipv4_next_hop_peer_addr)
  set_ipv4_next_hop_redist_set(default_set_ipv4_next_hop_redist) unless
    attrs[:v4red].nil?
  set_ipv4_next_hop_unchanged_set(default_set_ipv4_next_hop_unchanged)
  v6ls = default_set_ipv4_default_next_hop_load_share
  set_ipv6_def_next_hop_set(default_set_ipv6_default_next_hop, v6ls) unless
                            default_set_ipv6_default_next_hop.nil?
  set_ipv6_next_hop_set(default_set_ipv6_next_hop)
  set_ipv6_next_hop_peer_addr_set(default_set_ipv6_next_hop_peer_addr)
  set_ipv6_next_hop_redist_set(default_set_ipv6_next_hop_redist) unless
    attrs[:v6red].nil?
  set_ipv6_next_hop_unchanged_set(default_set_ipv6_next_hop_unchanged)
end

#set_ip_next_hop_set(attrs) ⇒ Object



2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
# File 'lib/cisco_node_utils/route_map.rb', line 2523

def set_ip_next_hop_set(attrs)
  set_ip_next_hop_reset(attrs)
  set_interface_set(attrs[:intf])
  set_ipv4_def_next_hop_set(attrs[:v4dnh], attrs[:v4dls]) unless
    default_set_ipv4_default_next_hop.nil?
  set_ipv4_next_hop_set(attrs[:v4nh], attrs[:v4ls])
  set_ipv4_next_hop_peer_addr_set(attrs[:v4peer])
  set_ipv4_next_hop_redist_set(attrs[:v4red]) unless attrs[:v4red].nil?
  set_ipv4_next_hop_unchanged_set(attrs[:v4unc])
  set_ipv6_def_next_hop_set(attrs[:v6dnh], attrs[:v6dls]) unless
    default_set_ipv6_default_next_hop.nil?
  set_ipv6_next_hop_set(attrs[:v6nh], attrs[:v6ls])
  set_ipv6_next_hop_peer_addr_set(attrs[:v6peer])
  set_ipv6_next_hop_redist_set(attrs[:v6red]) unless attrs[:v6red].nil?
  set_ipv6_next_hop_unchanged_set(attrs[:v6unc])
end

#set_ip_precedence(v4, v6) ⇒ Object



2049
2050
2051
2052
2053
2054
# File 'lib/cisco_node_utils/route_map.rb', line 2049

def set_ip_precedence(v4, v6)
  set_ipv4_precedence_set(default_set_ipv4_precedence)
  set_ipv6_precedence_set(default_set_ipv6_precedence)
  set_ipv4_precedence_set(v4)
  set_ipv6_precedence_set(v6)
end

#set_ipv4_def_next_hop_set(list, share) ⇒ Object



1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
# File 'lib/cisco_node_utils/route_map.rb', line 1882

def set_ipv4_def_next_hop_set(list, share)
  carr = set_ipv4_default_next_hop
  fail Cisco::UnsupportedError.new(
    'route_map',
    'set_ipv4_default_next_hop') if carr.nil?
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  cstr.concat('load-share')
  set_args_keys(state: 'no', nh: cstr)
  # reset the current config
  config_set('route_map', 'set_ipv4_default_next_hop', @set_args)
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  nstr.concat('load-share') if share
  return if nstr.empty?
  set_args_keys(state: '', nh: nstr)
  config_set('route_map', 'set_ipv4_default_next_hop', @set_args)
end

#set_ipv4_default_next_hopObject

set ip default next-hop 1.1.1.1 2.2.2.2 3.3.3.3



1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
# File 'lib/cisco_node_utils/route_map.rb', line 1870

def set_ipv4_default_next_hop
  str = config_get('route_map', 'set_ipv4_default_next_hop', @get_args)
  return if str.nil?
  if str.empty?
    val = default_set_ipv4_default_next_hop
  else
    val = str.split
    val.delete('load-share')
  end
  val
end

#set_ipv4_default_next_hop_load_shareObject

set ip default next-hop 1.1.1.1 2.2.2.2 3.3.3.3 load-share set ip default next-hop load-share



1911
1912
1913
1914
1915
# File 'lib/cisco_node_utils/route_map.rb', line 1911

def set_ipv4_default_next_hop_load_share
  match = config_get('route_map', 'set_ipv4_default_next_hop', @get_args)
  return if match.nil?
  match.include?('load-share')
end

#set_ipv4_next_hopObject

set ip next-hop 1.1.1.1 2.2.2.2 3.3.3.3



1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
# File 'lib/cisco_node_utils/route_map.rb', line 1922

def set_ipv4_next_hop
  arr = config_get('route_map', 'set_ipv4_next_hop', @get_args)
  val = default_set_ipv4_next_hop
  arr.each do |str|
    next if str.empty?
    next if str.include?('peer-address')
    next if str.include?('unchanged')
    next if str.include?('redist-unchanged')
    val = str.split
    val.delete('load-share')
  end
  val
end

#set_ipv4_next_hop_load_shareObject

set ip next-hop 1.1.1.1 2.2.2.2 3.3.3.3 load-share set ip next-hop load-share



1963
1964
1965
1966
1967
1968
1969
1970
1971
# File 'lib/cisco_node_utils/route_map.rb', line 1963

def set_ipv4_next_hop_load_share
  arr = config_get('route_map', 'set_ipv4_next_hop', @get_args)
  val = default_set_ipv4_next_hop_load_share
  arr.each do |str|
    next if str.empty?
    return true if str.include?('load-share')
  end
  val
end

#set_ipv4_next_hop_peer_addrObject



1977
1978
1979
# File 'lib/cisco_node_utils/route_map.rb', line 1977

def set_ipv4_next_hop_peer_addr
  config_get('route_map', 'set_ipv4_next_hop_peer_addr', @get_args)
end

#set_ipv4_next_hop_peer_addr_set(val) ⇒ Object



1981
1982
1983
1984
1985
# File 'lib/cisco_node_utils/route_map.rb', line 1981

def set_ipv4_next_hop_peer_addr_set(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_ipv4_next_hop_peer_addr', @set_args)
end

#set_ipv4_next_hop_redistObject



1991
1992
1993
# File 'lib/cisco_node_utils/route_map.rb', line 1991

def set_ipv4_next_hop_redist
  config_get('route_map', 'set_ipv4_next_hop_redist', @get_args)
end

#set_ipv4_next_hop_redist_set(val) ⇒ Object



1995
1996
1997
1998
1999
# File 'lib/cisco_node_utils/route_map.rb', line 1995

def set_ipv4_next_hop_redist_set(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_ipv4_next_hop_redist', @set_args)
end

#set_ipv4_next_hop_set(list, share = false) ⇒ Object



1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
# File 'lib/cisco_node_utils/route_map.rb', line 1936

def set_ipv4_next_hop_set(list, share=false)
  carr = set_ipv4_next_hop
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  cstr.concat('load-share') unless default_set_ipv4_next_hop_load_share.nil?
  set_args_keys(state: 'no', nh: cstr)
  # reset the current config
  config_set('route_map', 'set_ipv4_next_hop', @set_args) unless
    cstr.empty?
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  nstr.concat('load-share') if share
  return if nstr.empty?
  set_args_keys(state: '', nh: nstr)
  config_set('route_map', 'set_ipv4_next_hop', @set_args)
end

#set_ipv4_next_hop_unchangedObject



2005
2006
2007
# File 'lib/cisco_node_utils/route_map.rb', line 2005

def set_ipv4_next_hop_unchanged
  config_get('route_map', 'set_ipv4_next_hop_unchanged', @get_args)
end

#set_ipv4_next_hop_unchanged_set(val) ⇒ Object



2009
2010
2011
2012
2013
# File 'lib/cisco_node_utils/route_map.rb', line 2009

def set_ipv4_next_hop_unchanged_set(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_ipv4_next_hop_unchanged', @set_args)
end

#set_ipv4_precedenceObject



1854
1855
1856
# File 'lib/cisco_node_utils/route_map.rb', line 1854

def set_ipv4_precedence
  config_get('route_map', 'set_ipv4_precedence', @get_args)
end

#set_ipv4_precedence_set(val) ⇒ Object



1858
1859
1860
1861
1862
1863
# File 'lib/cisco_node_utils/route_map.rb', line 1858

def set_ipv4_precedence_set(val)
  state = val ? '' : 'no'
  pre = val ? val : ''
  set_args_keys(state: state, pre: pre)
  config_set('route_map', 'set_ipv4_precedence', @set_args)
end

#set_ipv4_prefixObject



1839
1840
1841
# File 'lib/cisco_node_utils/route_map.rb', line 1839

def set_ipv4_prefix
  config_get('route_map', 'set_ipv4_prefix', @get_args)
end

#set_ipv4_prefix=(val) ⇒ Object



1843
1844
1845
1846
1847
1848
# File 'lib/cisco_node_utils/route_map.rb', line 1843

def set_ipv4_prefix=(val)
  state = val ? '' : 'no'
  pf = val ? val : set_ipv4_prefix
  set_args_keys(state: state, pf: pf)
  config_set('route_map', 'set_ipv4_prefix', @set_args)
end

#set_ipv6_def_next_hop_set(list, share) ⇒ Object



2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
# File 'lib/cisco_node_utils/route_map.rb', line 2069

def set_ipv6_def_next_hop_set(list, share)
  carr = set_ipv6_default_next_hop
  fail Cisco::UnsupportedError.new(
    'route_map',
    'set_ipv6_default_next_hop') if carr.nil?
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  cstr.concat('load-share')
  set_args_keys(state: 'no', nh: cstr)
  # reset the current config
  config_set('route_map', 'set_ipv6_default_next_hop', @set_args)
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  nstr.concat('load-share') if share
  return if nstr.empty?
  set_args_keys(state: '', nh: nstr)
  config_set('route_map', 'set_ipv6_default_next_hop', @set_args)
end

#set_ipv6_default_next_hopObject

set ipv6 default next-hop 1.1.1.1 2.2.2.2 3.3.3.3



2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
# File 'lib/cisco_node_utils/route_map.rb', line 2057

def set_ipv6_default_next_hop
  str = config_get('route_map', 'set_ipv6_default_next_hop', @get_args)
  return if str.nil?
  if str.empty?
    val = default_set_ipv6_default_next_hop
  else
    val = str.split
    val.delete('load-share')
  end
  val
end

#set_ipv6_default_next_hop_load_shareObject

set ipv6 default next-hop 1.1.1.1 2.2.2.2 3.3.3.3 load-share set ipv6 default next-hop load-share



2098
2099
2100
2101
2102
# File 'lib/cisco_node_utils/route_map.rb', line 2098

def set_ipv6_default_next_hop_load_share
  match = config_get('route_map', 'set_ipv6_default_next_hop', @get_args)
  return if match.nil?
  match.include?('load-share')
end

#set_ipv6_next_hopObject

set ipv6 next-hop 1.1.1.1 2.2.2.2 3.3.3.3



2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
# File 'lib/cisco_node_utils/route_map.rb', line 2109

def set_ipv6_next_hop
  arr = config_get('route_map', 'set_ipv6_next_hop', @get_args)
  val = default_set_ipv6_next_hop
  arr.each do |str|
    next if str.empty?
    next if str.include?('peer-address')
    next if str.include?('unchanged')
    next if str.include?('redist-unchanged')
    val = str.split
    val.delete('load-share')
  end
  val
end

#set_ipv6_next_hop_load_shareObject

set ipv6 default next-hop 1.1.1.1 2.2.2.2 3.3.3.3 load-share set ipv6 default next-hop load-share



2150
2151
2152
2153
2154
2155
2156
2157
2158
# File 'lib/cisco_node_utils/route_map.rb', line 2150

def set_ipv6_next_hop_load_share
  arr = config_get('route_map', 'set_ipv6_next_hop', @get_args)
  val = default_set_ipv6_next_hop_load_share
  arr.each do |str|
    next if str.empty?
    return true if str.include?('load-share')
  end
  val
end

#set_ipv6_next_hop_peer_addrObject



2164
2165
2166
# File 'lib/cisco_node_utils/route_map.rb', line 2164

def set_ipv6_next_hop_peer_addr
  config_get('route_map', 'set_ipv6_next_hop_peer_addr', @get_args)
end

#set_ipv6_next_hop_peer_addr_set(val) ⇒ Object



2168
2169
2170
2171
2172
# File 'lib/cisco_node_utils/route_map.rb', line 2168

def set_ipv6_next_hop_peer_addr_set(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_ipv6_next_hop_peer_addr', @set_args)
end

#set_ipv6_next_hop_redistObject



2178
2179
2180
# File 'lib/cisco_node_utils/route_map.rb', line 2178

def set_ipv6_next_hop_redist
  config_get('route_map', 'set_ipv6_next_hop_redist', @get_args)
end

#set_ipv6_next_hop_redist_set(val) ⇒ Object



2182
2183
2184
2185
2186
# File 'lib/cisco_node_utils/route_map.rb', line 2182

def set_ipv6_next_hop_redist_set(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_ipv6_next_hop_redist', @set_args)
end

#set_ipv6_next_hop_set(list, share = false) ⇒ Object



2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
# File 'lib/cisco_node_utils/route_map.rb', line 2123

def set_ipv6_next_hop_set(list, share=false)
  carr = set_ipv6_next_hop
  cstr = ''
  carr.each do |elem|
    cstr = cstr.concat(elem + ' ')
  end
  cstr.concat('load-share') unless default_set_ipv6_next_hop_load_share.nil?
  set_args_keys(state: 'no', nh: cstr)
  # reset the current config
  config_set('route_map', 'set_ipv6_next_hop', @set_args) unless
    cstr.empty?
  nstr = ''
  list.each do |elem|
    nstr = nstr.concat(elem + ' ')
  end
  nstr.concat('load-share') if share
  return if nstr.empty?
  set_args_keys(state: '', nh: nstr)
  config_set('route_map', 'set_ipv6_next_hop', @set_args)
end

#set_ipv6_next_hop_unchangedObject



2192
2193
2194
# File 'lib/cisco_node_utils/route_map.rb', line 2192

def set_ipv6_next_hop_unchanged
  config_get('route_map', 'set_ipv6_next_hop_unchanged', @get_args)
end

#set_ipv6_next_hop_unchanged_set(val) ⇒ Object



2196
2197
2198
2199
2200
# File 'lib/cisco_node_utils/route_map.rb', line 2196

def set_ipv6_next_hop_unchanged_set(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_ipv6_next_hop_unchanged', @set_args)
end

#set_ipv6_precedenceObject



2034
2035
2036
# File 'lib/cisco_node_utils/route_map.rb', line 2034

def set_ipv6_precedence
  config_get('route_map', 'set_ipv6_precedence', @get_args)
end

#set_ipv6_precedence_set(val) ⇒ Object



2038
2039
2040
2041
2042
2043
# File 'lib/cisco_node_utils/route_map.rb', line 2038

def set_ipv6_precedence_set(val)
  state = val ? '' : 'no'
  pre = val ? val : ''
  set_args_keys(state: state, pre: pre)
  config_set('route_map', 'set_ipv6_precedence', @set_args)
end

#set_ipv6_prefixObject



2019
2020
2021
# File 'lib/cisco_node_utils/route_map.rb', line 2019

def set_ipv6_prefix
  config_get('route_map', 'set_ipv6_prefix', @get_args)
end

#set_ipv6_prefix=(val) ⇒ Object



2023
2024
2025
2026
2027
2028
# File 'lib/cisco_node_utils/route_map.rb', line 2023

def set_ipv6_prefix=(val)
  state = val ? '' : 'no'
  pf = val ? val : set_ipv6_prefix
  set_args_keys(state: state, pf: pf)
  config_set('route_map', 'set_ipv6_prefix', @set_args)
end

#set_levelObject



1419
1420
1421
# File 'lib/cisco_node_utils/route_map.rb', line 1419

def set_level
  config_get('route_map', 'set_level', @get_args)
end

#set_level=(val) ⇒ Object



1423
1424
1425
1426
1427
1428
# File 'lib/cisco_node_utils/route_map.rb', line 1423

def set_level=(val)
  state = val ? '' : 'no'
  level = val ? val : ''
  set_args_keys(state: state, level: level)
  config_set('route_map', 'set_level', @set_args)
end

#set_local_preferenceObject



1434
1435
1436
# File 'lib/cisco_node_utils/route_map.rb', line 1434

def set_local_preference
  config_get('route_map', 'set_local_preference', @get_args)
end

#set_local_preference=(val) ⇒ Object



1438
1439
1440
1441
1442
1443
# File 'lib/cisco_node_utils/route_map.rb', line 1438

def set_local_preference=(val)
  state = val ? '' : 'no'
  pref = val ? val : ''
  set_args_keys(state: state, pref: pref)
  config_set('route_map', 'set_local_preference', @set_args)
end

#set_metric_additiveObject



1593
1594
1595
1596
# File 'lib/cisco_node_utils/route_map.rb', line 1593

def set_metric_additive
  hash = set_metric_get
  hash[:additive]
end

#set_metric_bandwidthObject



1602
1603
1604
1605
# File 'lib/cisco_node_utils/route_map.rb', line 1602

def set_metric_bandwidth
  hash = set_metric_get
  hash[:bandwidth]
end

#set_metric_delayObject



1611
1612
1613
1614
# File 'lib/cisco_node_utils/route_map.rb', line 1611

def set_metric_delay
  hash = set_metric_get
  hash[:delay]
end

#set_metric_effective_bandwidthObject



1629
1630
1631
1632
# File 'lib/cisco_node_utils/route_map.rb', line 1629

def set_metric_effective_bandwidth
  hash = set_metric_get
  hash[:effective_bandwidth]
end

#set_metric_getObject

set metric 44 55 66 77 88 set metric +33



1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
# File 'lib/cisco_node_utils/route_map.rb', line 1556

def set_metric_get
  hash = {}
  hash[:additive] = false
  hash[:bandwidth] = false
  hash[:delay] = false
  hash[:reliability] = false
  hash[:effective_bandwidth] = false
  hash[:mtu] = false
  str = config_get('route_map', 'set_metric', @get_args)
  return hash if str.nil?
  arr = str.split
  hash[:additive] = true if arr[0].include?('+')
  hash[:bandwidth] = arr[0].delete('+').to_i
  return hash if arr.size == 1
  hash[:delay] = arr[1].to_i
  hash[:reliability] = arr[2].to_i
  hash[:effective_bandwidth] = arr[3].to_i
  hash[:mtu] = arr[4].to_i
  hash
end

#set_metric_mtuObject



1638
1639
1640
1641
# File 'lib/cisco_node_utils/route_map.rb', line 1638

def set_metric_mtu
  hash = set_metric_get
  hash[:mtu]
end

#set_metric_reliabilityObject



1620
1621
1622
1623
# File 'lib/cisco_node_utils/route_map.rb', line 1620

def set_metric_reliability
  hash = set_metric_get
  hash[:reliability]
end

#set_metric_set(plus, bndw, del, reliability, eff_bw, mtu) ⇒ Object



1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
# File 'lib/cisco_node_utils/route_map.rb', line 1577

def set_metric_set(plus, bndw, del, reliability, eff_bw, mtu)
  set_args_keys(state: 'no', additive: '', bw: '', delay: '',
                rel: '', eff: '', mtu: '')
  config_set('route_map', 'set_metric', @set_args)
  return unless bndw
  additive = plus ? '+' : ''
  bw = bndw ? bndw : ''
  delay = del ? del : ''
  rel = reliability ? reliability : ''
  eff = eff_bw ? eff_bw : ''
  lmtu = mtu ? mtu : ''
  set_args_keys(state: '', additive: additive, bw: bw, delay: delay,
                rel: rel, eff: eff, mtu: lmtu)
  config_set('route_map', 'set_metric', @set_args)
end

#set_metric_typeObject



1449
1450
1451
# File 'lib/cisco_node_utils/route_map.rb', line 1449

def set_metric_type
  config_get('route_map', 'set_metric_type', @get_args)
end

#set_metric_type=(val) ⇒ Object



1453
1454
1455
1456
1457
1458
# File 'lib/cisco_node_utils/route_map.rb', line 1453

def set_metric_type=(val)
  state = val ? '' : 'no'
  type = val ? val : ''
  set_args_keys(state: state, type: type)
  config_set('route_map', 'set_metric_type', @set_args)
end

#set_nssa_onlyObject



1464
1465
1466
# File 'lib/cisco_node_utils/route_map.rb', line 1464

def set_nssa_only
  config_get('route_map', 'set_nssa_only', @get_args)
end

#set_nssa_only=(val) ⇒ Object



1468
1469
1470
1471
1472
# File 'lib/cisco_node_utils/route_map.rb', line 1468

def set_nssa_only=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_nssa_only', @set_args)
end

#set_originObject



1478
1479
1480
# File 'lib/cisco_node_utils/route_map.rb', line 1478

def set_origin
  config_get('route_map', 'set_origin', @get_args)
end

#set_origin=(val) ⇒ Object



1482
1483
1484
1485
1486
1487
# File 'lib/cisco_node_utils/route_map.rb', line 1482

def set_origin=(val)
  state = val ? '' : 'no'
  origin = val ? val : ''
  set_args_keys(state: state, origin: origin)
  config_set('route_map', 'set_origin', @set_args)
end

#set_path_selectionObject



1493
1494
1495
# File 'lib/cisco_node_utils/route_map.rb', line 1493

def set_path_selection
  config_get('route_map', 'set_path_selection', @get_args)
end

#set_path_selection=(val) ⇒ Object



1497
1498
1499
1500
1501
# File 'lib/cisco_node_utils/route_map.rb', line 1497

def set_path_selection=(val)
  state = val ? '' : 'no'
  set_args_keys(state: state)
  config_set('route_map', 'set_path_selection', @set_args)
end

#set_tagObject



1507
1508
1509
# File 'lib/cisco_node_utils/route_map.rb', line 1507

def set_tag
  config_get('route_map', 'set_tag', @get_args)
end

#set_tag=(val) ⇒ Object



1511
1512
1513
1514
1515
1516
# File 'lib/cisco_node_utils/route_map.rb', line 1511

def set_tag=(val)
  state = val ? '' : 'no'
  tag = val ? val : ''
  set_args_keys(state: state, tag: tag)
  config_set('route_map', 'set_tag', @set_args)
end

#set_vrfObject



1522
1523
1524
1525
# File 'lib/cisco_node_utils/route_map.rb', line 1522

def set_vrf
  vrf = config_get('route_map', 'set_vrf', @get_args)
  vrf == 'default' ? 'default_vrf' : vrf
end

#set_vrf=(val) ⇒ Object



1527
1528
1529
1530
1531
1532
1533
# File 'lib/cisco_node_utils/route_map.rb', line 1527

def set_vrf=(val)
  state = val ? '' : 'no'
  vrf = val ? val : ''
  vrf = vrf == 'default_vrf' ? 'default' : vrf
  set_args_keys(state: state, vrf: vrf)
  config_set('route_map', 'set_vrf', @set_args)
end

#set_weightObject



1539
1540
1541
# File 'lib/cisco_node_utils/route_map.rb', line 1539

def set_weight
  config_get('route_map', 'set_weight', @get_args)
end

#set_weight=(val) ⇒ Object



1543
1544
1545
1546
1547
1548
# File 'lib/cisco_node_utils/route_map.rb', line 1543

def set_weight=(val)
  state = val ? '' : 'no'
  weight = val ? val : ''
  set_args_keys(state: state, weight: weight)
  config_set('route_map', 'set_weight', @set_args)
end