diff --git a/network/netmanager/include/net_connection.h b/network/netmanager/include/net_connection.h index 0ab63a063080a619c9d6d44964064b819a5e8a44..a8a896b8b8b95345d68afde3832c2056ecb88bfc 100644 --- a/network/netmanager/include/net_connection.h +++ b/network/netmanager/include/net_connection.h @@ -401,6 +401,42 @@ int32_t OH_NetConn_QueryProbeResult(char *destination, int32_t duration, NetConn int32_t OH_NetConn_QueryTraceRoute(char *destination, NetConn_TraceRouteOption *option, NetConn_TraceRouteInfo *traceRouteInfo); +/** + * @brief Sets the URL of the current PAC file script. + * Proxy information can be obtained through parsing the script address. + * + * @param pacUrl the URL of the current PAC script. + * @return the result defines in {@link NetConn_ErrorCode}. + * {@link NETCONN_SUCCESS} Success. + * {@link NETCONN_PERMISSION_DENIED} Permission denied. + * {@link NETCONN_PARAMETER_ERROR} Parameter check failed. + * {@link NETCONN_OPERATION_FAILED} Failed to connect to the service. + * @permission ohos.permission.SET_PAC_URL + * @since 20 + */ +NetConn_ErrorCode OH_NetConn_SetPacFileUrl(const char *pacUrl); + +/** + * @brief find the proxy infomation for the url + * @param url the url link + * @param proxy the pac proxy infomation + * @return the proxy result + * @since 20 + */ +NetConn_ErrorCode OH_NetConn_FindProxyForUrl(const char *url, char *proxy); + +/** + * @brief Obtains the URL of the current PAC file script. + * + * @param pacUrl the URL of the current PAC script. + * @return the result defines in {@link NetConn_ErrorCode}. + * {@link NETCONN_SUCCESS} Success. + * {@link NETCONN_PARAMETER_ERROR} Parameter check failed. + * {@link NETCONN_OPERATION_FAILED} Failed to connect to the service. + * @since 20 + */ +NetConn_ErrorCode OH_NetConn_GetPacFileUrl(char *pacUrl); + #ifdef __cplusplus } #endif diff --git a/network/netmanager/libnet_connection.ndk.json b/network/netmanager/libnet_connection.ndk.json index ed2a16131598098e136c2718e19eecb1c6c753e1..b5be47e8e8ad9e3a3121a49c1ae9319133185691 100644 --- a/network/netmanager/libnet_connection.ndk.json +++ b/network/netmanager/libnet_connection.ndk.json @@ -94,5 +94,17 @@ { "first_introduced": "20", "name": "OH_NetConn_QueryTraceRoute" + }, + { + "first_introduced": "20", + "name": "OH_NetConn_SetPacFileUrl" + }, + { + "first_introduced": "20", + "name": "OH_NetConn_GetPacFileUrl" + }, + { + "first_introduced": "20", + "name": "OH_NetConn_FindProxyForUrl" } ] \ No newline at end of file