;ELC   
;;; Compiled by rms@psilocin.ai.mit.edu on Tue Jun 23 11:55:06 1998
;;; from file /gd/gnu/emacs/lisp/net-utils.el
;;; in Emacs version 20.2.95.4
;;; with bytecomp version 2.46
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`net-utils.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(custom-declare-group 'net-utils nil "Network utility functions." :prefix "net-utils-" :group 'comm :version "20.3")
#@44 If non-nil, remove control-Ms from output.
(custom-declare-variable 'net-utils-remove-ctl-m '(member system-type (list 'windows-nt 'msdos)) '(#$ . 723) :group 'net-utils :type 'boolean)
#@49 Program to trace network hops to a destination.
(custom-declare-variable 'traceroute-program '(if (eq system-type 'windows-nt) "tracert" "traceroute") '(#$ . 915) :group 'net-utils :type 'string)
#@37 Options for the traceroute program.
(custom-declare-variable 'traceroute-program-options 'nil '(#$ . 1117) :group 'net-utils :type '(repeat 'string))
#@49 Program to send network test packets to a host.
(custom-declare-variable 'ping-program '"ping" '(#$ . 1273) :group 'net-utils :type 'string)
#@101 Options for the ping program.
These options can be used to limit how many ICMP packets are emitted.
(custom-declare-variable 'ping-program-options '(and (memq system-type (list 'linux 'gnu/linux 'irix)) (list "-c" "4")) '(#$ . 1421) :group 'net-utils :type '(repeat 'string))
#@53 Program to print network configuration information.
(custom-declare-variable 'ipconfig-program '(if (eq system-type 'windows-nt) "ipconfig" "ifconfig") '(#$ . 1703) :group 'net-utils :type 'string)
#@31 Options for ipconfig-program.
(custom-declare-variable 'ipconfig-program-options '(list (if (eq system-type 'windows-nt) "/all" "-a")) '(#$ . 1907) :group 'net-utils :type '(repeat 'string))
#@38 Program to print network statistics.
(custom-declare-variable 'netstat-program '"netstat" '(#$ . 2104) :group 'net-utils :type 'string)
#@30 Options for netstat-program.
(custom-declare-variable 'netstat-program-options 'nil '(#$ . 2246) :group 'net-utils :type '(repeat 'string))
#@52 Program to print IP to address translation tables.
(custom-declare-variable 'arp-program '"arp" '(#$ . 2392) :group 'net-utils :type 'string)
#@26 Options for arp-program.
(custom-declare-variable 'arp-program-options '(list "-a") '(#$ . 2540) :group 'net-utils :type '(repeat 'string))
#@34 Program to print routing tables.
(custom-declare-variable 'route-program '(if (eq system-type 'windows-nt) "route" "netstat") '(#$ . 2686) :group 'net-utils :type 'string)
#@28 Options for route-program.
(custom-declare-variable 'route-program-options '(if (eq system-type 'windows-nt) (list "print") (list "-r")) '(#$ . 2864) :group 'net-utils :type '(repeat 'string))
#@49 Program to interactively query DNS information.
(custom-declare-variable 'nslookup-program '"nslookup" '(#$ . 3063) :group 'net-utils :type 'string)
#@50 List of options to pass to the nslookup program.
(custom-declare-variable 'nslookup-program-options 'nil '(#$ . 3218) :group 'net-utils :type '(repeat 'string))
#@38 Regexp to match the nslookup prompt.
(custom-declare-variable 'nslookup-prompt-regexp '"^> " '(#$ . 3385) :group 'net-utils :type 'regexp)
#@36 Progam to run to do FTP transfers.
(custom-declare-variable 'ftp-program '"ftp" '(#$ . 3530) :group 'net-utils :type 'string)
#@45 List of options to pass to the FTP program.
(custom-declare-variable 'ftp-program-options 'nil '(#$ . 3662) :group 'net-utils :type '(repeat 'string))
#@48 Regexp which matches the FTP program's prompt.
(custom-declare-variable 'ftp-prompt-regexp '"^ftp>" '(#$ . 3819) :group 'net-utils :type 'regexp)
#@40 Expressions to font-lock for nslookup.
(defconst nslookup-font-lock-keywords (byte-code "\2056 \306\307!\210	\310\nE\311\310E\312\313\fE\314\315\316\317\320\"\321#\310E\322\314\315\316\323\"\321#\324\325R)\310E\257\207" [window-system nslookup-prompt-regexp font-lock-reference-face font-lock-type-face font-lock-keyword-face font-lock-variable-name-face require font-lock 0 "^[A-Za-z0-9 _]+:" "\\<\\(SOA\\|NS\\|MX\\|A\\|CNAME\\)\\>" 1 mapconcat identity make-list 4 "[0-9]+" "\\." "[-A-Za-z0-9]+" 2 "\\(\\." "\\)*" host-expression] 9) (#$ . 3971))
#@28 Abbrev table for nslookup.
(defvar nslookup-abbrev-table (make-abbrev-table) (#$ . 4537))
(byte-code "\301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\311#\210\301\312\313#\210\301\314\315#\210\301\316\317#\210\301\320\321#\207" [nslookup-abbrev-table define-abbrev "e" "exit" "f" "finger" "h" "help" "lse" "lserver" "r" "root" "s" "set" "se" "server" "v" "viewer"] 4)
#@23 Abbrev table for ftp.
(defvar ftp-abbrev-table (make-abbrev-table) (#$ . 4931))
(byte-code "\306\307\310#\210\306\311\312#\210\306\313\314#\210\306\315\316#\210	\205% \317\320!\210\n\321EC\304B\306\207" [ftp-abbrev-table window-system ftp-prompt-regexp font-lock-reference-face ftp-font-lock-keywords current-load-list define-abbrev "q" "quit" "g" "get" "p" "prompt" "anon" "anonymous" require font-lock 0] 4)
#@29 Remove trailing control Ms.
(defalias 'net-utils-remove-ctrl-m-filter #[(process output-string) "p\305\216\306\307\f!q\210`\310\f!U\311\312	\"\203$ \313\314\306\211	$\202 \212\310\f!b\210	c\210\310\f!`\306\223\210)\205= \310\f!b,\207" [output-string filtered-string old-buffer moving process ((set-buffer old-buffer)) nil process-buffer process-mark string-match "" replace-match ""] 5 (#$ . 5355)])
#@36 Run a network information program.
(defalias 'net-utils-run-program '(macro . #[(name header program &rest args) "\304\305\306\307\310\311BBBDDC\312\313\314	\315BB\316\317\320\305\nBBBBB\321BB\322BBBBBB\207" [name header program args let buf get-buffer-create concat "*" ("*") (set-buffer buf) (erase-buffer) insert ("\n") set-process-filter apply 'start-process ('net-utils-remove-ctrl-m-filter) ((display-buffer buf))] 12 (#$ . 5770)]))
#@36 Run traceroute program for TARGET.
(defalias 'traceroute #[(target) "\203\f \305	C\"\202 	C\306\307\310\311	Q\307Q!\211q\210\312 \210\313\f\314	R\315\261\210\316\317\320\310\311	Q\f\n%\321\"\210\322!*\207" [traceroute-program-options target options buf traceroute-program append get-buffer-create "*" "Traceroute" " " erase-buffer "** Traceroute ** " " ** " "\n" set-process-filter apply start-process net-utils-remove-ctrl-m-filter display-buffer] 8 (#$ . 6218) "sTarget: "])
#@108 Ping HOST.
If your system's ping continues until interrupted, you can try setting 
`ping-program-options'.
(defalias 'ping #[(host) "\203\f \305	C\"\202 	C\306\307\310\311	Q\307Q!\211q\210\312 \210\313\f\314	R\315\261\210\316\317\320\310\311	Q\f\n%\321\"\210\322!*\207" [ping-program-options host options buf ping-program append get-buffer-create "*" "Ping" " " erase-buffer "** Ping ** " " ** " "\n" set-process-filter apply start-process net-utils-remove-ctrl-m-filter display-buffer] 8 (#$ . 6710) (list (progn (require 'ffap) (read-from-minibuffer "Ping host: " (or (ffap-string-at-point 'machine) ""))))])
#@23 Run ipconfig program.
(defalias 'ipconfig #[nil "\303\304!\211q\210\305 \210\306	\307Q\310\261\210\311\312\313\314	\n%\315\"\210\316!)\207" [buf ipconfig-program ipconfig-program-options get-buffer-create "*Ipconfig*" erase-buffer "** Ipconfig ** " " ** " "\n" set-process-filter apply start-process "Ipconfig" net-utils-remove-ctrl-m-filter display-buffer] 8 (#$ . 7335) nil])
(defalias 'ifconfig 'ipconfig)
#@22 Run netstat program.
(defalias 'netstat #[nil "\303\304!\211q\210\305 \210\306	\307Q\310\261\210\311\312\313\314	\n%\315\"\210\316!)\207" [buf netstat-program netstat-program-options get-buffer-create "*Netstat*" erase-buffer "** Netstat ** " " ** " "\n" set-process-filter apply start-process "Netstat" net-utils-remove-ctrl-m-filter display-buffer] 8 (#$ . 7754) nil])
#@22 Run the arp program.
(defalias 'arp #[nil "\303\304!\211q\210\305 \210\306	\307Q\310\261\210\311\312\313\314	\n%\315\"\210\316!)\207" [buf arp-program arp-program-options get-buffer-create "*Arp*" erase-buffer "** Arp ** " " ** " "\n" set-process-filter apply start-process "Arp" net-utils-remove-ctrl-m-filter display-buffer] 8 (#$ . 8135) nil])
#@24 Run the route program.
(defalias 'route #[nil "\303\304!\211q\210\305 \210\306	\307Q\310\261\210\311\312\313\314	\n%\315\"\210\316!)\207" [buf route-program route-program-options get-buffer-create "*Route*" erase-buffer "** Route ** " " ** " "\n" set-process-filter apply start-process "Route" net-utils-remove-ctrl-m-filter display-buffer] 8 (#$ . 8492) nil])
#@38 Lookup the DNS information for HOST.
(defalias 'nslookup-host #[(host) "\203\f \305	C\"\202 	C\306\307!\211q\210\310 \210\311\312\313\314	\fE\315#P\316\261\210\317\320\321\314\f\n%\322\"\210\323!*\207" [nslookup-program-options host options buf nslookup-program append get-buffer-create "*Nslookup*" erase-buffer "** " mapconcat identity "Nslookup" " ** " "\n" set-process-filter apply start-process net-utils-remove-ctrl-m-filter display-buffer] 8 (#$ . 8863) (list (read-from-minibuffer "Lookup host: " (or (ffap-string-at-point 'machine) "")))])
#@23 Run nslookup program.
(defalias 'nslookup #[nil "\304!\210\305\306\307!\310\"\210\311\312!\313L\210\311\314!	L\210\315\316!\210\311\303!\210\n\211\207" [nslookup-program nslookup-abbrev-table nslookup-prompt-regexp comint-prompt-regexp comint-run set-process-filter get-buffer-process "*nslookup*" net-utils-remove-ctrl-m-filter make-local-variable font-lock-defaults ((nslookup-font-lock-keywords)) local-abbrev-table abbrev-mode t] 3 (#$ . 9426) nil])
#@18 Run ftp program.
(defalias 'ftp #[(host) "\306\307\310Q!\211q\210\311 \210\312	\313P\n\314\203  \315C\"\202\" C%\210\316\317!\320L\210\316\305!\210\f\321C\316\322!L\210\323\324!\210\325	!)\207" [host buf ftp-program ftp-program-options ftp-prompt-regexp comint-prompt-regexp get-buffer-create "*ftp [" "]*" comint-mode comint-exec "ftp-" nil append make-local-variable font-lock-defaults ((ftp-font-lock-keywords)) comint-watch-for-password-prompt local-abbrev-table abbrev-mode t switch-to-buffer-other-window comint-output-filter-functions ftp-abbrev-table] 9 (#$ . 9888) "sFtp to Host: "])
#@79 Alist of services and associated TCP port numbers.
This list in not complete.
(defvar network-connection-service-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" [echo 7 active-users 11 daytime 13 chargen 19 ftp 21 telnet 23 smtp 25 time 37 whois 43 gopher 70 finger 79 www 80 pop2 109 pop3 110 sun-rpc 111 nntp 119 ntp 123 netbios-name 137 netbios-data 139 irc 194 https 443 rlogin 513] 23) (#$ . 10499))
(defalias 'run-network-program '(macro . #[(process-name host port &optional initial-string) "\304\305\306\307\310\311\312\313BBBDE\314\315\306\316\317\307	\n\257E\320\321	EE\322\323\324\325\326\316\311\327BBEE\330BBBBBBBBB\207" [process-name host port initial-string let ((tcp-connection) (buf)) setq buf get-buffer-create concat "*" ("*") (set-buffer buf) or tcp-connection open-network-stream error "Could not open connection to %s" (erase-buffer) (set-marker (process-mark tcp-connection) (point-min)) (set-process-filter tcp-connection 'net-utils-remove-ctrl-m-filter) and process-send-string ("\n") ((display-buffer buf))] 15]))
#@22 Finger USER on HOST.
(defalias 'finger #[(user host) "\306	Q\307\n\310Q\311\211\312\313\313Q!\211q\210\314\f	\315\316\"A$\211\204- \317\320	\"\210\321 \210\322!e\311\223\210\323\324\"\210\n\203G \325\n\326P\"\210\327\f!,\207" [user host user-and-host process-name buf tcp-connection "@" "Finger [" "]" nil get-buffer-create "*" open-network-stream assoc finger error "Could not open connection to %s" erase-buffer process-mark set-process-filter net-utils-remove-ctrl-m-filter process-send-string "\n" display-buffer network-connection-service-alist] 8 (#$ . 11730) (byte-code "\302\303!\210\304\305\306\307!\"\310\311\312!\"\211\203# \313	O	T\314OD\202/ \304\315\306\316!\206- \317\"D*\207" [answer index require ffap read-from-minibuffer "Finger User: " ffap-string-at-point url string-match regexp-quote "@" 0 nil "At Host: " machine ""] 6)])
#@34 Host name for the whois service.
(custom-declare-variable 'whois-server-name '"whois.internic.net" '(#$ . 12603) :group 'net-utils :type 'string)
#@115 Send SEARCH-STRING to server defined by the `whois-server-name' variable.
With argument, prompt for whois server.
(defalias 'whois #[(arg search-string) "\203\n \306\307!\202 	\310\211\311\312!\211q\210\313\314\n\315\316\"A$\211\204+ \317\320\n\"\210\321 \210\322\f!e\310\223\210\323\f\324\"\210\203G \325\f\326P\"\210\327!+\207" [arg whois-server-name host buf tcp-connection network-connection-service-alist read-from-minibuffer "Whois server name: " nil get-buffer-create "*Whois*" open-network-stream "Whois" assoc whois error "Could not open connection to %s" erase-buffer process-mark set-process-filter net-utils-remove-ctrl-m-filter process-send-string "\n" display-buffer search-string] 8 (#$ . 12756) "P\nsWhois: "])
#@44 Server which provides inverse DNS mapping.
(custom-declare-variable 'whois-reverse-lookup-server '"whois.arin.net" '(#$ . 13504) :group 'net-utils :type 'string)
(defalias 'whois-reverse-lookup #[nil "\302\303!)\207" [whois-reverse-lookup-server whois-server-name call-interactively whois] 2 nil nil])
#@47 Open a network connection to SERVICE on HOST.
(defalias 'network-connection-to-service #[(host service) "\303\304\305	!\n\"A\"\207" [host service network-connection-service-alist network-connection assoc intern] 5 (#$ . 13814) (list (progn (require 'ffap) (read-from-minibuffer "Host: " (ffap-string-at-point 'machine))) (completing-read "Service: " (mapcar #'(lambda (elt) (list (symbol-name (car elt)))) network-connection-service-alist)))])
#@44 Open a network connection to HOST on PORT.
(defalias 'network-connection #[(host port) "\302\303	!\"\207" [host port network-service-connection number-to-string] 4 (#$ . 14265) "sHost: \nnPort: "])
#@47 Open a network connection to SERVICE on HOST.
(defalias 'network-service-connection #[(host service) "\304\305	\306\260\307	!\310\n!\204 \n\311	B\"\210\312\313\314\314Q!!*\207" [host service portnum process-name "Network Connection [" " " "]" string-to-number zerop make-comint pop-to-buffer get-buffer "*"] 5 (#$ . 14470)])
(provide 'net-utils)
