[Feature][T106_eSDK]T106-V2.01.01.02P56U06.AP.17.02_CAP.17.02(SDK4.7)diff_17.09(SDK4.8)

Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: Ia4837d58067710f089936cb298d6801cca8e2e85
diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq-qser-network-demo.cpp b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq-qser-network-demo.cpp
new file mode 100755
index 0000000..ad38820
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq-qser-network-demo.cpp
@@ -0,0 +1,626 @@
+#include <stdlib.h>

+#include <stdio.h>

+#include <stdint.h>

+#include <string.h>

+#include <dlfcn.h>

+#include <sys/types.h>

+//#include <pthread.h>

+#include <unistd.h>

+#include "lynq_qser_network.h"

+

+#ifndef LOG_TAG

+#define LOG_TAG "QSER_NETWORK_DEMO"

+#endif

+

+void *handle_network;

+

+int (*qser_nw_client_init_p)(nw_client_handle_type  * ph_nw);

+int (*qser_nw_client_deinit_p)(nw_client_handle_type h_nw);

+int (*qser_nw_set_config_p)(nw_client_handle_type  h_nw, QSER_NW_CONFIG_INFO_T *pt_info);

+int (*qser_nw_get_operator_name_p)(nw_client_handle_type    h_nw, QSER_NW_OPERATOR_NAME_INFO_T    *pt_info );

+int (*qser_nw_get_reg_status_p)(nw_client_handle_type  h_nw, QSER_NW_REG_STATUS_INFO_T *pt_info);

+int (*qser_nw_add_rx_msg_handler_p)(nw_client_handle_type  h_nw, QSER_NW_RxMsgHandlerFunc_t handlerPtr,void* contextPtr);

+int (*qser_nw_get_signal_strength_p)(nw_client_handle_type h_nw,QSER_NW_SIGNAL_STRENGTH_INFO_T *pt_info);

+int (*qser_nw_set_oos_config_p)(nw_client_handle_type   h_nw, QSER_NW_OOS_CONFIG_INFO_T *pt_info);

+int (*qser_nw_get_oos_config_p)(nw_client_handle_type   h_nw, QSER_NW_OOS_CONFIG_INFO_T *pt_info);

+int (*qser_nw_set_rf_mode_p) (nw_client_handle_type   h_nw,E_QSER_NW_RF_MODE_TYPE_T rf_mode);

+int (*qser_nw_get_rf_mode_p) (nw_client_handle_type   h_nw,E_QSER_NW_RF_MODE_TYPE_T* rf_mode);

+int (*qser_nw_set_ims_enable_p) (nw_client_handle_type h_nw,E_QSER_NW_IMS_MODE_TYPE_T ims_mode);

+int (*qser_nw_get_ims_reg_status_p) (nw_client_handle_type h_nw, QSER_NW_IMS_REG_STATUS_INFO_T *pt_info);

+

+

+

+int getFunc()

+{

+    const char *lynq_libpath_network = "/lib/liblynq-qser-network.so";

+

+    handle_network = dlopen(lynq_libpath_network,RTLD_NOW);

+    if(NULL == handle_network)

+    {

+        printf("dlopen lynq_libpath_network fail:%s",dlerror());

+        exit(EXIT_FAILURE);

+    }

+

+    qser_nw_client_init_p = (int (*)(nw_client_handle_type  * ph_nw))dlsym(handle_network,"qser_nw_client_init");    

+    qser_nw_client_deinit_p = (int (*)(nw_client_handle_type h_nw))dlsym(handle_network,"qser_nw_client_deinit");

+    qser_nw_set_config_p = (int (*)(nw_client_handle_type  h_nw, QSER_NW_CONFIG_INFO_T *pt_info))dlsym(handle_network,"qser_nw_set_config");

+    qser_nw_get_operator_name_p = (int (*)(nw_client_handle_type  h_nw, QSER_NW_OPERATOR_NAME_INFO_T  *pt_info ))dlsym(handle_network,"qser_nw_get_operator_name");

+    qser_nw_get_reg_status_p = (int (*)(nw_client_handle_type  h_nw, QSER_NW_REG_STATUS_INFO_T  *pt_info))dlsym(handle_network,"qser_nw_get_reg_status");

+    qser_nw_get_signal_strength_p = (int (*)(nw_client_handle_type h_nw, QSER_NW_SIGNAL_STRENGTH_INFO_T *pt_info))dlsym(handle_network,"qser_nw_get_signal_strength");

+    qser_nw_add_rx_msg_handler_p = (int (*)(nw_client_handle_type  h_nw, QSER_NW_RxMsgHandlerFunc_t handlerPtr,void* contextPtr))dlsym(handle_network,"qser_nw_add_rx_msg_handler");

+    qser_nw_get_oos_config_p = (int (*)(nw_client_handle_type   h_nw, QSER_NW_OOS_CONFIG_INFO_T *pt_info))dlsym(handle_network,"qser_nw_get_oos_config");

+    qser_nw_set_oos_config_p = (int (*)(nw_client_handle_type   h_nw, QSER_NW_OOS_CONFIG_INFO_T *pt_info))dlsym(handle_network,"qser_nw_set_oos_config");

+    qser_nw_set_rf_mode_p = (int (*)(nw_client_handle_type   h_nw, E_QSER_NW_RF_MODE_TYPE_T rf_mode))dlsym(handle_network,"qser_nw_set_rf_mode");

+    qser_nw_get_rf_mode_p = (int (*)(nw_client_handle_type   h_nw, E_QSER_NW_RF_MODE_TYPE_T* rf_mode))dlsym(handle_network,"qser_nw_get_rf_mode");

+    qser_nw_set_ims_enable_p = (int (*)(nw_client_handle_type  h_nw, E_QSER_NW_IMS_MODE_TYPE_T ims_mode))dlsym(handle_network,"qser_nw_set_ims_enable");

+    qser_nw_get_ims_reg_status_p = (int (*)(nw_client_handle_type  h_nw, QSER_NW_IMS_REG_STATUS_INFO_T  *pt_info))dlsym(handle_network,"qser_nw_get_ims_reg_status");

+        

+    if(qser_nw_client_deinit_p==NULL || qser_nw_client_init_p==NULL || qser_nw_set_config_p ==NULL ||

+       qser_nw_get_operator_name_p == NULL || qser_nw_get_reg_status_p ==NULL || qser_nw_add_rx_msg_handler_p==NULL ||

+       qser_nw_set_rf_mode_p == NULL || qser_nw_get_rf_mode_p == NULL || qser_nw_get_oos_config_p == NULL || qser_nw_set_oos_config_p == NULL || 

+       qser_nw_set_ims_enable_p == NULL || qser_nw_get_ims_reg_status_p == NULL)

+    {

+        printf("get func pointer null");

+        exit(EXIT_FAILURE);

+    }    

+    return  0;    

+}

+

+static int test_nw(void);

+

+int main(int argc, char const *argv[])

+{

+    printf("--------->[%s,%d] start \n",__FUNCTION__,__LINE__);   

+    

+    if(getFunc()==0)

+    {

+        test_nw();

+    }    

+

+    return 0;

+}

+

+typedef struct

+{

+    int  cmdIdx;

+    char *funcName;

+} st_api_test_case;

+

+st_api_test_case at_nw_testlist[] = 

+{

+    {0,     "qser_nw_client_init"},

+    {1,     "qser_nw_set_config"},      

+    {2,     "qser_nw_get_operator_name"},

+    {3,     "qser_nw_get_reg_status"},        

+    {4,     "qser_nw_add_rx_msg_handler"},     

+    {5,     "qser_nw_get_signal_strength"},

+    {6,     "qser_nw_set_oos_config"},

+    {7,     "qser_nw_get_oos_config"},

+    {8,     "qser_nw_set_rf_mode"},

+    {9,     "qser_nw_get_rf_mode"},

+    {10,     "qser_nw_set_ims_enable"},

+    {11,     "qser_nw_get_ims_reg_status"},

+    {12,     "qser_nw_client_deinit"},      

+    {-1,    "quit"}

+};

+

+typedef int (*TEST)(void);

+

+typedef struct

+{

+    char                *group_name;

+    st_api_test_case    *test_cases;

+    TEST                pf_test;

+} func_api_test_t;

+

+func_api_test_t t_nw_test = {"nw", at_nw_testlist, test_nw};

+

+void show_group_help(func_api_test_t *pt_test)

+{

+    int i;

+

+    printf("Group Name:%s, Supported test cases:\n", pt_test->group_name);

+    for(i = 0; ; i++)

+    {

+        if(pt_test->test_cases[i].cmdIdx == -1)

+        {

+            break;

+        }

+        printf("%d:\t%s\n", pt_test->test_cases[i].cmdIdx, pt_test->test_cases[i].funcName);

+    }

+}

+

+static nw_client_handle_type h_nw = 0;

+

+char *tech_domain[] = {"NONE", "3GPP", "3GPP2"};

+char *radio_tech[] = {"unknown", 

+    "TD_SCDMA", "GSM",      "HSPAP",    "LTE",      "EHRPD",    "EVDO_B", 

+    "HSPA",     "HSUPA",    "HSDPA",    "EVDO_A",   "EVDO_0",   "1xRTT", 

+    "IS95B",    "IS95A",    "UMTS",     "EDGE",     "GPRS",     "NONE"};

+

+void nw_event_ind_handler (

+    nw_client_handle_type h_nw, 

+    u_int32_t ind_flag, 

+    void                  *ind_msg_buf, 

+    u_int32_t              ind_msg_len, 

+    void                  *contextPtr)

