proc StartStopDeviceGroupProtocolNgpf { deviceGroupList action protocol } { # Description: # Only start|stop a protocol for specific device group. # Every other protocol on the device group will not be touched. # deviceGroup = One or more device group in a list. # Handle should be provided by HLT or user must know # how to retrieve the device group handle somehow. # Handle style: /topology:1/deviceGroup:1 # action = start or stop # protocol = Only one protocol # protocol: # bgpIpv4Peer, dhcpv4relayAgent, dhcpv4server, greoipv4, igmpHost, igmpQuerier # lac, ldpBasicRouter, ldpConnectedInterface, lns, ospfv2, pimV4Interface, port # ptp, rsvpteIf, vsvpteLsps, staticMPLS, tag, vxlan set supportedProtocols "bgpIpv4Peer, dhcpv4relayAgent, dhcpv4server, greoipv4, igmpHost, igmpQuerier lac, ldpBasicRouter, ldpConnectedInterface, lns, ospfv2, pimV4Interface, port, ptp, rsvpteIf, vsvpteLsps, staticMPLS, tag, vxlan" if {$action == "start"} { set action startIGMP } if {$action == "stop"} { set action stopIGMP } set root [ixNet getRoot] foreach deviceGroup $deviceGroupList { foreach topology [ixNet getList $root topology] { foreach deviceGroupObj [ixNet getList $topology deviceGroup] { # HLT returns handles like this: /topology:1/deviceGroup:1 # But full path is like this: ::ixNet::OBJ-/topology:1/deviceGroup:1 if {[lsearch -regexp $deviceGroupObj $deviceGroup] != -1} { foreach ethernet [ixNet getList $deviceGroupObj ethernet] { foreach ipv4 [ixNet getList $ethernet ipv4] { # protocolObjDiscovered: ::ixNet::OBJ-/topology:1/deviceGroup:1/ethernet:1/ipv4:1/igmpHost:1 set protocolObjDiscovered [ixNet getList $ipv4 $protocol] if {$protocolObjDiscovered != ""} { catch {ixNet execute $action $protocolObjDiscovered} errMsg if {$errMsg != "::ixNet::OK"} { puts "\nError StartStopDeviceGroupProtocolNgpf: Failed to start NGPF $protocol on $deviceGroupObj\n" return 1 } else { puts "\nStartStopDeviceGroupProtocolNgpf Success: $action NGPF on $deviceGroupObj\n" } } else { puts "\nError StartStopDeviceGroupProtocolNgpf: $protocol is not configured on $deviceGroup. If $protocol is configured on $deviceGroup, verify correct protocol spelling:\n\n$supportedProtocols\n" } } } } } } } return 0 }