guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

118/197: installer: Distinguish between Wifi encryption methods.


From: Danny Milosavljevic
Subject: 118/197: installer: Distinguish between Wifi encryption methods.
Date: Mon, 3 Jul 2017 20:37:10 -0400 (EDT)

dannym pushed a commit to branch wip-installer-2
in repository guix.

commit cc3032b44d0cf674f4518e4bdc14e7b08c7f1e50
Author: John Darrington <address@hidden>
Date:   Wed Jan 18 15:01:53 2017 +0100

    installer: Distinguish between Wifi encryption methods.
    
    * gnu/system/installer/wireless.scm (get-wifi): Return a symbol in
    the encryption field to indicaate the encryption type.
---
 gnu/system/installer/wireless.scm | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/gnu/system/installer/wireless.scm 
b/gnu/system/installer/wireless.scm
index e26b257..5c47d22 100644
--- a/gnu/system/installer/wireless.scm
+++ b/gnu/system/installer/wireless.scm
@@ -136,9 +136,10 @@
                 #:disp-proc
                 (lambda (d _)
                   (format #f "~30a ~a" (assq-ref d 'essid)
-                          (if (assq-ref d 'encryption)
-                              (M_ "Encr.")
-                              (M_ "Clear")))))))
+                          (or
+                           (and=> (assq-ref d 'encryption)
+                                  symbol->string)
+                            (M_ "clear")))))))
 
     (addstr*   text-window  (format #f
                                     (gettext
@@ -197,9 +198,20 @@
               (cons
                (append (car prev)
                        (list `(encryption .
-                                          ,(string-suffix? "on" x))))
+                                          ;; Assume WEP encryption until we 
know
+                                          ;; otherwise.
+                                          ,(if (string-suffix? "on" x) 'wep 
#f))))
                (cdr prev)))
 
+             ((string-match "^IE:  *IEEE 802.11i" x)
+              ;; If we find the above string, and encryption is on, then the 
encrpytion
+              ;; type is probably WPA2
+              (let ((current-ap (car prev)))
+                (if (assq-ref current-ap 'encryption)
+                    (cons  (assq-set! current-ap 'encryption 'wpa2)
+                           (cdr prev))
+                    prev)))
+
              ((string-prefix? "Quality=" x)
               (let ((lvl (string-match "level=(-?[0-9][0-9]*) dBm" x)))
                 (if lvl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]