proc VerifyArpNgpf { {ipType ipv4} } { # This Proc requires: # 1> DeviceGroupProtocolStacksNgpf # # ipType: ipv4 or ipv6 # # This API will verify for ARP session resolvement on # every Device Group including inner Device Groups. # # How it works? # Each device group has a list of $sessionStatus: up, down or notStarted. # If the deviceGroup has sessionStatus as "up", then ARP will be verified. # It also has a list of $resolvedGatewayMac: MacAddress or removePacket[Unresolved] # These two $sessionStatus and $resolvedGatewayMac lists are aligned. # If lindex 0 on $sessionSatus is up, then $resolvedGatewayMac on index 0 expects # to have a mac address. Not removePacket[Unresolved]. # If not, then arp is not resolved. # # Return 0 if ARP passes. # Return 1 if device group is not started # Returns a list of unresolved ARPs (src ip) set startFlag 0 set unresolvedArpList {} foreach topology [ixNet getList [ixNet getRoot] topology] { foreach deviceGroup [ixNet getList $topology deviceGroup] { puts "\n$deviceGroup" set deviceGroupStatus [ixNet getAttribute $deviceGroup -status] puts "\tdeviceGroup Status: $deviceGroupStatus" if {$deviceGroupStatus == "started"} { set startFlag 1 set arpResult [DeviceGroupProtocolStacksNgpf $deviceGroup $ipType] if {$arpResult != ""} { set unresolvedArpList [concat $unresolvedArpList $arpResult] } if {[ixNet getList $deviceGroup deviceGroup] != ""} { foreach innerDeviceGroup [ixNet getList $deviceGroup deviceGroup] { puts "\n$innerDeviceGroup" set deviceGroupStatus1 [ixNet getAttribute $innerDeviceGroup -status] puts "\tInner deviceGroup Status: $deviceGroupStatus1" if {$deviceGroupStatus == "started"} { set arpResult [DeviceGroupProtocolStacksNgpf $innerDeviceGroup $ipType] if {$arpResult != ""} { set unresolvedArpList [concat $unresolvedArpList $arpResult] } } } } } elseif {[ixNet getAttribute $deviceGroup -status] == "mixed"} { set startFlag 1 puts "\tWarning: Ethernet stack is started, but layer3 is not started" set arpResult [DeviceGroupProtocolStacksNgpf $deviceGroup $ipType] if {$arpResult != ""} { set unresolvedArpList [concat $unresolvedArpList $arpResult] } if {[ixNet getList $deviceGroup deviceGroup] != ""} { foreach innerDeviceGroup [ixNet getList $deviceGroup deviceGroup] { puts "\n$innerDeviceGroup" set deviceGroupStatus2 [ixNet getAttribute $innerDeviceGroup -status] puts "\tInner deviceGroup Status: $deviceGroupStatus2" if {$deviceGroupStatus2 == "started"} { set arpResult [DeviceGroupProtocolStacksNgpf $innerDeviceGroup $ipType] if {$arpResult != ""} { set unresolvedArpList [concat $unresolvedArpList $arpResult] } } } } } else { puts "\nVerifyArpNgpf: Protocol not started successfuly on:\n\t$deviceGroup" } } } if {$unresolvedArpList == "" && $startFlag == 1} { return 0 } if {$unresolvedArpList == "" && $startFlag == 0} { return 1 } if {$unresolvedArpList != "" && $startFlag == 1} { puts \n foreach unresolvedArp $unresolvedArpList { puts "VerifyArpNgpf: UnresolvedArps: $unresolvedArp" } puts \n return $unresolvedArpList } }