Merge pull request #75 from rtbrick/mac-modifier

#71 mac-modifier
This commit is contained in:
Christian Giese
2022-04-19 09:09:55 +02:00
committed by GitHub
4 changed files with 14 additions and 2 deletions
+8
View File
@@ -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");
+1
View File
@@ -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 */
+1 -1
View File
@@ -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;
+4 -1
View File
@@ -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