"src MAC": info['src_mac'],
"src IPv4": info['src_ipv4'],
"Destination": info['dest'],
- "ARP Resolution": info['arp'],
+ "ARP Resolution": format_text("{0}".format(info['arp']), 'bold', 'red') if info['arp'] == 'unresolved' else info['arp'],
"PCI Address": info['pci_addr'],
"NUMA Node": info['numa'],
"--": "",
}
void
-TRexPortAttr::update_src_dst_mac(uint8_t *raw_pkt) {
- memcpy(raw_pkt, get_dest().get_dest_mac(), 6);
+TRexPortAttr::update_src_dst_mac(uint8_t *raw_pkt) const {
+ memcpy(raw_pkt, m_dest.get_dest_mac(), 6);
memcpy(raw_pkt + 6, get_src_mac(), 6);
}
* if the dest is not resolved
* it will return the default MAC
*/
- const uint8_t *get_dest_mac() {
+ const uint8_t *get_dest_mac() const {
return m_mac;
}
std::string get_rx_filter_mode() const;
/* for a raw packet, write the src/dst MACs */
- void update_src_dst_mac(uint8_t *raw_pkt);
+ void update_src_dst_mac(uint8_t *raw_pkt) const;
/* SETTERS */
virtual int set_promiscuous(bool enabled) = 0;
void set_src_ipv4(uint32_t addr) {
m_src_ipv4 = addr;
+ /* when IP source changes - consider this as link down */
+ m_dest.on_link_down();
}
/* DUMPS */