info['src_mac'] = attr.get('src_mac', 'N/A')
info['src_ipv4'] = attr.get('src_ipv4', 'N/A')
- if info['src_ipv4'] == 'none':
+ if info['src_ipv4'] is None:
info['src_ipv4'] = 'Not Configured'
# dest
info['arp'] = dest.get('arp', 'N/A')
- if info['dest'] == 'none':
+ if info['dest'] is None:
info['dest'] = 'Not Configured'
- if info['arp'] == 'none':
+ if info['arp'] is None:
info['arp'] = 'unresolved'
def get_src_addr (self):
src_mac = self.__attr['src_mac']
-
src_ipv4 = self.__attr['src_ipv4']
- if src_ipv4 == 'none':
- src_ipv4 = None
return {'mac': src_mac, 'ipv4': src_ipv4}
elif dest['type'] == 'ipv4':
dst_ipv4 = dest['addr']
dst_mac = dest['arp']
- if dst_mac == 'none':
- dst_mac = None
else:
assert(0)
return self.port.err('Ping - port does not have an IPv4 address configured')
if dst['mac'] is None:
- return self.port.err('Ping - port is not ARP resolved')
+ return self.port.err('Ping - port has an unresolved destination, cannot determine next hop MAC address')
if self.ping_ip == src['ipv4']:
return self.port.err('Ping - cannot ping own IP')
if (get_src_ipv4() != 0) {
output["src_ipv4"] = utl_uint32_to_ipv4(get_src_ipv4());
} else {
- output["src_ipv4"] = "none";
+ output["src_ipv4"] = Json::nullValue;
}