[Feature][API-1578][DATA]Added DATA packet filtering between the AP and the MODEM

    Only Configure: Yes
    Affected branch: MR3.0-Merge-v2.0-GSW
    Affected module: Data
    Is it affected on both ZXIC and MTK: only MTK
    Self-test: Yes
    Doc Update: No

Change-Id: Ie16d9fef020e1f8b58e6e14900a53c35aed87974
diff --git a/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/ril.cpp b/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/ril.cpp
index 0ef8d3e..bed4369 100755
--- a/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/ril.cpp
+++ b/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/ril.cpp
@@ -7757,6 +7757,10 @@
         // case RIL_REQUEST_PCSCF_DISCOVERY_PCO_ALT: return "RIL_REQUEST_PCSCF_DISCOVERY_PCO_ALT";
         case RIL_REQUEST_SET_MD_IMSCFG: return "RIL_REQUEST_SET_MD_IMSCFG";
         // case RIL_REQUEST_SET_IMS_EVS_ENABLE : return "RIL_REQUEST_SET_IMS_EVS_ENABLE";
+        case RIL_REQUEST_SET_IP_TUPLE_FILTER: return "RIL_REQUEST_SET_IP_TUPLE_FILTER";
+        case RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE: return "RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE";
+        case RIL_REQUEST_GET_IP_TUPLE_FILTER: return "RIL_REQUEST_GET_IP_TUPLE_FILTER";
+        case RIL_REQUEST_DEL_IP_TUPLE_FILTER: return "RIL_REQUEST_DEL_IP_TUPLE_FILTER";
         default: return mtkRequestToString(request);
     }
 }
diff --git a/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.cpp b/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.cpp
index 9054404..0fe5cdf 100755
--- a/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.cpp
+++ b/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.cpp
@@ -563,6 +563,10 @@
             RIL_REQUEST_ALLOW_DATA,  // 123
             RIL_REQUEST_SET_DATA_PROFILE, //128
             RIL_REQUEST_SYNC_DATA_SETTINGS_TO_MD, //2062
+            RIL_REQUEST_SET_IP_TUPLE_FILTER, // 2178
+            RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE, //2179
+            RIL_REQUEST_GET_IP_TUPLE_FILTER, //2180
+            RIL_REQUEST_DEL_IP_TUPLE_FILTER, //2181
     };
 
     const int urc_id_list[] = {
@@ -652,6 +656,18 @@
     case RIL_REQUEST_SYNC_DATA_SETTINGS_TO_MD:
         handleSyncDataSettingsToMdRequest(message);
         break;
+    case RIL_REQUEST_SET_IP_TUPLE_FILTER:
+        handleSetIpTupleFilter(message);
+        break;
+    case RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE:
+        handleSetIpTupleFilterMode(message);
+        break;
+    case RIL_REQUEST_GET_IP_TUPLE_FILTER:
+        handleGetIpTupleFilter(message);
+        break;
+    case RIL_REQUEST_DEL_IP_TUPLE_FILTER:
+        handleDelIpTupleFilter(message);
+        break;
 
     default:
         RFX_LOG_D(RFX_LOG_TAG, "unknown request, ignore!");
@@ -2210,3 +2226,135 @@
             rid, __FUNCTION__, BTOS(pdnsOfActive > 1), aid, cmd.string(), getPdnManager()->getTransIntfId(aid));
     return (pdnsOfActive > 1) ? true : false;
 }
