mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
Add multicast-traffic-tos support
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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, ð) != PROTOCOL_SUCCESS) {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user