diff options
author | Skylar Chang <chiaweic@codeaurora.org> | 2015-10-14 20:02:01 -0700 |
---|---|---|
committer | Skylar Chang <chiaweic@codeaurora.org> | 2015-10-14 20:02:01 -0700 |
commit | ff639a2c5d56d7967592d42fdd772e6b8395d00b (patch) | |
tree | 740737cf31f2f2fa3091c59cea8c2e7cef3ecddd /ipacm/src/IPACM_Wlan.cpp | |
parent | 5cbcdf91d7817e8daef40beea174234932a7e032 (diff) | |
download | ipacfg-mgr-ff639a2c5d56d7967592d42fdd772e6b8395d00b.tar.gz |
IPACM: Routing/Filtering support for IPAv3
Add support for non-hashable/hashable routing and filtering rules.
Change-Id: I2495fc3ed7f779692071568625fdf841b2f0aeb6
Diffstat (limited to 'ipacm/src/IPACM_Wlan.cpp')
-rw-r--r-- | ipacm/src/IPACM_Wlan.cpp | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp index 530e2bf..be2b89d 100644 --- a/ipacm/src/IPACM_Wlan.cpp +++ b/ipacm/src/IPACM_Wlan.cpp @@ -1559,17 +1559,25 @@ int IPACM_Wlan::handle_uplink_filter_rule(ipacm_ext_prop *prop, ipa_ip_type ipty memset(&flt_index, 0, sizeof(flt_index)); flt_index.source_pipe_index = ioctl(fd, IPA_IOC_QUERY_EP_MAPPING, rx_prop->rx[0].src_pipe); flt_index.install_status = IPA_QMI_RESULT_SUCCESS_V01; +#ifndef FEATURE_IPA_V3 flt_index.filter_index_list_len = prop->num_ext_props; +#else /* defined (FEATURE_IPA_V3) */ + flt_index.rule_id_valid = 1; + flt_index.rule_id_len = prop->num_ext_props; +#endif flt_index.embedded_pipe_index_valid = 1; flt_index.embedded_pipe_index = ioctl(fd, IPA_IOC_QUERY_EP_MAPPING, IPA_CLIENT_APPS_LAN_WAN_PROD); flt_index.retain_header_valid = 1; flt_index.retain_header = 0; flt_index.embedded_call_mux_id_valid = 1; flt_index.embedded_call_mux_id = IPACM_Iface::ipacmcfg->GetQmapId(); - - IPACMDBG_H("flt_index: src pipe: %d, num of rules: %d, ebd pipe: %d, mux id: %d\n", flt_index.source_pipe_index, - flt_index.filter_index_list_len, flt_index.embedded_pipe_index, flt_index.embedded_call_mux_id); - +#ifndef FEATURE_IPA_V3 + IPACMDBG_H("flt_index: src pipe: %d, num of rules: %d, ebd pipe: %d, mux id: %d\n", + flt_index.source_pipe_index, flt_index.filter_index_list_len, flt_index.embedded_pipe_index, flt_index.embedded_call_mux_id); +#else /* defined (FEATURE_IPA_V3) */ + IPACMDBG_H("flt_index: src pipe: %d, num of rules: %d, ebd pipe: %d, mux id: %d\n", + flt_index.source_pipe_index, flt_index.rule_id_len, flt_index.embedded_pipe_index, flt_index.embedded_call_mux_id); +#endif len = sizeof(struct ipa_ioc_add_flt_rule) + prop->num_ext_props * sizeof(struct ipa_flt_rule_add); pFilteringTable = (struct ipa_ioc_add_flt_rule*)malloc(len); if (pFilteringTable == NULL) @@ -1588,6 +1596,10 @@ int IPACM_Wlan::handle_uplink_filter_rule(ipacm_ext_prop *prop, ipa_ip_type ipty memset(&flt_rule_entry, 0, sizeof(struct ipa_flt_rule_add)); // Zero All Fields flt_rule_entry.at_rear = 1; +#ifdef FEATURE_IPA_V3 + if (flt_rule_entry.rule.eq_attrib.ipv4_frag_eq_present) + flt_rule_entry.at_rear = 0; +#endif flt_rule_entry.flt_rule_hdl = -1; flt_rule_entry.status = -1; @@ -1639,14 +1651,20 @@ int IPACM_Wlan::handle_uplink_filter_rule(ipacm_ext_prop *prop, ipa_ip_type ipty IPACMDBG_H("xlat meta-data is modified for rule: %d has index: %d with xlat_mux_id: %d\n", cnt, index, xlat_mux_id); } - +#ifdef FEATURE_IPA_V3 + flt_rule_entry.rule.hashable = prop->prop[cnt].is_rule_hashable; + flt_rule_entry.rule.rule_id = prop->prop[cnt].rule_id; +#endif memcpy(&pFilteringTable->rules[cnt], &flt_rule_entry, sizeof(flt_rule_entry)); IPACMDBG_H("Modem UL filtering rule %d has index %d\n", cnt, index); +#ifndef FEATURE_IPA_V3 flt_index.filter_index_list[cnt].filter_index = index; - index++; - flt_index.filter_index_list[cnt].filter_handle = prop->prop[cnt].filter_hdl; +#else /* defined (FEATURE_IPA_V3) */ + flt_index.rule_id[cnt] = prop->prop[cnt].rule_id; +#endif + index++; } if(false == m_filtering.SendFilteringRuleIndex(&flt_index)) @@ -2182,7 +2200,6 @@ int IPACM_Wlan::handle_wlan_client_route_rule(uint8_t *mac_addr, ipa_ip_type ipt rt_rule_entry->rule.hdr_hdl = get_client_memptr(wlan_client, wlan_index)->hdr_hdl_v4; rt_rule_entry->rule.attrib.u.v4.dst_addr = get_client_memptr(wlan_client, wlan_index)->v4_addr; rt_rule_entry->rule.attrib.u.v4.dst_addr_mask = 0xFFFFFFFF; - if (false == m_routing.AddRoutingRule(rt_rule)) { IPACMERR("Routing rule addition failed!\n"); @@ -2222,7 +2239,6 @@ int IPACM_Wlan::handle_wlan_client_route_rule(uint8_t *mac_addr, ipa_ip_type ipt rt_rule_entry->rule.attrib.u.v6.dst_addr_mask[1] = 0xFFFFFFFF; rt_rule_entry->rule.attrib.u.v6.dst_addr_mask[2] = 0xFFFFFFFF; rt_rule_entry->rule.attrib.u.v6.dst_addr_mask[3] = 0xFFFFFFFF; - if (false == m_routing.AddRoutingRule(rt_rule)) { IPACMERR("Routing rule addition failed!\n"); @@ -2263,7 +2279,6 @@ int IPACM_Wlan::handle_wlan_client_route_rule(uint8_t *mac_addr, ipa_ip_type ipt rt_rule_entry->rule.attrib.u.v6.dst_addr_mask[1] = 0xFFFFFFFF; rt_rule_entry->rule.attrib.u.v6.dst_addr_mask[2] = 0xFFFFFFFF; rt_rule_entry->rule.attrib.u.v6.dst_addr_mask[3] = 0xFFFFFFFF; - if (false == m_routing.AddRoutingRule(rt_rule)) { IPACMERR("Routing rule addition failed!\n"); @@ -3318,7 +3333,6 @@ int IPACM_Wlan::install_dummy_flt_rule(ipa_ip_type iptype, int num_rule) flt_rule.flt_rule_hdl = -1; flt_rule.status = -1; flt_rule.rule.action = IPA_PASS_TO_EXCEPTION; - memcpy(&flt_rule.rule.attrib, &rx_prop->rx[0].attrib, sizeof(flt_rule.rule.attrib)); @@ -4499,7 +4513,6 @@ int IPACM_Wlan::eth_bridge_add_wlan_client_rt_rule(uint8_t* mac, eth_bridge_src_ position++; } } - if(false == m_routing.AddRoutingRule(rt_rule_table)) { IPACMERR("Routing rule addition failed!\n"); |