+
+void RpDataController::handleSetIpTupleFilter(const sp<RfxMessage>& request)
+{
+    int count = 0;
+    int cid = -1;
+    int result = -1;
+    RFX_LOG_D(RFX_LOG_TAG, "%s:%d  slotid[%d] clientid[%d] token[%d]", __FUNCTION__ ,  __LINE__, \
+                request->getSlotId(), request->getClientId(), request->getToken());
+    Parcel *request_parcel = NULL;
+    request_parcel = request->getParcel();
+    request_parcel->readInt32(&count);
+    request_parcel->readInt32(&cid);
+    RFX_LOG_D(RFX_LOG_TAG, "count = %d,cid = %d",count,cid);
+    int IP_TYPE = MIPC_PACKET_FILTER_IP_TYPE_IP_ALL;
+    int PROTOCOL = MIPC_PACKET_FILTER_PROTOCOL_TYPE_PROTOCOL_ALL;
+    int SRC_PORT=0;
+    int DST_PORT=0;
+    int ip_dst[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+    int ip_src[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+
+    result = mipc_data_set_ip_tuple_packet_filter(slot_id_to_mipc_sim_id(request->getSlotId()),0,cid,IP_TYPE,PROTOCOL,ip_src,ip_dst,SRC_PORT,DST_PORT);
+    RFX_LOG_D(RFX_LOG_TAG,"%s,result = %d",__FUNCTION__,result);
+    if(result != 0)
+    {
+        rfx_enqueue_response_message(NULL, request->getRilToken(),(RIL_SOCKET_ID)request->getSlotId(), RIL_E_GENERIC_FAILURE);
+    }
+    else
+    {
+        Parcel * p = new Parcel();
+        p->writeInt32(1);
+        p->writeInt32(result);
+        rfx_enqueue_response_message(p,request->getRilToken(),(RIL_SOCKET_ID)request->getSlotId(),RIL_E_SUCCESS);
+    }
+    
+}
+
+
+void RpDataController::handleSetIpTupleFilterMode(const sp<RfxMessage>& request)
+{
+    int count = 0;
+    int cid = -1;
+    int result = -1;
+    int operation = -1;
+    RFX_LOG_D(RFX_LOG_TAG, "%s:%d  slotid[%d] clientid[%d] token[%d]", __FUNCTION__ ,  __LINE__, \
+                request->getSlotId(), request->getClientId(), request->getToken());
+    Parcel *request_parcel = NULL;
+    request_parcel = request->getParcel();
+    request_parcel->readInt32(&count);
+    request_parcel->readInt32(&cid);
+    request_parcel->readInt32(&operation);
+
+    RFX_LOG_D(RFX_LOG_TAG, "count = %d,cid = %d,operation = %d",count,cid,operation);
+
+    result = mipc_data_set_ip_tuple_packet_filter_mode(slot_id_to_mipc_sim_id(request->getSlotId()),0,cid,operation);
+    RFX_LOG_D(RFX_LOG_TAG,"%s,result = %d",__FUNCTION__,result);
+    
+    if(result != 0)
+    {
+        rfx_enqueue_response_message(NULL, request->getRilToken(),(RIL_SOCKET_ID)request->getSlotId(), RIL_E_GENERIC_FAILURE);
+    }
+    else
+    {
+        Parcel * p = new Parcel();
+        p->writeInt32(1);
+        p->writeInt32(result);
+        rfx_enqueue_response_message(p,request->getRilToken(),(RIL_SOCKET_ID)request->getSlotId(),RIL_E_SUCCESS);
+    }
+}
+
+void RpDataController::handleGetIpTupleFilter(const sp<RfxMessage>& request)
+{
+    RFX_LOG_D(RFX_LOG_TAG, "%s:%d  slotid[%d] clientid[%d] token[%d]", __FUNCTION__ ,  __LINE__, \
+                request->getSlotId(), request->getClientId(), request->getToken());
+    int count = 0;
+    int cid = -1;
+    int result = -1;
+    int filter_count = 0;
+    int filter_mode = 0;
+    RFX_LOG_D(RFX_LOG_TAG, "%s:%d  slotid[%d] clientid[%d] token[%d]", __FUNCTION__ ,  __LINE__, \
+                request->getSlotId(), request->getClientId(), request->getToken());
+    Parcel *request_parcel = NULL;
+    request_parcel = request->getParcel();
+    request_parcel->readInt32(&count);
+    request_parcel->readInt32(&cid);
+
+    RFX_LOG_D(RFX_LOG_TAG, "count = %d,cid = %d",count,cid);
+    result = mipc_data_get_ip_tuple_packet_filter(slot_id_to_mipc_sim_id(request->getSlotId()), 0, cid, &filter_count, &filter_mode);
+    RFX_LOG_D(RFX_LOG_TAG,"%s,result = %d",__FUNCTION__,result);
+    if(result != 0)
+    {
+        rfx_enqueue_response_message(NULL, request->getRilToken(),(RIL_SOCKET_ID)request->getSlotId(), RIL_E_GENERIC_FAILURE);
+    }
+    else
+    {
+        RFX_LOG_D(RFX_LOG_TAG,"filter_count = %d, filter_mode =%d",filter_count, filter_mode);
+        Parcel * p = new Parcel();
+        p->writeInt32(2);
+        p->writeInt32(filter_count);
+        p->writeInt32(filter_mode);
+        rfx_enqueue_response_message(p,request->getRilToken(),(RIL_SOCKET_ID)request->getSlotId(),RIL_E_SUCCESS);
+    }
+}
+
+void RpDataController::handleDelIpTupleFilter(const sp<RfxMessage>& request)
+{
+    RFX_LOG_D(RFX_LOG_TAG, "%s:%d  slotid[%d] clientid[%d] token[%d]", __FUNCTION__ ,  __LINE__, \
+                request->getSlotId(), request->getClientId(), request->getToken());
+    int count = 0;
+    int cid = -1;
+    int result = -1;
+    Parcel *request_parcel = NULL;
+    request_parcel = request->getParcel();
+    request_parcel->readInt32(&count);
+    request_parcel->readInt32(&cid);
+
+    RFX_LOG_D(RFX_LOG_TAG, "count = %d,cid = %d",count,cid);
+    result = mipc_data_del_ip_tuple_packet_filter(slot_id_to_mipc_sim_id(request->getSlotId()), 0, cid);
+    RFX_LOG_D(RFX_LOG_TAG,"%s,result = %d",__FUNCTION__,result);
+
+    if(result != 0)
+    {
+        rfx_enqueue_response_message(NULL, request->getRilToken(),(RIL_SOCKET_ID)request->getSlotId(), RIL_E_GENERIC_FAILURE);
+    }
+    else
+    {
+        Parcel * p = new Parcel();
+        p->writeInt32(1);
+        p->writeInt32(result);
+        rfx_enqueue_response_message(p,request->getRilToken(),(RIL_SOCKET_ID)request->getSlotId(),RIL_E_SUCCESS);
+    }
+    
+}
\ No newline at end of file
diff --git a/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.h b/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.h
index 7f6d2fe..489a9d6 100755
--- a/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.h
+++ b/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.h
@@ -133,6 +133,10 @@
     RIL_DataCallFailCause convertFailCauseToRilStandard(int cause);
     bool notifyDeactReasonIfNeeded(const int deactivatedAid);
     bool isFallbackPdn(const int aid);
+    void handleSetIpTupleFilter(const sp<RfxMessage>& request);
+    void handleSetIpTupleFilterMode(const sp<RfxMessage>& request);
+    void handleGetIpTupleFilter(const sp<RfxMessage>& request);
+    void handleDelIpTupleFilter(const sp<RfxMessage>& request);
 
 
 protected:
diff --git a/IC_src/mtk/telephonyware/3.0/hardware/ril/include/telephony/mtk_ril.h b/IC_src/mtk/telephonyware/3.0/hardware/ril/include/telephony/mtk_ril.h
index 4a502c3..6d86718 100644
--- a/IC_src/mtk/telephonyware/3.0/hardware/ril/include/telephony/mtk_ril.h
+++ b/IC_src/mtk/telephonyware/3.0/hardware/ril/include/telephony/mtk_ril.h
@@ -1094,6 +1094,15 @@
 */
 #define RIL_REQUEST_QUERY_SIM_RETRY_COUNT (RIL_REQUEST_VENDOR_BASE + 177)
 
+#define RIL_REQUEST_SET_IP_TUPLE_FILTER (RIL_REQUEST_VENDOR_BASE + 178)
+
+#define RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE (RIL_REQUEST_VENDOR_BASE + 179)
+
+#define RIL_REQUEST_GET_IP_TUPLE_FILTER (RIL_REQUEST_VENDOR_BASE + 180)
+
+#define RIL_REQUEST_DEL_IP_TUPLE_FILTER (RIL_REQUEST_VENDOR_BASE + 181)
+
+
 /*********************************************************************************/
 /*  Vendor local request                                                         */
 /*********************************************************************************/
diff --git a/IC_src/mtk/telephonyware/3.0/hardware/ril/include/telephony/mtk_ril_commands.h b/IC_src/mtk/telephonyware/3.0/hardware/ril/include/telephony/mtk_ril_commands.h
index 25e6fb4..2afc78b 100644
--- a/IC_src/mtk/telephonyware/3.0/hardware/ril/include/telephony/mtk_ril_commands.h
+++ b/IC_src/mtk/telephonyware/3.0/hardware/ril/include/telephony/mtk_ril_commands.h
@@ -542,4 +542,9 @@
 {RIL_REQUEST_SET_IMSCFG_LOCAL, dispatchInts, responseVoid, RIL_CMD_PROXY_1, RIL_CHANNEL_1},
 {RIL_REQUEST_QUERY_EID, dispatchVoid, responseString, RIL_CMD_PROXY_1, RIL_CHANNEL_1},
 {RIL_REQUEST_QUERY_SIM_RETRY_COUNT, dispatchVoid, responseInts, RIL_CMD_PROXY_1, RIL_CHANNEL_1},
+{RIL_REQUEST_SET_IP_TUPLE_FILTER, dispatchInts, responseInts, RIL_CMD_PROXY_5, RIL_CHANNEL_4},
+{RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE, dispatchInts, responseInts, RIL_CMD_PROXY_5, RIL_CHANNEL_4},
+{RIL_REQUEST_GET_IP_TUPLE_FILTER, dispatchInts, responseInts, RIL_CMD_PROXY_5, RIL_CHANNEL_4},
+{RIL_REQUEST_DEL_IP_TUPLE_FILTER, dispatchInts, responseInts, RIL_CMD_PROXY_5, RIL_CHANNEL_4},
+
 #endif // MTK_USE_HIDL
diff --git a/IC_src/mtk/telephonyware/3.0/hardware/ril/platformlib/libmipc/lib/include/api/mipc_data_api.h b/IC_src/mtk/telephonyware/3.0/hardware/ril/platformlib/libmipc/lib/include/api/mipc_data_api.h
index 6c3ec31..d9a633f 100644
--- a/IC_src/mtk/telephonyware/3.0/hardware/ril/platformlib/libmipc/lib/include/api/mipc_data_api.h
+++ b/IC_src/mtk/telephonyware/3.0/hardware/ril/platformlib/libmipc/lib/include/api/mipc_data_api.h
@@ -737,6 +737,75 @@
 */
 
 
+/**
+  *@brief function for set_ip_tuple_packet_filter
+  *@param[in] sim_ps_id indicate which sim or ps received the event (the value is decided by what is used when doing register operation)
+  *@param[in] global_set indicate this is for all CID or not.
+  *@param[in] cid Data call id
+  *@param[in] ip_type refer to PACKET_FLITER_IP_TYPE, 0 means IPv4, 1 means IPv6, 2 means ALL
+  *@param[in] protocol refer to PACKET_FILTER_PROTOCOL_TYPE, 0 means TCP, 1 means UDP
+  *@param[in] ip_src Source ip
+  *@param[in] ip_dst Dest ip
+  *@param[in] src_port Source port
+  *@param[in] dst_port Dest port
+*/
+
+mipc_api_result_enum mipc_data_set_ip_tuple_packet_filter(
+    mipc_sim_ps_id_enum sim_ps_id,
+    uint8_t global_set,
+    uint8_t cid,
+    uint8_t ip_type,
+    uint8_t protocol,
+    int* ip_src,
+    int* ip_dst,
+    uint16_t src_port,
+    uint16_t dst_port
+);
+
+/**
+  *@brief function for set_ip_tuple_packet_filter_mode
+  *@param[in] sim_ps_id indicate which sim or ps received the event (the value is decided by what is used when doing register operation)
+  *@param[in] global_set indicate this is for all CID or not.
+  *@param[in] cid Data call id
+  *@param[in] operation Indicate the filter to be activated or not,1 means activated, 0 means deactivated
+*/
+
+mipc_api_result_enum mipc_data_set_ip_tuple_packet_filter_mode(
+    mipc_sim_ps_id_enum sim_ps_id,
+    uint8_t global_set,
+    uint8_t cid,
+    uint8_t operation
+);
+
+/**
+  *@brief function for get_ip_tuple_packet_filter
+  *@param[in] sim_ps_id indicate which sim or ps received the event (the value is decided by what is used when doing register operation)
+  *@param[in] global_set indicate this is for all CID or not.
+  *@param[in] cid Data call id
+*/
+mipc_api_result_enum mipc_data_get_ip_tuple_packet_filter(
+    mipc_sim_ps_id_enum sim_ps_id,
+    uint8_t global_set,
+    uint8_t cid,
+    int* filter_count, 
+    int* filter_mode
+);
+
+/**
+  *@brief function for del_ip_tuple_packet_filter
+  *@param[in] sim_ps_id indicate which sim or ps received the event (the value is decided by what is used when doing register operation)
+  *@param[in] global_set indicate this is for all CID or not.
+  *@param[in] cid Data call id
+*/
+
+mipc_api_result_enum mipc_data_del_ip_tuple_packet_filter(
+    mipc_sim_ps_id_enum sim_ps_id,
+    uint8_t global_set,
+    uint8_t cid
+);
+
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/IC_src/mtk/telephonyware/3.0/hardware/ril/platformlib/libmipc/lib/src/api/mipc_data_api.c b/IC_src/mtk/telephonyware/3.0/hardware/ril/platformlib/libmipc/lib/src/api/mipc_data_api.c
index 7d56c73..faee7f4 100644
--- a/IC_src/mtk/telephonyware/3.0/hardware/ril/platformlib/libmipc/lib/src/api/mipc_data_api.c
+++ b/IC_src/mtk/telephonyware/3.0/hardware/ril/platformlib/libmipc/lib/src/api/mipc_data_api.c
@@ -1237,3 +1237,152 @@
     return mipc_data_get_retry_timer(sim_ps_id, cb, cb_priv_ptr, NULL, apnName);
 }
 
+mipc_api_result_enum mipc_data_set_ip_tuple_packet_filter(mipc_sim_ps_id_enum sim_ps_id, uint8_t global_set, uint8_t cid, uint8_t ip_type, uint8_t protocol, int* ip_src, int* ip_dst, uint16_t src_port, uint16_t dst_port)
+{
+    mtkLogD(LOG_TAG, "start set");
+    mipc_msg_t *msg_req_ptr = mipc_msg_init(MIPC_DATA_SET_IP_TUPLE_PACKET_FILTER_REQ, (mipc_msg_sim_ps_id_enum)sim_ps_id);
+    mtkLogD(LOG_TAG, "init done");
+    mipc_msg_t *msg_cnf_ptr = NULL;
+    mipc_api_result_enum ret = MIPC_API_RESULT_FAIL;
+
+    if(ip_dst == NULL || ip_src == NULL)
+    {
+        mipc_msg_deinit(msg_req_ptr);
+        return ret;
+    }
+
+    //add tlv
+    if(global_set == 1)
+    {
+        mipc_data_set_ip_tuple_packet_filter_req_add_global_set(msg_req_ptr,global_set);
+    }
+
+
+    mipc_data_set_ip_tuple_packet_filter_req_add_cid(msg_req_ptr,cid);
+
+    mipc_data_set_ip_tuple_packet_filter_req_add_ip_type(msg_req_ptr,ip_type);
+
+    mipc_data_set_ip_tuple_packet_filter_req_add_protocol(msg_req_ptr,protocol);
+
+    mipc_data_set_ip_tuple_packet_filter_req_add_ip_src(msg_req_ptr,16,ip_src);
+
+    mipc_data_set_ip_tuple_packet_filter_req_add_ip_dst(msg_req_ptr,16,ip_dst);
+
+    mipc_data_set_ip_tuple_packet_filter_req_add_src_port(msg_req_ptr,src_port);
+
+    mipc_data_set_ip_tuple_packet_filter_req_add_dst_port(msg_req_ptr,dst_port);
+    mtkLogD(LOG_TAG, "[%s]", __FUNCTION__);
+
+    msg_cnf_ptr = mipc_msg_sync_timeout(msg_req_ptr);
+    mipc_msg_deinit(msg_req_ptr);
+    if(msg_cnf_ptr == NULL)
+    {
+        ret = MIPC_API_RESULT_TIMEOUT;
+    }
+    else
+    {
+        ret = mipc_get_result(msg_cnf_ptr);
+    }
+    mipc_msg_deinit(msg_cnf_ptr);
+    return ret;
+}
+
+mipc_api_result_enum mipc_data_set_ip_tuple_packet_filter_mode(mipc_sim_ps_id_enum sim_ps_id, uint8_t global_set, uint8_t cid, uint8_t operation)
+{
+    
+    mipc_msg_t *msg_req_ptr = mipc_msg_init(MIPC_DATA_SET_IP_TUPLE_PACKET_FILTER_MODE_REQ, (mipc_msg_sim_ps_id_enum)sim_ps_id);
+    mipc_msg_t *msg_cnf_ptr = NULL;
+    mipc_api_result_enum ret = MIPC_API_RESULT_FAIL;
+
+    //add tlv
+    if(global_set == 1)
+    {
+        mipc_data_set_ip_tuple_packet_filter_mode_req_add_global_set(msg_req_ptr,global_set);
+    }
+    mipc_data_set_ip_tuple_packet_filter_mode_req_add_cid(msg_req_ptr,cid);
+    mipc_data_set_ip_tuple_packet_filter_mode_req_add_operation(msg_req_ptr,operation);
+    mtkLogD(LOG_TAG, "[%s] global_set = %d, cid = %d,operation = %d",__FUNCTION__,global_set, cid, operation);
+
+    msg_cnf_ptr = mipc_msg_sync_timeout(msg_req_ptr);
+    mipc_msg_deinit(msg_req_ptr);
+    if(msg_cnf_ptr == NULL)
+    {
+        ret = MIPC_API_RESULT_TIMEOUT;
+    }
+    else
+    {
+        ret = mipc_get_result(msg_cnf_ptr);
+    }
+    mipc_msg_deinit(msg_cnf_ptr);
+    return ret;
+}
+
+mipc_api_result_enum mipc_data_get_ip_tuple_packet_filter(mipc_sim_ps_id_enum sim_ps_id, uint8_t global_set, uint8_t cid, int* filter_count, int* filter_mode)
+{
+    mipc_msg_t *msg_req_ptr = mipc_msg_init(MIPC_DATA_GET_IP_TUPLE_PACKET_FILTER_MODE_REQ, (mipc_msg_sim_ps_id_enum)sim_ps_id);
+    mipc_msg_t *msg_cnf_ptr = NULL;
+    mipc_api_result_enum ret = MIPC_API_RESULT_FAIL;
+
+    //add tlv
+    if(global_set == 1)
+    {
+        mipc_data_get_ip_tuple_packet_filter_mode_req_add_global_set(msg_req_ptr,global_set);
+    }
+    mipc_data_get_ip_tuple_packet_filter_mode_req_add_cid(msg_req_ptr,cid);
+    mtkLogD(LOG_TAG, "[%s] global_set = %d, cid = %d",__FUNCTION__,global_set, cid);
+
+    msg_cnf_ptr = mipc_msg_sync_timeout(msg_req_ptr);
+    mipc_msg_deinit(msg_req_ptr);
+    if(msg_cnf_ptr == NULL)
+    {
+        ret = MIPC_API_RESULT_TIMEOUT;
+    }
+    else
+    {
+        ret = mipc_get_result(msg_cnf_ptr);
+        if(ret == MIPC_API_RESULT_SUCCESS)
+        {
+            int filter_count_temp = 0;
+            int filter_mode_temp = 0;
+            *filter_count = mipc_data_get_ip_tuple_packet_filter_mode_cnf_get_filter_count(msg_cnf_ptr, filter_count_temp);
+            *filter_mode = mipc_data_get_ip_tuple_packet_filter_mode_cnf_get_filter_mode(msg_cnf_ptr, filter_mode_temp);
+            mtkLogD(LOG_TAG, "[%s] filter_count = %d, filter_mode = %d",__FUNCTION__,*filter_count, *filter_mode);
+        }
+    }
+    mipc_msg_deinit(msg_cnf_ptr);
+    return ret;
+
+}
+
+mipc_api_result_enum mipc_data_del_ip_tuple_packet_filter(mipc_sim_ps_id_enum sim_ps_id, uint8_t global_set, uint8_t cid)
+{
+    mipc_msg_t *msg_req_ptr = mipc_msg_init(MIPC_DATA_DEL_IP_TUPLE_PACKET_FILTER_REQ, (mipc_msg_sim_ps_id_enum)sim_ps_id);
+    mipc_msg_t *msg_cnf_ptr = NULL;
+    mipc_api_result_enum ret = MIPC_API_RESULT_FAIL;
+
+    //add tlv
+    if(global_set == 1)
+    {
+        mipc_data_del_ip_tuple_packet_filter_req_add_global_set(msg_req_ptr,global_set);
+    }
+    mipc_data_del_ip_tuple_packet_filter_req_add_cid(msg_req_ptr,cid);
+    mtkLogD(LOG_TAG, "[%s] global_set = %d, cid = %d",__FUNCTION__,global_set, cid);
+
+    msg_cnf_ptr = mipc_msg_sync_timeout(msg_req_ptr);
+    mipc_msg_deinit(msg_req_ptr);
+    if(msg_cnf_ptr == NULL)
+    {
+        ret = MIPC_API_RESULT_TIMEOUT;
+    }
+    else
+    {
+        ret = mipc_get_result(msg_cnf_ptr);
+    }
+    mipc_msg_deinit(msg_cnf_ptr);
+    return ret;
+
+}
+
+
+
+
diff --git a/IC_src/mtk/telephonyware/3.0/libvendor-ril/include/telephony/mtk_ril_sp.h b/IC_src/mtk/telephonyware/3.0/libvendor-ril/include/telephony/mtk_ril_sp.h
index 1ba5f89..c2ddb3e 100644
--- a/IC_src/mtk/telephonyware/3.0/libvendor-ril/include/telephony/mtk_ril_sp.h
+++ b/IC_src/mtk/telephonyware/3.0/libvendor-ril/include/telephony/mtk_ril_sp.h
@@ -1441,6 +1441,14 @@
 */
 #define RIL_REQUEST_RESET_APN (RIL_REQUEST_VENDOR_BASE + 194)
 
+#define RIL_REQUEST_SET_IP_TUPLE_FILTER (RIL_REQUEST_VENDOR_BASE + 195)
+
+#define RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE (RIL_REQUEST_VENDOR_BASE + 196)
+
+#define RIL_REQUEST_GET_IP_TUPLE_FILTER (RIL_REQUEST_VENDOR_BASE + 197)
+
+#define RIL_REQUEST_DEL_IP_TUPLE_FILTER (RIL_REQUEST_VENDOR_BASE + 198)
+
 
 #define RIL_LOCAL_GSM_REQUEST_VENDOR_BASE 2500
 
diff --git a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/data_to_parcel_mtk_ril_commands.h b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/data_to_parcel_mtk_ril_commands.h
index 721cf86..42fcc37 100644
--- a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/data_to_parcel_mtk_ril_commands.h
+++ b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/data_to_parcel_mtk_ril_commands.h
@@ -272,4 +272,8 @@
 {RIL_REQUEST_QUERY_EID , voidToParcel, parcelToString, COMMAND_SUPPORETD(1)},
 {RIL_REQUEST_QUERY_SIM_RETRY_COUNT, voidToParcel, parcelToInts, COMMAND_SUPPORETD(1)},
 {RIL_REQUEST_MODIFY_APN, voidToParcel, parcelToString, COMMAND_SUPPORETD(0)},
-{RIL_REQUEST_RESET_APN, voidToParcel, parcelToString, COMMAND_SUPPORETD(0)},
\ No newline at end of file
+{RIL_REQUEST_RESET_APN, voidToParcel, parcelToString, COMMAND_SUPPORETD(0)},
+{RIL_REQUEST_SET_IP_TUPLE_FILTER,intsToParcel, parcelToVoid,COMMAND_SUPPORETD(1)},
+{RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE,intsToParcel, parcelToVoid,COMMAND_SUPPORETD(1)},
+{RIL_REQUEST_GET_IP_TUPLE_FILTER,intsToParcel, parcelToInts,COMMAND_SUPPORETD(1)},
+{RIL_REQUEST_DEL_IP_TUPLE_FILTER,intsToParcel, parcelToVoid,COMMAND_SUPPORETD(1)},
\ No newline at end of file
diff --git a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/framework/base/RfxParcelTransfer.cpp b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/framework/base/RfxParcelTransfer.cpp
index 07e52c7..46261b9 100644
--- a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/framework/base/RfxParcelTransfer.cpp
+++ b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/framework/base/RfxParcelTransfer.cpp
@@ -153,6 +153,15 @@
         return (RIL_REQUEST_VENDOR_BASE + 176);
     case RIL_REQUEST_QUERY_SIM_RETRY_COUNT:
         return (RIL_REQUEST_VENDOR_BASE + 177);
+    case RIL_REQUEST_SET_IP_TUPLE_FILTER:
+        return (RIL_REQUEST_VENDOR_BASE + 178);
+    case RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE:
+        return (RIL_REQUEST_VENDOR_BASE + 179);
+    case RIL_REQUEST_GET_IP_TUPLE_FILTER:
+        return (RIL_REQUEST_VENDOR_BASE + 180);
+    case RIL_REQUEST_DEL_IP_TUPLE_FILTER:
+        return (RIL_REQUEST_VENDOR_BASE + 181);
+        
     default:
         return requset;
     }
