mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
store RX interface changes
This commit is contained in:
@@ -17,7 +17,12 @@ bbl_rx_stream_network(bbl_network_interface_s *interface,
|
||||
if(!eth->bbl) return false;
|
||||
stream = bbl_stream_rx(eth, interface->mac);
|
||||
if(stream) {
|
||||
if(stream->rx_network_interface == NULL) {
|
||||
if(stream->rx_network_interface != interface) {
|
||||
if(stream->rx_network_interface) {
|
||||
/* RX interface has changed! */
|
||||
stream->rx_interface_changes++;
|
||||
stream->rx_interface_changed_epoch = eth->timestamp.tv_sec;
|
||||
}
|
||||
stream->rx_network_interface = interface;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -2580,6 +2580,10 @@ bbl_stream_json(bbl_stream_s *stream, bool debug)
|
||||
"rx-last-epoch", stream->rx_last_epoch
|
||||
);
|
||||
|
||||
if(stream->rx_interface_changes) {
|
||||
json_object_set(root, "rx-interface-changes", json_integer(stream->rx_interface_changes));
|
||||
json_object_set(root, "rx-interface-changed-epoch", json_integer(stream->rx_interface_changed_epoch));
|
||||
}
|
||||
if(stream->config->rx_mpls1) {
|
||||
json_object_set(root, "rx-mpls1-expected", json_integer(stream->config->rx_mpls1_label));
|
||||
}
|
||||
|
||||
@@ -193,6 +193,9 @@ typedef struct bbl_stream_
|
||||
__time_t rx_first_epoch;
|
||||
__time_t rx_last_epoch;
|
||||
|
||||
__time_t rx_interface_changed_epoch;
|
||||
uint8_t rx_interface_changes;
|
||||
|
||||
uint8_t rx_ttl; /* IPv4 or IPv6 TTL */
|
||||
uint8_t rx_priority; /* IPv4 TOS or IPv6 TC */
|
||||
uint8_t rx_outer_vlan_pbit;
|
||||
|
||||
Reference in New Issue
Block a user