The status file writer will be added later on.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6- SmartGatewayEgressFilePeriod determines the period (in milliseconds) on which
the SmartGatewayEgressFile is checked for changes and processed if changed.
The default setting is 5000.
6- SmartGatewayEgressFilePeriod determines the period (in milliseconds) on which
the SmartGatewayEgressFile is checked for changes and processed if changed.
The default setting is 5000.
-7- SmartGatewayTablesOffset and SmartGatewayRulesOffset determine the ranges of
+7- SmartGatewayStatusFile declares the file that is written by olsrd to contain
+ the status of the smart gateways and is only relevant when
+ SmartGatewayUseCount is larger than 1.
+ The default setting is <not set>
+8- SmartGatewayTablesOffset and SmartGatewayRulesOffset determine the ranges of
policy routing rule markings that are used in a multi-gateway setup (see the
policy routing script for an explanation).
The default settings are 90 and 0 respectively. The value of 0 for
SmartGatewayRulesOffset will automatically align the table and rule numbers
for the server tunnel, egress interfaces and gateway tunnel interfaces.
policy routing rule markings that are used in a multi-gateway setup (see the
policy routing script for an explanation).
The default settings are 90 and 0 respectively. The value of 0 for
SmartGatewayRulesOffset will automatically align the table and rule numbers
for the server tunnel, egress interfaces and gateway tunnel interfaces.
-8- SmartGatewayAllowNAT controls whether you want to allow the selection
+9- SmartGatewayAllowNAT controls whether you want to allow the selection
of an outgoing ipv4 gateway with NAT (Network Address Translation).
The default setting is "yes".
of an outgoing ipv4 gateway with NAT (Network Address Translation).
The default setting is "yes".
-9- SmartGatewayPeriod determines the period (in milliseconds) on which
+10-SmartGatewayPeriod determines the period (in milliseconds) on which
a new smart gateway selection is performed.
The default setting is 10000 milliseconds.
a new smart gateway selection is performed.
The default setting is 10000 milliseconds.
-10-SmartGatewayStableCount determines the number of times the same new gateway
+11-SmartGatewayStableCount determines the number of times the same new gateway
must be chosen before that new smart gateway is actually selected.
The default setting is 6.
must be chosen before that new smart gateway is actually selected.
The default setting is 6.
-11-SmartGatewayThreshold (percentage) controls whether you want to allow
+12-SmartGatewayThreshold (percentage) controls whether you want to allow
re-selection of a new outgoing gateway if its routing cost is lower or equal
to the configured percentage of the routing cost of the current gateway.
The default setting is 0, which disables it.
re-selection of a new outgoing gateway if its routing cost is lower or equal
to the configured percentage of the routing cost of the current gateway.
The default setting is 0, which disables it.
-12-SmartGatewayWeightExitLinkUp, SmartGatewayWeightExitLinkDown,
+13-SmartGatewayWeightExitLinkUp, SmartGatewayWeightExitLinkDown,
SmartGatewayWeightEtx and SmartGatewayDividerEtx control the weighing
of gateway bandwidth and ETX costs.
SmartGatewayWeightEtx and SmartGatewayDividerEtx control the weighing
of gateway bandwidth and ETX costs.
# SmartGatewayEgressFilePeriod "5000"
# SmartGatewayEgressFilePeriod "5000"
+# Declares the file that is written by olsrd to contain the status of the smart
+# gateways and is only relevant when SmartGatewayUseCount is larger than 1.
+# The default setting is <not set>
+
+# SmartGatewayStatusFile <not set>
+
# Determines the routing tables offset for multi-gateway policy routing tables
# See the policy routing script for an explanation.
# (default is 90)
# Determines the routing tables offset for multi-gateway policy routing tables
# See the policy routing script for an explanation.
# (default is 90)
# SmartGatewayEgressFilePeriod "5000"
# SmartGatewayEgressFilePeriod "5000"
+# Declares the file that is written by olsrd to contain the status of the smart
+# gateways and is only relevant when SmartGatewayUseCount is larger than 1.
+# The default setting is <not set>
+
+# SmartGatewayStatusFile <not set>
+
# Determines the routing tables offset for multi-gateway policy routing tables
# See the policy routing script for an explanation.
# (default is 90)
# Determines the routing tables offset for multi-gateway policy routing tables
# See the policy routing script for an explanation.
# (default is 90)
# SmartGatewayEgressFilePeriod "5000"
# SmartGatewayEgressFilePeriod "5000"
+# Declares the file that is written by olsrd to contain the status of the smart
+# gateways and is only relevant when SmartGatewayUseCount is larger than 1.
+# The default setting is <not set>
+
+# SmartGatewayStatusFile <not set>
+
# Determines the routing tables offset for multi-gateway policy routing tables
# See the policy routing script for an explanation.
# (default is 90)
# Determines the routing tables offset for multi-gateway policy routing tables
# See the policy routing script for an explanation.
# (default is 90)
abuf_appendf(out, "%sSmartGatewayEgressFilePeriod %u\n",
cnf->smart_gw_egress_file_period == DEF_GW_EGRESS_FILE_PERIOD ? "# " : "",
cnf->smart_gw_egress_file_period);
abuf_appendf(out, "%sSmartGatewayEgressFilePeriod %u\n",
cnf->smart_gw_egress_file_period == DEF_GW_EGRESS_FILE_PERIOD ? "# " : "",
cnf->smart_gw_egress_file_period);
+ abuf_appendf(out,
+ "\n"
+ "# Declares the file that is written by olsrd to contain the status of the smart\n"
+ "# gateways and is only relevant when SmartGatewayUseCount is larger than 1.\n"
+ "# (default is %s)\n"
+ "\n", "<not set>");
+ {
+ bool def = !cnf->smart_gw_status_file || !strlen(cnf->smart_gw_status_file);
+ abuf_appendf(out, "%sSmartGatewayStatusFile %s\n",
+ def ? "# " : "", def ? "<not set>" : cnf->smart_gw_status_file);
+ }
abuf_appendf(out,
"\n"
"# Determines the routing tables offset for multi-gateway policy routing tables\n"
abuf_appendf(out,
"\n"
"# Determines the routing tables offset for multi-gateway policy routing tables\n"
cnf->smart_gw_egress_interfaces_count = 0;
cnf->smart_gw_egress_file = NULL;
cnf->smart_gw_egress_file_period = DEF_GW_EGRESS_FILE_PERIOD;
cnf->smart_gw_egress_interfaces_count = 0;
cnf->smart_gw_egress_file = NULL;
cnf->smart_gw_egress_file_period = DEF_GW_EGRESS_FILE_PERIOD;
+ cnf->smart_gw_status_file = NULL;
cnf->smart_gw_offset_tables = DEF_GW_OFFSET_TABLES;
cnf->smart_gw_offset_rules = DEF_GW_OFFSET_RULES;
cnf->smart_gw_allow_nat = DEF_GW_ALLOW_NAT;
cnf->smart_gw_offset_tables = DEF_GW_OFFSET_TABLES;
cnf->smart_gw_offset_rules = DEF_GW_OFFSET_RULES;
cnf->smart_gw_allow_nat = DEF_GW_ALLOW_NAT;
printf("SmGw. Egr Fl Per.: %u\n", cnf->smart_gw_egress_file_period);
printf("SmGw. Egr Fl Per.: %u\n", cnf->smart_gw_egress_file_period);
+ printf("SmGw. Status File: %s\n", cnf->smart_gw_status_file);
+
printf("SmGw. Offst Tabls: %u\n", cnf->smart_gw_offset_tables);
printf("SmGw. Offst Rules: %u\n", cnf->smart_gw_offset_rules);
printf("SmGw. Offst Tabls: %u\n", cnf->smart_gw_offset_tables);
printf("SmGw. Offst Rules: %u\n", cnf->smart_gw_offset_rules);
%token TOK_SMART_GW_EGRESS_IFS
%token TOK_SMART_GW_EGRESS_FILE
%token TOK_SMART_GW_EGRESS_FILE_PERIOD
%token TOK_SMART_GW_EGRESS_IFS
%token TOK_SMART_GW_EGRESS_FILE
%token TOK_SMART_GW_EGRESS_FILE_PERIOD
+%token TOK_SMART_GW_STATUS_FILE
%token TOK_SMART_GW_OFFSET_TABLES
%token TOK_SMART_GW_OFFSET_RULES
%token TOK_SMART_GW_ALLOW_NAT
%token TOK_SMART_GW_OFFSET_TABLES
%token TOK_SMART_GW_OFFSET_RULES
%token TOK_SMART_GW_ALLOW_NAT
| ssmart_gw_policyrouting_script
| ssmart_gw_egress_file
| ismart_gw_egress_file_period
| ssmart_gw_policyrouting_script
| ssmart_gw_egress_file
| ismart_gw_egress_file_period
+ | ssmart_gw_status_file
| ismart_gw_offset_tables
| ismart_gw_offset_rules
| bsmart_gw_allow_nat
| ismart_gw_offset_tables
| ismart_gw_offset_rules
| bsmart_gw_allow_nat
+ssmart_gw_status_file: TOK_SMART_GW_STATUS_FILE TOK_STRING
+{
+ PARSER_DEBUG_PRINTF("Smart gateway status file: %s\n", $2->string);
+ olsr_cnf->smart_gw_status_file = $2->string;
+ free($2);
+}
+;
+
ismart_gw_offset_tables: TOK_SMART_GW_OFFSET_TABLES TOK_INTEGER
{
PARSER_DEBUG_PRINTF("Smart gateway tables offset: %d\n", $2->integer);
ismart_gw_offset_tables: TOK_SMART_GW_OFFSET_TABLES TOK_INTEGER
{
PARSER_DEBUG_PRINTF("Smart gateway tables offset: %d\n", $2->integer);
return TOK_SMART_GW_EGRESS_FILE_PERIOD;
}
return TOK_SMART_GW_EGRESS_FILE_PERIOD;
}
+"SmartGatewayStatusFile" {
+ yylval = NULL;
+ return TOK_SMART_GW_STATUS_FILE;
+}
+
"SmartGatewayTablesOffset" {
yylval = NULL;
return TOK_SMART_GW_OFFSET_TABLES;
"SmartGatewayTablesOffset" {
yylval = NULL;
return TOK_SMART_GW_OFFSET_TABLES;
uint8_t smart_gw_egress_interfaces_count;
char *smart_gw_egress_file;
uint32_t smart_gw_egress_file_period;
uint8_t smart_gw_egress_interfaces_count;
char *smart_gw_egress_file;
uint32_t smart_gw_egress_file_period;
+ char *smart_gw_status_file;
uint32_t smart_gw_offset_tables;
uint32_t smart_gw_offset_rules;
uint32_t smart_gw_period;
uint32_t smart_gw_offset_tables;
uint32_t smart_gw_offset_rules;
uint32_t smart_gw_period;