diff --git a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/parcel_transfer_mtk_ril_commands.h b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/parcel_transfer_mtk_ril_commands.h
index 5192b40..fc6b86d 100644
--- a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/parcel_transfer_mtk_ril_commands.h
+++ b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/parcel_transfer_mtk_ril_commands.h
@@ -265,3 +265,9 @@
 {RIL_REQUEST_GSM_SET_BROADCAST_LANGUAGE, tranferRequestRaw, tranferResponseRaw},
 {RIL_REQUEST_QUERY_EID, tranferRequestRaw, tranferResponseRaw},
 {RIL_REQUEST_QUERY_SIM_RETRY_COUNT, tranferRequestRaw, tranferResponseRaw},
+{RIL_REQUEST_MODIFY_APN, tranferRequestRaw, tranferResponseRaw},
+{RIL_REQUEST_RESET_APN, tranferRequestRaw, tranferResponseRaw},
+{RIL_REQUEST_SET_IP_TUPLE_FILTER, tranferRequestRaw, tranferResponseRaw},
+{RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE, tranferRequestRaw, tranferResponseRaw},
+{RIL_REQUEST_GET_IP_TUPLE_FILTER, tranferRequestRaw, tranferResponseRaw},
+{RIL_REQUEST_DEL_IP_TUPLE_FILTER, tranferRequestRaw, tranferResponseRaw},
\ No newline at end of file
diff --git a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/RpDataController.cpp b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/RpDataController.cpp
index f6d260e..7d51994 100755
--- a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/RpDataController.cpp
+++ b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/RpDataController.cpp
@@ -93,7 +93,10 @@
             RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE, // 56
             RIL_REQUEST_DATA_CALL_LIST,  // 57
             RIL_REQUEST_ALLOW_DATA,  // 123