+{

+    switch(ind_flag) {

+        case NW_IND_VOICE_REG_EVENT_IND_FLAG:

+            {

+                QSER_NW_VOICE_REG_EVENT_IND_T *ind = (QSER_NW_VOICE_REG_EVENT_IND_T*)ind_msg_buf;

+                printf("Recv event indication : VOICE REG EVENT\n");

+                

+                if(ind==NULL)

+                {

+                     printf("ind is NULL\n");

+                     break;

+                }

+

+                if(ind->registration_valid)

+                {

+                    printf("voice_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n", 

+                            tech_domain[ind->registration.tech_domain], 

+                            radio_tech[ind->registration.radio_tech],

+                            ind->registration.roaming,

+                            ind->registration.registration_state);

+                }

+                if(ind->registration_details_3gpp_valid)

+                {

+                    printf("voice_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n", 

+                            tech_domain[ind->registration_details_3gpp.tech_domain], 

+                            radio_tech[ind->registration_details_3gpp.radio_tech],

+                            ind->registration_details_3gpp.mcc,

+                            ind->registration_details_3gpp.mnc,

+                            ind->registration_details_3gpp.roaming,

+                            ind->registration_details_3gpp.forbidden,                    

+                            ind->registration_details_3gpp.cid,

+                            ind->registration_details_3gpp.lac,

+                            ind->registration_details_3gpp.psc,

+                            ind->registration_details_3gpp.tac);

+                }

+

+                if(ind->registration_details_3gpp2_valid)

+                {

+                    printf("voice_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, sid=%d, nid=%d, bsid=%d\n", 

+                            tech_domain[ind->registration_details_3gpp2.tech_domain], 

+                            radio_tech[ind->registration_details_3gpp2.radio_tech],

+                            ind->registration_details_3gpp2.mcc,

+                            ind->registration_details_3gpp2.mnc,

+                            ind->registration_details_3gpp2.roaming,

+                            ind->registration_details_3gpp2.forbidden,                    

+                            ind->registration_details_3gpp2.sid,

+                            ind->registration_details_3gpp2.nid,

+                            ind->registration_details_3gpp2.bsid);

+                }

+

+                break;

+            }

+        case NW_IND_DATA_REG_EVENT_IND_FLAG:

+            {

+                QSER_NW_DATA_REG_EVENT_IND_T *ind = (QSER_NW_DATA_REG_EVENT_IND_T*)ind_msg_buf;

+

+                printf("Recv event indication : DATA REG EVENT\n");

+                

+                if(ind==NULL)

+                {

+                     printf("ind is NULL\n");

+                     break;

+                }

+              

+

+                if(ind->registration_valid)

+                {

+                    printf("data_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n", 

+                            tech_domain[ind->registration.tech_domain], 

+                            radio_tech[ind->registration.radio_tech],

+                            ind->registration.roaming,

+                            ind->registration.registration_state);

+                }

+                if(ind->registration_details_3gpp_valid)

+                {

+                    printf("data_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n", 

+                            tech_domain[ind->registration_details_3gpp.tech_domain], 

+                            radio_tech[ind->registration_details_3gpp.radio_tech],

+                            ind->registration_details_3gpp.mcc,

+                            ind->registration_details_3gpp.mnc,

+                            ind->registration_details_3gpp.roaming,

+                            ind->registration_details_3gpp.forbidden,                    

+                            ind->registration_details_3gpp.cid,

+                            ind->registration_details_3gpp.lac,

+                            ind->registration_details_3gpp.psc,

+                            ind->registration_details_3gpp.tac);

+                }

+

+                if(ind->registration_details_3gpp2_valid)

+                {

+                    printf("data_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, prl=%d, css=%d, sid=%d, nid=%d, bsid=%d\n", 

+                            tech_domain[ind->registration_details_3gpp2.tech_domain], 

+                            radio_tech[ind->registration_details_3gpp2.radio_tech],

+                            ind->registration_details_3gpp2.mcc,

+                            ind->registration_details_3gpp2.mnc,

+                            ind->registration_details_3gpp2.roaming,

+                            ind->registration_details_3gpp2.forbidden,   

+                            ind->registration_details_3gpp2.inPRL,

+                            ind->registration_details_3gpp2.css,

+                            ind->registration_details_3gpp2.sid,

+                            ind->registration_details_3gpp2.nid,

+                            ind->registration_details_3gpp2.bsid);

+                }

+

+                break;

+            }

+        case NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG:

+            {

+                QSER_NW_SINGNAL_EVENT_IND_T *ind = (QSER_NW_SINGNAL_EVENT_IND_T*)ind_msg_buf;

+

+                printf("Recv event indication : SIGNAL STRENGTH EVENT\n");

+                

+                if(ind==NULL)

+                {

+                     printf("ind is NULL\n");

+                     break;

+                }

+

+                if(ind->gsm_sig_info_valid)

+                {

+                    printf("gsm_sig_info: rssi=%d\n", 

+                            ind->gsm_sig_info.rssi);

+                } 

+

+                if(ind->wcdma_sig_info_valid)

+                {

+                    printf("wcdma_sig_info: rssi=%d, ecio=%d\n", 

+                            ind->wcdma_sig_info.rssi, 

+                            ind->wcdma_sig_info.ecio);

+                } 

+                if(ind->tdscdma_sig_info_valid)

+                {

+                    printf("tdscdma_sig_info: rssi=%d, rscp=%d, ecio=%d, sinr=%d\n", 

+                            ind->tdscdma_sig_info.rssi, 

+                            ind->tdscdma_sig_info.rscp,

+                            ind->tdscdma_sig_info.ecio,

+                            ind->tdscdma_sig_info.sinr);

+                } 

+                if(ind->lte_sig_info_valid)

+                {

+                    printf("lte_sig_info: rssi=%d, rsrq=%d, rsrp=%d, snr=%d\n", 

+                            ind->lte_sig_info.rssi, 

+                            ind->lte_sig_info.rsrq,

+                            ind->lte_sig_info.rsrp,

+                            ind->lte_sig_info.snr);

+                } 

+                if(ind->cdma_sig_info_valid)

+                {

+                    printf("cdma_sig_info: rssi=%d, ecio=%d\n", 

+                            ind->cdma_sig_info.rssi, 

+                            ind->cdma_sig_info.ecio);

+                } 

+                if(ind->hdr_sig_info_valid)

+                {

+                    printf("hdr_sig_info: rssi=%d, ecio=%d, sinr=%d, io=%d\n", 

+                            ind->hdr_sig_info.rssi, 

+                            ind->hdr_sig_info.ecio,

+                            ind->hdr_sig_info.sinr,

+                            ind->hdr_sig_info.io);

+                }

+                break;

+            }

+        case NW_IND_IMS_REG_EVENT_IND_FLAG:

+            {

+                printf("Recv event indication : IMS REG EVENT\n");               

+                

+                break;

+            }

+        default:

+            break;

+    }

+}

+

+static int test_nw(void)

