@@ -22,6 +22,7 @@ use config::{DeviceConfig, ExternalConfig, GenId, GwConfig, InternalConfig, Vali
2222
2323use crate :: processor:: confbuild:: internal:: build_internal_config;
2424use crate :: processor:: confbuild:: router:: generate_router_config;
25+ use flofi:: { FlofiContext , FlofiContextWriter } ;
2526use flow_filter:: { FlowFilterTable , FlowFilterTableWriter } ;
2627use nat:: masquerade:: { MasqueradeConfig , NatAllocatorWriter } ;
2728use nat:: portfw:: PortFwTableWriter ;
@@ -97,6 +98,9 @@ pub struct ConfigProcessorParams {
9798 // writer for flow filter table
9899 pub flowfilterw : FlowFilterTableWriter ,
99100
101+ // writer for flofi table
102+ pub flofi_writer : FlofiContextWriter ,
103+
100104 // writer for port forwarding table
101105 pub portfw_w : PortFwTableWriter ,
102106
@@ -527,6 +531,15 @@ fn apply_flow_filtering_config(
527531 Ok ( ( ) )
528532}
529533
534+ fn apply_flofi_config (
535+ overlay : & ValidatedOverlay ,
536+ flofi_writer : & mut FlofiContextWriter ,
537+ ) -> ConfigResult {
538+ flofi_writer. store ( FlofiContext :: try_from ( overlay) ?) ;
539+ debug ! ( "Successfully updated flofi table" ) ;
540+ Ok ( ( ) )
541+ }
542+
530543fn apply_port_forwarding_config (
531544 vpc_table : & ValidatedVpcTable ,
532545 portfw_w : & mut PortFwTableWriter ,
@@ -573,6 +586,7 @@ impl ConfigProcessor {
573586 let nattablesw = & mut self . proc_params . nattablesw ;
574587 let natallocatorw = & mut self . proc_params . natallocatorw ;
575588 let flowfilterw = & mut self . proc_params . flowfilterw ;
589+ let flofi_writer = & mut self . proc_params . flofi_writer ;
576590 let portfw_w = & mut self . proc_params . portfw_w ;
577591 let flow_table = & self . proc_params . flow_table ;
578592
@@ -623,6 +637,9 @@ impl ConfigProcessor {
623637 /* apply flow filtering config */
624638 apply_flow_filtering_config ( config. external ( ) . overlay ( ) , flowfilterw) ?;
625639
640+ /* apply flofi config */
641+ apply_flofi_config ( config. external ( ) . overlay ( ) , flofi_writer) ?;
642+
626643 /* apply port-forwarding config */
627644 apply_port_forwarding_config ( config. external ( ) . overlay ( ) . vpc_table ( ) , portfw_w) ?;
628645
0 commit comments