# ###################### End Create a Custom TLV ################################ # # ###################### Add TLVs to DCPv4 Client ############################## # # ###################### Add TLVs to DCPv4 Client ############################## # # ###################### Add TLVs to DCPv4 Client ############################## # dhcpv4_tlvProfile = ixNet.getList(dhcpClient, 'tlvProfile')[0] print ("Getting default TLV") dhcp_default_tlv = ixNet.getList(dhcpv4_tlvProfile, 'defaultTlv')[0] print ("Adding TLVs to the DHCP client") prototype_custom_tlv_1_name = 'Test TLV' prototype_predefined_tlv_1_name = '[12] Host Name' global_predefined_tlv_1 = ixNet.getFilteredList(global_default_template, 'tlv', '-name', prototype_predefined_tlv_1_name) global_predefined_custom_tlv_1 = ixNet.getFilteredList(new_template, 'tlv', '-name', prototype_custom_tlv_1_name) predefined_tlv_1 = ixNet.execute("copyTlv", dhcpv4_tlvProfile, global_predefined_tlv_1) ixNet.commit() custom_tlv_1 = ixNet.execute("copyTlv", dhcpv4_tlvProfile, global_predefined_custom_tlv_1) ixNet.commit() messages = ixNet.getAttribute(predefined_tlv_1, '-availableIncludeInMessages') discover = messages[0] request = messages[1] decline = messages[2] release = messages[3] # ###################### Configure TLV values ############################## # print ("Configure TLV values")
print( "*************************************************************************************************" ) print('\n\n Add Link and custom TLV in LTE \n\n') print( "*************************************************************************************************" ) print("\n 1. Creating Link TLV ") link_value = '[77] Link Type' tlv_profile = ixNet.getList(bonded_gre_lte, 'tlvProfile') print("\n TLV profile is : %s" % tlv_profile) # Get Link Type TLV from many default templates tlv_list = ixNet.getFilteredList(global_template, 'tlv', '-name', link_value)[0] ixNet.commit() name = ixNet.getAttribute(tlv_list, '-name') # Copy Link Type TLV template to tlv profile link_type_tlv = ixNet.execute("copyTlv", tlv_profile, tlv_list) ixNet.commit() print("\n 2. Creating custom TLV with Type , Length and Value") custom_tlv = '[xx] Bonded GRE Custom TLV' # Get Custom Type TLV from many default templates tlv_list = ixNet.getFilteredList(global_template, 'tlv', '-name', custom_tlv) ixNet.commit()
print(''' # ############################################################################# # Setting DSL type in DSL line Attribute.. # ############################################################################# ''') """ This part is doing following: 1. Create DSL line Attribute TLV 2. It will search for sub tlv and put the object in req_tlv variable 3. Fetch required type TLV handle which corresponds to particular index value in sub tlv value handle list 4. Enable DSL type sub tlv by enabling tlv_is_enabled parameter 5. Set value field for subtlv to 123 """ dsl = 'DSL-Line-Attributes' # Get DSL Line attribute TLV from many default templates dsl_line_attribute = ixNet.getFilteredList(global_default_template, 'tlv', '-name', dsl) ixNet.commit() print "DSL Line attribute is :%s" % dsl_line_attribute # Copy DSL Line attribute TLV template to tlv profile dsl_line_attribute_tlv = ixNet.execute("copyTlv", tlv_profile, dsl_line_attribute) ixNet.commit() print "DSL Line attribute TLV is :%s" % dsl_line_attribute_tlv parent_tlv_value = ixNet.getList(dsl_line_attribute_tlv, 'value')[0] parent_tlv_object = ixNet.getList(parent_tlv_value, 'object') # Searching for [84] Minimum-Net-Data-Rate-Downstream tlv and put the object in req_tlv variable req_tlv = "" tlv_name = "" for obj in parent_tlv_object: