[9610][7885][7872] wlbt : Enabling NAT KeepAlive Offload Feature.
authorMohit Ghuley <mohit.ghuley@samsung.com>
Mon, 10 Jul 2017 06:22:46 +0000 (11:52 +0530)
committerTarun Karela <t.karela@samsung.com>
Mon, 4 Jun 2018 09:40:47 +0000 (10:40 +0100)
Enabling NAT KeepAlive Offload Feature.

Change-Id: I9e6538b5ab5eabad0018e91be322456ad56d5ab1
SCSC-Bug-Id:SSB-28747
Signed-off-by: Mohit Ghuley <mohit.ghuley@samsung.com>
wifi_offload.cpp [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 5882927..726c81c
@@ -197,17 +197,35 @@ public:
     }
 };
 
+
 /* API to send specified mkeep_alive packet periodically. */
 wifi_error wifi_start_sending_offloaded_packet(wifi_request_id index, wifi_interface_handle iface,
         u8 *ip_packet, u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr, u32 period_msec)
 {
-    ALOGE("Returning WIFI_ERROR_NOT_SUPPORTED, as NAT KeepAlive Feature is disabled as of now.");
-    return WIFI_ERROR_NOT_SUPPORTED;
+    if ((index > 0 && index <= N_AVAIL_ID) && (ip_packet != NULL) && (src_mac_addr != NULL)
+            && (dst_mac_addr != NULL) && (period_msec > 0)
+            && (ip_packet_len <= MKEEP_ALIVE_IP_PKT_MAX)) {
+        MKeepAliveCommand *cmd = new MKeepAliveCommand(iface, index, ip_packet, ip_packet_len,
+                src_mac_addr, dst_mac_addr, period_msec, START_MKEEP_ALIVE);
+        wifi_error result = (wifi_error)cmd->start();
+        delete cmd;
+        return result;
+    } else {
+        ALOGE("Invalid mkeep_alive parameters");
+        return  WIFI_ERROR_INVALID_ARGS;
+    }
 }
 
 /* API to stop sending mkeep_alive packet. */
 wifi_error wifi_stop_sending_offloaded_packet(wifi_request_id index, wifi_interface_handle iface)
 {
-    ALOGE("Returning WIFI_ERROR_NOT_SUPPORTED, as NAT KeepAlive Feature is disabled as of now.");
-    return WIFI_ERROR_NOT_SUPPORTED;
+    if (index > 0 && index <= N_AVAIL_ID) {
+        MKeepAliveCommand *cmd = new MKeepAliveCommand(iface, index, STOP_MKEEP_ALIVE);
+        wifi_error result = (wifi_error)cmd->start();
+        delete cmd;
+        return result;
+    } else {
+        ALOGE("Invalid mkeep_alive parameters");
+        return  WIFI_ERROR_INVALID_ARGS;
+    }
 }