[Bugfix][T108][bug-view-1367] not support gsw set vlan info
Only Configure: No
Affected branch: unknown
Affected module: rtp
Is it affected on both ZXIC and ASR: only ASR
Self-test: yes
Doc Update: no
Change-Id: I9cf849d46788e7de7d4be26a8b00143faf1a2fe8
diff --git a/mbtk/libgsw_lib/gsw_voice_interface.c b/mbtk/libgsw_lib/gsw_voice_interface.c
index 1063c79..d74802a 100755
--- a/mbtk/libgsw_lib/gsw_voice_interface.c
+++ b/mbtk/libgsw_lib/gsw_voice_interface.c
@@ -217,6 +217,7 @@
int (*mbtk_rtp_client_port_set)(int port);
int (*mbtk_rtp_sample_rate_set)(int sample_rate);
int (*mbtk_rtp_channel_set)(int channel);
+int (*mbtk_rtp_vlan_set)(const char *vlan);
/*rtp end*/
@@ -365,6 +366,13 @@
LOGE("mbtk_rtp_channel_set dlsym fail\n");
return GSW_HAL_NORMAL_FAIL;
}
+
+ mbtk_rtp_vlan_set = (int (*)(const char *vlan))dlsym(dlHandle_mbtk, "mbtk_rtp_vlan_set");
+ if (mbtk_rtp_vlan_set == NULL)
+ {
+ LOGE("mbtk_rtp_vlan_set dlsym fail\n");
+ return GSW_HAL_NORMAL_FAIL;
+ }
return GSW_HAL_SUCCESS;
}
@@ -1008,5 +1016,27 @@
}
return GSW_HAL_SUCCESS;
}
+
+/**
+ * @brief set rtp vlan
+ * @param [in] interfaceName network interface name
+ * @retval 0: success
+ * @retval other: fail
+ */
+int32_t gsw_voice_set_rtp_vlan_info(const char *interfaceName)
+{
+ if(gsw_voice_init_flag == 0)
+ {
+ return GSW_HAL_NORMAL_FAIL;
+ }
+
+ int ret=mbtk_rtp_vlan_set(interfaceName);
+
+ if(ret !=0 )
+ {
+ return GSW_HAL_NORMAL_FAIL;
+ }
+ return GSW_HAL_SUCCESS;
+}
/*##########################################rtp end*/
diff --git a/mbtk/test/libgsw_lib/gsw_voice_test.c b/mbtk/test/libgsw_lib/gsw_voice_test.c
index 894ac86..366b58a 100755
--- a/mbtk/test/libgsw_lib/gsw_voice_test.c
+++ b/mbtk/test/libgsw_lib/gsw_voice_test.c
@@ -118,6 +118,7 @@
int32_t (*gsw_voice_set_remote_rtp_ip)(const char *ip, int32_t len);
int32_t (*gsw_voice_set_rtp_port)(RTPMode rtpMode, int32_t port);
int32_t (*gsw_voice_set_rtp_param)(int32_t clockRate, int32_t channel, int32_t latency);
+int32_t (*gsw_voice_set_rtp_vlan_info)(const char *interfaceName);
/*#############################rtp end*/
CallHandle call_handle;
@@ -166,9 +167,9 @@
return -1;
}
- gsw_voice_get_current_call_end_reason = (int32_t (*)(CallHandle handle))dlsym(dlHandle_voice, "gsw_voice_get_current_call_end_reason");
- if(gsw_voice_get_current_call_end_reason == NULL) {
- printf("dlsym gsw_voice_get_current_call_end_reason failed: %s\n", dlerror());
+ gsw_voice_set_rtp_vlan_info = (int32_t (*)(const char *interfaceName))dlsym(dlHandle_voice, "gsw_voice_set_rtp_vlan_info");
+ if(gsw_voice_set_rtp_vlan_info == NULL) {
+ printf("dlsym gsw_voice_set_rtp_vlan_info failed: %s\n", dlerror());
return -1;
}
@@ -223,6 +224,12 @@
return -1;
}
+ gsw_voice_get_current_call_end_reason = (int32_t (*)(CallHandle handle))dlsym(dlHandle_voice, "gsw_voice_get_current_call_end_reason");
+ if(gsw_voice_get_current_call_end_reason == NULL) {
+ printf("dlsym gsw_voice_get_current_call_end_reason failed: %s\n", dlerror());
+ return -1;
+ }
+
return gsw_rtp_api_import();
}
@@ -248,7 +255,8 @@
"\t8 set remote rtp ip\n"
"\t9 set rtp port\n"
"\t10 set rtp param\n"
- "\t11 get current call end reason\n"
+ "\t11 set rtp vlan\n"
+ "\t12 get current call end reason\n"
"operator: >> \n");
memset(operator, 0, sizeof(operator));
@@ -473,9 +481,31 @@
}
}
break;
+ case 11:
+ {
+ printf(">>>>>Input gsw_voice_set_rtp_vlan_info<<<<<\n");
+
+ char interface[100] = {0};
+
+ printf("Enter vlan interface info (for example: eth2.4) \n");
+ printf("%d\n",scanf("%s", interface));
+ fflush(stdin);
+ printf("vlan interface is %s\n", interface);
+
+ ret = gsw_voice_set_rtp_vlan_info(interface);
+ if(ret != 0)
+ {
+ printf("gsw_voice_set_rtp_vlan_info fail\n");
+ }
+ else
+ {
+ printf("gsw_voice_set_rtp_vlan_info success\n");
+ }
+ }
+ break;
/*#############################rtp end*/
- case 11:
+ case 12:
{
printf(">>>>gsw_voice_get_current_call_end_reason<<<\n");
ret = gsw_voice_get_current_call_end_reason(call_handle);