-
+            RIL_REQUEST_SET_IP_TUPLE_FILTER, //2195
+            RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE, //2196
+            RIL_REQUEST_GET_IP_TUPLE_FILTER, //2197
+            RIL_REQUEST_DEL_IP_TUPLE_FILTER, //2198
             };
 
     const int urc_id_list[] = {
@@ -151,6 +154,17 @@
     case RIL_REQUEST_ALLOW_DATA:
         handleSetDataAllowRequest(message);
         break;
+    case RIL_REQUEST_SET_IP_TUPLE_FILTER:
+        handleSetIpTupleFilterRequest(message);
+        break;
+    case RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE:
+        handleSetIpTupleFilterModeRequest(message);
+        break;
+    case RIL_REQUEST_GET_IP_TUPLE_FILTER:
+        handleGetIpTupleFilterRequest(message);
+        break;
+    case RIL_REQUEST_DEL_IP_TUPLE_FILTER:
+        handleDelIpTupleFilterRequest(message);
     default:
         logD(RFX_LOG_TAG, "unknown request, ignore!");
         break;
@@ -177,6 +191,17 @@
     case RIL_REQUEST_ALLOW_DATA:
         handleSetDataAllowResponse(message);
         break;
+    case RIL_REQUEST_SET_IP_TUPLE_FILTER:
+        handleSetIpTupleFilterResponse(message);
+        break;
+    case RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE:
+        handleSetIpTupleFilterResponse(message);
+        break;
+    case RIL_REQUEST_GET_IP_TUPLE_FILTER:
+        handleGetIpTupleFilterResponse(message);
+        break;
+    case RIL_REQUEST_DEL_IP_TUPLE_FILTER:
+        handleDelIpTupleFilterResponse(message);
     default:
         logD(RFX_LOG_TAG, "unknown response, ignore!");
         break;
@@ -271,6 +296,72 @@
     }
 }
 
