Knox Tizen Wearable SDK
wifi.h
1 /*
2  * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of
7  * SAMSUNG ELECTRONICS ("Confidential Information").
8  * You shall not disclose such Confidential Information and shall
9  * use it only in accordance with the terms of the license agreement
10  * you entered into with SAMSUNG ELECTRONICS.
11  * SAMSUNG make no representations or warranties about the suitability
12  * of the software, either express or implied, including but not
13  * limited to the implied warranties of merchantability, fitness for
14  * a particular purpose, or non-infringement.
15  * SAMSUNG shall not be liable for any damages suffered by licensee as
16  * a result of using, modifying or distributing this software or its derivatives.
17  */
18 
19 #ifndef LIBMDM_MDM_WIFI_H
20 #define LIBMDM_MDM_WIFI_H
21 
22 #include <stdbool.h>
23 #include "mdm_client_type.h"
24 
35 typedef struct {
36  char *dns1;
37  char *dns2;
38  char *gateway;
39  char *ipAddress;
40  char *netmask;
41 } dhcp_info_t;
42 
48 typedef struct {
49  char *ssid;
50  char *value;
51  int type;
52 } wifi_info_t;
53 
59 typedef struct {
60  char *ssid;
61  char *filepath;
62  char *password;
64 
70 typedef enum {
78  MDM_WIFI_EAP_TYPE_MAX
80 
86 typedef enum {
97  SECURITY_LEVEL_MAX
99 
105 typedef enum {
112  MDM_WIFI_EAP_PHASE_2_AUTH_MAX
114 
119 typedef struct mdm_wifi_open_sim_aka_data_s {
120  int reserved;
122 
128 typedef struct mdm_wifi_wep_wpa_data_s {
129  const char *password;
131 
137 typedef struct mdm_wifi_eap_peap_ttls_data_s {
138  const char * identity;
139  const char * anonymous_identity;
140  const char * password;
142  const char * ca_cert_file;
143  const char * subject_match;
145 
151 typedef struct mdm_wifi_eap_tls_data_s {
152  const char *identity;
153  const char *anonymous_identity;
154  const char *password;
155  const char *ca_cert_file;
156  const char *client_cert_file;
157  const char *private_key_file;
158  const char *subject_match;
160 
177 typedef struct mdm_wifi_ap_config_s {
178  const char * ssid;
180  union {
186  mdm_wifi_eap_tls_data_t eap_tls;
189  } security;
191 
192 /*
193  * @brief Wi-Fi certificate level
194  * @since_mdm 1.0.0
195  * @since_tizen 2.3.1.5
196  */
197 typedef enum {
201  CERTIFICATE_SECURITY_LEVEL_MAX
203 
210 typedef struct {
211  char *ssid;
212  int sec_type;
214 
221 typedef enum {
222  MDM_WIFI_ALLOWED = 0x0010,
223  MDM_WIFI_BLOCKED_NETWORK_POLICY_CHANGED = 0x0020,
225 
232 typedef enum {
235 
242 typedef enum {
245 } wifi_noti_t;
246 
247 #ifdef __cplusplus
248 extern "C" {
249 #endif
250 
308 
349 
381 MDM_DEPRECATED_API mdm_data_t *mdm_get_wifi_ssid(void);
382 
413 
414 /*
415  * @brief API to connect to a Wi-Fi network to be associated with.
416  *
417  * @since_mdm 1.0.0
418  *
419  * @since_tizen 2.3.2.5
420  *
421  * @feature %http://developer.samsung.com/tizen/feature/mdm
422  *
423  * @par Usage:
424  *
425  * This will let the user to choose a Wi-Fi network from a system dialog
426  * that contains all the available networks in the area.
427  *
428  * @code{.c}
429 
430  mdm_result_t ret = mdm_set_wifi_network();
431  if(ret != MDM_RESULT_SUCCESS) {
432  //Fail
433  } else {
434  //System dialog with available
435  //networks will be displayed
436  }
437 
438  * @endcode
439  *
440  * @privlevel public
441  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
442  *
443  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
444  *
445  * @retval #MDM_RESULT_SUCCESS Successful
446  * @retval #MDM_RESULT_FAIL General failure
447  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
448  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
449  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
450  *
451  * @par Permission:
452  * Usage of this API is restricted to registered clients only.
453  *
454  */
455 mdm_result_t mdm_set_wifi_network(void);
456 
498 MDM_DEPRECATED_API mdm_data_t *mdm_get_wifi_dhcpinfo(void);
499 
500 /*
501  * @brief API to set the link security level of the enterprise WLAN.
502  *
503  * @since_mdm 1.0.0
504  *
505  * @since_tizen 2.3.2.5
506  *
507  * @feature %http://developer.samsung.com/tizen/feature/mdm
508  *
509  * @par Usage:
510  *
511  * Admin can set the link security level of the enterprise WLAN.
512  * The acceptable values are: "NONE" ,"WEP" ,"PSK" and "EAP-x", where x can be "PEAP", "LEAP", "TLS", "TTLS" and "FAST".
513  *
514  * @code{.c}
515 
516  mdm_result_t result = mdm_set_network_link_security();
517  if (result == MDM_RESULT_SUCCESS) {
518  //Success
519  } else {
520  //Fail
521  }
522  * @endcode
523  *
524  * @privlevel public
525  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
526  *
527  * @param[in] ssid The SSID of a Enterprise WLAN Network.
528  * @param[in] value The security level for WLAN enterprise network.
529  *
530  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set network link security level success,
531  * MDM_RESULT_FAIL on set network link security level failure.
532  *
533  * @retval #MDM_RESULT_SUCCESS Successful
534  * @retval #MDM_RESULT_FAIL General failure
535  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
536  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
537  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
538  *
539  * @par Permission:
540  * Usage of this API is restricted to registered clients only.
541  *
542  */
543 mdm_result_t mdm_set_network_link_security(const char *ssid, mdm_wifi_sec_type_e value);
544 
545 /*
546  * @brief API to get the enterprise WLAN Link Security.
547  *
548  * @since_mdm 1.0.0
549  *
550  * @since_tizen 2.3.2.5
551  *
552  * @feature %http://developer.samsung.com/tizen/feature/mdm
553  *
554  * @par Usage:
555  *
556  * Admin can get the enterprise WLAN Link Security.
557  * The possible values are: "Open", "WEP", "WPA or WPA2 PSK""802.1x EAP-LEAP", "802.1x EAP-FAST",
558  * "802.1x EAP-PEAP", "802.1x EAP-TTLS" and "802.1x EAP-TLS"
559  *
560  * @code{.c}
561 
562  mdm_wifi_sec_type_e type;
563  mdm_result_t ret = mdm_get_network_link_security("CompanyAP", &type);
564  if (ret == MDM_RESULT_SUCCESS) {
565  //Success
566  } else {
567  //Fail
568  }
569  * @endcode
570  *
571  * @param[in] ssid The SSID of a Enterprise WLAN Network.
572  * @param[out] type The security type for WLAN enterprise network.
573  *
574  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set network link security level success,
575  * MDM_RESULT_FAIL on set network link security level failure.
576  *
577  * @retval #MDM_RESULT_SUCCESS Successful
578  * @retval #MDM_RESULT_FAIL General failure
579  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
580  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
581  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
582  *
583  */
584 mdm_result_t mdm_get_network_link_security(const char *ssid, mdm_wifi_sec_type_e *type);
585 
586 /*
587  * @brief API to set the enterprise WLAN EAP Network Identity (username).
588  *
589  * @since_mdm 1.0.0
590  *
591  * @since_tizen 2.3.2.5
592  *
593  * @feature %http://developer.samsung.com/tizen/feature/mdm
594  *
595  * @par Usage:
596  *
597  * Admin can set the username (identity) for PEAP or LEAP security access for the enterprise WLAN network.
598  *
599  * @code{.c}
600 
601  mdm_result_t ret = mdm_set_network_identity_value(ssid, password);
602  if (ret == MDM_RESULT_SUCCESS) {
603  //Success
604  } else {
605  //Fail
606  }
607  * @endcode
608  *
609  * @privlevel public
610  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
611  *
612  * @param[in] ssid The SSID of a Enterprise WLAN Network.
613  * @param[in] value The WLAN EAP identity value (username).
614  *
615  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set network identity value success,
616  * MDM_RESULT_FAIL on set network identity value failure.
617  *
618  * @retval #MDM_RESULT_SUCCESS Successful
619  * @retval #MDM_RESULT_FAIL General failure
620  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
621  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
622  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
623  *
624  * @par Permission:
625  * Usage of this API is restricted to registered clients only.
626  *
627  */
628 mdm_result_t mdm_set_network_identity_value(const char *ssid, const char *value);
629 
630 /*
631  * @brief API to get the enterprise WLAN EAP Identity.
632  *
633  * @since_mdm 1.0.0
634  *
635  * @since_tizen 2.3.2.5
636  *
637  * @feature %http://developer.samsung.com/tizen/feature/mdm
638  *
639  * @par Usage:
640  *
641  * Admin can get the enterprise WLAN EAP Identity (username).
642  *
643  * @code{.c}
644 
645  mdm_data_t *lp_data = mdm_get_network_identity_value(ssid);
646  if (lp_data) {
647  char *username = (char *)lp_data->data;
648  } else {
649  // Fail
650  }
651  * @endcode
652  *
653  * @param[in] ssid The SSID of a Enterprise WLAN Network.
654  *
655  * @return #mdm_data_t * : The user name for the enterprise WLAN network if set, null if no user name set.
656  *
657  */
658 mdm_data_t *mdm_get_network_identity_value(const char *ssid);
659 
660 /*
661  * @brief API to set the enterprise WLAN EAP password.
662  *
663  * @since_mdm 1.0.0
664  *
665  * @since_tizen 2.3.2.5
666  *
667  * @feature %http://developer.samsung.com/tizen/feature/mdm
668  *
669  * @par Usage:
670  *
671  * Admin can set a password for PEAP or LEAP security access for the enterprise WLAN network.
672  *
673  * @code{.c}
674 
675  mdm_result_t ret = mdm_set_network_password(ssid, password);
676  if (ret == MDM_RESULT_SUCCESS) {
677  //Success
678  } else {
679  //Fail
680  }
681  * @endcode
682  *
683  * @privlevel public
684  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
685  *
686  * @param[in] ssid The SSID of a Enterprise WLAN Network.
687  * @param[in] value The WLAN EAP identity value (password).
688  *
689  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set network identity value success,
690  * MDM_RESULT_FAIL on set network identity value failure.
691  *
692  * @retval #MDM_RESULT_SUCCESS Successful
693  * @retval #MDM_RESULT_FAIL General failure
694  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
695  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
696  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
697  *
698  * @par Permission:
699  * Usage of this API is restricted to registered clients only.
700  *
701  * @see mdm_get_network_password
702  */
703 mdm_result_t mdm_set_network_password(const char *ssid, const char *value);
704 
705 /*
706  * @brief API to get the enterprise WLAN EAP password.
707  *
708  * @since_mdm 1.0.0
709  *
710  * @since_tizen 2.3.2.5
711  *
712  * @feature %http://developer.samsung.com/tizen/feature/mdm
713  *
714  * @par Usage:
715  *
716  * Admin can get the enterprise WLAN Pre-Shared Key for WPA or WPA2 security access for the enterprise WLAN network.
717  *
718  * @code{.c}
719 
720  mdm_status_t status = mdm_get_network_password();
721  if(status == MDM_TRUE) {
722  // set
723  } else if (status == MDM_FALSE) {
724  // not set
725  } else {
726  // fail
727  }
728 
729  * @endcode
730  *
731  * @param[in] ssid The SSID of a Enterprise WLAN Network.
732  *
733  * @return #mdm_status_t : The current prevention status.
734  *
735  * @retval #MDM_TRUE Password set.
736  * @retval #MDM_FALSE Password not set.
737  *
738  * @see mdm_set_network_password
739  */
740 mdm_status_t mdm_get_network_password(const char *ssid);
741 
742 /*
743  * @brief API to set the enterprise WLAN WEP Key.
744  *
745  * @since_mdm 1.0.0
746  *
747  * @since_tizen 2.3.2.5
748  *
749  * @feature %http://developer.samsung.com/tizen/feature/mdm
750  *
751  * @par Usage:
752  *
753  * Admin can set an string value for WEP key.
754  *
755  * @code{.c}
756 
757  mdm_result_t ret = mdm_set_network_wep_key(ssid, key);
758  if (ret == MDM_RESULT_SUCCESS) {
759  //Success
760  } else {
761  //Fail
762  }
763  * @endcode
764  *
765  * @privlevel public
766  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
767  *
768  * @param[in] ssid The SSID of a Enterprise WLAN Network.
769  * @param[in] value The WEP Key .
770  *
771  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set WEP key value success, MDM_RESULT_FAIL on set WEP key value failure.
772  *
773  * @retval #MDM_RESULT_SUCCESS Successful
774  * @retval #MDM_RESULT_FAIL General failure
775  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
776  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
777  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
778  *
779  * @par Permission:
780  * Usage of this API is restricted to registered clients only.
781  *
782  * @see mdm_get_network_wep_key
783  */
784 mdm_result_t mdm_set_network_wep_key(const char *ssid, const char *value);
785 
786 /*
787  * @brief API to get WEP Key.
788  *
789  * @since_mdm 1.0.0
790  *
791  * @since_tizen 2.3.2.5
792  *
793  * @feature %http://developer.samsung.com/tizen/feature/mdm
794  *
795  * @par Usage:
796  *
797  * Admin can set an string value for WEP key.
798  *
799  * @code{.c}
800 
801  mdm_status_t ret = mdm_get_network_wep_key(ssid, key);
802  if (ret == MDM_TRUE) {
803  // WEP key exists
804  } else if(ret == MDM_FALSE) {
805  // WEP key doesn't exist
806  } else {
807  // Fail
808  }
809  * @endcode
810  *
811  * @param[in] ssid The SSID of a Enterprise WLAN Network.
812  *
813  * @return #mdm_status_t : Current status.
814  *
815  * @retval #MDM_TRUE WEP Key exists
816  * @retval #MDM_FALSE No WEP Key set
817  * @retval #MDM_STATUS_ERROR Get WEP key value failure
818  *
819  * @see mdm_set_network_wep_key
820  */
821 mdm_status_t mdm_get_network_wep_key(const char *ssid);
822 
823 /*
824  * @brief API to set the enterprise WLAN EAP CA Certificate.
825  *
826  * @since_mdm 1.0.0
827  *
828  * @since_tizen 2.3.2.5
829  *
830  * @feature %http://developer.samsung.com/tizen/feature/mdm
831  *
832  * @par Usage:
833  *
834  * Admin can set the CA certificate for enterprise WLAN EAP configured on the device to be used on authentication with server.
835  *
836  * @code{.c}
837 
838  mdm_result_t ret = mdm_set_network_ca_certificate(ssid, key);
839  if (ret == MDM_RESULT_SUCCESS) {
840  //Success
841  } else {
842  //Fail
843  }
844  * @endcode
845  *
846  * @privlevel public
847  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
848  *
849  * @param[in] ssid The SSID of a Enterprise WLAN Network.
850  * @param[in] value The WEP Key. Admin can get the certificates using mdm_get_installed_certificate_names(String)
851  *
852  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set WEP key value success, MDM_RESULT_FAIL on set WEP key value failure.
853  *
854  * @retval #MDM_RESULT_SUCCESS Successful
855  * @retval #MDM_RESULT_FAIL General failure
856  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
857  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
858  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
859  *
860  * @par Permission:
861  * Usage of this API is restricted to registered clients only.
862  *
863  * @see mdm_get_network_ca_certificate
864  */
865 mdm_result_t mdm_set_network_ca_certificate(const char *ssid, const char *value);
866 
867 /*
868  * @brief API to get the enterprise WLAN EAP Ca Certificate.
869  *
870  * @since_mdm 1.0.0
871  *
872  * @since_tizen 2.3.2.5
873  *
874  * @feature %http://developer.samsung.com/tizen/feature/mdm
875  *
876  * @par Usage:
877  *
878  * Admin can get the enterprise WLAN EAP Ca Certificate configured on the device, used during authentication with server.
879  *
880  * @code{.c}
881 
882  mdm_data_t *lp_data = mdm_get_network_ca_certificate(ssid);
883 
884  if (lp_data) {
885  //Success
886  char *filepath = (char *)lp_data->data;
887  } else {
888  //Fail
889  }
890  * @endcode
891  *
892  * @param[in] ssid The SSID of a Enterprise WLAN Network.
893  *
894  * @return #mdm_data_t * : The ca certificate if set, NULL if no WLAN ca certificate set.
895  *
896  * @see mdm_set_network_ca_certificate
897  */
898 mdm_data_t *mdm_get_network_ca_certificate(const char *ssid);
899 
900 /*
901  * @brief API to set the enterprise WLAN EAP Client Certificate.
902  *
903  * @since_mdm 1.0.0
904  *
905  * @since_tizen 2.3.2.5
906  *
907  * @feature %http://developer.samsung.com/tizen/feature/mdm
908  *
909  * @par Usage:
910  *
911  * Admin can set the Client Certificate for enterprise WLAN EAP configured on the device
912  * to be used on authentication with server.
913  *
914  * @code{.c}
915  mdm_data_t *lp_data = mdm_get_installed_certificate_names(type);
916  char *cert_name = NULL;
917  if(lp_data) {
918  GList *current = g_list_first(lp_data->data);
919  if(current && current->data) {
920  cert_name = (char *)current->data;
921  }
922  }
923 
924  mdm_result_t ret = mdm_set_network_client_certificate(ssid, cert_name);
925  if (ret == MDM_RESULT_SUCCESS) {
926  //Success
927  } else {
928  //Fail
929  }
930  mdm_free_data(lp_data);
931  * @endcode
932  *
933  * @privlevel public
934  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
935  *
936  * @param[in] ssid The SSID of a Enterprise WLAN Network.
937  * @param[in] value The WLAN EAP Client certificate name stored on cert manager.
938  * Admin can get the certificates using #mdm_get_installed_certificate_names
939  *
940  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set network client certificate success, MDM_RESULT_FALSE on set network client certificate failure.
941  *
942  * @retval #MDM_RESULT_SUCCESS Successful
943  * @retval #MDM_RESULT_FAIL General failure
944  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
945  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
946  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
947  *
948  * @par Permission:
949  * Usage of this API is restricted to registered clients only.
950  *
951  * @see mdm_get_network_client_certificate
952  */
953 mdm_result_t mdm_set_network_client_certificate(const char *ssid, const char *value);
954 
955 /*
956  * @brief API to get the enterprise WLAN Client Certificate.
957  *
958  * @since_mdm 1.0.0
959  *
960  * @since_tizen 2.3.2.5
961  *
962  * @feature %http://developer.samsung.com/tizen/feature/mdm
963  *
964  * @par Usage:
965  *
966  * Admin can get the enterprise WLAN Client Certificate configured on the device, used during authentication with server.
967  *
968  * @code{.c}
969 
970  mdm_data_t *lp_data = mdm_get_network_client_certificate(ssid);
971 
972  if (lp_data) {
973  //Success
974  char *filepath = (char *)lp_data->data;
975  } else {
976  //Fail
977  }
978  * @endcode
979  *
980  * @param[in] ssid The SSID of a Enterprise WLAN Network.
981  *
982  * @return #mdm_data_t * : The client certificate if set, NULL if no WLAN client certificate set.
983  *
984  * @see mdm_set_network_client_certificate
985  */
986 mdm_data_t *mdm_get_network_client_certificate(const char *ssid);
987 
988 /*
989  * @brief API to set the enterprise WLAN User Private Key credential.
990  *
991  * @since_mdm 1.0.0
992  *
993  * @since_tizen 2.3.2.5
994  *
995  * @feature %http://developer.samsung.com/tizen/feature/mdm
996  *
997  * @par Usage:
998  *
999  * Admin can set the Private Key credential for enterprise WLAN EAP configured on the device to be used on authentication with server.
1000  * The private key is provisioned along with each client certificate, so the caller should set the same name used for mdm_set_network_client_certificate.
1001  *
1002  * @code{.c}
1003 
1004 
1005  mdm_result_t ret = mdm_set_network_private_key(ssid, filepath, password);
1006  if (ret == MDM_RESULT_SUCCESS) {
1007  //Success
1008  } else {
1009  //Fail
1010  }
1011  mdm_free_data(lp_data);
1012  * @endcode
1013  *
1014  * @privlevel public
1015  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
1016  *
1017  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1018  * @param[in] filepath The file path of private key
1019  * @param[in] password The password
1020  *
1021  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set network client certificate success,
1022  * MDM_RESULT_FALSE on set network client certificate failure.
1023  *
1024  * @retval #MDM_RESULT_SUCCESS Successful
1025  * @retval #MDM_RESULT_FAIL General failure
1026  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1027  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1028  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1029  *
1030  * @par Permission:
1031  * Usage of this API is restricted to registered clients only.
1032  *
1033  * @see mdm_get_network_private_key
1034  */
1035 mdm_result_t mdm_set_network_private_key(const char *ssid, const char *filepath, const char *password);
1036 
1037 /*
1038  * @brief API to get the enterprise WLAN user private key credential.
1039  *
1040  * @since_mdm 1.0.0
1041  *
1042  * @since_tizen 2.3.2.5
1043  *
1044  * @feature %http://developer.samsung.com/tizen/feature/mdm
1045  *
1046  * @par Usage:
1047  *
1048  * Admin can get the enterprise WLAN user private key credential for enterprise WLAN EAP configured on the device,
1049  * used on authentication with server.
1050  *
1051  * @code{.c}
1052  mdm_data_t *lp_data = mdm_get_network_private_key(ssid);
1053  if(lp_data && lp_data->data) {
1054  char *key = (char *)lp_data->data;
1055  }
1056 
1057  mdm_free_data(lp_data);
1058  * @endcode
1059  *
1060  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1061  *
1062  * @return #mdm_data_t * : The private key filepath if set, NULL if no private key set
1063  *
1064  * @see mdm_set_network_private_key
1065  */
1066 mdm_data_t *mdm_get_network_private_key(const char *ssid);
1067 
1068 /*
1069  * @brief API to get the enterprise WLAN EAP type.
1070  *
1071  * @since_mdm 1.0.0
1072  *
1073  * @since_tizen 2.3.2.5
1074  *
1075  * @feature %http://developer.samsung.com/tizen/feature/mdm
1076  *
1077  * @par Usage:
1078  *
1079  * Admin can get the enterprise WLAN EAP type (TLS, TTLS, FAST..).
1080  *
1081  * @code{.c}
1082 
1083  mdm_wifi_eap_type_e type;
1084  mdm_result_t ret = mdm_get_network_eap_type(ssid, &type);
1085 
1086  * @endcode
1087  *
1088  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1089  * @param[out] type The WLAN EAP type (PEAP, LEAP, TLS, TTLS, FAST) if set, MDM_WIFI_EAP_TYPE_NONE if no EAP type set.
1090  *
1091  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1092  *
1093  * @retval #MDM_RESULT_SUCCESS Successful
1094  * @retval #MDM_RESULT_FAIL General failure
1095  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1096  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1097  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1098  *
1099  */
1100 mdm_result_t mdm_get_network_eap_type(const char *ssid, mdm_wifi_eap_type_e *type);
1101 
1137 MDM_DEPRECATED_API mdm_status_t mdm_is_network_secure(const char *ssid);
1138 
1139 /*
1140  * @brief API to set the default Gateway on a enterprise network in case the DHCP is turned off.
1141  *
1142  * @since_mdm 1.0.0
1143  *
1144  * @since_tizen 2.3.2.5
1145  *
1146  * @feature %http://developer.samsung.com/tizen/feature/mdm
1147  *
1148  * @par Usage:
1149  *
1150  * Admin can set the default Gateway in case the connection settings are set to use a static IP to connect to the network.
1151  * In case one tries to call this function for a network with a dynamic configuration (for example, DHCP is on), an error will be
1152  * returned. To check, if network is static or dynamic call mdm_get_network_dhcp_enabled().
1153  *
1154  * @code{.c}
1155 
1156  mdm_result_t ret = mdm_set_network_gateway(ssid, ip);
1157  if(ret == MDM_RESULT_SUCCESS) {
1158  //Success
1159  } else {
1160  //Fail
1161  }
1162 
1163  * @endcode
1164  *
1165  * @privlevel public
1166  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
1167  *
1168  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1169  * @param[in] value The Gateway address.
1170  *
1171  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set default gateway success, MDM_RESULT_FAIL on set default gateway failure
1172  *
1173  * @retval #MDM_RESULT_SUCCESS Successful
1174  * @retval #MDM_RESULT_FAIL General failure
1175  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1176  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1177  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1178  *
1179  * @par Permission:
1180  * Usage of this API is restricted to registered clients only.
1181  *
1182  * @see mdm_get_network_gateway
1183  */
1184 mdm_result_t mdm_set_network_gateway(const char *ssid, const char *value);
1185 
1186 /*
1187  * @brief API to get the default Gateway on a enterprise network in case the DHCP is turned off.
1188  *
1189  * @since_mdm 1.0.0
1190  *
1191  * @since_tizen 2.3.2.5
1192  *
1193  * @feature %http://developer.samsung.com/tizen/feature/mdm
1194  *
1195  * @par Usage:
1196  *
1197  * Admin can get the default Gateway in case the connection settings are set to use a static IP to connect to the network.
1198  *
1199  * @code{.c}
1200 
1201  mdm_data_t *lp_data = mdm_get_network_gateway(ssid);
1202  if(lp_data && lp_data->ret == MDM_RESULT_SUCCESS) {
1203  char *ipAddr = (char *)lp_data->data;
1204  } else {
1205  //Fail
1206  }
1207 
1208  * @endcode
1209  *
1210  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1211  *
1212  * @return #mdm_data_t * : The default gateway, if it has been previously configured; NULL, if it has not been previously configured.
1213  *
1214  * @see mdm_set_network_gateway
1215  */
1216 mdm_data_t *mdm_get_network_gateway(const char *ssid);
1217 
1218 /*
1219  * @brief API to set the default IP on the enterprise network in case the DHCP is turned off.
1220  *
1221  * @since_mdm 1.0.0
1222  *
1223  * @since_tizen 2.3.2.5
1224  *
1225  * @feature %http://developer.samsung.com/tizen/feature/mdm
1226  *
1227  * @par Usage:
1228  *
1229  * Admin can set the default IP in case the connection settings are set to use a static IP to connect to the network.
1230  * In case one tries to call this function for a network with a dynamic configuration
1231  * (for example, DHCP is on), an error will be
1232  * returned. To check, if network is static or dynamic call mdm_get_network_dhcp_enabled().
1233  * @code{.c}
1234 
1235  mdm_result_t ret = mdm_set_network_ip(ssid, ip);
1236  if(ret == MDM_RESULT_SUCCESS) {
1237  //Success
1238  } else {
1239  //Fail
1240  }
1241 
1242  * @endcode
1243  *
1244  * @privlevel public
1245  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
1246  *
1247  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1248  * @param[in] value The IP address.
1249  *
1250  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set default IP success, MDM_RESULT_FAIL on set default IP failure
1251  *
1252  * @retval #MDM_RESULT_SUCCESS Successful
1253  * @retval #MDM_RESULT_FAIL General failure
1254  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1255  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1256  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1257  *
1258  * @par Permission:
1259  * Usage of this API is restricted to registered clients only.
1260  *
1261  * @see mdm_get_network_ip
1262  */
1263 mdm_result_t mdm_set_network_ip(const char *ssid, const char *value);
1264 
1265 /*
1266  * @brief API to get the default IP on a enterprise network in case the DHCP is turned off.
1267  *
1268  * @since_mdm 1.0.0
1269  *
1270  * @since_tizen 2.3.2.5
1271  *
1272  * @feature %http://developer.samsung.com/tizen/feature/mdm
1273  *
1274  * @par Usage:
1275  *
1276  * Admin can get the default IP in case the connection settings are set to use a static IP to connect to the network.
1277  *
1278  * @code{.c}
1279 
1280  mdm_data_t *lp_data = mdm_get_network_ip(ssid);
1281  if(lp_data) {
1282  char *ipAddr = (char *)lp_data->data;
1283  } else {
1284  //Fail
1285  }
1286 
1287  * @endcode
1288  *
1289  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1290  *
1291  * @return #mdm_data_t * : The default IP address, if it has been previously configured; NULL, if it has not been previously configured.
1292  *
1293  * @see mdm_set_network_ip
1294  */
1295 mdm_data_t *mdm_get_network_ip(const char *ssid);
1296 
1297 /*
1298  * @brief API to set the default Primary DNS on a enterprise network in case the DHCP is turned off.
1299  *
1300  * @since_mdm 1.0.0
1301  *
1302  * @since_tizen 2.3.2.5
1303  *
1304  * @feature %http://developer.samsung.com/tizen/feature/mdm
1305  *
1306  * @par Usage:
1307  *
1308  * Admin can set the default Primary DNS in case the connection settings are set to use a static IP
1309  * to connect to the network.
1310  * In case one tries to call this function for a network with a dynamic configuration
1311  * (for example, DHCP is on), an error will be
1312  * returned. To check, if network is static or dynamic call mdm_get_network_dhcp_enabled().
1313  *
1314  * @code{.c}
1315 
1316  mdm_result_t ret = mdm_set_network_primary_dns(ssid, ip);
1317  if(ret == MDM_RESULT_SUCCESS) {
1318  //Success
1319  } else {
1320  //Fail
1321  }
1322 
1323  * @endcode
1324  *
1325  * @privlevel public
1326  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
1327  *
1328  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1329  * @param[in] value The primary dns address.
1330  *
1331  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set primary dns success, MDM_RESULT_FAIL on set primary dns failure
1332  *
1333  * @retval #MDM_RESULT_SUCCESS Successful
1334  * @retval #MDM_RESULT_FAIL General failure
1335  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1336  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1337  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1338  *
1339  * @par Permission:
1340  * Usage of this API is restricted to registered clients only.
1341  *
1342  * @see mdm_get_network_primary_dns
1343  */
1344 mdm_result_t mdm_set_network_primary_dns(const char *ssid, const char *value);
1345 
1346 /*
1347  * @brief API to set the primary DNS on a enterprise network in case the DHCP is turned off.
1348  *
1349  * @since_mdm 1.0.0
1350  *
1351  * @since_tizen 2.3.2.5
1352  *
1353  * @feature %http://developer.samsung.com/tizen/feature/mdm
1354  *
1355  * @par Usage:
1356  *
1357  * Admin can set the primary DNS in case the connection settings are set to use a static IP to connect to the network.
1358  *
1359  * @code{.c}
1360 
1361  mdm_data_t *lp_data = mdm_get_network_primary_dns(ssid);
1362  if(lp_data) {
1363  char *ipAddr = (char *)lp_data->data;
1364  } else {
1365  //Fail
1366  }
1367 
1368  * @endcode
1369  *
1370  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1371  *
1372  * @return #mdm_data_t * : The primary DNS, if it has been previously configured; null, if it has not been previously configured.
1373  *
1374  * @see mdm_set_network_primary_dns
1375  */
1376 mdm_data_t *mdm_get_network_primary_dns(const char *ssid);
1377 
1378 /*
1379  * @brief API to set the secondary DNS on a enterprise network in case the DHCP is turned off.
1380  *
1381  * @since_mdm 1.0.0
1382  *
1383  * @since_tizen 2.3.2.5
1384  *
1385  * @feature %http://developer.samsung.com/tizen/feature/mdm
1386  *
1387  * @par Usage:
1388  *
1389  * Admin can set the secondary DNS in case the connection settings are set to use a static IP to connect to the network.
1390  * In case one tries to call this function for a network with a dynamic configuration
1391  * (for example, DHCP is on), an error will be
1392  * returned. To check, if network is static or dynamic call mdm_get_network_dhcp_enabled().
1393  *
1394  * @code{.c}
1395 
1396  mdm_result_t ret = mdm_set_network_secondary_dns(ssid, ip);
1397  if(ret == MDM_RESULT_SUCCESS) {
1398  //Success
1399  } else {
1400  //Fail
1401  }
1402 
1403  * @endcode
1404  *
1405  * @privlevel public
1406  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
1407  *
1408  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1409  * @param[in] value The secondary DNS address.
1410  *
1411  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set secondary DNS success, MDM_RESULT_FAIL on set secondary DNS failure
1412  *
1413  * @retval #MDM_RESULT_SUCCESS Successful
1414  * @retval #MDM_RESULT_FAIL General failure
1415  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1416  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1417  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1418  *
1419  * @par Permission:
1420  * Usage of this API is restricted to registered clients only.
1421  *
1422  * @see mdm_get_network_secondary_dns
1423  */
1424 mdm_result_t mdm_set_network_secondary_dns(const char *ssid, const char *value);
1425 
1426 /*
1427  * @brief API to set the secondary DNS on a enterprise network in case the DHCP is turned off.
1428  *
1429  * @since_mdm 1.0.0
1430  *
1431  * @since_tizen 2.3.2.5
1432  *
1433  * @feature %http://developer.samsung.com/tizen/feature/mdm
1434  *
1435  * @par Usage:
1436  *
1437  * Admin can set the secondary DNS in case the connection settings are set to use a static IP to connect to the network.
1438  *
1439  * @code{.c}
1440 
1441  mdm_data_t *lp_data = mdm_get_network_secondary_dns(ssid);
1442  if(lp_data) {
1443  char *ipAddr = (char *)lp_data->data;
1444  } else {
1445  //Fail
1446  }
1447 
1448  * @endcode
1449  *
1450  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1451  *
1452  * @return #mdm_data_t * : The secondary DNS, if it has been previously configured; null,
1453  * if it has not been previously configured.
1454  *
1455  * @see mdm_set_network_secondary_dns
1456  */
1457 mdm_data_t *mdm_get_network_secondary_dns(const char *ssid);
1458 
1459 /*
1460  * @brief API to set the default Subnet Mask on a enterprise network in case the DHCP is turned off.
1461  *
1462  * @since_mdm 1.0.0
1463  *
1464  * @since_tizen 2.3.2.5
1465  *
1466  * @feature %http://developer.samsung.com/tizen/feature/mdm
1467  *
1468  * @par Usage:
1469  *
1470  * Admin can set the default default Subnet Mask in case the connection settings are set to
1471  * use a static IP to connect to the network.
1472  * In case one tries to call this function for a network with a dynamic configuration
1473  * (for example, DHCP is on), an error is
1474  * returned. To check, if network is static or dynamic call mdm_get_network_dhcp_enabled().
1475  *
1476  * @code{.c}
1477 
1478  mdm_result_t ret = mdm_set_network_subnet_mask(ssid, ip);
1479  if(ret == MDM_RESULT_SUCCESS) {
1480  //Success
1481  } else {
1482  //Fail
1483  }
1484 
1485  * @endcode
1486  *
1487  * @privlevel public
1488  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
1489  *
1490  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1491  * @param[in] value The subnet Mask.
1492  *
1493  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set subnet mask success, MDM_RESULT_FAIL on set subnet mask failure
1494  *
1495  * @retval #MDM_RESULT_SUCCESS Successful
1496  * @retval #MDM_RESULT_FAIL General failure
1497  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1498  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1499  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1500  *
1501  * @par Permission:
1502  * Usage of this API is restricted to registered clients only.
1503  *
1504  * @see mdm_get_network_subnet_mask
1505  */
1506 mdm_result_t mdm_set_network_subnet_mask(const char *ssid, const char *value);
1507 
1508 /*
1509  * @brief API to get the default Subnet Mask on a enterprise network in case the DHCP is turned off.
1510  *
1511  * @since_mdm 1.0.0
1512  *
1513  * @since_tizen 2.3.2.5
1514  *
1515  * @feature %http://developer.samsung.com/tizen/feature/mdm
1516  *
1517  * @par Usage:
1518  *
1519  * Admin can get the default Subnet Mask in case the connection settings are set to use a static IP to connect to the network.
1520  *
1521  * @code{.c}
1522 
1523  mdm_data_t *lp_data = mdm_get_network_subnet_mask(ssid);
1524  if(lp_data) {
1525  char *ipAddr = (char *)lp_data->data;
1526  } else {
1527  //Fail
1528  }
1529 
1530  * @endcode
1531  *
1532  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1533  *
1534  * @return #mdm_data_t * : The subnet mask if it has been previously configured; null,
1535  * if it has not been previously configured;
1536  *
1537  * @see mdm_set_network_subnet_mask
1538  */
1539 mdm_data_t *mdm_get_network_subnet_mask(const char *ssid);
1540 
1610 mdm_result_t mdm_get_blocked_networks(GList **blockedlist, GList **exceptlist);
1611 
1612 
1661 
1695 
1739 
1786 
1787 /*
1788  * @brief API to set a minimum certificate security level Wi-Fi AP.
1789  *
1790  * @since_mdm 1.0.0
1791  *
1792  * @since_tizen 2.3.2.5
1793  *
1794  * @feature %http://developer.samsung.com/tizen/feature/mdm
1795  *
1796  * @par Usage:
1797  *
1798  * Admin can set a minimum certificate security level one of below:
1799  * #CERTIFICATE_SECURITY_LEVEL_LOW
1800  * #CERTIFICATE_SECURITY_LEVEL_HIGH
1801  *
1802  * @code{.c}
1803 
1804  mdm_result_t ret = mdm_set_tls_certificate_security_level(CERTIFICATE_SECURITY_LEVEL_LOW);
1805  if(ret == MDM_RESULT_SUCCESS) {
1806  //Success
1807  } else {
1808  //Fail
1809  }
1810 
1811  * @endcode
1812  *
1813  * @privlevel public
1814  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
1815  *
1816  * @param[in] level The minimum required certificate level.
1817  *
1818  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1819  *
1820  * @retval #MDM_RESULT_SUCCESS Successful
1821  * @retval #MDM_RESULT_FAIL General failure
1822  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1823  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1824  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1825  *
1826  * @par Permission:
1827  * Usage of this API is restricted to registered clients only.
1828  *
1829  * @see mdm_get_tls_certificate_security_level
1830  */
1831 mdm_result_t mdm_set_tls_certificate_security_level(mdm_wifi_cert_level_e level);
1832 
1833 /*
1834  * @brief API to get a Wi-Fi profile from the admin.
1835  *
1836  * @since_mdm 1.0.0
1837  *
1838  * @since_tizen 2.3.2.5
1839  *
1840  * @feature %http://developer.samsung.com/tizen/feature/mdm
1841  *
1842  * @par Usage:
1843  *
1844  * Admin can get current minimum security level to connect to a Wi-Fi AP.
1845  * The possible values, from the lowest to highest, are:
1846  * #CERTIFICATE_SECURITY_LEVEL_LOW,
1847  * #CERTIFICATE_SECURITY_LEVEL_HIGH.
1848  *
1849  * @code{.c}
1850 
1851  mdm_wifi_sec_type_e secType = mdm_get_tls_certificate_security_level();
1852 
1853  * @endcode
1854  *
1855  * @return #mdm_wifi_sec_type_e : Representing the network security level if set, CERTIFICATE_SECURITY_LEVEL_NONE if certificate security level not set.
1856  *
1857  * @retval #CERTIFICATE_SECURITY_LEVEL_NONE Wi-Fi certificate level none
1858  * @retval #CERTIFICATE_SECURITY_LEVEL_LOW General Wi-Fi certificate level low
1859  * @retval #CERTIFICATE_SECURITY_LEVEL_HIGH Wi-Fi certificate level high
1860  *
1861  * @see mdm_set_tls_certificate_security_level
1862  */
1863 mdm_wifi_cert_level_e mdm_get_tls_certificate_security_level(void);
1864 
1913 
1946 
1947 /*
1948  * @brief API to set the enterprise WLAN Pre-Shared Key for WPA/WPA2 access.
1949  *
1950  * @since_mdm 1.0.0
1951  *
1952  * @since_tizen 2.3.2.5
1953  *
1954  * @feature %http://developer.samsung.com/tizen/feature/mdm
1955  *
1956  * @par Usage:
1957  *
1958  * Admin can set a Pre-Shared Key for WPA or WPA2 security access for the enterprise WLAN network.
1959  * The Pre-Shared Key can be a 256-bit Hex or a string value. PSK is a shared secret which was
1960  * previously shared between the two parties using some secure channel before it needs to be used.
1961  *
1962  * @code{.c}
1963 
1964  mdm_result_t ret = mdm_set_network_psk(("Company Wi-Fi",
1965  "f348e73d08e4812e51e40ed04b400f38cfe07a7a4d8d12745327a4a3d51cf854");
1966  if(ret == MDM_RESULT_SUCCESS) {
1967  //Success
1968  } else {
1969  //Fail
1970  }
1971 
1972  * @endcode
1973  *
1974  * @privlevel public
1975  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
1976  *
1977  * @param[in] ssid The SSID of a Enterprise WLAN Network.
1978  * @param[in] psk The Pre-Shared Key.
1979  *
1980  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set network PSK success, MDM_RESULT_FAIL on set network PSK failure.
1981  *
1982  * @retval #MDM_RESULT_SUCCESS Successful
1983  * @retval #MDM_RESULT_FAIL General failure
1984  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1985  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1986  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1987  *
1988  * @par Permission:
1989  * Usage of this API is restricted to registered clients only.
1990  *
1991  * @see mdm_get_network_psk
1992  */
1993 mdm_result_t mdm_set_network_psk(const char *ssid, const char *psk);
1994 
1995 /*
1996  * @brief API to get the enterprise WLAN Pre-Shared Key.
1997  *
1998  * @since_mdm 1.0.0
1999  *
2000  * @since_tizen 2.3.2.5
2001  *
2002  * @feature %http://developer.samsung.com/tizen/feature/mdm
2003  *
2004  * @par Usage:
2005  *
2006  * Admin can get the enterprise WLAN Pre-Shared Key for WPA or WPA2 security access for the enterprise WLAN network.
2007  *
2008  * @code{.c}
2009 
2010  mdm_status_t ret = mdm_get_network_psk();
2011  if(ret == MDM_TRUE) {
2012  // hidden
2013  } else if (ret == MDM_FALSE) {
2014  // not hidden
2015  } else {
2016  // fail
2017  }
2018 
2019  * @endcode
2020  *
2021  * @return #mdm_status_t : Whether Pre-Shared Key is set
2022  *
2023  * @retval #MDM_TRUE Pre-Shared Key set
2024  * @retval #MDM_FALSE No Pre-Shared Key set
2025  * @retval #MDM_STATUS_ERROR Error
2026  *
2027  * @see mdm_set_network_psk
2028  */
2029 mdm_status_t mdm_get_network_psk(const char *ssid);
2030 
2031 /*
2032  * @brief API to set the the enterprise WLAN EAP Anonymous Identity.
2033  *
2034  * @since_mdm 1.0.0
2035  *
2036  * @since_tizen 2.3.2.5
2037  *
2038  * @feature %http://developer.samsung.com/tizen/feature/mdm
2039  *
2040  * @par Usage:
2041  *
2042  * Admin can set the the enterprise WLAN EAP Anonymous Identity. This key is only relevant to TTLS, PEAP, and EAP-FAST.
2043  * This allows the user to hide his or her identity. The user's actual name appears only inside the encrypted tunnel.
2044  * For example, it could be set to "anonymous" or "anon", or "anon@mycompany.net".
2045  *
2046  * @code{.c}
2047 
2048  mdm_result_t ret = mdm_set_network_anonymous_id_value(ssid, value);
2049  if(ret == MDM_RESULT_SUCCESS) {
2050  //Success
2051  } else {
2052  //Fail
2053  }
2054 
2055  * @endcode
2056  *
2057  * @privlevel public
2058  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
2059  *
2060  * @param[in] ssid The SSID of a Enterprise WLAN Network.
2061  * @param[in] value The WLAN EAP Anonymous Identity value.
2062  *
2063  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set network anonymous Identity value success,
2064  * MDM_RESULT_FAIL on set network anonymous Identity value failure.
2065  *
2066  * @retval #MDM_RESULT_SUCCESS Successful
2067  * @retval #MDM_RESULT_FAIL General failure
2068  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2069  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2070  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2071  *
2072  * @par Permission:
2073  * Usage of this API is restricted to registered clients only.
2074  *
2075  * @see mdm_get_network_anonymous_id_value
2076  */
2077 mdm_result_t mdm_set_network_anonymous_id_value(const char *ssid, const char *value);
2078 
2079 /*
2080  * @brief API to get the enterprise WLAN EAP Anonymous Identity.
2081  *
2082  * @since_mdm 1.0.0
2083  *
2084  * @since_tizen 2.3.2.5
2085  *
2086  * @feature %http://developer.samsung.com/tizen/feature/mdm
2087  *
2088  * @par Usage:
2089  *
2090  * Admin can set the the enterprise WLAN EAP Anonymous Identity. This key is only relevant to TTLS, PEAP, and EAP-FAST.
2091  * This allows the user to hide his or her identity. The user's actual name appears only inside the encrypted tunnel.
2092  * For example, it could be set to "anonymous" or "anon", or "anon@mycompany.net".
2093  *
2094  * @code{.c}
2095  mdm_data_t *lp_data = mdm_get_network_anonymous_id_value(ssid);
2096  if(lp_data) {
2097  char *value = (char *)lp_data->data;
2098  } else {
2099  //Fail
2100  }
2101  * @endcode
2102  *
2103  * @param[in] ssid The SSID of a Enterprise WLAN Network.
2104  *
2105  * @return #mdm_data_t * : The network anonymous id value if set, null if network anonymous id value not set
2106  *
2107  * @see mdm_set_network_anonymous_id_value
2108  */
2109 mdm_data_t *mdm_get_network_anonymous_id_value(const char *ssid);
2110 
2111 
2112 /*
2113  * @brief API to enable use of DHCP on a enterprise network.
2114  *
2115  * @since_mdm 1.0.0
2116  *
2117  * @since_tizen 2.3.2.5
2118  *
2119  * @feature %http://developer.samsung.com/tizen/feature/mdm
2120  *
2121  * @par Usage:
2122  *
2123  * Admin can enable use of DHCP on a enterprise network.
2124  *
2125  * @code{.c}
2126  mdm_result_t ret = mdm_set_network_dhcp_enabled(ssid, MDM_DISABLED);
2127  if(ret == MDM_RESULT_SUCCESS) {
2128  //Success
2129  } else {
2130  //Fail
2131  }
2132  * @endcode
2133  *
2134  * @privlevel public
2135  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
2136  * @param[in] ssid The SSID of a Enterprise WLAN Network.
2137  * @param[in] enable MDM_ENABLED to enable connection using DHCP, MDM_DISABLED to disable it
2138  *
2139  * @return #mdm_result_t : MDM_RESULT_SUCCESS on set network DHCP enabled success, MDM_RESULT_FAIL on set network DHCP enabled failure.
2140  *
2141  * @retval #MDM_RESULT_SUCCESS Successful
2142  * @retval #MDM_RESULT_FAIL General failure
2143  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2144  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2145  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2146  *
2147  * @par Permission:
2148  * Usage of this API is restricted to registered clients only.
2149  *
2150  * @see mdm_get_network_dhcp_enabled
2151  */
2152 mdm_result_t mdm_set_network_dhcp_enabled(const char *ssid, mdm_status_t enable);
2153 
2154 /*
2155  * @brief API to check the use of DHCP on a enterprise network.
2156  *
2157  * @since_mdm 1.0.0
2158  *
2159  * @since_tizen 2.3.2.5
2160  *
2161  * @feature %http://developer.samsung.com/tizen/feature/mdm
2162  *
2163  * @par Usage:
2164  *
2165  * Admin can check the use of DHCP on a enterprise network or it is restricted to static IP.
2166  *
2167  * @code{.c}
2168  mdm_status_t ret = mdm_get_network_dhcp_enabled(ssid);
2169  if(ret == MDM_ENABLED) {
2170  // Enabled
2171  } else if(ret == MDM_DISABLED) {
2172  // Disabled
2173  } else {
2174  // Fail
2175  }
2176  * @endcode
2177  *
2178  * @param[in] ssid The SSID of a Enterprise WLAN Network.
2179  *
2180  * @return #mdm_status_t : Whether DHCP is enabled.
2181  *
2182  * @retval #MDM_ENABLED DHCP is enabled
2183  * @retval #MDM_DISABLED Static IP is enabled
2184  * @retval #MDM_STATUS_ERROR Error
2185  *
2186  * @see mdm_set_network_dhcp_enabled
2187  */
2188 mdm_status_t mdm_get_network_dhcp_enabled(const char *ssid);
2189 
2224 mdm_status_t mdm_is_network_blocked(const char *ssid);
2225 
2226 /*
2227  * @brief API to remove the enterprise WLAN configuration.
2228  *
2229  * @since_mdm 1.0.0
2230  *
2231  * @since_tizen 2.3.2.5
2232  *
2233  * @feature %http://developer.samsung.com/tizen/feature/mdm
2234  *
2235  * @par Usage:
2236  *
2237  * Admin can remove an enterprise WLAN configuration. The network name is removed from the APs list,
2238  * so that the user does not need to remove it manually.
2239  *
2240  * @code{.c}
2241  mdm_result_t ret = mdm_remove_network_configuration(ssid);
2242  if(ret == MDM_RESULT_SUCCESS) {
2243  //Success
2244  } else {
2245  //Fail
2246  }
2247  * @endcode
2248  *
2249  * @privlevel public
2250  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.wifi
2251  *
2252  * @param[in] ssid The SSID of a Enterprise WLAN Network.
2253  *
2254  * @return #mdm_result_t : MDM_RESULT_SUCCESS on removal success, MDM_RESULT_FAIL on removal failure.
2255  *
2256  * @retval #MDM_RESULT_SUCCESS Successful
2257  * @retval #MDM_RESULT_FAIL General failure
2258  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2259  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2260  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2261  *
2262  * @par Permission:
2263  * Usage of this API is restricted to registered clients only.
2264  *
2265  */
2266 mdm_result_t mdm_remove_network_configuration(const char *ssid);
2267 
2318 mdm_result_t mdm_set_wifi_ap_setting(const char *ssid, mdm_wifi_sec_type_e securityType, const char *password);
2319 
2360 
2418 
2461 
2521 
2574 
2628 
2675 
2710 
2766 
2820 
2865 
2904 
2951 
2985 
3031 
3068 
3117 
3153 
3201 mdm_result_t knox_mdm_preferred_ssid_add(const char *ssid);
3202 
3248 
3291 
3345 
3392 mdm_result_t knox_mdm_protected_ssid_add(const char *ssid);
3393 
3439 
3482 
3537 
3589 
3625 
3626 /*
3627  * @brief API to check if end users have permission to change Wi-Fi configurations.
3628  *
3629  * @since_mdm 2.2.0
3630  *
3631  * @since_tizen 3.0.0.1
3632  *
3633  * @par Usage:
3634  * Use this API to check if end users have permission to change Wi-Fi configurations.
3635  *
3636  * @code{.c}
3637  mdm_status_t status = knox_mdm_get_allow_wifi_change();
3638  if(status == MDM_TRUE) {
3639  // Do something
3640  } else {
3641  // Do something
3642  }
3643  * @endcode
3644  *
3645  * @privlevel internal
3646  *
3647  * @return #mdm_status_t : Whether user can change WIFI.
3648  *
3649  * @retval #MDM_ALLOWED Allows end users to modify Wi-Fi configurations.
3650  * @retval #MDM_RESTRICTED Blocks end users from modifying Wi-Fi settings.
3651  * @retval #MDM_STATUS_ERROR Any error
3652  *
3653  * @see knox_mdm_set_allow_wifi_change
3654  */
3655 mdm_status_t knox_mdm_get_allow_wifi_change(void);
3656 
3657 /*
3658  * @brief API blocks end users from changing the Wi-Fi configurations.
3659  *
3660  * @since_mdm 2.2.0
3661  *
3662  * @since_tizen 3.0.0.1
3663  *
3664  * @par Usage:
3665  * Use this API to block end users from modifying the Wi-Fi settings. Internal usage only.
3666  *
3667  * @remark
3668  * WiFi state #wifi_noti_t is written to #MDM_POLICY_ON_WIFI_STATE notification file.
3669  * Restriction of WiFi state changing #wifi_noti_t is written to #MDM_POLICY_ON_WIFI_CHANGE notification file.
3670  * You can register a callbacks for both events using #mdm_register_policy_receiver.
3671  *
3672  * @code{.c}
3673  mdm_status_t status = knox_mdm_set_allow_wifi_change(MDM_RESTRICTED);
3674  if(status == MDM_TRUE) {
3675  // Do something
3676  } else {
3677  // Do something
3678  }
3679  * @endcode
3680  *
3681  * @param[in] status #MDM_ALLOWED — allows end users to modify Wi-Fi settings.
3682  * \n #MDM_RESTRICTED — blocks end users from modifying Wi-Fi settings.
3683  *
3684  * @privlevel internal
3685  *
3686  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3687  *
3688  * @retval #MDM_RESULT_SUCCESS Success
3689  * @retval #MDM_RESULT_FAIL General failure.
3690  * @retval #MDM_RESULT_SERVICE_NOT_ENABLED Service not enabled.
3691  * @retval #MDM_RESULT_ACCESS_DENIED Caller is not authorized to access Knox MDM client information.
3692  *
3693  * @see knox_mdm_get_allow_wifi_change
3694  */
3695 mdm_result_t knox_mdm_set_allow_wifi_change(mdm_status_t status);
3696 
3701 #ifdef __cplusplus
3702 }
3703 #endif
3704 
3705 #endif // LIBMDM_MDM_WIFI_H
char * dns2
Definition: wifi.h:37
char * gateway
Definition: wifi.h:38
mdm_status_t mdm_is_wifi_hidden_ssid(void)
MDM_TRUE if this network does not broadcast its SSID, so an SSID-specific probe request must be used ...
mdm_wifi_sec_type_e type
Definition: wifi.h:179
mdm_wifi_status_t
Enumerate Wi-Fi status type.
Definition: wifi.h:221
const char * anonymous_identity
Definition: wifi.h:139
mdm_result_t mdm_add_wifi_ssids_to_blacklist(GList *SSIDs)
API to add a list of Wi-Fi network SSIDs to the Wi-Fi network blacklist.
mdm_wifi_eap_phase_2_auth_e phase_2_auth
Definition: wifi.h:141
mdm_result_t mdm_set_minimum_required_security(mdm_wifi_sec_type_e secType)
API to set a minimum security level to connect to a Wi-Fi AP.
mdm_result_t mdm_set_allow_wifi(mdm_status_t state)
API to allow or restrict the use of Wi-Fi.
Wi-Fi private key Information.
Definition: wifi.h:59
wifi_noti_t
Enumerate Wi-Fi notice type.
Definition: wifi.h:242
Wi-Fi Information.
Definition: wifi.h:48
const char * anonymous_identity
Definition: wifi.h:153
const char * private_key_file
Definition: wifi.h:157
mdm_result_t knox_mdm_preferred_ssids_clear(void)
API to clear Wi-Fi SSIDs from the list of preferred access points.
mdm_result_t mdm_clear_wifi_ssids_blacklist(void)
API to remove all Wi-Fi network SSIDs from the Wi-Fi network blacklist.
const char * ca_cert_file
Definition: wifi.h:155
mdm_result_t mdm_set_wifi_state_change_allowed(bool allow)
API to allow or disallow Wi-Fi State Change (to ON/OFF).
This structure is used to store GList.
mdm_status_t mdm_is_wifi_ap_setting_user_modification_allowed(void)
API to check whether modification of Wi-Fi AP Setting by the user is allowed or not.
mdm_result_t mdm_activate_wifi_ssid_restriction(mdm_status_t value)
API to activate or deactivate the Wi-Fi Network SSID access restriction.
mdm_wifi_eap_phase_2_auth_e
Phase 2 EAP authentication.
Definition: wifi.h:105
DHCP Information.
Definition: wifi.h:35
mdm_data_t * mdm_get_wifi_ap_setting(void)
API to get the current Wi-Fi AP or Wi-Fi tethering or HotSpot setting of the device.
wifi_tethering_status_t
Enumerate Wi-Fi tethering status type.
Definition: wifi.h:232
Access point configuration.
Definition: wifi.h:177
char * ssid
Definition: wifi.h:49
mdm_status_t mdm_get_allow_wifi(void)
API to check if Wi-Fi use is allowed or restricted.
mdm_data_t * mdm_get_wifi_ssids_from_blacklist(void)
API to retrieve the blacklist of Wi-Fi network SSIDs for all admins.
const char * ca_cert_file
Definition: wifi.h:142
Struct to store AP password.
Definition: wifi.h:128
mdm_status_t
MDM Policy status.
mdm_status_t mdm_get_allow_user_policy_changes(void)
API to allow or disallow modify all Wi-Fi network settings.
mdm_result_t mdm_allow_wifi_ap_setting_user_modification(mdm_status_t value)
API to allow or deny the user to edit Wi-Fi AP settings.
mdm_result_t knox_mdm_preferred_ssid_enforce(mdm_status_t status)
API to set the enforce mode of the preferred Wi-Fi access point list.
const char * subject_match
Definition: wifi.h:143
mdm_status_t mdm_get_automatic_connection_to_wifi(void)
API to check whether the automatic connection to a known Wi-Fi network is allowed or not...
mdm_status_t mdm_get_password_hidden(void)
API to get a Wi-Fi profile from the admin.
mdm_status_t mdm_is_network_blocked(const char *ssid)
API to check if a network with the given SSID is blocked.
const char * subject_match
Definition: wifi.h:158
mdm_result_t mdm_remove_wifi_ssids_from_blacklist(GList *SSIDs)
API to remove a list of Wi-Fi network SSIDs from the Wi-Fi network blacklist.
mdm_data_t * knox_mdm_protected_ssids_get(const mdm_status_t all_admins)
API to identify the contents of the protected Wi-Fi access point list.
const char * identity
Definition: wifi.h:138
mdm_status_t mdm_is_wifi_ssid_restriction_active(void)
API to get active state of the Bluetooth device restriction.
mdm_result_t mdm_clear_wifi_ssids_whitelist(void)
API to remove all Wi-Fi network SSIDs from the Wi-Fi network blacklist.
char * netmask
Definition: wifi.h:40
mdm_result_t mdm_set_wifi_ap_setting(const char *ssid, mdm_wifi_sec_type_e securityType, const char *password)
API to configure the Wi-Fi AP or Wi-Fi tethering or HotSpot setting of the device.
mdm_data_t * mdm_get_wifi_ssid(void)
API to get the Service Set Identifier (SSID) of the current 802.11 network.
mdm_result_t mdm_add_wifi_ap_config(const mdm_wifi_ap_config_t *config)
API to add new Wi-Fi access point configuration.
Wi-Fi configuration type.
Definition: wifi.h:210
int type
Definition: wifi.h:51
mdm_result_t
MDM API result.
mdm_result_t knox_mdm_protected_ssids_clear(void)
API to clear Wi-Fi SSIDs from the protected access point list.
mdm_status_t knox_mdm_preferred_ssid_is_enforced(void)
API to get the current status of enforce mode for preferred Wi-Fi access points.
mdm_result_t mdm_set_allow_user_policy_changes(mdm_status_t enable)
API to allow or disallow modify all Wi-Fi network settings.
mdm_status_t mdm_is_network_secure(const char *ssid)
API to get the enterprise WLAN EAP type.
mdm_result_t knox_mdm_protected_ssid_delete(const char *ssid)
API to delete an SSID from the protected Wi-Fi access point list.
mdm_result_t mdm_set_password_hidden(mdm_status_t passHidden)
API to set the hidden state of the WLAN enterprise network.
mdm_data_t * mdm_get_wifi_dhcpinfo(void)
API to get the DHCP-assigned addresses from the last successful DHCP request, if any.
mdm_status_t mdm_is_wifi_state_change_allowed(void)
API to check if Wi-Fi state change is allowed or not.
char * ipAddress
Definition: wifi.h:39
Settings to set for SECURITY_LEVEL_EAP_PEAP and SECURITY_LEVEL_EAP_TTLS.
Definition: wifi.h:137
char * dns1
Definition: wifi.h:36
const char * password
Definition: wifi.h:140
mdm_wifi_sec_type_e mdm_get_minimum_required_security(void)
API to get the current minimum security level.
mdm_wifi_eap_type_e
Wi-Fi eap type.
Definition: wifi.h:70
Settings to set for SECURITY_LEVEL_EAP_TLS.
Definition: wifi.h:151
mdm_data_t * knox_mdm_preferred_ssids_get(mdm_status_t all_admins)
API to identify the contents of the preferred Wi-Fi access point list.
mdm_wifi_cert_level_e
Definition: wifi.h:197
mdm_result_t mdm_add_wifi_ssids_to_whitelist(GList *SSIDs)
API to add a list of Wi-Fi network SSIDs to the Wi-Fi network whitelist.
mdm_result_t knox_mdm_protected_ssid_add(const char *ssid)
API to add an SSID into the protected Wi-Fi access point list.
mdm_result_t mdm_get_blocked_networks(GList **blockedlist, GList **exceptlist)
API to get the list of blocked SSIDs and the list of SSID exceptions.
mdm_result_t mdm_remove_wifi_ssids_from_whitelist(GList *SSIDs)
API to remove a list of Wi-Fi network SSIDs from the Wi-Fi network whitelist.
const char * identity
Definition: wifi.h:152
const char * ssid
Definition: wifi.h:178
mdm_result_t knox_mdm_preferred_ssid_add(const char *ssid)
API to add SSIDs onto the list of preferred Wi-Fi access points.
const char * client_cert_file
Definition: wifi.h:156
mdm_result_t mdm_set_automatic_connection_to_wifi(bool enable)
API to allow or disallow the user to automatically connect to a known Wi-Fi network.
mdm_result_t knox_mdm_preferred_ssid_delete(const char *ssid)
API to delete specified SSIDs from the list of preferred Wi-Fi access points.
mdm_wifi_sec_type_e
Wi-Fi security type.
Definition: wifi.h:86
mdm_data_t * mdm_get_wifi_ssids_from_whitelist(void)
API to retrieve the whitelist of Wi-Fi network SSIDs for all admins.
char * value
Definition: wifi.h:50
const char * password
Definition: wifi.h:154