Add multicast-traffic-tos support

This commit is contained in:
Christian Giese
2021-03-22 19:25:51 +01:00
parent d1551cc883
commit 44abf20e98
4 changed files with 8 additions and 0 deletions
+1
View File
@@ -453,6 +453,7 @@ Attribute | Description | Default
`view-duration` | Define the view duration in seconds | 0 (disabled)
`send-multicast-traffic` | Generate multicast traffic | false
`multicast-traffic-length` | Multicast traffic IP length | 76
`multicast-traffic-tos` | Multicast traffic TOS priority | 0
Per default join and leave requests are send using dedicated reports. The option `combined-leave-join` allows
the combination of leave and join records within a single IGMPv3 report using multiple group records.
+2
View File
@@ -143,6 +143,7 @@ bbl_add_multicast_packets (bbl_ctx_s *ctx, bbl_interface_s *interface)
ip.src = source;
ip.dst = htobe32(group);
ip.ttl = 64;
ip.tos = ctx->config.multicast_traffic_tos;
ip.protocol = PROTOCOL_IPV4_UDP;
ip.next = &udp;
udp.src = BBL_UDP_PORT;
@@ -154,6 +155,7 @@ bbl_add_multicast_packets (bbl_ctx_s *ctx, bbl_interface_s *interface)
}
bbl.type = BBL_TYPE_MULTICAST;
bbl.direction = BBL_DIRECTION_DOWN;
bbl.tos = ctx->config.multicast_traffic_tos;
bbl.mc_source = ip.src;
bbl.mc_group = ip.dst ;
if(encode_ethernet(buf, &len, &eth) != PROTOCOL_SUCCESS) {
+1
View File
@@ -538,6 +538,7 @@ typedef struct bbl_ctx_
/* Multicast Traffic */
bool send_multicast_traffic;
uint8_t multicast_traffic_tos;
uint16_t multicast_traffic_len;
/* Session Traffic */
+4
View File
@@ -543,6 +543,10 @@ json_parse_config (json_t *root, bbl_ctx_s *ctx) {
fprintf(stderr, "JSON config error: Invalid value for igmp->multicast-traffic-length (max 1500)\n");
}
}
value = json_object_get(section, "multicast-traffic-tos");
if (json_is_number(value)) {
ctx->config.multicast_traffic_tos = json_number_value(value);
}
}
/* Access Line Configuration */