mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
add option to disable access-line in DHCPv4/6
This commit is contained in:
@@ -1918,6 +1918,10 @@ json_parse_config(json_t *root)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
value = json_object_get(section, "access-line");
|
||||
if(json_is_boolean(value)) {
|
||||
g_ctx->config.dhcp_access_line = json_boolean_value(value);
|
||||
}
|
||||
}
|
||||
|
||||
/* DHCPv6 Configuration */
|
||||
@@ -1939,6 +1943,10 @@ json_parse_config(json_t *root)
|
||||
if(json_is_number(value)) {
|
||||
g_ctx->config.dhcpv6_retry = json_number_value(value);
|
||||
}
|
||||
value = json_object_get(section, "access-line");
|
||||
if(json_is_boolean(value)) {
|
||||
g_ctx->config.dhcpv6_access_line = json_boolean_value(value);
|
||||
}
|
||||
}
|
||||
|
||||
/* IGMP Configuration */
|
||||
@@ -2708,12 +2716,14 @@ bbl_config_init_defaults()
|
||||
g_ctx->config.ip6cp_conf_request_timeout = 5;
|
||||
g_ctx->config.ip6cp_conf_request_retry = 10;
|
||||
g_ctx->config.dhcp_enable = false;
|
||||
g_ctx->config.dhcp_access_line = true;
|
||||
g_ctx->config.dhcp_timeout = 5;
|
||||
g_ctx->config.dhcp_retry = 10;
|
||||
g_ctx->config.dhcp_release_interval = 1;
|
||||
g_ctx->config.dhcp_release_retry = 3;
|
||||
g_ctx->config.dhcpv6_enable = true;
|
||||
g_ctx->config.dhcpv6_rapid_commit = true;
|
||||
g_ctx->config.dhcpv6_access_line = true;
|
||||
g_ctx->config.dhcpv6_timeout = 5;
|
||||
g_ctx->config.dhcpv6_retry = 10;
|
||||
g_ctx->config.igmp_autostart = true;
|
||||
|
||||
@@ -270,6 +270,7 @@ typedef struct bbl_ctx_
|
||||
/* DHCP */
|
||||
bool dhcp_enable;
|
||||
bool dhcp_broadcast;
|
||||
bool dhcp_access_line;
|
||||
uint16_t dhcp_timeout;
|
||||
uint8_t dhcp_retry;
|
||||
uint8_t dhcp_release_interval;
|
||||
@@ -280,6 +281,7 @@ typedef struct bbl_ctx_
|
||||
/* DHCPv6 */
|
||||
bool dhcpv6_enable;
|
||||
bool dhcpv6_rapid_commit;
|
||||
bool dhcpv6_access_line;
|
||||
uint16_t dhcpv6_timeout;
|
||||
uint8_t dhcpv6_retry;
|
||||
uint8_t dhcpv6_tc;
|
||||
|
||||
@@ -446,11 +446,16 @@ bbl_tx_encode_packet_dhcpv6_request(bbl_session_s *session)
|
||||
return IGNORED;
|
||||
}
|
||||
|
||||
access_line.aci = session->agent_circuit_id;
|
||||
access_line.ari = session->agent_remote_id;
|
||||
access_line.up = session->rate_up;
|
||||
access_line.down = session->rate_down;
|
||||
access_line.dsl_type = session->dsl_type;
|
||||
if(g_ctx->config.dhcpv6_access_line &&
|
||||
(session->agent_circuit_id || session->agent_remote_id) &&
|
||||
session->dhcpv6_state != BBL_DHCP_RELEASE) {
|
||||
access_line.aci = session->agent_circuit_id;
|
||||
access_line.ari = session->agent_remote_id;
|
||||
access_line.up = session->rate_up;
|
||||
access_line.down = session->rate_down;
|
||||
access_line.dsl_type = session->dsl_type;
|
||||
dhcpv6.access_line = &access_line;
|
||||
}
|
||||
|
||||
eth.src = session->client_mac;
|
||||
eth.qinq = session->access_config->qinq;
|
||||
@@ -507,19 +512,16 @@ bbl_tx_encode_packet_dhcpv6_request(bbl_session_s *session)
|
||||
dhcpv6.server_duid_len = 0;
|
||||
dhcpv6.ia_na_option_len = 0;
|
||||
dhcpv6.ia_pd_option_len = 0;
|
||||
dhcpv6.access_line = &access_line;
|
||||
LOG(DHCP, "DHCPv6 (ID: %u) DHCPv6-Solicit send\n", session->session_id);
|
||||
break;
|
||||
case BBL_DHCP_REQUESTING:
|
||||
dhcpv6.type = DHCPV6_MESSAGE_REQUEST;
|
||||
session->stats.dhcpv6_tx_request++;
|
||||
dhcpv6.access_line = &access_line;
|
||||
LOG(DHCP, "DHCPv6 (ID: %u) DHCPv6-Request send\n", session->session_id);
|
||||
break;
|
||||
case BBL_DHCP_RENEWING:
|
||||
dhcpv6.type = DHCPV6_MESSAGE_RENEW;
|
||||
session->stats.dhcpv6_tx_renew++;
|
||||
dhcpv6.access_line = &access_line;
|
||||
LOG(DHCP, "DHCPv6 (ID: %u) DHCPv6-Renew send\n", session->session_id);
|
||||
break;
|
||||
case BBL_DHCP_RELEASE:
|
||||
@@ -1099,7 +1101,9 @@ bbl_tx_encode_packet_dhcp(bbl_session_s *session)
|
||||
}
|
||||
|
||||
/* Option 82 ... */
|
||||
if((session->agent_circuit_id || session->agent_remote_id) && session->dhcp_state != BBL_DHCP_RELEASE) {
|
||||
if(g_ctx->config.dhcp_access_line &&
|
||||
(session->agent_circuit_id || session->agent_remote_id) &&
|
||||
session->dhcp_state != BBL_DHCP_RELEASE) {
|
||||
access_line.aci = session->agent_circuit_id;
|
||||
access_line.ari = session->agent_remote_id;
|
||||
access_line.up = session->rate_up;
|
||||
|
||||
@@ -33,4 +33,7 @@
|
||||
- 0
|
||||
* - `vlan-priority`
|
||||
- VLAN PBIT for all DHCP control traffic
|
||||
- 0
|
||||
- 0
|
||||
* - `access-line`
|
||||
- Add access-line attributes like Agent-Remote/Circuit-Id
|
||||
- true
|
||||
@@ -21,4 +21,7 @@
|
||||
- 5
|
||||
* - `retry`
|
||||
- DHCPv6 retry
|
||||
- 10
|
||||
- 10
|
||||
* - `access-line`
|
||||
- Add access-line attributes like Agent-Remote/Circuit-Id
|
||||
- true
|
||||
Reference in New Issue
Block a user