diff options
| author | Mark Oteiza | 2016-06-25 10:31:04 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2016-06-25 10:38:33 -0400 |
| commit | d6930356cabd3036e445cc6a2f668b1fd3e0cde4 (patch) | |
| tree | 57bbae7f8dd0bd22d6f03101063df7697c764667 | |
| parent | 852507f147b4253a8ec265951b70229cfd7c5a64 (diff) | |
| download | emacs-d6930356cabd3036e445cc6a2f668b1fd3e0cde4.tar.gz emacs-d6930356cabd3036e445cc6a2f668b1fd3e0cde4.zip | |
Teach net-utils more iproute2 and nl80211 tools
* lisp/net/net-utils.el (iwconfig-program): Add iw(8).
(iwconfig-program-options): Add "dev" argument for iw. Another useful
option is "phy"; beyond that one needs to know the interface name.
(netstat-program): Add ss(8).
(route-program): Add ip(8).
(route-program-options): Add "route" argument for ip.
| -rw-r--r-- | lisp/net/net-utils.el | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index b13bece3912..1547f5247aa 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el | |||
| @@ -112,22 +112,31 @@ These options can be used to limit how many ICMP packets are emitted." | |||
| 112 | :group 'net-utils | 112 | :group 'net-utils |
| 113 | :type '(repeat string)) | 113 | :type '(repeat string)) |
| 114 | 114 | ||
| 115 | (defcustom iwconfig-program "iwconfig" | 115 | (defcustom iwconfig-program |
| 116 | (cond ((executable-find "iwconfig") "iwconfig") | ||
| 117 | ((net-utils--executable-find-sbin "iw") "iw") | ||
| 118 | (t "iw")) | ||
| 116 | "Program to print wireless network configuration information." | 119 | "Program to print wireless network configuration information." |
| 117 | :group 'net-utils | 120 | :group 'net-utils |
| 118 | :type 'string | 121 | :type 'string |
| 119 | :version "23.1") | 122 | :version "25.2") |
| 120 | 123 | ||
| 121 | (defcustom iwconfig-program-options nil | 124 | (defcustom iwconfig-program-options |
| 125 | (cond ((string-match-p "iw\\'" iwconfig-program) (list "dev")) | ||
| 126 | (t nil)) | ||
| 122 | "Options for the iwconfig program." | 127 | "Options for the iwconfig program." |
| 123 | :group 'net-utils | 128 | :group 'net-utils |
| 124 | :type '(repeat string) | 129 | :type '(repeat string) |
| 125 | :version "23.1") | 130 | :version "25.2") |
| 126 | 131 | ||
| 127 | (defcustom netstat-program "netstat" | 132 | (defcustom netstat-program |
| 133 | (cond ((executable-find "netstat") "netstat") | ||
| 134 | ((net-utils--executable-find-sbin "ss")) | ||
| 135 | (t "ss")) | ||
| 128 | "Program to print network statistics." | 136 | "Program to print network statistics." |
| 129 | :group 'net-utils | 137 | :group 'net-utils |
| 130 | :type 'string) | 138 | :type 'string |
| 139 | :version "25.2") | ||
| 131 | 140 | ||
| 132 | (defcustom netstat-program-options | 141 | (defcustom netstat-program-options |
| 133 | (list "-a") | 142 | (list "-a") |
| @@ -147,20 +156,25 @@ These options can be used to limit how many ICMP packets are emitted." | |||
| 147 | :type '(repeat string)) | 156 | :type '(repeat string)) |
| 148 | 157 | ||
| 149 | (defcustom route-program | 158 | (defcustom route-program |
| 150 | (if (eq system-type 'windows-nt) | 159 | (cond ((eq system-type 'windows-nt) "route") |
| 151 | "route" | 160 | ((executable-find "netstat") "netstat") |
| 152 | "netstat") | 161 | ((net-utils--executable-find-sbin "netstat")) |
| 162 | ((executable-find "ip") "ip") | ||
| 163 | ((net-utils--executable-find-sbin "ip")) | ||
| 164 | (t "ip")) | ||
| 153 | "Program to print routing tables." | 165 | "Program to print routing tables." |
| 154 | :group 'net-utils | 166 | :group 'net-utils |
| 155 | :type 'string) | 167 | :type 'string |
| 168 | :version "25.2") | ||
| 156 | 169 | ||
| 157 | (defcustom route-program-options | 170 | (defcustom route-program-options |
| 158 | (if (eq system-type 'windows-nt) | 171 | (cond ((eq system-type 'windows-nt) (list "print")) |
| 159 | (list "print") | 172 | ((string-match-p "netstat\\'" route-program) (list "-r")) |
| 160 | (list "-r")) | 173 | (t (list "route"))) |
| 161 | "Options for the route program." | 174 | "Options for the route program." |
| 162 | :group 'net-utils | 175 | :group 'net-utils |
| 163 | :type '(repeat string)) | 176 | :type '(repeat string) |
| 177 | :version "25.2") | ||
| 164 | 178 | ||
| 165 | (defcustom nslookup-program "nslookup" | 179 | (defcustom nslookup-program "nslookup" |
| 166 | "Program to interactively query DNS information." | 180 | "Program to interactively query DNS information." |