+void RpDataController::handleSetIpTupleFilterRequest(const sp<RfxMessage>& request)
+{
+    logD(RFX_LOG_TAG, "handleSetIpTupleFilterRequest with clientId: %d, with token: %d",
+            request->getClientId(), request->getToken());
+
+    RpDataController::sendToGsm(request);
+
+}
+
+
+void RpDataController::handleSetIpTupleFilterResponse(const sp<RfxMessage>& response)
+{
+    logD(RFX_LOG_TAG, "handleSetIpTupleFilterResponse with clientId: %d, with token: %d",
+            response->getClientId(), response->getToken());
+    responseToRilj(response);
+    
+}
+
+
+void RpDataController::handleSetIpTupleFilterModeRequest(const sp<RfxMessage>& request)
+{
+    logD(RFX_LOG_TAG, "handleSetIpTupleFilterModeRequest with clientId: %d, with token: %d",
+            request->getClientId(), request->getToken());
+    RpDataController::sendToGsm(request);
+
+}
+
+void RpDataController::handleSetIpTupleFilterModeResponse(const sp<RfxMessage>& response)
+{
+    logD(RFX_LOG_TAG, "handleSetIpTupleFilterModeResponse with clientId: %d, with token: %d",
+            response->getClientId(), response->getToken());
+    responseToRilj(response);
+
+}
+
+
+void RpDataController::handleGetIpTupleFilterRequest(const sp<RfxMessage>& request)
+{
+    logD(RFX_LOG_TAG, "handleGetIpTupleFilterRequest with clientId: %d, with token: %d",
+            request->getClientId(), request->getToken());
+    RpDataController::sendToGsm(request);
+}
+
+void RpDataController::handleGetIpTupleFilterResponse(const sp<RfxMessage>& response)
+{
+    logD(RFX_LOG_TAG, "handleGetIpTupleFilterResponse with clientId: %d, with token: %d",
+            response->getClientId(), response->getToken());
+    responseToRilj(response);
+}
+
+
+void RpDataController::handleDelIpTupleFilterRequest(const sp<RfxMessage>& request)
+{
+    logD(RFX_LOG_TAG, "handleDelIpTupleFilterRequest with clientId: %d, with token: %d",
+            request->getClientId(), request->getToken());
+    RpDataController::sendToGsm(request);
+}
+
+void RpDataController::handleDelIpTupleFilterResponse(const sp<RfxMessage>& response)
+{
+    logD(RFX_LOG_TAG, "handleDelIpTupleFilterResponse with clientId: %d, with token: %d",
+                response->getClientId(), response->getToken());
+    responseToRilj(response);
+}
+
+
 void RpDataController::handleDataCallListChangeUrc(const sp<RfxMessage>& message) {
     RpDataController::mDcTracker.onDataCallListChanged(message);
 
diff --git a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/RpDataController.h b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/RpDataController.h
index fb8075a..61a5447 100755
--- a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/RpDataController.h
+++ b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/RpDataController.h
@@ -100,6 +100,20 @@
     virtual void handleSetDataAllowRequest(const sp<RfxMessage>& request);
     virtual void handleSetDataAllowResponse(const sp<RfxMessage>& response);
 
+    virtual void handleSetIpTupleFilterRequest(const sp<RfxMessage> & request);
+    virtual void handleSetIpTupleFilterResponse(const sp<RfxMessage>& response);
+
+    virtual void handleSetIpTupleFilterModeRequest(const sp<RfxMessage> & request);
+    virtual void handleSetIpTupleFilterModeResponse(const sp<RfxMessage>& response);
+
+    virtual void handleGetIpTupleFilterRequest(const sp<RfxMessage> & request);
+    virtual void handleGetIpTupleFilterResponse(const sp<RfxMessage>& response);
+    
+    virtual void handleDelIpTupleFilterRequest(const sp<RfxMessage> & request);
+    virtual void handleDelIpTupleFilterResponse(const sp<RfxMessage>& response);
+    
+    
+
     virtual void onRadioStateChanged(RfxStatusKeyEnum key, RfxVariant old_value, RfxVariant value);
     virtual void onServiceStateChanged(RfxStatusKeyEnum key, RfxVariant old_value, RfxVariant value);
     virtual void onCallStateChanged(RfxStatusKeyEnum key, RfxVariant old_value, RfxVariant value);
diff --git a/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_custom/mipc.release.tar.gz b/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_custom/mipc.release.tar.gz
index a20cb06..caf7e60 100644
--- a/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_custom/mipc.release.tar.gz
+++ b/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_custom/mipc.release.tar.gz
Binary files differ
diff --git a/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_wide_temp_b30rx_custom/mipc.release.tar.gz b/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_wide_temp_b30rx_custom/mipc.release.tar.gz
index f4ab1e7..caf7e60 100644
--- a/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_wide_temp_b30rx_custom/mipc.release.tar.gz
+++ b/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_wide_temp_b30rx_custom/mipc.release.tar.gz
Binary files differ
diff --git a/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_wide_temp_custom/mipc.release.tar.gz b/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_wide_temp_custom/mipc.release.tar.gz
old mode 100755
new mode 100644
index f4ab1e7..caf7e60
--- a/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_wide_temp_custom/mipc.release.tar.gz
+++ b/IC_src/mtk/telephonyware/3.0/mipc/mt2735_ivt_nlwg_wide_temp_custom/mipc.release.tar.gz
Binary files differ
diff --git a/IC_src/mtk/telephonyware/3.0/mipc/mt6890_evb_nlwg_custom/mipc.release.tar.gz b/IC_src/mtk/telephonyware/3.0/mipc/mt6890_evb_nlwg_custom/mipc.release.tar.gz
index 0680522..caf7e60 100644
--- a/IC_src/mtk/telephonyware/3.0/mipc/mt6890_evb_nlwg_custom/mipc.release.tar.gz
+++ b/IC_src/mtk/telephonyware/3.0/mipc/mt6890_evb_nlwg_custom/mipc.release.tar.gz
Binary files differ
diff --git a/common_src/framework/lynq-ril-service/src/commands.h b/common_src/framework/lynq-ril-service/src/commands.h
index 115e16d..8a5f736 100755
--- a/common_src/framework/lynq-ril-service/src/commands.h
+++ b/common_src/framework/lynq-ril-service/src/commands.h
@@ -57,6 +57,11 @@
     {"RIL_REQUEST_SYNC_DATA_SETTINGS_TO_MD",syncDataSettingsToMd, "sync data settings to modem", RIL_REQUEST_SYNC_DATA_SETTINGS_TO_MD},
     {"RIL_REQUEST_MODIFY_APN",modifyApnRecord, "modify apn db", RIL_REQUEST_MODIFY_APN},
     {"RIL_REQUEST_RESET_APN",resetApnRecord, "reset apn db", RIL_REQUEST_RESET_APN},
+    {"RIL_REQUEST_SET_IP_TUPLE_FILTER",setIpFilter,"set ip filter", RIL_REQUEST_SET_IP_TUPLE_FILTER},
+    {"RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE",setIpFilterMode,"set ip filter mode",RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE},
+    {"RIL_REQUEST_GET_IP_TUPLE_FILTER",getIpFilter,"get ip filter",RIL_REQUEST_GET_IP_TUPLE_FILTER},
+    {"RIL_REQUEST_DEL_IP_TUPLE_FILTER",delIpFilter,"delete ip filter",RIL_REQUEST_DEL_IP_TUPLE_FILTER},
+    
 //CC
     {"RIL_REQUEST_DIAL",dial,"dial",RIL_REQUEST_DIAL},
     {"RIL_REQUEST_HANGUP",hangupConnection,"hangup",RIL_REQUEST_HANGUP},
diff --git a/common_src/framework/lynq-ril-service/src/data/data.cpp b/common_src/framework/lynq-ril-service/src/data/data.cpp
index 678568d..23103a1 100755
--- a/common_src/framework/lynq-ril-service/src/data/data.cpp
+++ b/common_src/framework/lynq-ril-service/src/data/data.cpp
@@ -1698,3 +1698,77 @@
     resetApnDB();
     return 0;
 }