+{

+    int    cmdIdx  = 0;

+    int    ret     = 0;       

+        

+    while(1)

+    {

+        show_group_help(&t_nw_test);

+        printf("please input cmd index(-1 exit): ");

+        ret = scanf("%d", &cmdIdx);

+        if(ret != 1)

+        {

+            char c;

+            while(((c=getchar()) != '\n') && (c != EOF))

+            {

+                ;

+            }

+            continue;

+        }

+        if(cmdIdx == -1)

+        {

+            break;

+        }

+        switch(cmdIdx)

+        {

+             case 0://"qser_nw_client_init"

+             {

+                 

+                 ret = qser_nw_client_init_p(&h_nw);

+                 printf("qser_nw_client_init ret = %d\n", ret);

+                 break;

+             }

+             case 1://"qser_nw_set_config"

+             {

+                 QSER_NW_CONFIG_INFO_T     t_info = {0};

+                 

+                 int mask = 0;

+                 printf("please input decimal format number,  whose hex format is (TDSCDMA | LTE | EVDO | CDMA | WCDMA | GSM) : \n");

+                 scanf("%d", &mask);

+                 t_info.preferred_nw_mode = mask;

+                 

+                 ret = qser_nw_set_config_p(h_nw, &t_info);

+                 printf("qser_nw_set_config ret = %d\n", ret);

+                 break;

+             }            

+             case 2://"qser_nw_get_operator_name"

+             {

+                 QSER_NW_OPERATOR_NAME_INFO_T  t_info;

+                 ret = qser_nw_get_operator_name_p(h_nw, &t_info);

+                 printf("qser_nw_get_operator_name ret = %d, long_eons=%s, short_eons=%s, mcc=%s, mnc=%s\n", ret,

+                         t_info.long_eons, t_info.short_eons, t_info.mcc, t_info.mnc);

+                 break;

+             }       

+             case 3://"qser_nw_get_reg_status"

+             {

+                 QSER_NW_REG_STATUS_INFO_T         t_info;

+     

+                 memset(&t_info, 0, sizeof(QSER_NW_REG_STATUS_INFO_T));

+                 ret = qser_nw_get_reg_status_p(h_nw, &t_info);

+                 printf("qser_nw_get_reg_status ret = %d, detail info:\n", ret);

+                 if(t_info.voice_registration_valid)

+                 {

+                     printf("voice_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n", 

+                         tech_domain[t_info.voice_registration.tech_domain], 

+                         radio_tech[t_info.voice_registration.radio_tech],

+                         t_info.voice_registration.roaming,

+                         t_info.voice_registration.registration_state);

+                 }

+                 if(t_info.data_registration_valid)

+                 {

+                     printf("data_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n", 

+                         tech_domain[t_info.data_registration.tech_domain], 

+                         radio_tech[t_info.data_registration.radio_tech],

+                         t_info.data_registration.roaming,

+                         t_info.data_registration.registration_state);

+                 }

+                 if(t_info.voice_registration_details_3gpp_valid)

+                 {

+                     printf("voice_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n", 

+                         tech_domain[t_info.voice_registration_details_3gpp.tech_domain], 

+                         radio_tech[t_info.voice_registration_details_3gpp.radio_tech],

+                         t_info.voice_registration_details_3gpp.mcc,

+                         t_info.voice_registration_details_3gpp.mnc,

+                         t_info.voice_registration_details_3gpp.roaming,

+                         t_info.voice_registration_details_3gpp.forbidden,                    

+                         t_info.voice_registration_details_3gpp.cid,

+                         t_info.voice_registration_details_3gpp.lac,

+                         t_info.voice_registration_details_3gpp.psc,

+                         t_info.voice_registration_details_3gpp.tac);

+                 }

+                 if(t_info.data_registration_details_3gpp_valid)

+                 {

+                     printf("data_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n", 

+                         tech_domain[t_info.data_registration_details_3gpp.tech_domain], 

+                         radio_tech[t_info.data_registration_details_3gpp.radio_tech],

+                         t_info.data_registration_details_3gpp.mcc,

+                         t_info.data_registration_details_3gpp.mnc,

+                         t_info.data_registration_details_3gpp.roaming,

+                         t_info.data_registration_details_3gpp.forbidden,                    

+                         t_info.data_registration_details_3gpp.cid,

+                         t_info.data_registration_details_3gpp.lac,

+                         t_info.data_registration_details_3gpp.psc,

+                         t_info.data_registration_details_3gpp.tac);

+                 }

+                 

+                 if(t_info.voice_registration_details_3gpp2_valid)

+                 {

+                     printf("voice_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, sid=%d, nid=%d, bsid=%d\n", 

+                         tech_domain[t_info.voice_registration_details_3gpp2.tech_domain], 

+                         radio_tech[t_info.voice_registration_details_3gpp2.radio_tech],

+                         t_info.voice_registration_details_3gpp2.mcc,

+                         t_info.voice_registration_details_3gpp2.mnc,

+                         t_info.voice_registration_details_3gpp2.roaming,

+                         t_info.voice_registration_details_3gpp2.forbidden,                    

+                         t_info.voice_registration_details_3gpp2.sid,

+                         t_info.voice_registration_details_3gpp2.nid,

+                         t_info.voice_registration_details_3gpp2.bsid);

+                 }

+                 

+                 if(t_info.data_registration_details_3gpp2_valid)

+                 {

+                     printf("data_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, sid=%d, nid=%d, bsid=%d\n", 

+                         tech_domain[t_info.data_registration_details_3gpp2.tech_domain], 

+                         radio_tech[t_info.data_registration_details_3gpp2.radio_tech],

+                         t_info.data_registration_details_3gpp2.mcc,

+                         t_info.data_registration_details_3gpp2.mnc,

+                         t_info.data_registration_details_3gpp2.roaming,

+                         t_info.data_registration_details_3gpp2.forbidden,                    

+                         t_info.data_registration_details_3gpp2.sid,

+                         t_info.data_registration_details_3gpp2.nid,

+                         t_info.data_registration_details_3gpp2.bsid);

+                 }

+                             

+                 break;

+             }                 

+             case 12://"qser_nw_client_deinit"

+             {

+                 ret = qser_nw_client_deinit_p(h_nw);

+                 printf("qser_nw_client_deinit ret = %d\n", ret);

+                 break;

+             }       

+             case 4 :

+             {

+                ret = qser_nw_add_rx_msg_handler_p(h_nw, nw_event_ind_handler, NULL);  

+                printf("qser_nw_add_rx_msg_handler, ret=%d\n", ret);

+                break;

+             }

+              case 5 :

+             {

+                QSER_NW_SIGNAL_STRENGTH_INFO_T t_info;

+                ret = qser_nw_get_signal_strength_p(h_nw, &t_info);  

+                printf("qser_nw_get_signal_strength, ret=%d\n", ret);

+                if(ret==0)

+                {                       

+                    printf("qser_solicited_signal_strength gsm_sig_info_valid = %d\n"

+                               "                               gsm_sig_info.rssi = %d\n"

+                               "                               wcdma     _sig_info_valid = %d\n" 

+                               "                               wcdma_sig_info.rssi = %d\n"

+                               "                               wcdma_sig_info.ecio = %d\n"

+                               "                               tdscdma_sig_info_valid = %d\n"

+                               "                               lte_sig_info_valid = %d\n"

+                               "                               lte_sig_info.rssi = %d\n"

+                               "                               lte_sig_info.rsrp = %d\n"

+                               "                               lte_sig_info.rsrq = %d\n"

+                               "                               lte_sig_info.snr = %d\n"

+                               "                               cdma_sig_info_valid = %d\n"

+                               "                               hdr_sig_info_valid = %d\n"

+                               "                               nr_sig_info_valid = %d\n"

+                               "                               nr_sig_info.ssRsrp = %d\n"

+                               "                               nr_sig_info.ssRsrq = %d\n"

+                               "                               nr_sig_info.ssSinr = %d\n"

+                               "                               nr_sig_info.csiRsrp = %d\n"

+                               "                               nr_sig_info.csiRsrq = %d\n"

+                               "                               nr_sig_info.csiSinr = %d\n",

+                              t_info.gsm_sig_info_valid, t_info.gsm_sig_info.rssi,

+                              t_info.wcdma_sig_info_valid, t_info.wcdma_sig_info.rssi,  t_info.wcdma_sig_info.ecio,

+                              t_info.tdscdma_sig_info_valid,

+                              t_info.lte_sig_info_valid, t_info.lte_sig_info.rssi, t_info.lte_sig_info.rsrp, t_info.lte_sig_info.rsrq, t_info.lte_sig_info.snr,

+                              t_info.cdma_sig_info_valid, 

+                              t_info.hdr_sig_info_valid, 

+                              t_info.nr_sig_info_valid, t_info.nr_sig_info.ssRsrp, t_info.nr_sig_info.ssRsrq, t_info.nr_sig_info.ssSinr,

+                              t_info.nr_sig_info.csiRsrp, t_info.nr_sig_info.csiRsrq, t_info.nr_sig_info.csiSinr);

+                        

+                }

+                break;

+             }        

+             case 7 :

+             {

+                QSER_NW_OOS_CONFIG_INFO_T t_info;

+                int type = 0;

+                printf("please input you want query oos config's type (0: fast network scan config; 1: full band network scan config ) : \n");

+                scanf("%d", &type);

+                t_info.type = type;

+                ret = qser_nw_get_oos_config_p(h_nw, &t_info);  

+                printf("qser_nw_get_oos_config, ret=%d\n", ret);

+                if(ret==0)

+                {         

+                    if(t_info.type == QSER_NW_OOS_CFG_TYPE_FULL_BAND_SCAN)

+                    {

+                        printf("qser_nw_get_oos_config         t_min = %d\n"

+                               "                               t_step = %d\n"

+                               "                               t_num = %d\n"

+                               "                               t_max = %d\n",

+                              t_info.u.full_band_scan_info.t_min, t_info.u.full_band_scan_info.t_step,                             

+                              t_info.u.full_band_scan_info.t_num, t_info.u.full_band_scan_info.t_max);

+                    }     

+                    else if(t_info.type == QSER_NW_OOS_CFG_TYPE_FAST_SCAN)

+                    {

+                        printf("qser_nw_get_oos_config         enable = %d\n"

+                               "                               time_interval = %d\n",

+                              t_info.u.fast_can_info.enable, t_info.u.fast_can_info.time_interval); 

+                    }

+                    else

+                    {

+                        printf("qser_nw_get_oos_config tyep is %d, ret is ok",t_info.type);

+                    }

+    

+                }

+                break;

+             }         

+             case 6 :

+             {

+                QSER_NW_OOS_CONFIG_INFO_T t_info;

+                int type = 0;

+                printf("please input you want set oos config's type (0: fast network scan config; 1: full band network scan config ) : \n");

+                scanf("%d", &type);

+                t_info.type = type;

+                if(t_info.type == QSER_NW_OOS_CFG_TYPE_FULL_BAND_SCAN)

+                {

+                      printf("please input  t_min: \n");

+                      scanf("%d", &(t_info.u.full_band_scan_info.t_min));

+                      printf("please input t_step: \n");

+                      scanf("%d", &(t_info.u.full_band_scan_info.t_step));

+                      printf("please input  t_num: \n");

+                      scanf("%d", &(t_info.u.full_band_scan_info.t_num));

+                      printf("please input t_max: \n");

+                      scanf("%d", &(t_info.u.full_band_scan_info.t_max));

+                      ret = qser_nw_set_oos_config_p(h_nw, &t_info);  

+                      printf("qser_nw_get_oos_config, ret=%d\n", ret);                      

+                }

+                else if(t_info.type==QSER_NW_OOS_CFG_TYPE_FAST_SCAN)

+                {

+                      printf("please input  enable: \n");

+                      scanf("%d", &(t_info.u.fast_can_info.enable));

+                      printf("please input time_interval: \n");

+                      scanf("%d", &(t_info.u.fast_can_info.time_interval));                      

+                      ret = qser_nw_set_oos_config_p(h_nw, &t_info);  

+                      printf("qser_nw_get_oos_config, ret=%d\n", ret);                    

+                }

+                else 

+                {

+                       ret = qser_nw_set_oos_config_p(h_nw, &t_info);  

+                       printf("qser_nw_get_oos_config, ret=%d\n", ret);            

+                }                

+                break;

+             }         

+             case 9://"qser_nw_get_rf_mode"

+             {

+                 E_QSER_NW_RF_MODE_TYPE_T  rf_mode;

+                 ret = qser_nw_get_rf_mode_p(h_nw, &rf_mode);

+                 printf("qser_nw_get_rf_mode ret = %d, rf mode=%d\n", ret, rf_mode);

+                 break;

+             }       

+             case 8://"qser_nw_set_rf_mode"

+             {

+                 E_QSER_NW_RF_MODE_TYPE_T  rf_mode;

+                 printf("please input you want set rf mode (0: cfun 0;  1: cfun 1; 4: flight mode \n");

+                 scanf("%d", &rf_mode);

+                 ret = qser_nw_set_rf_mode_p(h_nw, rf_mode);

+                 printf("qser_nw_set_rf_mode %d ret = %dn",rf_mode, ret);

+                 break;

+             }       

+             case 10://"qser_nw_set_ims_enable"

+             {

+                 E_QSER_NW_IMS_MODE_TYPE_T  ims_mode;

+                 printf("please input you want set ims mode (0: off;  1: volte enable \n");

+                 scanf("%d", &ims_mode);

+                 ret = qser_nw_set_ims_enable_p(h_nw, ims_mode);

+                 printf("qser_nw_set_ims_enable %d ret = %dn",ims_mode, ret);

+                 break;

+             }       

+             case 11://"qser_nw_get_ims_reg_status"

+             {

+                 QSER_NW_IMS_REG_STATUS_INFO_T         t_info;

+                 memset(&t_info, 0, sizeof(QSER_NW_IMS_REG_STATUS_INFO_T));

+                 ret = qser_nw_get_ims_reg_status_p(h_nw, &t_info);

+                 printf("qser_nw_get_ims_reg_status ret = %d, detail info:\n", ret);

+                 if(ret == 0)

+                 {

+                     printf("ims_registration: registration_state=%d\n",                          

+                         t_info.registration_state);

+                 }                

+                 break;

+             }                 

+             default:

+             {

+                 show_group_help(&t_nw_test);

+             }

+        }

+    }

+    return 0;

+}

+

+

+

+

+

