;;; net-utils.el --- network functions
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2012 Free Software Foundation, Inc.
;; Author: Peter Breton <pbreton@cs.umb.edu>
;; Created: Sun Mar 16 1997
:group 'comm
:version "20.3")
-(defcustom net-utils-remove-ctl-m
- (member system-type (list 'windows-nt 'msdos))
+(defcustom net-utils-remove-ctl-m (memq system-type '(windows-nt msdos))
"If non-nil, remove control-Ms from output."
:group 'net-utils
:type 'boolean)
;; On GNU/Linux and Irix, the system's ping program seems to send packets
;; indefinitely unless told otherwise
(defcustom ping-program-options
- (and (memq system-type (list 'linux 'gnu/linux 'irix))
+ (and (memq system-type '(gnu/linux irix))
(list "-c" "4"))
"Options for the ping program.
These options can be used to limit how many ICMP packets are emitted."
:group 'net-utils
:type 'string)
+(define-obsolete-variable-alias 'ipconfig-program-options
+ 'ifconfig-program-options "22.2")
+
(defcustom ifconfig-program-options
(list
(if (eq system-type 'windows-nt)
:type 'string
:version "23.1")
-(define-obsolete-variable-alias 'ipconfig-program-options
- 'ifconfig-program-options "22.2")
-
(defcustom iwconfig-program-options nil
"Options for the iwconfig program."
:group 'net-utils
(display-buffer buffer-name))
;;;###autoload
-(defun ifconfig ()
- "Run ifconfig and display diagnostic output."
- (interactive)
- (net-utils-run-simple
- (format "*%s*" ifconfig-program)
- ifconfig-program
+(defun ifconfig ()
+ "Run ifconfig and display diagnostic output."
+ (interactive)
+ (net-utils-run-simple
+ (format "*%s*" ifconfig-program)
+ ifconfig-program
ifconfig-program-options))
(defalias 'ipconfig 'ifconfig)
;;;###autoload
-(defun iwconfig ()
- "Run iwconfig and display diagnostic output."
- (interactive)
- (net-utils-run-simple
- (format "*%s*" iwconfig-program)
- iwconfig-program
+(defun iwconfig ()
+ "Run iwconfig and display diagnostic output."
+ (interactive)
+ (net-utils-run-simple
+ (format "*%s*" iwconfig-program)
+ iwconfig-program
iwconfig-program-options))
;;;###autoload
(defun netstat ()
- "Run netstat and display diagnostic output."
+ "Run netstat and display diagnostic output."
(interactive)
(net-utils-run-simple
(format "*%s*" netstat-program)
;;;###autoload
(defun arp ()
- "Run arp and display diagnostic output."
+ "Run arp and display diagnostic output."
(interactive)
(net-utils-run-simple
(format "*%s*" arp-program)
(defun nslookup ()
"Run nslookup program."
(interactive)
- (comint-run nslookup-program)
+ (switch-to-buffer (make-comint "nslookup" nslookup-program))
(nslookup-mode))
(defvar comint-prompt-regexp)
(autoload 'comint-mode "comint" nil t)
+(defvar nslookup-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\t" 'comint-dynamic-complete)
+ map))
+
;; Using a derived mode gives us keymaps, hooks, etc.
(define-derived-mode nslookup-mode comint-mode "Nslookup"
"Major mode for interacting with the nslookup program."
(setq comint-prompt-regexp nslookup-prompt-regexp)
(setq comint-input-autoexpand t))
-(define-key nslookup-mode-map "\t" 'comint-dynamic-complete)
-
;;;###autoload
(defun dns-lookup-host (host)
"Lookup the DNS information for HOST (name or IP address)."
(list host)))
(pop-to-buffer buf)))
+(defvar ftp-mode-map
+ (let ((map (make-sparse-keymap)))
+ ;; Occasionally useful
+ (define-key map "\t" 'comint-dynamic-complete)
+ map))
+
(define-derived-mode ftp-mode comint-mode "FTP"
"Major mode for interacting with the ftp program."
(setq comint-prompt-regexp ftp-prompt-regexp)
(add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt
nil t)))
-;; Occasionally useful
-(define-key ftp-mode-map "\t" 'comint-dynamic-complete)
-
(defun smbclient (host service)
"Connect to SERVICE on HOST via SMB."
(interactive
(provide 'net-utils)
-;; arch-tag: 97119e91-9edb-4376-838b-bf7058fa1314
;;; net-utils.el ends here