mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
@@ -1801,6 +1801,14 @@ json_parse_config(json_t *root, bbl_ctx_s *ctx) {
|
||||
if (json_is_boolean(value)) {
|
||||
ctx->pcap.include_streams = json_boolean_value(value);
|
||||
}
|
||||
value = json_object_get(section, "mac-modifier");
|
||||
if (json_is_number(value)) {
|
||||
if(json_number_value(value) < 0 || json_number_value(value) > UINT8_MAX) {
|
||||
fprintf(stderr, "Config error: Invalid value for interfaces->mac-modifier\n");
|
||||
return false;
|
||||
}
|
||||
ctx->config.mac_modifier = json_number_value(value);
|
||||
}
|
||||
|
||||
/* Network Interface Configuration Section */
|
||||
sub = json_object_get(section, "network");
|
||||
|
||||
@@ -144,6 +144,7 @@ typedef struct bbl_ctx_
|
||||
/* Config options */
|
||||
struct {
|
||||
bool interface_lock_force;
|
||||
uint8_t mac_modifier;
|
||||
|
||||
uint64_t tx_interval; /* TX interval in nsec */
|
||||
uint64_t rx_interval; /* RX interval in nsec */
|
||||
|
||||
@@ -560,7 +560,7 @@ bbl_sessions_init(bbl_ctx_s *ctx)
|
||||
/* Set client OUI to locally administered */
|
||||
session->client_mac[0] = 0x02;
|
||||
session->client_mac[1] = 0x00;
|
||||
session->client_mac[2] = 0x00;
|
||||
session->client_mac[2] = ctx->config.mac_modifier;
|
||||
/* Use session identifier for remaining bytes */
|
||||
session->client_mac[3] = i>>16;
|
||||
session->client_mac[4] = i>>8;
|
||||
|
||||
@@ -30,4 +30,7 @@
|
||||
- 32
|
||||
* - `capture-include-streams`
|
||||
- Include traffic streams in capture
|
||||
- true
|
||||
- true
|
||||
* - `mac-modifier`
|
||||
- Third byte of access session MAC address (0-255)
|
||||
- 0
|
||||
Reference in New Issue
Block a user