+ elseif string.match(s.encryption, '^psk') then
+ encr = m:field(ListValue, "encryption", translate("Encryption"))
+ encr:value("psk", "WPA PSK")
+ encr:value("psk-mixed", "WPA/WPA2 mixed")
+ encr:value("psk2", "WPA2 PSK")
+ encr.default = s.encryption
+
+ ciph = m:field(ListValue, "cipher", translate("Cipher"))
+ ciph:value("auto", translate("Automatic"))
+ ciph:value("ccmp", translate("Force CCMP (AES)"))
+ ciph:value("tkip", translate("Force TKIP"))
+ ciph:value("tkip+ccmp", translate("Force TKIP and CCMP (AES)"))
+ ciph.default = s.cipher
+
+ wkey = m:field(Value, "key", translate("Passphrase"))
+ wkey.datatype = "wpakey"
+ elseif string.match(s.encryption, '^wpa') then
+ encr = m:field(ListValue, "encryption", translate("Encryption"))
+ encr:value("wpa", "WPA Enterprise")
+ encr:value("wpa-mixed", "WPA/WPA2 Enterprise mixed")
+ encr:value("wpa2", "WPA2 Enterprise")
+ encr.default = s.encryption
+
+ ciph = m:field(ListValue, "cipher", translate("Cipher"))
+ ciph:value("auto", translate("Automatic"))
+ ciph:value("ccmp", translate("Force CCMP (AES)"))
+ ciph:value("tkip", translate("Force TKIP"))
+ ciph:value("tkip+ccmp", translate("Force TKIP and CCMP (AES)"))
+ ciph.default = s.cipher
+
+ eaptype = m:field(ListValue, "eap_type", translate("EAP-Method"))
+ eaptype:value("tls", "TLS")
+ eaptype:value("ttls", "TTLS")
+ eaptype:value("peap", "PEAP")
+ eaptype:value("fast", "FAST")
+ eaptype.default = s.eap_type or "peap"
+
+ authentication = m:field(ListValue, "auth", translate("Authentication"))
+ authentication:value("PAP")
+ authentication:value("CHAP")
+ authentication:value("MSCHAP")
+ authentication:value("MSCHAPV2")
+ authentication:value("EAP-GTC")
+ authentication:value("EAP-MD5")
+ authentication:value("EAP-MSCHAPV2")
+ authentication:value("EAP-TLS")
+ authentication:value("auth=PAP")
+ authentication:value("auth=MSCHAPV2")
+ authentication.default = s.auth or "EAP-MSCHAPV2"
+
+ ident = m:field(Value, "identity", translate("Identity"))
+ ident.default = s.identity or ""
+
+ wkey = m:field(Value, "password", translate("Passphrase"))