+
+int setIpFilter(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI)
+{
+    RLOGD("%s,argc = %d,argv = %d", __FUNCTION__,argc,atoi(argv[1]));
+    if (argc < 2){
+        RLOGD("%s parameters  number isn't enough", __FUNCTION__);
+        return -1;
+    }
+    int cid = atoi(argv[1]);
+    android::Parcel p;
+    size_t pos = p.dataPosition();
+    p.writeInt32(1);
+    p.writeInt32(cid);
+    p.setDataPosition(pos);
+    pRI->pCI->dispatchFunction(p, pRI);
+    RLOGD("dispatchFunction done");
+    return 0;
+}
+
+int setIpFilterMode(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI)
+{
+    RLOGD("%s,argc = %d,argv = %d", __FUNCTION__,argc,atoi(argv[1]));
+    if (argc < 3){
+        RLOGD("%s parameters  number isn't enough", __FUNCTION__);
+        return -1;
+    }
+    int cid = atoi(argv[1]);
+    int operation = atoi(argv[2]);
+    android::Parcel p;
+    size_t pos = p.dataPosition();
+    p.writeInt32(2);
+    p.writeInt32(cid);
+    p.writeInt32(operation);
+    p.setDataPosition(pos);
+    pRI->pCI->dispatchFunction(p, pRI);
+    RLOGD("dispatchFunction done");
+    return 0;
+}
+
+int getIpFilter(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI)
+{
+    if (argc < 2){
+        RLOGD("%s parameters  number isn't enough", __FUNCTION__);
+        return -1;
+    }
+    RLOGD("%s,argc = %d,argv = %d", __FUNCTION__,argc,atoi(argv[1]));
+    int cid = atoi(argv[1]);
+    android::Parcel p;
+    size_t pos = p.dataPosition();
+    p.writeInt32(1);
+    p.writeInt32(cid);
+    p.setDataPosition(pos);
+    pRI->pCI->dispatchFunction(p, pRI);
+    RLOGD("dispatchFunction done");
+    return 0;
+}
+
+int delIpFilter(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI)
+{
+    if (argc < 2){
+        RLOGD("%s parameters  number isn't enough", __FUNCTION__);
+        return -1;
+    }
+    RLOGD("%s,argc = %d,argv = %d", __FUNCTION__,argc,atoi(argv[1]));
+    int cid = atoi(argv[1]);
+    android::Parcel p;
+    size_t pos = p.dataPosition();
+    p.writeInt32(1);
+    p.writeInt32(cid);
+    p.setDataPosition(pos);
+    pRI->pCI->dispatchFunction(p, pRI);
+    RLOGD("dispatchFunction done");
+    return 0;
+}
diff --git a/common_src/framework/lynq-ril-service/src/data/data.h b/common_src/framework/lynq-ril-service/src/data/data.h
index 657f8be..e526661 100755
--- a/common_src/framework/lynq-ril-service/src/data/data.h
+++ b/common_src/framework/lynq-ril-service/src/data/data.h
@@ -56,4 +56,12 @@
 int syncDataSettings(RIL_SOCKET_ID socket_id);
 int modifyApnRecord(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
 int resetApnRecord(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
+int setIpFilter(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
+int setIpFilterMode(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
+int getIpFilter(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
+int delIpFilter(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
+
+
+
+
 #endif
diff --git a/common_src/framework/lynq-ril-service/src/mtk_ril_commands.h b/common_src/framework/lynq-ril-service/src/mtk_ril_commands.h
index 4b10fce..50cb474 100755
--- a/common_src/framework/lynq-ril-service/src/mtk_ril_commands.h
+++ b/common_src/framework/lynq-ril-service/src/mtk_ril_commands.h
@@ -97,3 +97,7 @@
 {RIL_REQUEST_GSM_SET_BROADCAST_LANGUAGE, dispatchString, responseVoid },
 {RIL_REQUEST_QUERY_SIM_RETRY_COUNT, dispatchVoid, responseInts },
 {RIL_REQUEST_QUERY_EID, dispatchVoid, responseString },
+{RIL_REQUEST_SET_IP_TUPLE_FILTER, dispatchInts, responseVoid},
+{RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE, dispatchInts, responseVoid},
+{RIL_REQUEST_GET_IP_TUPLE_FILTER, dispatchInts, responseVoid},
+{RIL_REQUEST_DEL_IP_TUPLE_FILTER, dispatchInts, responseVoid},
\ No newline at end of file
diff --git a/common_src/framework/lynq-ril-service/src/ril.cpp b/common_src/framework/lynq-ril-service/src/ril.cpp
index 9ae636a..9b5fcc7 100755
--- a/common_src/framework/lynq-ril-service/src/ril.cpp
+++ b/common_src/framework/lynq-ril-service/src/ril.cpp
@@ -4441,6 +4441,17 @@
                     lynq_send_result_already();
                     break;
                 }
+                case RIL_REQUEST_GET_IP_TUPLE_FILTER:
+                {
+                    int numInts = responselen / sizeof(int);
+                    if(numInts > 0) {
+                       int *p_int = (int *) response;
+                       p.writeInt32(p_int[0]);
+                       p.writeInt32(p_int[1]);
+                   } else {
+                       RLOGD("RIL_REQUEST_GET_IP_TUPLE_FILTER response numInts: %d", numInts);
+                   }
+                }
                default:
                    break;
                }
@@ -5308,6 +5319,10 @@
         case LYNQ_REQUEST_GET_RTP_PARAM:return "LYNQ_REQUEST_GET_RTP_PARAM";
         case LYNQ_REQUEST_SET_CALL_RTP_SSRC:return "LYNQ_REQUEST_SET_CALL_RTP_SSRC";
         case LYNQ_REQUEST_GET_CALL_RTP_SSRC:return "LYNQ_REQUEST_GET_CALL_RTP_SSRC";
+        case RIL_REQUEST_SET_IP_TUPLE_FILTER:return "RIL_REQUEST_SET_IP_TUPLE_FILTER";
+        case RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE:return "RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE";
+        case RIL_REQUEST_GET_IP_TUPLE_FILTER:return "RIL_REQUEST_GET_IP_TUPLE_FILTER";
+        case RIL_REQUEST_DEL_IP_TUPLE_FILTER:return "RIL_REQUEST_DEL_IP_TUPLE_FILTER";
         /*warren add for t800 ril service 2022/1/22 end*/
         default: return "<unknown request>";
     }
@@ -5590,6 +5605,10 @@
         case LYNQ_REQUEST_GET_RTP_PARAM:return "LYNQ_REQUEST_GET_RTP_PARAM";
         case LYNQ_REQUEST_SET_CALL_RTP_SSRC:return "LYNQ_REQUEST_SET_CALL_RTP_SSRC";
         case LYNQ_REQUEST_GET_CALL_RTP_SSRC:return "LYNQ_REQUEST_GET_CALL_RTP_SSRC";
+        case RIL_REQUEST_SET_IP_TUPLE_FILTER:return "RIL_REQUEST_SET_IP_TUPLE_FILTER";
+        case RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE:return "RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE";
+        case RIL_REQUEST_GET_IP_TUPLE_FILTER:return "RIL_REQUEST_GET_IP_TUPLE_FILTER";
+        case RIL_REQUEST_DEL_IP_TUPLE_FILTER:return "RIL_REQUEST_DEL_IP_TUPLE_FILTER";
         /*warren add for t800 ril service 2022/1/22 end*/
         default: return "<unknown request>";
     }
diff --git a/common_src/framework/lynq-ril-service/src/ril_commands.h b/common_src/framework/lynq-ril-service/src/ril_commands.h
index d90c8ba..3d381f3 100755
--- a/common_src/framework/lynq-ril-service/src/ril_commands.h
+++ b/common_src/framework/lynq-ril-service/src/ril_commands.h
@@ -154,3 +154,7 @@
     {RIL_REQUEST_STOP_LCE, dispatchVoid, responseLceStatus},
     {RIL_REQUEST_PULL_LCEDATA, dispatchVoid, responseLceData},
     {RIL_REQUEST_GET_ACTIVITY_INFO, dispatchVoid, responseActivityData},
+    {RIL_REQUEST_SET_IP_TUPLE_FILTER, dispatchInts, responseInts},
+    {RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE, dispatchInts, responseInts},
+    {RIL_REQUEST_GET_IP_TUPLE_FILTER, dispatchInts, responseInts},
+    {RIL_REQUEST_DEL_IP_TUPLE_FILTER, dispatchInts, responseInts},
diff --git a/common_src/lib/liblynq-data/include/libdata/lynq_data.h b/common_src/lib/liblynq-data/include/libdata/lynq_data.h
index fe1a7d1..983cae5 100755
--- a/common_src/lib/liblynq-data/include/libdata/lynq_data.h
+++ b/common_src/lib/liblynq-data/include/libdata/lynq_data.h
@@ -72,6 +72,10 @@
 void decode_data_log(char str[], int n);
 //xy.he@20240516 add for encode infomation end
 
+int lynq_set_ip_filter(int cid);
+int lynq_set_ip_filter_mode(int cid,int operation);
+int lynq_get_ip_filter(int cid,int *filter_count, int *filter_mode);
+int lynq_del_ip_filter(int cid);
 #ifdef __cplusplus
 }
 #endif
diff --git a/common_src/lib/liblynq-data/lynq_data.cpp b/common_src/lib/liblynq-data/lynq_data.cpp
index d04533a..2a14545 100755
--- a/common_src/lib/liblynq-data/lynq_data.cpp
+++ b/common_src/lib/liblynq-data/lynq_data.cpp
@@ -2183,4 +2183,199 @@
 
     RLOGD("decode_data_log: %s", str);
 }