diff --git a/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq_qser_network.h b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq_qser_network.h
new file mode 100755
index 0000000..56e2ce0
--- /dev/null
+++ b/esdk/layers/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq_qser_network.h
@@ -0,0 +1,475 @@
+/**
+ *@file     QSER_nw.h
+ *@date     2018-02-22
+ *@author   
+ *@brief    
+ */   
+#ifndef __LYNQ_QSER_NETWORK_H__
+#define __LYNQ_QSER_NETWORK_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef uint32_t nw_client_handle_type;
+
+
+#define QSER_NW_MODE_NONE     0x00    /**<  No network. */
+#define QSER_NW_MODE_GSM      0x01    /**<  Include GSM networks. */
+#define QSER_NW_MODE_WCDMA    0x02    /**<  Include WCDMA networks. */
+#define QSER_NW_MODE_CDMA     0x04    /**<  Include CDMA networks. */
+#define QSER_NW_MODE_EVDO     0x08    /**<  Include EVDO networks. */
+#define QSER_NW_MODE_LTE      0x10    /**<  Include LTE networks. */
+#define QSER_NW_MODE_TDSCDMA  0x20    /**<  Include TDSCDMA networks. */
+
+typedef enum 
+{
+    E_QSER_NW_ROAM_STATE_OFF  = 0,    /**<  None, or roaming indicator off. */
+    E_QSER_NW_ROAM_STATE_ON   = 1     /**<  Roaming indicator on. */
+}E_QSER_NW_ROAM_STATE_TYPE_T;
+
+/** Configures the settings that define the MCM network interface. */
+typedef struct 
+{
+    /*  Configuration parameters for MCM network registration Network registration details Technology dependent network registration details */
+    uint64_t                        preferred_nw_mode;  /**<   Preferred network mode for connections; a bitmask of QSER_NW_MODE_xxxx.*/
+    E_QSER_NW_ROAM_STATE_TYPE_T   roaming_pref;       /**<   Roaming preference.*/
+}QSER_NW_CONFIG_INFO_T;
+
+typedef enum 
+{
+    E_QSER_NW_IMS_MODE_OFF    = 0,     /**<  close ims. */
+    E_QSER_NW_IMS_MODE_VOLTE_ENABLE    = 1,  /**<  support volte. */
+}E_QSER_NW_IMS_MODE_TYPE_T;
+
+/** Configures the OOS (out of service)  settings that define the MCM network interface. */
+#define QSER_NW_OOS_CFG_TYPE_FAST_SCAN          0x00    /**<  fast net scan */
+#define QSER_NW_OOS_CFG_TYPE_FULL_BAND_SCAN     0x01    /**<  full band scan */
+
+typedef struct 
+{
+    /*    Configuration parameters for MCM network fast network scan when OOS (out of service)*/
+    char                        enable;
+    uint16_t                    time_interval;
+}QSER_NW_OOS_CONFIG_FAST_SCAN_INFO_T;
+
+typedef struct 
+{
+    /*    Configuration parameters for MCM network full band network scan when OOS (out of service)*/
+    int t_min;
+    int t_step;
+    int t_num;
+    int t_max;
+}QSER_NW_OOS_CONFIG_FULL_BAND_SCAN_INFO_T;
+
+
+typedef struct 
+{    
+    char                        type;  /**<   QSER_NW_OOS_CFG_TYPE_xxxx.*/
+    union {
+    QSER_NW_OOS_CONFIG_FAST_SCAN_INFO_T  fast_can_info;       // 00
+    QSER_NW_OOS_CONFIG_FULL_BAND_SCAN_INFO_T full_band_scan_info;     // 01   
+  } u;
+}QSER_NW_OOS_CONFIG_INFO_T;
+
+//defined for QSER_NW_EventRegister
+#define     NW_IND_VOICE_REG_EVENT_IND_FLAG               (1 << 0)    /**< msg format : QSER_NW_VOICE_REG_EVENT_IND_T */
+#define     NW_IND_DATA_REG_EVENT_IND_FLAG                (1 << 1)    /**< msg format : QSER_NW_DATA_REG_EVENT_IND_T */ 
+#define     NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG         (1 << 2)    /**< msg format : QSER_NW_SINGNAL_EVENT_IND_T */ 
+//#define     NW_IND_CELL_ACCESS_STATE_CHG_EVENT_IND_FLAG   (1 << 3)    /**< msg format : QL_MCM_NW_CELL_ACCESS_STATE_EVENT_IND_T */ 
+//#define     NW_IND_NITZ_TIME_UPDATE_EVENT_IND_FLAG        (1 << 4)    /**< msg format : QL_MCM_NW_NITZ_TIME_EVENT_IND_T */ 
+#define     NW_IND_IMS_REG_EVENT_IND_FLAG                 (1 << 5)    /**< msg format : NULL */ 
+
+typedef struct 
+{
+    char long_eons[512 + 1];    /**<   Long EONS.*/
+    char short_eons[512 + 1];   /**<   Short EONS.*/
+    char mcc[3 + 1];            /**<   Mobile country code.*/
+    char mnc[3 + 1];            /**<   Mobile network code.*/
+}QSER_NW_OPERATOR_NAME_INFO_T;
+
+typedef enum 
+{
+    E_QSER_NW_RADIO_TECH_TD_SCDMA = 1,
+    E_QSER_NW_RADIO_TECH_GSM      = 2,    /**<  GSM; only supports voice. */
+    E_QSER_NW_RADIO_TECH_HSPAP    = 3,    /**<  HSPA+. */
+    E_QSER_NW_RADIO_TECH_LTE      = 4,    /**<  LTE. */
+    E_QSER_NW_RADIO_TECH_EHRPD    = 5,    /**<  EHRPD. */
+    E_QSER_NW_RADIO_TECH_EVDO_B   = 6,    /**<  EVDO B. */
+    E_QSER_NW_RADIO_TECH_HSPA     = 7,    /**<  HSPA. */
+    E_QSER_NW_RADIO_TECH_HSUPA    = 8,    /**<  HSUPA. */
+    E_QSER_NW_RADIO_TECH_HSDPA    = 9,    /**<  HSDPA. */
+    E_QSER_NW_RADIO_TECH_EVDO_A   = 10,   /**<  EVDO A. */
+    E_QSER_NW_RADIO_TECH_EVDO_0   = 11,   /**<  EVDO 0. */
+    E_QSER_NW_RADIO_TECH_1xRTT    = 12,   /**<  1xRTT. */
+    E_QSER_NW_RADIO_TECH_IS95B    = 13,   /**<  IS95B. */
+    E_QSER_NW_RADIO_TECH_IS95A    = 14,   /**<  IS95A. */
+    E_QSER_NW_RADIO_TECH_UMTS     = 15,   /**<  UMTS. */
+    E_QSER_NW_RADIO_TECH_EDGE     = 16,   /**<  EDGE. */
+    E_QSER_NW_RADIO_TECH_GPRS     = 17,   /**<  GPRS. */
+    E_QSER_NW_RADIO_TECH_NONE     = 18    /**<  No technology selected. */
+}E_QSER_NW_RADIO_TECH_TYPE_T;
+
+
+typedef enum 
+{
+    E_QSER_NW_TECH_DOMAIN_NONE    = 0,    /**<  None. */
+    E_QSER_NW_TECH_DOMAIN_3GPP    = 1,    /**<  3GPP. */
+    E_QSER_NW_TECH_DOMAIN_3GPP2   = 2,    /**<  3GPP2. */
+}E_QSER_NW_TECH_DOMAIN_TYPE_T;
+
+typedef enum 
+{
+    E_QSER_NW_IMSI_UNKNOWN_HLR_DENY_REASON                    = 1, /**<  IMSI unknown in HLR. */
+    E_QSER_NW_ILLEGAL_MS_DENY_REASON                          = 2, /**<  Illegal MS. */
+    E_QSER_NW_IMSI_UNKNOWN_VLR_DENY_REASON                    = 3, /**<  IMSI unknown in VLR. */
+    E_QSER_NW_IMEI_NOT_ACCEPTED_DENY_REASON                   = 4, /**<  IMEI not accepted. */
+    E_QSER_NW_ILLEGAL_ME_DENY_REASON                          = 5, /**<  Illegal ME. */
+    E_QSER_NW_PLMN_NOT_ALLOWED_DENY_REASON                    = 6, /**<  PLMN not allowed. */
+    E_QSER_NW_LA_NOT_ALLOWED_DENY_REASON                      = 7, /**<  Location area not allowed. */
+    E_QSER_NW_ROAMING_NOT_ALLOWED_LA_DENY_REASON              = 8, /**<  Roaming not allowed in this location area. */
+    E_QSER_NW_NO_SUITABLE_CELLS_LA_DENY_REASON                = 9, /**<  No suitable cells in location area. */
+    E_QSER_NW_NETWORK_FAILURE_DENY_REASON                     = 10, /**<  Network failure. */
+    E_QSER_NW_MAC_FAILURE_DENY_REASON                         = 11, /**<  MAC failure. */
+    E_QSER_NW_SYNCH_FAILURE_DENY_REASON                       = 12, /**<  Sync failure. */
+    E_QSER_NW_CONGESTION_DENY_REASON                          = 13, /**<  Congestion. */
+    E_QSER_NW_GSM_AUTHENTICATION_UNACCEPTABLE_DENY_REASON     = 14, /**<  GSM authentication unacceptable. */
+    E_QSER_NW_NOT_AUTHORIZED_CSG_DENY_REASON                  = 15, /**<  Not authorized in this CSG. */
+    E_QSER_NW_SERVICE_OPTION_NOT_SUPPORTED_DENY_REASON        = 16, /**<  Service option not supported. */
+    E_QSER_NW_REQ_SERVICE_OPTION_NOT_SUBSCRIBED_DENY_REASON   = 17, /**<  Requested service option not subscribed. */
+    E_QSER_NW_CALL_CANNOT_BE_IDENTIFIED_DENY_REASON           = 18, /**<  Call cannot be identified. */
+    E_QSER_NW_SEMANTICALLY_INCORRECT_MSG_DENY_REASON          = 19, /**<  Semantically incorrect message. */
+    E_QSER_NW_INVALID_MANDATORY_INFO_DENY_REASON              = 20, /**<  Invalid mandatory information. */
+    E_QSER_NW_MSG_TYPE_NON_EXISTENT_DENY_REASON               = 21, /**<  Message type non-existent or not implemented. */
+    E_QSER_NW_INFO_ELEMENT_NON_EXISTENT_DENY_REASON           = 22, /**<  Message type not compatible with the protocol state. */
+    E_QSER_NW_CONDITIONAL_IE_ERR_DENY_REASON                  = 23, /**<  Conditional IE error. */
+    E_QSER_NW_MSG_INCOMPATIBLE_PROTOCOL_STATE_DENY_REASON     = 24, /**<  Message not compatible with the protocol state. */
+    E_QSER_NW_PROTOCOL_ERROR_DENY_REASON                      = 25, /**<  Unspecified protocol error. */
+}E_QSER_NW_DENY_REASON_TYPE_T;
+
+
+typedef enum 
+{
+    E_QSER_NW_SERVICE_NONE     = 0x0000,  /**<  Not registered or no data. */
+    E_QSER_NW_SERVICE_LIMITED  = 0x0001,  /**<  Registered; emergency service only. */
+    E_QSER_NW_SERVICE_FULL     = 0x0002,  /**<  Registered, full service. */
+}E_QSER_NW_SERVICE_TYPE_T;
+
+typedef struct 
+{
+    E_QSER_NW_TECH_DOMAIN_TYPE_T  tech_domain;        /**<   Technology, used to determine the structure type  tech: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/
+    E_QSER_NW_RADIO_TECH_TYPE_T   radio_tech;         /**<   Radio technology; see #nw_radio_tech_t_v01.*/
+    E_QSER_NW_ROAM_STATE_TYPE_T   roaming;            /**<   0 -- Off, 1 -- Roaming (3GPP2 has extended values).*/
+    E_QSER_NW_DENY_REASON_TYPE_T  deny_reason;        /**<   Set when registration state is #nw_deny_reason_t_v01.*/
+    E_QSER_NW_SERVICE_TYPE_T      registration_state; /**<   Registration state.*/
+}QSER_NW_COMMON_REG_INFO_T;
+
+
+typedef struct 
+{
+    E_QSER_NW_TECH_DOMAIN_TYPE_T  tech_domain;        /**<   Technology, used to determine the structure type  tech: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/
+    E_QSER_NW_RADIO_TECH_TYPE_T   radio_tech;         /**<   Radio technology; see #nw_radio_tech_t_v01.*/
+    char                            mcc[3+1];           /**<   Mobile country code.*/
+    char                            mnc[3+1];           /**<   Mobile network code.*/
+    E_QSER_NW_ROAM_STATE_TYPE_T   roaming;            /**<   0 -- Off, 1 -- Roaming (3GPP2 has extended values).*/
+    uint8_t                         forbidden;          /**<   Forbidden: 0 -- No, 1 -- Yes.*/
+    uint32_t                        cid;                /**<   Cell ID for the registered 3GPP system.*/
+    uint16_t                        lac;                /**<   Locatin area code for the registered 3GPP system.*/
+    uint16_t                        psc;                /**<   Primary scrambling code (WCDMA only); 0 -- None.*/
+    uint16_t                        tac;                /**<   Tracking area code information for LTE.*/
+}QSER_NW_3GPP_REG_INFO_T;
+
+
+typedef struct 
+{
+    E_QSER_NW_TECH_DOMAIN_TYPE_T  tech_domain;        /**<   Technology, used to determine structure type  tech: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/
+    E_QSER_NW_RADIO_TECH_TYPE_T   radio_tech;         /**<   Radio technology; see #nw_radio_tech_t_v01.*/
+    char                            mcc[3+1];           /**<   Mobile country code.*/
+    char                            mnc[3+1];           /**<   Mobile network code.*/
+    E_QSER_NW_ROAM_STATE_TYPE_T   roaming;            /**<   Roaming status; see #nw_roam_state_t_v01.*/
+    uint8_t                         forbidden;          /**<   Forbidden: 0 -- No, 1 -- Yes.*/
+    uint8_t                         inPRL;              /**<   0 -- Not in PRL, 1 -- In PRL.*/
+    uint8_t                         css;                /**<   Concurrent services supported: 0 -- No, 1 -- Yes.*/
+    uint16_t                        sid;                /**<   CDMA system ID.*/
+    uint16_t                        nid;                /**<   CDMA network ID.*/
+    uint16_t                        bsid;               /**<   Base station ID. @newpagetable */
+}QSER_NW_3GPP2_REG_INFO_T;
+
+/** Gets the status associated with the connection of \<id\>. */
+typedef struct 
+{
+    uint8_t                         voice_registration_valid;               /**< Must be set to TRUE if voice_registration is being passed. */
+    QSER_NW_COMMON_REG_INFO_T     voice_registration;                     /**<   Voice registration. */
+
+    uint8_t                         data_registration_valid;                /**< Must be set to TRUE if data_registration is being passed. */
+    QSER_NW_COMMON_REG_INFO_T     data_registration;                      /**<   Data registration. */
+
+    uint8_t                         voice_registration_details_3gpp_valid;  /**< Must be set to TRUE if voice_registration_details_3gpp is being passed. */
+    QSER_NW_3GPP_REG_INFO_T       voice_registration_details_3gpp;        /**<   Voice registration details for 3GPP. */
+
+    uint8_t                         data_registration_details_3gpp_valid;   /**< Must be set to TRUE if data_registration_details_3gpp is being passed. */
+    QSER_NW_3GPP_REG_INFO_T       data_registration_details_3gpp;         /**<   Data registration details for 3GPP. */
+
+    uint8_t                         voice_registration_details_3gpp2_valid; /**< Must be set to TRUE if voice_registration_details_3gpp2 is being passed. */
+    QSER_NW_3GPP2_REG_INFO_T      voice_registration_details_3gpp2;       /**<   Voice registration details for 3GPP2. */
+
+    uint8_t                         data_registration_details_3gpp2_valid;  /**< Must be set to TRUE if data_registration_details_3gpp2 is being passed. */
+    QSER_NW_3GPP2_REG_INFO_T      data_registration_details_3gpp2;        /**<   Data registration details for 3GPP2. */
+}QSER_NW_REG_STATUS_INFO_T;
+
+typedef enum 
+{
+    E_QSER_NW_IMS_SERVICE_NONE     = 0x0000,  /**<  Not registered */
+    E_QSER_NW_IMS_SERVICE_REGISTERED     = 0x0001,  /**<  Registered*/
+}E_QSER_NW_IMS_SERVICE_TYPE_T;
+
+typedef struct 
+{   
+    E_QSER_NW_IMS_SERVICE_TYPE_T      registration_state; /**<   Registration state.*/
+}QSER_NW_IMS_REG_STATUS_INFO_T;
+
+typedef struct 
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates received signal strength. A signed value; -125 or lower indicates no signal.*/
+}QSER_NW_GSM_SIGNAL_INFO_T;
+
+
+typedef struct 
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Ec. A signed value; -125 or lower indicates no signal.*/
+    int16_t     ecio;       /**<   Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/
+}QSER_NW_WCDMA_SIGNAL_INFO_T;
+
+typedef struct 
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Ec.    a signed value; -125 or lower indicates no signal.*/
+    int8_t      rscp;       /**<   RSCP in dBm.*/
+    int16_t     ecio;       /**<   Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/
+    int8_t      sinr;       /**<   Measured SINR in dB. @newpagetable */
+}QSER_NW_TDSCDMA_SIGNAL_INFO_T;
+
+typedef struct 
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Ec. A signed value; -125 or lower indicates no signal.*/
+    int8_t      rsrq;       /**<   RSRQ value in dB (signed integer value), as measured by L1. Range: -3 to -20 (-3 equals -3 dB, -20 equals -20 dB).*/
+    int16_t      rsrp;       /**<   Current RSRP in dBm, as measured by L1. Range: -44 to -140 (-44 equals -44 dBm, -140 equals -140 dBm).*/
+    int16_t      snr;        /**<   SNR level as a scaled integer in units of 0.1 dB; e.g., -16 dB has a value of -160 and 24.6 dB has a value of 246.*/
+}QSER_NW_LTE_SIGNAL_INFO_T;
+
+typedef struct 
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Power (AGC) + Ec/Io. A signed value; -125 or lower indicates no signal.*/
+    int16_t     ecio;       /**<   Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/
+}QSER_NW_CDMA_SIGNAL_INFO_T;
+
+typedef struct 
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Power (AGC) + Ec/Io. A signed value; -125 or lower indicates no signal.*/
+    int16_t     ecio;       /**<   Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/
+    int8_t      sinr;       /**<   SINR level.*/
+    int32_t     io;         /**<   Received IO in dBm. */
+}QSER_NW_HDR_SIGNAL_INFO_T;
+
+typedef struct
+{
+    int16_t     ssRsrp;   /* SS(Synchronization Signal) reference signal received power, multipled by -1.
+                      * Reference: 3GPP TS 38.215.
+                      * Range [44, 140], INT_MAX means invalid/unreported.*/
+    int16_t     ssRsrq;   /* SS reference signal received quality, multipled by -1.
+                      * Reference: 3GPP TS 38.215.
+                      * Range [3, 20], INT_MAX means invalid/unreported.*/
+    int16_t     ssSinr;   /* SS signal-to-noise and interference ratio.
+                      * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1.
+                      * Range [-23, 40], INT_MAX means invalid/unreported.*/
+    int16_t     csiRsrp;  /* CSI reference signal received power, multipled by -1.
+                      * Reference: 3GPP TS 38.215.
+                      * Range [44, 140], INT_MAX means invalid/unreported.*/
+    int16_t     csiRsrq;  /* CSI reference signal received quality, multipled by -1.
+                      * Reference: 3GPP TS 38.215.
+                      * Range [3, 20], INT_MAX means invalid/unreported.*/
+    int16_t     csiSinr;  /* CSI signal-to-noise and interference ratio.
+                      * Reference: 3GPP TS 138.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1.
+                      * Range [-23, 40], INT_MAX means invalid/unreported.*/
+}QSER_NW_NR_SIGNAL_INFO_T;
+
+
+/** Gets signal strength information. */
+typedef struct 
+{
+    uint8_t                         gsm_sig_info_valid;         /**< Must be set to TRUE if gsm_sig_info is being passed. */
+    QSER_NW_GSM_SIGNAL_INFO_T     gsm_sig_info;               /**<   GSM signal information. */
+    uint8_t                         wcdma_sig_info_valid;       /**< Must be set to TRUE if wcdma_sig_info is being passed. */
+    QSER_NW_WCDMA_SIGNAL_INFO_T   wcdma_sig_info;             /**<   WCDMA signal information. */
+    uint8_t                         tdscdma_sig_info_valid;     /**< Must be set to TRUE if tdscdma_sig_info is being passed. */
+    QSER_NW_TDSCDMA_SIGNAL_INFO_T tdscdma_sig_info;           /**<   TDSCDMA signal information. */
+    uint8_t                         lte_sig_info_valid;         /**< Must be set to TRUE if lte_sig_info is being passed. */
+    QSER_NW_LTE_SIGNAL_INFO_T     lte_sig_info;               /**<   LTE signal information. */
+    uint8_t                         cdma_sig_info_valid;        /**< Must be set to TRUE if cdma_sig_info is being passed. */
+    QSER_NW_CDMA_SIGNAL_INFO_T    cdma_sig_info;              /**<   CDMA signal information. */
+    uint8_t                         hdr_sig_info_valid;         /**< Must be set to TRUE if hdr_sig_info is being passed. */
+    QSER_NW_HDR_SIGNAL_INFO_T     hdr_sig_info;               /**<   HDR signal information. */
+    uint8_t                         nr_sig_info_valid;
+    QSER_NW_NR_SIGNAL_INFO_T      nr_sig_info;
+}QSER_NW_SIGNAL_STRENGTH_INFO_T;
+
+
+
+
+
+/* @bridef Callback function registered to QSER_NW_AddRxMsgHandler 
+ * map of ind_flag and ind_msg_buf as bellow :
+ *  NW_IND_VOICE_REG_EVENT_IND_FLAG : QSER_NW_VOICE_REG_EVENT_IND_T
+ *  NW_IND_DATA_REG_EVENT_IND_FLAG : QSER_NW_DATA_REG_EVENT_IND_T
+ *  NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG : QSER_NW_SINGNAL_EVENT_IND_T
+ *  NW_IND_CELL_ACCESS_STATE_CHG_EVENT_IND_FLAG : QSER_NW_CELL_ACCESS_STATE_EVENT_IND_T
+ *  NW_IND_NITZ_TIME_UPDATE_EVENT_IND_FLAG : QSER_NW_NITZ_TIME_EVENT_IND_T 
+ *  NW_IND_IMS_REG_EVENT_IND_FLAG : NULL 
+ * */
+typedef void (*QSER_NW_RxMsgHandlerFunc_t)(
+    nw_client_handle_type h_nw, 
+    uint32_t ind_flag, 
+    void                  *ind_msg_buf, 
+    uint32_t              ind_msg_len, 
+    void                  *contextPtr
+);
+
+
+/** Indication message; Indication for the corresponding registered event flag NW_IND_VOICE_REG_EVENT_IND_FLAG */
+typedef struct {
+
+  uint8_t                         registration_valid;               /**< Must be set to TRUE if voice_registration is being passed. */
+  QSER_NW_COMMON_REG_INFO_T     registration;                     /**< Voice registration. */
+
+  uint8_t                         registration_details_3gpp_valid;  /**< Must be set to TRUE if voice_registration_details_3gpp is being passed. */
+  QSER_NW_3GPP_REG_INFO_T       registration_details_3gpp;        /**< Voice registration details for 3GPP. */
+
+  uint8_t                         registration_details_3gpp2_valid; /**< Must be set to TRUE if voice_registration_details_3gpp2 is being passed. */
+  QSER_NW_3GPP2_REG_INFO_T      registration_details_3gpp2;       /**< Voice registration details for 3GPP2. */
+}QSER_NW_VOICE_REG_EVENT_IND_T; 
+
+/** Indication message; Indication for the corresponding registered event flag NW_IND_DATA_REG_EVENT_IND_FLAG */
+typedef struct {
+
+  uint8_t                         registration_valid;               /**< Must be set to TRUE if data_registration is being passed. */
+  QSER_NW_COMMON_REG_INFO_T     registration;                     /**< Data registration. */
+  
+  uint8_t                         registration_details_3gpp_valid;  /**< Must be set to TRUE if data_registration_details_3gpp is being passed. */
+  QSER_NW_3GPP_REG_INFO_T       registration_details_3gpp;        /**< Data registration details for 3GPP. */
+
+  uint8_t                         registration_details_3gpp2_valid; /**< Must be set to TRUE if data_registration_details_3gpp2 is being passed. */
+  QSER_NW_3GPP2_REG_INFO_T      registration_details_3gpp2;       /**< Data registration details for 3GPP2. */
+}QSER_NW_DATA_REG_EVENT_IND_T;
+
+
+/** Indication message; Indication for the corresponding registered event flag NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG */
+typedef struct {
+    uint8_t gsm_sig_info_valid;                       /**< Must be set to TRUE if gsm_sig_info is being passed. */
+    QSER_NW_GSM_SIGNAL_INFO_T       gsm_sig_info;   /**< GSM singal information. */
+
+    uint8_t wcdma_sig_info_valid;                     /**< Must be set to TRUE if wcdma_sig_info is being passed. */
+    QSER_NW_WCDMA_SIGNAL_INFO_T wcdma_sig_info;     /**< WCDMA singal information. */
+
+    uint8_t tdscdma_sig_info_valid;                   /**< Must be set to TRUE if tdscdma_sig_info is being passed. */
+    QSER_NW_TDSCDMA_SIGNAL_INFO_T tdscdma_sig_info; /**< TDSCDMA singal information. */
+
+    uint8_t lte_sig_info_valid;                       /**< Must be set to TRUE if lte_sig_info is being passed. */
+    QSER_NW_LTE_SIGNAL_INFO_T lte_sig_info;         /**< LTE singal information. */
+
+    uint8_t cdma_sig_info_valid;                      /**< Must be set to TRUE if cdma_sig_info is being passed. */
+    QSER_NW_CDMA_SIGNAL_INFO_T cdma_sig_info;       /**< CDMA singal information. */
+
+    uint8_t hdr_sig_info_valid;                       /**< Must be set to TRUE if hdr_sig_info is being passed. */
+    QSER_NW_HDR_SIGNAL_INFO_T hdr_sig_info;         /**< HDR singal information. */
+    
+    uint8_t                         nr_sig_info_valid;
+    QSER_NW_NR_SIGNAL_INFO_T      nr_sig_info;
+}QSER_NW_SINGNAL_EVENT_IND_T;
+
+typedef enum 
+{
+    E_QSER_NW_RF_MODE_CFUN_0 = 0,    /**<  CFUN 0. */
+    E_QSER_NW_RF_MODE_CFUN_1 = 1,    /**<  CFUN 1. */
+    E_QSER_NW_RF_MODE_FLIGHT = 4,    /**<  Flight Mode, CFUN 4. */
+}E_QSER_NW_RF_MODE_TYPE_T;
+
+int qser_nw_client_init(nw_client_handle_type  *ph_nw);
+
+int qser_nw_client_deinit(nw_client_handle_type  h_nw);
+
+int qser_nw_set_config
+(
+    nw_client_handle_type       h_nw,
+    QSER_NW_CONFIG_INFO_T     *pt_info 
+);
+
+int qser_nw_set_ims_enable
+(
+    nw_client_handle_type h_nw,
+    E_QSER_NW_IMS_MODE_TYPE_T ims_mode
+);
+
+int qser_nw_set_oos_config
+(
+    nw_client_handle_type       h_nw,
+    QSER_NW_OOS_CONFIG_INFO_T     *pt_info 
+);
+
+int qser_nw_get_oos_config
+(
+    nw_client_handle_type       h_nw,
+    QSER_NW_OOS_CONFIG_INFO_T     *pt_info 
+);
+
+int qser_nw_event_register
+(
+    nw_client_handle_type       h_nw,
+    uint32_t                    bitmask // bit OR of NW_IND_xxxx_EVENT_ON
+);
+
+int qser_nw_get_operator_name
+(
+    nw_client_handle_type           h_nw,
+    QSER_NW_OPERATOR_NAME_INFO_T  *pt_info //You should malloc this or may cause stack overflow
+);
+
+int qser_nw_get_reg_status
+(
+    nw_client_handle_type               h_nw,
+    QSER_NW_REG_STATUS_INFO_T         *pt_info 
+);
+
+int qser_nw_get_ims_reg_status
+(
+    nw_client_handle_type h_nw,
+    QSER_NW_IMS_REG_STATUS_INFO_T *pt_info
+);
+
+int qser_nw_get_signal_strength
+(
+    nw_client_handle_type               h_nw,
+    QSER_NW_SIGNAL_STRENGTH_INFO_T    *pt_info
+);
+
+int qser_nw_add_rx_msg_handler
+(
+    nw_client_handle_type        h_nw,
+    QSER_NW_RxMsgHandlerFunc_t handlerPtr, 
+    void* contextPtr
+);
+
+int qser_nw_set_rf_mode
+(
+    nw_client_handle_type       h_nw,
+    E_QSER_NW_RF_MODE_TYPE_T    rf_mode
+);
+
+int qser_nw_get_rf_mode
+(
+    nw_client_handle_type       h_nw,
+    E_QSER_NW_RF_MODE_TYPE_T    *rf_mode
+);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif//__QSER_NW_H__
diff --git a/esdk/layers/meta-zxic-selinux/recipes-security/refpolicy/files/policy-mls/policy/modules/system/logging.te b/esdk/layers/meta-zxic-selinux/recipes-security/refpolicy/files/policy-mls/policy/modules/system/logging.te
new file mode 100755
index 0000000..fe01295
--- /dev/null
+++ b/esdk/layers/meta-zxic-selinux/recipes-security/refpolicy/files/policy-mls/policy/modules/system/logging.te
@@ -0,0 +1,677 @@
+policy_module(logging, 1.33.1)
+
+########################################
+#
+# Declarations
+#
+
+attribute logfile;
+
+type auditctl_t;
+type auditctl_exec_t;
+init_system_domain(auditctl_t, auditctl_exec_t)
+role system_r types auditctl_t;
+
+type auditd_etc_t;
+files_security_file(auditd_etc_t)
+
+type auditd_log_t;
+files_security_file(auditd_log_t)
+files_security_mountpoint(auditd_log_t)
+
+type audit_spool_t;
+files_security_file(audit_spool_t)
+files_security_mountpoint(audit_spool_t)
+
+type auditd_t;
+type auditd_exec_t;
+init_daemon_domain(auditd_t, auditd_exec_t)
+
+type auditd_initrc_exec_t;
+init_script_file(auditd_initrc_exec_t)
+
+type auditd_runtime_t alias auditd_var_run_t;
+files_runtime_file(auditd_runtime_t)
+
+type auditd_unit_t;
+init_unit_file(auditd_unit_t)
+
+type audisp_t;
+type audisp_exec_t;
+init_system_domain(audisp_t, audisp_exec_t)
+
+type audisp_remote_t;
+type audisp_remote_exec_t;
+logging_dispatcher_domain(audisp_remote_t, audisp_remote_exec_t)
+
+type audisp_runtime_t alias audisp_var_run_t;
+files_runtime_file(audisp_runtime_t)
+
+type devlog_t;
+files_type(devlog_t)
+mls_trusted_object(devlog_t)
+
+type klogd_t;
+type klogd_exec_t;
+init_daemon_domain(klogd_t, klogd_exec_t)
+
+type klogd_runtime_t alias klogd_var_run_t;
+files_runtime_file(klogd_runtime_t)
+
+type klogd_tmp_t;
+files_tmp_file(klogd_tmp_t)
+
+type syslog_conf_t;
+files_config_file(syslog_conf_t)
+
+type syslogd_t;
+type syslogd_exec_t;
+init_daemon_domain(syslogd_t, syslogd_exec_t)
+init_named_socket_activation(syslogd_t, syslogd_runtime_t)
+mls_trusted_socket(syslogd_t)
+
+type syslogd_initrc_exec_t;
+init_script_file(syslogd_initrc_exec_t)
+
+type syslogd_runtime_t alias syslogd_var_run_t;
+files_runtime_file(syslogd_runtime_t)
+
+type syslogd_tmp_t;
+files_tmp_file(syslogd_tmp_t)
+
+type syslogd_unit_t;
+init_unit_file(syslogd_unit_t)
+
+type syslogd_var_lib_t;
+files_type(syslogd_var_lib_t)
+
+type var_log_t;
+logging_log_file(var_log_t)
+files_mountpoint(var_log_t)
+
+ifdef(`enable_mls',`
+	init_ranged_daemon_domain(auditd_t, auditd_exec_t, mls_systemhigh)
+	init_ranged_daemon_domain(syslogd_t, syslogd_exec_t, mls_systemhigh)
+')
+
+########################################
+#
+# Auditctl local policy
+#
+
+allow auditctl_t self:capability { dac_override dac_read_search fsetid };
+allow auditctl_t self:process getcap;
+allow auditctl_t self:netlink_audit_socket nlmsg_readpriv;
+
+read_files_pattern(auditctl_t, auditd_etc_t, auditd_etc_t)
+allow auditctl_t auditd_etc_t:dir list_dir_perms;
+dontaudit auditctl_t auditd_etc_t:file map;
+
+corecmd_search_bin(auditctl_t)
+
+# Needed for adding watches
+files_getattr_all_dirs(auditctl_t)
+files_getattr_all_files(auditctl_t)
+files_read_etc_files(auditctl_t)
+
+kernel_read_kernel_sysctls(auditctl_t)
+kernel_read_proc_symlinks(auditctl_t)
+kernel_setsched(auditctl_t)
+kernel_getattr_proc(auditctl_t)
+
+domain_read_all_domains_state(auditctl_t)
+domain_use_interactive_fds(auditctl_t)
+
+mls_file_read_all_levels(auditctl_t)
+
+term_use_all_terms(auditctl_t)
+
+init_dontaudit_use_fds(auditctl_t)
+
+logging_set_audit_parameters(auditctl_t)
+logging_send_syslog_msg(auditctl_t)
+
+miscfiles_read_localization(auditctl_t)
+
+ifdef(`init_systemd',`
+	init_rw_stream_sockets(auditctl_t)
+')
+
+optional_policy(`
+	locallogin_dontaudit_use_fds(auditctl_t)
+')
+
+########################################
+#
+# Auditd local policy
+#
+
+allow auditd_t self:capability { chown fsetid sys_nice sys_resource };
+dontaudit auditd_t self:capability sys_tty_config;
+allow auditd_t self:process { getcap signal_perms setcap setpgid setsched };
+allow auditd_t self:file rw_file_perms;
+allow auditd_t self:unix_dgram_socket create_socket_perms;
+allow auditd_t self:fifo_file rw_fifo_file_perms;
+allow auditd_t self:tcp_socket create_stream_socket_perms;
+
+allow auditd_t auditd_etc_t:dir list_dir_perms;
+allow auditd_t auditd_etc_t:file read_file_perms;
+dontaudit auditd_t auditd_etc_t:file map;
+
+allow auditd_t audisp_remote_exec_t:file getattr;
+
+manage_files_pattern(auditd_t, auditd_log_t, auditd_log_t)
+allow auditd_t auditd_log_t:dir setattr;
+manage_lnk_files_pattern(auditd_t, auditd_log_t, auditd_log_t)
+allow auditd_t var_log_t:dir search_dir_perms;
+allow auditd_t var_log_t:lnk_file read_lnk_file_perms;
+
+manage_files_pattern(auditd_t, auditd_runtime_t, auditd_runtime_t)
+manage_sock_files_pattern(auditd_t, auditd_runtime_t, auditd_runtime_t)
+files_runtime_filetrans(auditd_t, auditd_runtime_t, { file sock_file })
+
+kernel_read_kernel_sysctls(auditd_t)
+# Needs to be able to run dispatcher.  see /etc/audit/auditd.conf
+# Probably want a transition, and a new auditd_helper app
+kernel_read_system_state(auditd_t)
+
+dev_read_sysfs(auditd_t)
+
+fs_getattr_all_fs(auditd_t)
+fs_search_auto_mountpoints(auditd_t)
+fs_rw_anon_inodefs_files(auditd_t)
+
+selinux_search_fs(auditctl_t)
+
+corenet_all_recvfrom_netlabel(auditd_t)
+corenet_tcp_sendrecv_generic_if(auditd_t)
+corenet_tcp_sendrecv_generic_node(auditd_t)
+corenet_tcp_bind_generic_node(auditd_t)
+corenet_tcp_bind_audit_port(auditd_t)
+corenet_sendrecv_audit_server_packets(auditd_t)
+
+# Needs to be able to run dispatcher.  see /etc/audit/auditd.conf
+# Probably want a transition, and a new auditd_helper app
+corecmd_exec_bin(auditd_t)
+corecmd_exec_shell(auditd_t)
+
+domain_use_interactive_fds(auditd_t)
+
+files_read_etc_files(auditd_t)
+files_list_usr(auditd_t)
+
+init_telinit(auditd_t)
+
+logging_set_audit_parameters(auditd_t)
+logging_send_syslog_msg(auditd_t)
+logging_domtrans_dispatcher(auditd_t)
+logging_signal_dispatcher(auditd_t)
+
+miscfiles_read_localization(auditd_t)
+
+mls_file_read_all_levels(auditd_t)
+mls_file_write_all_levels(auditd_t) # Need to be able to write to /var/run/ directory
+mls_fd_use_all_levels(auditd_t)
+mls_socket_write_all_levels(auditd_t)
+
+seutil_dontaudit_read_config(auditd_t)
+
+sysnet_dns_name_resolve(auditd_t)
+
+userdom_use_user_terminals(auditd_t)
+userdom_dontaudit_use_unpriv_user_fds(auditd_t)
+userdom_dontaudit_search_user_home_dirs(auditd_t)
+
+ifdef(`distro_ubuntu',`
+	optional_policy(`
+		unconfined_domain(auditd_t)
+	')
+')
+
+optional_policy(`
+	mta_send_mail(auditd_t)
+')
+
+optional_policy(`
+	seutil_sigchld_newrole(auditd_t)
+')
+
+optional_policy(`
+	init_list_unit_dirs(auditd_t)
+	systemd_start_power_units(auditd_t)
+	systemd_status_power_units(auditd_t)
+')
+
+########################################
+#
+# audit dispatcher local policy
+#
+
+allow audisp_t self:capability { dac_override setpcap sys_nice };
+allow audisp_t self:process { getcap signal_perms setcap setsched };
+allow audisp_t self:fifo_file rw_fifo_file_perms;
+allow audisp_t self:unix_stream_socket create_stream_socket_perms;
+allow audisp_t self:unix_dgram_socket create_socket_perms;
+
+allow audisp_t auditd_t:unix_stream_socket rw_socket_perms;
+
+manage_sock_files_pattern(audisp_t, audisp_runtime_t, audisp_runtime_t)
+files_runtime_filetrans(audisp_t, audisp_runtime_t, sock_file)
+
+kernel_read_system_state(audisp_t)
+
+corecmd_exec_bin(audisp_t)
+corecmd_exec_shell(audisp_t)
+
+domain_use_interactive_fds(audisp_t)
+
+files_map_etc_files(audisp_t)
+files_read_etc_files(audisp_t)
+files_read_etc_runtime_files(audisp_t)
+
+mls_file_write_all_levels(audisp_t)
+
+logging_send_syslog_msg(audisp_t)
+
+miscfiles_read_localization(audisp_t)
+
+sysnet_dns_name_resolve(audisp_t)
+
+optional_policy(`
+	dbus_system_bus_client(audisp_t)
+')
+
+########################################
+#
+# Audit remote logger local policy
+#
+
+allow audisp_remote_t self:capability { setpcap setuid };
+allow audisp_remote_t self:process { getcap setcap };
+allow audisp_remote_t self:tcp_socket create_socket_perms;
+allow audisp_remote_t var_log_t:dir search_dir_perms;
+allow audisp_remote_t var_log_t:lnk_file read_lnk_file_perms;
+
+manage_dirs_pattern(audisp_remote_t, audit_spool_t, audit_spool_t)
+manage_files_pattern(audisp_remote_t, audit_spool_t, audit_spool_t)
+files_spool_filetrans(audisp_remote_t, audit_spool_t, { dir file })
+
+corecmd_exec_bin(audisp_remote_t)
+
+corenet_all_recvfrom_netlabel(audisp_remote_t)
+corenet_tcp_sendrecv_generic_if(audisp_remote_t)
+corenet_tcp_sendrecv_generic_node(audisp_remote_t)
+corenet_tcp_bind_audit_port(audisp_remote_t)
+corenet_tcp_bind_generic_node(audisp_remote_t)
+corenet_tcp_connect_audit_port(audisp_remote_t)
+corenet_sendrecv_audit_client_packets(audisp_remote_t)
+
+files_read_etc_files(audisp_remote_t)
+
+logging_send_syslog_msg(audisp_remote_t)
+logging_send_audit_msgs(audisp_remote_t)
+
+miscfiles_read_localization(audisp_remote_t)
+
+sysnet_dns_name_resolve(audisp_remote_t)
+
+########################################
+#
+# klogd local policy
+#
+
+allow klogd_t self:capability sys_admin;
+dontaudit klogd_t self:capability { sys_resource sys_tty_config };
+allow klogd_t self:process signal_perms;
+
+manage_dirs_pattern(klogd_t, klogd_tmp_t, klogd_tmp_t)
+manage_files_pattern(klogd_t, klogd_tmp_t, klogd_tmp_t)
+files_tmp_filetrans(klogd_t, klogd_tmp_t,{ file dir })
+
+manage_files_pattern(klogd_t, klogd_runtime_t, klogd_runtime_t)
+files_runtime_filetrans(klogd_t, klogd_runtime_t, file)
+
+kernel_read_system_state(klogd_t)
+kernel_read_messages(klogd_t)
+kernel_read_kernel_sysctls(klogd_t)
+# Control syslog and console logging
+kernel_clear_ring_buffer(klogd_t)
+kernel_change_ring_buffer_level(klogd_t)
+
+files_read_kernel_symbol_table(klogd_t)
+
+dev_read_raw_memory_cond(klogd_t, allow_raw_memory_access)
+dev_read_sysfs(klogd_t)
+
+fs_getattr_all_fs(klogd_t)
+fs_search_auto_mountpoints(klogd_t)
+
+domain_use_interactive_fds(klogd_t)
+
+files_read_etc_runtime_files(klogd_t)
+# read /etc/nsswitch.conf
+files_read_etc_files(klogd_t)
+
+logging_send_syslog_msg(klogd_t)
+
+miscfiles_read_localization(klogd_t)
+
+mls_file_read_all_levels(klogd_t)
+
+userdom_dontaudit_search_user_home_dirs(klogd_t)
+
+ifdef(`distro_ubuntu',`
+	optional_policy(`
+		unconfined_domain(klogd_t)
+	')
+')
+
+optional_policy(`
+	seutil_sigchld_newrole(klogd_t)
+')
+
+########################################
+#
+# syslogd local policy
+#
+
+# chown fsetid for syslog-ng
+# sys_admin for the integrated klog of syslog-ng and metalog
+# sys_nice for rsyslog
+# cjp: why net_admin!
+allow syslogd_t self:capability { chown dac_override fsetid net_admin setgid setuid sys_admin sys_nice sys_resource sys_tty_config };
+dontaudit syslogd_t self:capability { sys_ptrace };
+# setpgid for metalog
+# setrlimit for syslog-ng
+# getsched for syslog-ng
+# setsched for rsyslog
+# getcap/setcap for syslog-ng
+allow syslogd_t self:process { getcap setcap signal_perms setpgid setrlimit getsched setsched };
+# receive messages to be logged
+allow syslogd_t self:unix_dgram_socket create_socket_perms;
+allow syslogd_t self:unix_stream_socket create_stream_socket_perms;
+allow syslogd_t self:unix_dgram_socket sendto;
+allow syslogd_t self:fifo_file rw_fifo_file_perms;
+allow syslogd_t self:udp_socket create_socket_perms;
+allow syslogd_t self:tcp_socket create_stream_socket_perms;
+
+allow syslogd_t syslog_conf_t:file read_file_perms;
+allow syslogd_t syslog_conf_t:dir list_dir_perms;
+
+# Create and bind to /dev/log or /var/run/log.
+allow syslogd_t devlog_t:sock_file manage_sock_file_perms;
+allow syslogd_t devlog_t:lnk_file manage_lnk_file_perms;
+files_runtime_filetrans(syslogd_t, devlog_t, sock_file)
+init_runtime_filetrans(syslogd_t, devlog_t, sock_file, "dev-log")
+
+# create/append log files.
+manage_files_pattern(syslogd_t, var_log_t, var_log_t)
+allow syslogd_t var_log_t:file map;
+rw_fifo_files_pattern(syslogd_t, var_log_t, var_log_t)
+files_search_spool(syslogd_t)
+
+# Allow access for syslog-ng
+allow syslogd_t var_log_t:dir { create setattr };
+allow syslogd_t var_log_t:lnk_file read_lnk_file_perms;
+
+# for systemd but can not be conditional
+files_runtime_filetrans(syslogd_t, syslogd_tmp_t, dir, "log")
+
+# manage temporary files
+manage_dirs_pattern(syslogd_t, syslogd_tmp_t, syslogd_tmp_t)
+manage_files_pattern(syslogd_t, syslogd_tmp_t, syslogd_tmp_t)
+allow syslogd_t syslogd_tmp_t:file map;
+
+files_tmp_filetrans(syslogd_t, syslogd_tmp_t, { dir file })
+
+manage_files_pattern(syslogd_t, syslogd_var_lib_t, syslogd_var_lib_t)
+allow syslogd_t syslogd_var_lib_t:file map;
+files_search_var_lib(syslogd_t)
+
+# manage runtime files
+allow syslogd_t syslogd_runtime_t:dir create_dir_perms;
+allow syslogd_t syslogd_runtime_t:sock_file { create setattr unlink };
+allow syslogd_t syslogd_runtime_t:file map;
+manage_files_pattern(syslogd_t, syslogd_runtime_t, syslogd_runtime_t)
+files_runtime_filetrans(syslogd_t, syslogd_runtime_t, file)
+
+kernel_read_crypto_sysctls(syslogd_t)
+kernel_read_system_state(syslogd_t)
+kernel_read_network_state(syslogd_t)
+kernel_read_kernel_sysctls(syslogd_t)
+kernel_read_proc_symlinks(syslogd_t)
+# Allow access to /proc/kmsg for syslog-ng
+kernel_read_messages(syslogd_t)
+# rsyslog
+kernel_read_vm_overcommit_sysctl(syslogd_t)
+kernel_clear_ring_buffer(syslogd_t)
+kernel_change_ring_buffer_level(syslogd_t)
+# Read ring buffer for journald
+kernel_read_ring_buffer(syslogd_t)
+# /initrd is not umounted before minilog starts
+kernel_dontaudit_search_unlabeled(syslogd_t)
+
+corenet_all_recvfrom_netlabel(syslogd_t)
+corenet_udp_sendrecv_generic_if(syslogd_t)
+corenet_udp_sendrecv_generic_node(syslogd_t)
+corenet_udp_bind_generic_node(syslogd_t)
+corenet_udp_bind_syslogd_port(syslogd_t)
+# syslog-ng can listen and connect on tcp port 514 (rsh)
+corenet_tcp_sendrecv_generic_if(syslogd_t)
+corenet_tcp_sendrecv_generic_node(syslogd_t)
+corenet_tcp_bind_generic_node(syslogd_t)
+corenet_tcp_bind_rsh_port(syslogd_t)
+corenet_tcp_connect_rsh_port(syslogd_t)
+# Allow users to define additional syslog ports to connect to
+corenet_tcp_bind_syslogd_port(syslogd_t)
+corenet_tcp_connect_syslogd_port(syslogd_t)
+corenet_tcp_connect_postgresql_port(syslogd_t)
+corenet_tcp_connect_mysqld_port(syslogd_t)
+
+# syslog-ng can send or receive logs
+corenet_sendrecv_syslogd_client_packets(syslogd_t)
+corenet_sendrecv_syslogd_server_packets(syslogd_t)
+corenet_sendrecv_postgresql_client_packets(syslogd_t)
+corenet_sendrecv_mysqld_client_packets(syslogd_t)
+
+dev_filetrans(syslogd_t, devlog_t, sock_file)
+dev_read_sysfs(syslogd_t)
+dev_read_urand(syslogd_t)
+# Allow access to /dev/kmsg for journald
+dev_rw_kmsg(syslogd_t)
+
+domain_use_interactive_fds(syslogd_t)
+# Allow access to /proc/ information for journald
+domain_read_all_domains_state(syslogd_t)
+
+files_read_etc_files(syslogd_t)
+files_read_usr_files(syslogd_t)
+files_read_var_files(syslogd_t)
+files_read_etc_runtime_files(syslogd_t)
+# /initrd is not umounted before minilog starts
+files_read_kernel_symbol_table(syslogd_t)
+files_var_lib_filetrans(syslogd_t, syslogd_var_lib_t, { file dir })
+
+fs_getattr_all_fs(syslogd_t)
+fs_search_auto_mountpoints(syslogd_t)
+fs_search_tmpfs(syslogd_t)
+
+mls_file_write_all_levels(syslogd_t) # Need to be able to write to /var/run/ and /var/log directories
+mls_file_read_all_levels(syslogd_t)
+mls_socket_write_all_levels(syslogd_t) # Neet to be able to sendto dgram
+mls_trusted_object(syslogd_t) # Other process need to have the right to connectto/sendto /dev/log
+mls_fd_use_all_levels(syslogd_t)
+
+term_write_console(syslogd_t)
+# Allow syslog to a terminal
+term_write_unallocated_ttys(syslogd_t)
+
+# for sending messages to logged in users
+init_read_utmp(syslogd_t)
+init_dontaudit_write_utmp(syslogd_t)
+term_write_all_ttys(syslogd_t)
+
+auth_use_nsswitch(syslogd_t)
+
+init_use_fds(syslogd_t)
+
+miscfiles_read_localization(syslogd_t)
+
+seutil_read_config(syslogd_t)
+
+userdom_dontaudit_use_unpriv_user_fds(syslogd_t)
+userdom_dontaudit_search_user_home_dirs(syslogd_t)
+
+ifdef(`init_systemd',`
+	# for systemd-journal
+	allow syslogd_t self:netlink_audit_socket connected_socket_perms;
+	allow syslogd_t self:capability2 audit_read;
+	allow syslogd_t self:capability { chown setgid setuid sys_ptrace dac_read_search sys_rawio };
+	allow syslogd_t self:netlink_audit_socket { getattr getopt read setopt write nlmsg_write };
+
+	# remove /run/log/journal when switching to permanent storage
+	allow syslogd_t var_log_t:dir rmdir;
+
+	kernel_getattr_dgram_sockets(syslogd_t)
+	kernel_read_ring_buffer(syslogd_t)
+	kernel_rw_stream_sockets(syslogd_t)
+	kernel_rw_unix_dgram_sockets(syslogd_t)
+	kernel_rw_netlink_audit_sockets(syslogd_t)
+	kernel_use_fds(syslogd_t)
+
+	dev_read_kmsg(syslogd_t)
+	dev_read_urand(syslogd_t)
+	dev_write_kmsg(syslogd_t)
+
+	domain_getattr_all_domains(syslogd_t)
+	domain_read_all_domains_state(syslogd_t)
+
+	init_create_runtime_dirs(syslogd_t)
+	init_daemon_runtime_file(syslogd_runtime_t, dir, "syslogd")
+	init_getattr(syslogd_t)
+	init_rename_runtime_files(syslogd_t)
+	init_delete_runtime_files(syslogd_t)
+	init_dgram_send(syslogd_t)
+	init_read_runtime_pipes(syslogd_t)
+	init_read_runtime_symlinks(syslogd_t)
+	init_read_state(syslogd_t)
+
+	# needed for systemd-initrd case when syslog socket is unlabelled
+	logging_send_syslog_msg(syslogd_t)
+
+	logging_set_loginuid(syslogd_t)
+
+	systemd_manage_journal_files(syslogd_t)
+
+	udev_read_runtime_files(syslogd_t)
+
+	userdom_search_user_runtime(syslogd_t)
+	systemd_search_user_runtime(syslogd_t)
+')
+
+ifdef(`distro_gentoo',`
+	# default gentoo syslog-ng config appends kernel
+	# and high priority messages to /dev/tty12
+	# and chown/chgrp/chmod /dev/tty12, which is denied
+	term_dontaudit_setattr_unallocated_ttys(syslogd_t)
+')
+
+ifdef(`distro_suse',`
+	# suse creates a /dev/log under /var/lib/stunnel for chrooted stunnel
+	files_var_lib_filetrans(syslogd_t, devlog_t, sock_file)
+')
+
+ifdef(`distro_ubuntu',`
+	optional_policy(`
+		unconfined_domain(syslogd_t)
+	')
+')
+
+optional_policy(`
+	bind_search_cache(syslogd_t)
+')
+
+optional_policy(`
+	cron_manage_log_files(syslogd_t)
+	cron_generic_log_filetrans_log(syslogd_t, file, "cron.log")
+')
+
+optional_policy(`
+	inn_manage_log(syslogd_t)
+	inn_generic_log_filetrans_innd_log(syslogd_t, file, "news.crit")
+	inn_generic_log_filetrans_innd_log(syslogd_t, file, "news.err")
+	inn_generic_log_filetrans_innd_log(syslogd_t, file, "news.notice")
+')
+
+optional_policy(`
+	mysql_stream_connect(syslogd_t)
+')
+
+optional_policy(`
+	postgresql_stream_connect(syslogd_t)
+')
+
+optional_policy(`
+	seutil_sigchld_newrole(syslogd_t)
+')
+
+optional_policy(`
+	# log to the xconsole
+	xserver_rw_console(syslogd_t)
+')
+gen_require(`
+    type default_t;
+	type nvserver_t;
+	type mnt_t;
+	type tmpfs_t;
+	type unlabeled_t;
+	type nvserver_t;
+	type mnt_t;
+')
+allow syslogd_t self:netlink_audit_socket nlmsg_write;
+allow syslogd_t self:capability audit_control;
+allow syslogd_t syslogd_var_run_t:sock_file create;
+allow syslogd_t tmpfs_t:dir { remove_name unlink add_name search create write open getattr };
+allow syslogd_t tmpfs_t:file { unlink create write open getattr };
+allow syslogd_t initrc_t:msg { send receive };
+allow syslogd_t initrc_t:msgq { create associate  getattr setattr read write unix_read unix_write };
+allow syslogd_t bin_t:file { map read  execute };
+allow syslogd_t nvserver_t:msgq { create associate getattr setattr read write unix_read unix_write };
+allow syslogd_t nvserver_t:msg { send receive };
+allow syslogd_t default_t:lnk_file { read };
+allow syslogd_t mnt_t:dir { search create };
+manage_chr_files_pattern(klogd_t, bin_t, bin_t)
+manage_dirs_pattern(klogd_t, bin_t, bin_t)
+manage_files_pattern(klogd_t,bin_t, bin_t)
+manage_chr_files_pattern(syslogd_t, var_t, var_t)
+manage_dirs_pattern(syslogd_t, var_t, var_t)
+manage_files_pattern(syslogd_t,var_t, var_t)
+manage_chr_files_pattern(syslogd_t, default_t, default_t)
+manage_dirs_pattern(syslogd_t, default_t, default_t)
+manage_files_pattern(syslogd_t,default_t, default_t)
+allow klogd_t bin_t:file { map execute };
+allow klogd_t default_t:lnk_file { read };
+allow klogd_t mnt_t:dir { search create };
+allow klogd_t tmpfs_t:dir { remove_name unlink add_name search create write open getattr };
+allow klogd_t tmpfs_t:file { unlink create write open getattr };
+manage_chr_files_pattern(syslogd_t, unlabeled_t, unlabeled_t)
+manage_dirs_pattern(syslogd_t, unlabeled_t, unlabeled_t)
+manage_files_pattern(syslogd_t,unlabeled_t, unlabeled_t)
+manage_chr_files_pattern(klogd_t, var_t, var_t)
+manage_dirs_pattern(klogd_t, var_t, var_t)
+manage_files_pattern(klogd_t,var_t, var_t)
+manage_lnk_files_pattern(klogd_t, var_t, var_t)
+manage_chr_files_pattern(klogd_t, unlabeled_t, unlabeled_t)
+manage_dirs_pattern(klogd_t, unlabeled_t, unlabeled_t)
+manage_files_pattern(klogd_t,unlabeled_t, unlabeled_t)
+manage_lnk_files_pattern(klogd_t, unlabeled_t, unlabeled_t)
+allow syslogd_t nvserver_t:msgq { unix_read unix_write associate getattr write read };
+allow syslogd_t nvserver_t:msg { send receive };
+allow syslogd_t default_t:lnk_file { read  };
+allow syslogd_t mnt_t:dir { search };
+allow syslogd_t tmpfs_t:dir { write add_name remove_name search };
+
+allow syslogd_t self:capability { sys_rawio };
+
+
+
diff --git a/esdk/layers/meta-zxic/recipes-kernel/linux-libc-headers/linux-libc-headers_5.10.bb b/esdk/layers/meta-zxic/recipes-kernel/linux-libc-headers/linux-libc-headers_5.10.bb
new file mode 100755
index 0000000..98ea747
--- /dev/null
+++ b/esdk/layers/meta-zxic/recipes-kernel/linux-libc-headers/linux-libc-headers_5.10.bb
@@ -0,0 +1,23 @@
+require linux-libc-headers.inc
+
+SRC_URI_append_libc-musl = "\
+    file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \
+    file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \
+    file://0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch \
+    file://0001-include-linux-stddef.h-in-swab.h-uapi-header.patch \
+   "
+
+SRC_URI_append = "\
+    file://0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch \
+    file://0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch \
+    file://0001-add-zxic-volte_drv.h.patch \
+    file://0002-add-zxic-rpmsg_zx29.h.patch \
+    file://0003-add-zxic-bsp_api_h.patch \
+    file://0001-mtd-abi.h.patch \
+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
+
+SRC_URI[md5sum] = "753adc474bf799d569dec4f165ed92c3"
+SRC_URI[sha256sum] = "dcdf99e43e98330d925016985bfbc7b83c66d367b714b2de0cbbfcbf83d8ca43"
+