;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'wid-edit) #@44 Convert 32-bit integer N into a byte list. (defalias 'enwc--int-to-byte-list #[(n) "\250\204 \304\305\306\300E\"\210\307\310\311\n W\203,\312\313\" B\314\315\"\nT\211\202 +\207" [n ret x --dotimes-limit-- signal wrong-type-argument integer nil 4 0 logand 255 lsh -8] 6 (#$ . 428)]) #@45 Convert byte list BL into a 32-bit integer. (defalias 'enwc--byte-list-to-int #[(bl) "<\204 \304\305\306\300E\"\210\307\310\211\203) @\311\312 \313\"\n\" A\211\204\310 +\207" [bl ret x --dolist-tail-- signal wrong-type-argument list 0 nil logior lsh 8] 6 (#$ . 730)]) #@63 Convert 32-bit integer N from hardware to network byte order. (defalias 'enwc--htonl #[(n) "\250\204 \301\302\303\300E\"\210\304\305!\237!\207" [n signal wrong-type-argument integer enwc--byte-list-to-int enwc--int-to-byte-list] 5 (#$ . 1018)]) #@100 View the text of the entry at point. This is mostly useful to view the text of the hidden entries. (defalias 'enwc-edit-view-entry #[nil "\300\301!\204\n\302\303!\210p\300\301!=\204\304\301!\210\305 \204\302\306!\210\307\310\305 !!\207" [get-buffer "*ENWC Edit*" error "Not editing a network entry." switch-to-buffer widget-at "No widget at point" message widget-field-value-get] 3 (#$ . 1274) nil]) (define-widget 'enwc-profile-props-widget 'group "ENWC edit widget." :convert-widget 'identity :format "IPv4 Settings:\n %v" :value-to-internal 'enwc-profile-props-to-widget :value-to-external 'enwc-widget-to-profile-props :match #[nil "\300\207" [t] 1] :indent 1 :args '((string :tag "Address") (string :tag "Netmask") (string :tag "Gateway") (string :tag "DNS1") (string :tag "DNS2"))) #@32 Create a profile props widget. (defalias 'enwc-profile-props-to-widget #[(widget props) "\301\302\303#\301\304\303#\301\305\303#\301\306\303#\301\307\303#\257\207" [props alist-get addr "" netmask gateway dns1 dns2] 8 (#$ . 2073)]) #@107 Convert widget values to a profile properties alist. WIDGET is unused. VALS is the list of widget values. (defalias 'enwc-widget-to-profile-props #[(widget vals) "@A@\3068\3078\3108\305 B\304\fB\303 B\302\nB\301 B\257-\207" [vals dns2 dns1 gateway netmask addr 2 3 4] 6 (#$ . 2318)]) #@122 An alist that maps supplicant entries to a widget type. For more information, see the documentation for wpa_supplicant. (defconst enwc-supplicant-alist (byte-code "\300\301B\302\303B\304\305B\306\307B\310\311B\312\313B\314\315B\316\317B\320\321B\322\323B\324\325B\326\327B\330\331B\332\333B\334\335B\336\337B\340\341B\342\343B\344\345B\346\347B\350\351B\352\353B\257\207" [proto (checklist :tag "Proto" :format #1="%{%t%}: %v" :sample-face bold :indent 9 :args ((item :tag "WPA" :value "wpa") (item :tag "RSN" :value "rsn"))) key-mgmt (checklist :tag "Key Mgmt" :format #1# :sample-face bold :indent 12 :args ((item :tag "NONE" :value "none") (item :tag "WPA-PSK" :value "wpa-psk") (item :tag "WPA-EAP" :value "wpa-eap") (item :tag "IEEE8021X" :value "ieee8021x"))) auth-alg (menu-choice :tag "Auth Alg" :format #3="%[%t%]: %v" :sample-face bold :args ((item :tag "OPEN" :value (downcase "OPEN")) (item :tag "SHARED" :value (downcase "SHARED")) (item :tag "LEAP" :value (downcase "LEAP")))) pairwise (checklist :tag "Pairwise" :format #1# :sample-face bold :indent 12 :args ((item :tag "CCMP" :value "ccmp") (item :tag "TKIP" :value "tkip") (item :tag "NONE" :value "none"))) group (checklist :tag "Group" :format #1# :sample-face bold :indent 9 :args ((item :tag "CCMP" :value "ccmp") (item :tag "TKIP" :value "tkip") (item :tag "WEP104" :value "wep104") (item :tag "WEP40" :value "wep40"))) psk (editable-field :tag "Psk" . #2=(:format "%{%t%}: %v" :sample-face bold :keymap enwc-edit-field-map :secret 42)) wep-key0 (editable-field :tag "Wep Key0" . #2#) wep-key1 (editable-field :tag "Wep Key1" . #2#) wep-key2 (editable-field :tag "Wep Key2" . #2#) wep-key3 (editable-field :tag "Wep Key3" . #2#) wep-tx-keyidx (menu-choice :tag "Wep Tx Keyidx" :format #3# :sample-face bold :args ((item :tag "0" :value (downcase "0")) (item :tag "1" :value (downcase "1")) (item :tag "2" :value (downcase "2")) (item :tag "3" :value (downcase "3")))) eap (menu-choice :tag "Eap" :format #3# :sample-face bold :args ((item :tag "TLS" :value (downcase "TLS")) (item :tag "PEAP" :value (downcase "PEAP")) (item :tag "TTLS" :value (downcase "TTLS")) (item :tag "LEAP" :value (downcase "LEAP")) (item :tag "FAST" :value (downcase "FAST")))) identity (editable-field :tag "Identity" . #4=(:sample-face bold :format "%{%t%}: %v")) anonymous-identity (editable-field :tag "Anonymous Identity" . #4#) password (editable-field :tag "Password" . #2#) ca-cert (file :tag "Ca Cert" . #5=(:format "%{%t%}: %v" :sample-face bold :must-match t)) client-cert (file :tag "Client Cert" . #5#) private-key (file :tag "Private Key" . #5#) private-key-passwd (editable-field :tag "Private Key Passwd" . #2#) pac-file (file :tag "Pac File" . #5#) phase1 (list :tag "Phase1" :format #7="%{%t%}: %v" :sample-face bold :indent 6 :args ((menu-choice :tag "Peapver" :format #3# :sample-face bold :args ((item :tag #6="" :value (downcase #6#)) (item :tag "0" :value (downcase "0")) (item :tag "1" :value (downcase "1")))) (menu-choice :tag "Peaplabel" :format #3# :sample-face bold :args ((item :tag #6# :value (downcase #6#)) (item :tag "0" :value (downcase "0")) (item :tag "1" :value (downcase "1")))) (menu-choice :tag "Fast Provisioning" :format #3# :sample-face bold :args ((item :tag #6# :value (downcase #6#)) (item :tag "0" :value (downcase "0")) (item :tag "1" :value (downcase "1")) (item :tag "2" :value (downcase "2")) (item :tag "3" :value (downcase "3")))))) phase2 (list :tag "Phase2" :format #7# :sample-face bold :indent 6 :args ((menu-choice :tag "Auth" :format #3# :sample-face bold :args ((item :tag #6# :value (downcase #6#)) (item :tag "MD5" :value (downcase "MD5")) (item :tag "MSCHAPV2" :value (downcase "MSCHAPV2")) (item :tag "OTP" :value (downcase "OTP")) (item :tag "GTC" :value (downcase "GTC")) (item :tag "TLS" :value (downcase "TLS")))) (menu-choice :tag "Autheap" :format #3# :sample-face bold :args ((item :tag #6# :value (downcase #6#)) (item :tag "MD5" :value (downcase "MD5")) (item :tag "MSCHAPV2" :value (downcase "MSCHAPV2")) (item :tag "OTP" :value (downcase "OTP")) (item :tag "GTC" :value (downcase "GTC")) (item :tag "TLS" :value (downcase "TLS")))) (file :tag "Ca Cert" . #5#) (file :tag "Client Cert" . #5#) (file :tag "Private Key" . #5#) (editable-field :tag "Private Key Passwd" . #2#)))] 23) (#$ . 2620)) #@371 The alist of templates for security. This should be an alist of the form (KEY . ((SUPPLICANT-KEY . INITIAL-INPUT) ...)) Each SUPPLICANT-KEY should be a key from `enwc-supplicant-alist', and INITIAL-INPUT should be an acceptable value for SUPPLICANT-KEY. If INITIAL-INPUT is the symbol req, then this option is required. The value opt means that the option is optional. (custom-declare-variable 'enwc-supplicant-template-alist '`((wep (key-mgmt "none") (wep-key0 . req) (wep-tx-keyidx . "0")) (wpa2 (proto "wpa" "rsn") (key-mgmt "wpa-psk") (pairwise "ccmp" "tkip") (group "ccmp" "tkip") (psk . req)) (leap (eap . "leap") (key-mgmt "ieee8021x") (auth-alg . "leap") (identity . req) (password . req)) (eap-fast (proto "rsn" "wpa") (pairwise "ccmp" "tkip") (group "ccmp" "tkip") (key-mgmt "wpa-eap") (eap . "fast") (identity . req) (password . req) (phase1 (fast-provisioning . "1")) (pac-file . opt)) (eap-tls (key-mgmt "wpa-eap") (pairwise "tkip") (group "tkip") (eap . "tls") (identity . req) (ca-cert . opt) (client-cert . opt) (private-key . req) (private-key-passwd . req)) (peap (proto "rsn") (key-mgmt "wpa-eap") (pairwise "ccmp") (eap . "peap") (identity . req) (password . req)) (peap-tkip (proto "wpa") (key-mgmt "wpa-eap") (pairwise "tkip") (group "tkip") (eap . "peap") (identity . req) (password . req) (ca-cert . opt) (phase1 (peaplabel . "0")) (phase2 (auth . "mschapv2")))) '(#$ . 6946) :group 'enwc :type '(alist :key-type symbol :value-type (alist :key-type symbol))) #@120 Create a widget definition from ENT. If optional parameter SEC-INFO is non-nil, then use it for security information. (defalias 'enwc--get-supplicant-entry #[(ent &optional sec-info) "A@ \236\306 \204\307\310@\"\210 A@\311=\203N\306\312 A\313\"\306\211\203I@\314\315\312\316\"\227!\f\317# BA\211\204,* \237) A@\320\f\321=\203f\322\323\324\314@\317#F\202{\f\325=\203x\324\314@\317#D\202{\324\fD AA\"+B\207" [ent enwc-supplicant-alist fin wid init act-init nil error "Unknown supplicant type %s" list widget-get :args alist-get enwc--str-to-sym :tag "" append req :required t :value opt arg --dolist-tail-- sec-info] 10 (#$ . 8437)]) #@129 Create the widget declaration for the menu of templates. If specified, SEC-INFO is passed to the templates to initialize them. (defalias 'enwc-create-template-menu #[(&optional sec-info) "\301\302\303\304\305\306\307\"BBBBB\207" [enwc-supplicant-template-alist menu-choice :tag "Security" :indent 2 mapcar #[(tm) "\301\302\303@!\304\303@!\305\306A\"BBBBB\207" [tm list :tag symbol-name :menu-tag mapcar #[(ent) "\302 \"\207" [ent sec-info enwc--get-supplicant-entry] 3]] 8]] 8 (#$ . 9115)]) #@110 Create the menu of security templates. If specified, SEC-INFO is passed to the templates to initialize them. (defalias 'enwc-display-sec-widget #[(&optional sec-info) "\301\302!!\207" [sec-info widget-create enwc-create-template-menu] 3 (#$ . 9619)]) #@45 Get the data from a security widget WIDGET. (defalias 'enwc-sec-widget-data #[(widget) "\305\211\306\"\307\"\310!\311 ! \236\211\204\312\313 \"\210\fA\314\311 !B\315\316\f\n#+B\207" [widget type values enwc-supplicant-template-alist template widget-get :choice :tag widget-value intern error "Unrecognized security template \"%s\"." sec-type cl-mapcar #[(val v) "\n@\305=\204\n@\306=\203#\307\310\311\312\n@ \"\313\"\"\314\315\f#)\316 !\210\n@ )B\207" [v vl val enwc-supplicant-alist subs phase1 phase2 mapcar #[(arg) "\301\302\303\"\227!\207" [arg enwc--str-to-sym widget-get :tag] 4] widget-get alist-get :args cl-mapcar cons print] 6]] 6 (#$ . 9877)]) #@57 The network information widget used in the edit buffer. (defvar enwc-network-edit-widget nil (#$ . 10555)) #@46 The security widget used in the edit buffer. (defvar enwc-security-edit-widget nil (#$ . 10668)) #@187 Setup the edit buffer. This removes the old one if neccessary, and redisplays the settings from the network profile with id `enwc-edit-id', which is set in `enwc-edit-entry-at-point'. (defalias 'enwc-setup-edit-buffer #[nil "\305\306!\203\n\307\306!\210r\310\306!q\210\311!\312\313\314\315\"\316Q!\210\312\316!\210\317\320\321 #\312\316!\210\322 !\323\f!\210\324 \210*\325\306!\207" [enwc-edit-id nw-info enwc-network-edit-widget enwc-security-edit-widget enwc-edit-map get-buffer "*ENWC Edit*" kill-buffer get-buffer-create enwc-get-profile-info widget-insert "Settings for access point " enwc-value-from-scan essid "\n" widget-create enwc-profile-props-widget :value enwc-display-sec-widget use-local-map widget-setup switch-to-buffer] 5 (#$ . 10772)]) #@49 Save the network settings from the edit buffer. (defalias 'enwc-edit-save #[nil "\303\304!\204\n\305\306!\210p\303\304!=\204\307\304!\210\310\311\312 !\313\n!\"\"\207" [enwc-edit-id enwc-network-edit-widget enwc-security-edit-widget get-buffer "*ENWC Edit*" error "Not editing a network entry" switch-to-buffer enwc-save-nw-settings append widget-value enwc-sec-widget-data] 6 (#$ . 11541) nil]) #@33 Edit the current network entry. (defalias 'enwc-edit-entry-at-point #[nil "\301\302\206`\303\"\262\304 \207" [enwc-edit-id nil get-text-property tabulated-list-id enwc-setup-edit-buffer] 4 (#$ . 11947) nil]) #@52 The keymap for editing network profiles with ENWC. (defvar enwc-edit-map (byte-code "\302!\303 \304\305#\210 )\207" [widget-keymap map copy-keymap define-key "" enwc-edit-save] 4) (#$ . 12166)) #@61 The keymap for editable fields within the ENWC edit buffer. (defvar enwc-edit-field-map (byte-code "\302!\303 \304\305#\210 )\207" [widget-field-keymap map copy-keymap define-key "" enwc-edit-view-entry] 4) (#$ . 12370))