-//xy.he@20240524 modify for T8TSK-338 end
\ No newline at end of file
+//xy.he@20240524 modify for T8TSK-338 end
+
+
+int lynq_set_ip_filter(int cid)
+{
+    Parcel *p =NULL;
+    lynq_client_t client;
+    int resp_type = -1;
+    int token;
+    int request = -1;
+    int slot_id = -1;
+    int error = -1;
+    int version =0;
+    int num = 0;
+
+    client.uToken = get_utoken();
+    client.request = LYNQ_SET_IP_TUPLE_FILTER;//RIL_REQUEST_SET_IP_TUPLE_FILTER 2195
+    client.paramLen = 1;
+    bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
+    sprintf(client.param,"%d",(cid / 100));
+    LYINFLOG("uToken=%d,request=%d,paralen=%d,param=%s",client.uToken,client.request,client.paramLen,client.param);
+    pthread_mutex_lock(&g_lynq_data_sendto_mutex);
+    if(send_request(lynq_client_sockfd,&client)==-1)
+    {
+        LYERRLOG("send request fail");
+        perror("[LYNQ_DATA] send request fail:");
+        pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+        return -1;
+    }
+    //get_response(lynq_client_sockfd,p);
+    error = wait_response(lynq_client_sockfd,p,client.uToken);
+    if(error!=0)
+    {
+        LYERRLOG("wait_response fail,ret:%d",error);
+        pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+        return error;
+    }
+    pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+    if(JumpHeader(p,&resp_type,&client.uToken,&request,&slot_id,&error)!=0)
+    {
+        LYERRLOG("JumpHeader fail");
+        return -1;
+    }
+    LYINFLOG("resp_type=%d,uToken=%d,request=%d,slot_id=%d,error_code=%d",resp_type,client.uToken,request,slot_id,error);
+    free_parcel(p);
+    return error;
+}
+
+int lynq_set_ip_filter_mode(int cid,int operation)
+{
+    Parcel *p =NULL;
+    lynq_client_t client;
+    int resp_type = -1;
+    int token;
+    int request = -1;
+    int slot_id = -1;
+    int error = -1;
+    int version =0;
+    int num = 0;
+
+    client.uToken = get_utoken();
+    client.request = LYNQ_SET_IP_TUPLE_FILTER_MODE;//RIL_REQUEST_SET_IP_TUPLE_FILTER_MODE 2196
+    client.paramLen = 2;
+    bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
+    sprintf(client.param,"%d %d",(cid / 100),operation);
+    
+    LYINFLOG("uToken=%d,request=%d,paralen=%d,param=%s",client.uToken,client.request,client.paramLen,client.param);
+    pthread_mutex_lock(&g_lynq_data_sendto_mutex);
+    if(send_request(lynq_client_sockfd,&client)==-1)
+    {
+        LYERRLOG("send request fail");
+        perror("[LYNQ_DATA] send request fail:");
+        pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+        return -1;
+    }
+    //get_response(lynq_client_sockfd,p);
+    error = wait_response(lynq_client_sockfd,p,client.uToken);
+    if(error!=0)
+    {
+        LYERRLOG("wait_response fail,ret:%d",error);
+        pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+        return error;
+    }
+    pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+    if(JumpHeader(p,&resp_type,&client.uToken,&request,&slot_id,&error)!=0)
+    {
+        LYERRLOG("JumpHeader fail");
+        return -1;
+    }
+    LYINFLOG("resp_type=%d,uToken=%d,request=%d,slot_id=%d,error_code=%d",resp_type,client.uToken,request,slot_id,error);
+    free_parcel(p);
+    return error;
+
+
+}
+
+int lynq_get_ip_filter(int cid,int *filter_count, int *filter_mode)
+{
+    Parcel *p =NULL;
+    lynq_client_t client;
+    int resp_type = -1;
+    int token;
+    int request = -1;
+    int slot_id = -1;
+    int error = -1;
+    int version =0;
+    int num = 0;
+
+    client.uToken = get_utoken();
+    client.request = LYNQ_GET_IP_TUPLE_FILTER;//RIL_REQUEST_GET_IP_TUPLE_FILTER 2197
+    client.paramLen = 1;
+    bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
+    sprintf(client.param,"%d",(cid / 100));
+    
+    LYINFLOG("uToken=%d,request=%d,paralen=%d,param=%s",client.uToken,client.request,client.paramLen,client.param);
+    pthread_mutex_lock(&g_lynq_data_sendto_mutex);
+    if(send_request(lynq_client_sockfd,&client)==-1)
+    {
+        LYERRLOG("send request fail");
+        perror("[LYNQ_DATA] send request fail:");
+        pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+        return -1;
+    }
+    //get_response(lynq_client_sockfd,p);
+    error = wait_response(lynq_client_sockfd,p,client.uToken);
+    if(error!=0)
+    {
+        LYERRLOG("wait_response fail,ret:%d",error);
+        pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+        return error;
+    }
+    pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+    if(JumpHeader(p,&resp_type,&client.uToken,&request,&slot_id,&error)!=0)
+    {
+        LYERRLOG("JumpHeader fail");
+        return -1;
+    }
+    LYINFLOG("resp_type=%d,uToken=%d,request=%d,slot_id=%d,error_code=%d",resp_type,client.uToken,request,slot_id,error);
+    if(error == 0)
+    {
+        p->readInt32(filter_count);
+        p->readInt32(filter_mode);
+    }
+    free_parcel(p);
+    return error;
+
+
+}
+
+int lynq_del_ip_filter(int cid)
+{
+    Parcel *p =NULL;
+    lynq_client_t client;
+    int resp_type = -1;
+    int token;
+    int request = -1;
+    int slot_id = -1;
+    int error = -1;
+    int version =0;
+    int num = 0;
+
+    client.uToken = get_utoken();
+    client.request = LYNQ_DEL_IP_TUPLE_FILTER;//RIL_REQUEST_DEL_IP_TUPLE_FILTER 2198
+    client.paramLen = 1;
+    bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
+    sprintf(client.param,"%d",(cid / 100));
+    
+    LYINFLOG("uToken=%d,request=%d,paralen=%d,param=%s",client.uToken,client.request,client.paramLen,client.param);
+    pthread_mutex_lock(&g_lynq_data_sendto_mutex);
+    if(send_request(lynq_client_sockfd,&client)==-1)
+    {
+        LYERRLOG("send request fail");
+        perror("[LYNQ_DATA] send request fail:");
+        pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+        return -1;
+    }
+    //get_response(lynq_client_sockfd,p);
+    error = wait_response(lynq_client_sockfd,p,client.uToken);
+    if(error!=0)
+    {
+        LYERRLOG("wait_response fail,ret:%d",error);
+        pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+        return error;
+    }
+    pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
+    if(JumpHeader(p,&resp_type,&client.uToken,&request,&slot_id,&error)!=0)
+    {
+        LYERRLOG("JumpHeader fail");
+        return -1;
+    }
+    LYINFLOG("resp_type=%d,uToken=%d,request=%d,slot_id=%d,error_code=%d",resp_type,client.uToken,request,slot_id,error);
+    free_parcel(p);
+    return error;
+
+
+}
\ No newline at end of file
diff --git a/common_src/lib/liblynq-data/lynq_data_urc.h b/common_src/lib/liblynq-data/lynq_data_urc.h
index 11aeb08..01edc34 100755
--- a/common_src/lib/liblynq-data/lynq_data_urc.h
+++ b/common_src/lib/liblynq-data/lynq_data_urc.h
@@ -22,6 +22,10 @@
 #define LYNQ_URC_MODIFY_APNDB (LYNQ_URC_VENDOR_BASE+4)
 #define LYNQ_URC_RESET_APNDB (LYNQ_URC_VENDOR_BASE+5)
 #define LYNQ_TELEPHONY_RESTART 3113
+#define LYNQ_SET_IP_TUPLE_FILTER 2195
+#define LYNQ_SET_IP_TUPLE_FILTER_MODE 2196
+#define LYNQ_GET_IP_TUPLE_FILTER 2197
+#define LYNQ_DEL_IP_TUPLE_FILTER 2198
 
 typedef struct{
     int resp_type;