;ELC   
;;; Compiled by buildd@akateko.buildd on Fri Oct 25 13:51:55 2013
;;; from file /build/buildd/emacs23-23.4+1/debian/build-x/lisp/net/socks.el
;;; in Emacs version 23.4.1
;;; 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.

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


(byte-code "\300\301!\210\302\303!\204 \304\303\305\"\210\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345&\207" [require custom fboundp split-string defalias #[(string &optional pattern) "\204 \304\305\306\307	#\203  	\306\224O\nB\306\225\202\n 	\305O\nB\237*\207" [pattern start parts string "[ \f	\n]+" nil 0 string-match] 4 "Return a list of substrings of STRING which are separated by PATTERN.\nIf PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."] define-widget dynamic-choice menu-choice "A pretty simple dynamic dropdown list" :format "%[%t%]: %v" :tag "Network" :case-fold t :void (item :format "invalid (%t)\n") :value-create s5-widget-value-create :value-delete widget-children-value-delete :value-get widget-choice-value-get :value-inline widget-choice-value-inline :mouse-down-action widget-choice-mouse-down-action :action widget-choice-action :error "Make a choice" :validate widget-choice-validate :match s5-dynamic-choice-match :match-inline s5-dynamic-choice-match-inline] 32)
(defalias 's5-dynamic-choice-match #[(widget value) "\305\306\" \307\211\203! 	\204! @A\310\n\311\f#\202\n 	+\207" [widget found current choices value widget-get :choice-function nil widget-apply :match] 4])
(defalias 's5-dynamic-choice-match-inline #[(widget value) "\305\306\" \307\211\203  	\204  @A\310\n\f\"\202\n 	+\207" [widget found current choices value widget-get :choice-function nil widget-match-inline] 3])
(defalias 's5-widget-value-create #[(widget) "\303\304\" \303\305\"	\204 \306\305\307\n@!#\210\306\310\n#\210\311!*\207" [widget value choices widget-get :choice-function :value widget-put widget-value :args widget-choice-value-create] 5])
(custom-declare-group 'socks nil "SOCKS Support" :version "22.2" :prefix "socks-" :group 'processes)
#@2 
(custom-declare-variable 'socks-server '(list "Default server" "socks" 1080 5) '(#$ . 2427) :group 'socks :type '(list (string :format "" :value "Default server") (string :tag "Server") (integer :tag "Port") (radio-button-choice :tag "SOCKS Version" :format "%t: %v" (const :tag "SOCKS v4  " :format "%t" :value 4) (const :tag "SOCKS v5" :format "%t" :value 5))))
(byte-code "\301B\302\303!\210\304B\305\304!\204 \306\304\307\"\210\310B\311\312!\210\313B\314\315!\210\316B\317\320!\210\321B\322\323!\210\324B\325\326!\210\327B\330\323!\210\331B\332\312!\210\333B\334\315!\210\335B\336\320!\210\337B\340\341!\210\342B\343\303!\210\344B\345\346!\210\347B\350\351!\210\352B\353\354!\210\355B\305\355!\204\226 \306\355\356\"\210\357B\360\312!\210\361B\362\320!\210\363B\364\341!\210\365B\305\365!\204\275 \306\365\303\"\210\366B\305\366!\204\317 \306\366\367\370\371\"\"\210\372B\305\372!\204\336 \306\372\307\"\210\373B\305\373!\204\356 \306\373\374 \"\210\375B\305\375!\204\375 \306\375\307\"\210\307\207" [current-load-list socks-version (lambda (#1=#:defconst-tmp-var) (defconst socks-version #1#)) 5 socks-debug default-boundp set-default nil socks-connect-command (lambda (#2=#:defconst-tmp-var) (defconst socks-connect-command #2#)) 1 socks-bind-command (lambda (#3=#:defconst-tmp-var) (defconst socks-bind-command #3#)) 2 socks-udp-associate-command (lambda (#4=#:defconst-tmp-var) (defconst socks-udp-associate-command #4#)) 3 socks-authentication-null (lambda (#5=#:defconst-tmp-var) (defconst socks-authentication-null #5#)) 0 socks-authentication-failure (lambda (#6=#:defconst-tmp-var) (defconst socks-authentication-failure #6#)) 255 socks-response-success (lambda (#7=#:defconst-tmp-var) (defconst socks-response-success #7#)) socks-response-general-failure (lambda (#8=#:defconst-tmp-var) (defconst socks-response-general-failure #8#)) socks-response-access-denied (lambda (#9=#:defconst-tmp-var) (defconst socks-response-access-denied #9#)) socks-response-network-unreachable (lambda (#10=#:defconst-tmp-var) (defconst socks-response-network-unreachable #10#)) socks-response-host-unreachable (lambda (#11=#:defconst-tmp-var) (defconst socks-response-host-unreachable #11#)) 4 socks-response-connection-refused (lambda (#12=#:defconst-tmp-var) (defconst socks-response-connection-refused #12#)) socks-response-ttl-expired (lambda (#13=#:defconst-tmp-var) (defconst socks-response-ttl-expired #13#)) 6 socks-response-cmd-not-supported (lambda (#14=#:defconst-tmp-var) (defconst socks-response-cmd-not-supported #14#)) 7 socks-response-address-not-supported (lambda (#15=#:defconst-tmp-var) (defconst socks-response-address-not-supported #15#)) 8 socks-errors ("Succeeded" "General SOCKS server failure" "Connection not allowed by ruleset" "Network unreachable" "Host unreachable" "Connection refused" "Time-to-live expired" "Command not supported" "Address type not supported") socks-address-type-v4 (lambda (#16=#:defconst-tmp-var) (defconst socks-address-type-v4 #16#)) socks-address-type-name (lambda (#17=#:defconst-tmp-var) (defconst socks-address-type-name #17#)) socks-address-type-v6 (lambda (#18=#:defconst-tmp-var) (defconst socks-address-type-v6 #18#)) socks-timeout socks-connections make-hash-table :size 13 socks-authentication-methods socks-username user-login-name socks-password] 5)
(defalias 'socks-register-authentication-method #[(id desc callback) "	\236\211\203 \n\fB\241\202 \fBB	B\211)\207" [id socks-authentication-methods old desc callback] 4])
(defalias 'socks-unregister-authentication-method #[(id) "	\236\211\205 \303\n	\"\211)\207" [id socks-authentication-methods old delq] 4])
(socks-register-authentication-method 0 "No authentication" 'identity)
(defalias 'socks-build-auth-list #[nil "\303\304\305\306\307\n!\"\210\310\311	#*\207" [retval num socks-authentication-methods 0 "" mapc #[(x) "\303AA!\205 \304\305	@#\nT\211\207" [x retval num fboundp format "%s%c"] 4] reverse format "%c%s"] 4])
(byte-code "\301B\302\303!\210\304B\305\306!\210\307B\310\311!\210\312B\313\314!\210\315B\316\317!\207" [current-load-list socks-state-waiting-for-auth (lambda (#1=#:defconst-tmp-var) (defconst socks-state-waiting-for-auth #1#)) 0 socks-state-submethod-negotiation (lambda (#2=#:defconst-tmp-var) (defconst socks-state-submethod-negotiation #2#)) 1 socks-state-authenticated (lambda (#3=#:defconst-tmp-var) (defconst socks-state-authenticated #3#)) 2 socks-state-waiting (lambda (#4=#:defconst-tmp-var) (defconst socks-state-waiting #4#)) 3 socks-state-connected (lambda (#5=#:defconst-tmp-var) (defconst socks-state-connected #5#)) 4] 2)
(defalias 'socks-wait-for-state-change '(macro . #[(proc htable cur-state) "\303\304\305\306\307E	E\310\311\nD\312BBE\313\n\314BBE\207" [htable cur-state proc while and = gethash 'state memq process-status ('(run open)) accept-process-output (socks-timeout)] 6]))
(defalias 'socks-filter #[(proc string) "\306	\"\307\211\211\211\204 \310\311\"\210\306\304\"\211U\203V \312\313\306\313\"P#\210\306\313\"\211G\314W?\205V\312\315\316H#\210\312\313\314\307O#\210\312\304 #\202V\f U\206V\f!U\206V\f\"U\203R\312\313\306\313\"P#\210\306\313\"\306\317\"\211\320\232\203\246 \321\322\"\205V\312\304##\210\312\323\324#\210\312\325#\202V\326\232\203\347 G\314W?\205V\327G\nW?\205V\316H\211\330U\203\317 \324\312\304##\210\312\323#\210\312\325#)\202V\331\232\205VG\326W?\205V\332\333H$U\203\326\202.\333H%U\203\334\202.\333H&U\205.G\331W\203)\335\202.\326HT\\G\nW?\205V\312\304##\210\312\323\316H#\210\312\325#\202V\f#U,\207" [proc socks-connections desired-len version state info gethash nil error "socks-filter called on non-SOCKS connection %S" puthash scratch 2 authtype 1 server-protocol http string-match "\n\n" reply 0 response 4 8 90 5 6 3 16 255 socks-state-waiting-for-auth string socks-state-submethod-negotiation socks-state-authenticated socks-state-waiting socks-state-connected socks-address-type-v4 socks-address-type-v6 socks-address-type-name] 7])
#@85 *Whether to overwrite the open-network-stream function with the SOCKSified
version.
(defvar socks-override-functions nil (#$ . -8568))
(byte-code "\301\302!\204 \303\302\304K\"\210\203 \303\304\305\"\210\301\207" [socks-override-functions fboundp socks-original-open-network-stream defalias open-network-stream socks-open-network-stream] 3)
(defalias 'socks-open-connection #[(server-info) "\212\306\307\310A@\3118$\312\313\314\"\310\211\315\f\316\"\210\317\f\310\"\210\320\f#\210\320\321)#\210\320\302*#\210\320\322\3238#\210\320\324A@#\210\3238\211\325\232\204\375 	\326\232\204\375 	\327\232\203\375 \330\f\331\332+\333 #\"\210\334\321\")U\203 \335\f!\336>\203 \337\f,\"\210\202d \334\302\"\211-U\203\227 .\203\361 \340\341!\210\202\361 \n*U\203\245 \342\343!\210\202\361 \334\302\"/\344/0\"\2111\205\273 1AA21\205\306 1A@3\315\f\310\"\2102\203\340 \3452!\203\340 2\f!\204\360 \346\f!\210\342\3473\206\354 \350/#\210,\320\3214#\210\315\f\316\"\210\f-\207" [server-info version authtype info proc socks-connections socks-original-open-network-stream "socks" nil 2 make-hash-table :size 13 set-process-filter socks-filter set-process-query-on-exit-flag puthash state server-protocol 3 server-name http 4 5 process-send-string format "%c%s" socks-build-auth-list gethash process-status (run open) accept-process-output message "No authentication necessary" error "No acceptable authentication methods found" assoc fboundp delete-process "Failed to use auth method: %s (%d)" "Unknown" socks-state-waiting-for-auth socks-authentication-failure socks-version socks-timeout socks-authentication-null socks-debug auth-type socks-authentication-methods auth-handler auth-func auth-desc socks-state-authenticated] 7 nil nil])
(defalias 'socks-send-command #[(proc command atype address port) "	U\204\f \nU\203 \202# \fU\203 \306\307G#\202# \310\311\"\312&\"\313\211'()*)\204< \310\314\"\210\315\316+)#\210\312\317)\"\211'\320\232\203i \306\321\f\232\203] \202a \310\322\",#(\202\304 '\323\232\203\224 \324\306\325'-\326,\327\",\326\211,\327\"\330\"Z*\331 \332&!(\202\304 '\333\232\203\276 \324\306\334'-\332*\326,\327\",\326\211,\327\"\330\"Z&!(\202\304 \310\335'\"\210\336(\"\210\312\316)\"+U\203\346 \337!\340>\203\346 \341.\"\210\202\312 \337!\210\312\342)\"\206\363 \343/U\204\344!\210\310\345\312\342)\"\206\34308\"\210,\207" [atype socks-address-type-v4 socks-address-type-v6 address socks-address-type-name proc format "%c%s" error "Unkown address type: %d" gethash nil "socks-send-command called on non-SOCKS connection %S" puthash state server-protocol http "CONNECT %s:%d HTTP/1.0\nUser-Agent: Emacs/SOCKS v1.0\n\n" "Unsupported address type for HTTP: %d" 4 string-make-unibyte "%c%c%c%c%s%s%c" lsh -8 8 user-full-name 0 5 "%c%c%c%c%s%c%c" "Unknown protocol version: %d" process-send-string process-status (run open) accept-process-output reply 1 delete-process "SOCKS: %s" socks-connections version request info addr socks-state-waiting port command socks-timeout socks-response-success socks-errors] 15])
#@76 *List of regexps matching hosts that we should not socksify connections to
(defvar socks-noproxy nil (#$ . -11700))
(defalias 'socks-find-route #[(host service) "	\n\2034 \n@\305H\306=\203! \307\n@\310\311O\f\"\203- \311\202- \307\n@\f\"\203- \311\211\nA\211\204 *\207" [socks-server socks-noproxy noproxy route host 0 33 string-match 1 nil] 5])
(byte-code "\301B\302\301!\204 \303\301\304\"\210\305B\302\305!\204# \303\305\306\307\310\311\312$\"\210\313B\302\313!\2047 \303\313\306\307\310\311\312$\"\210\301\207" [current-load-list socks-services-file default-boundp set-default "/etc/services" socks-tcp-services make-hash-table :size 13 :test equal socks-udp-services] 7)
(defalias 'socks-parse-services #[nil "\306!\203\f \307!\204 \310\311\"\210\312	!\210\312\n!\210r\313\314!q\210\315 \210\316!\210eb\210\317\320\321\322#\2038 \323\324!\210\202) eb\210\317\325\321\322#\203J \323\324!\210\202; eb\210\321\211\211\317\326\321\322#\205~ \327\330!\227\331\327\332!!\327\333!\227\334\f\335\232\203x \n\202y 	#\210\202S ,\207" [socks-services-file socks-tcp-services socks-udp-services type port name file-exists-p file-readable-p error "Could not find services file: %s" clrhash get-buffer-create " *socks-tmp*" erase-buffer insert-file-contents re-search-forward "#.*" nil t replace-match "" "^[ 	\n]+" "^\\([^ 	]+\\)[ 	]+\\([0-9]+\\)/\\([a-z]+\\)" match-string 1 string-to-number 2 3 puthash "udp"] 5])
#@43 Return the port # associated with SERVICE
(defalias 'socks-find-services-entry #[(service &optional udp) "\304!\305U\203 \306 \210\307	\227\n\203 \202 \"\207" [socks-tcp-services service udp socks-udp-services hash-table-count 0 socks-parse-services gethash] 3 (#$ . 13143)])
(defalias 'socks-open-network-stream #[(name buffer host service) "\306	\"\307\211\307\211\n\204 \310	$\202\223 \311\n!\312\"\312\313\f\"\211\314\232\203M \315!\211<\204@ \316\317\"\210\320\321\322#\202Q \323 	;\203j \324	!\206k \316\325	\"\202k 	%\210\326\327\f#\210\326\300\f#\210\326\301\f#\210\330\307\"\210\331\205\220 \332!\"\210-\207" [host service route proc info version socks-find-route nil socks-original-open-network-stream socks-open-connection gethash server-protocol 4 socks-nslookup-host error "Could not get IP address for: %s" apply format "%c%c%c%c" socks-send-command socks-find-services-entry "Unknown service: %s" puthash buffer set-process-filter set-process-buffer get-buffer-create atype name socks-connections socks-address-type-v4 socks-address-type-name socks-connect-command] 9])
(byte-code "\301\302\303\304#\210\305B\306\307!\207" [current-load-list socks-register-authentication-method 2 "Username/Password" socks-username/password-auth socks-username/password-auth-version (lambda (#1=#:defconst-tmp-var) (defconst socks-username/password-auth-version #1#)) 1] 4)
(defalias 'socks-username/password-auth-filter #[(proc str) "\305	\"\211\204 \306\307\"\210\310\311\305\311\n\"P\n#\210\305\311\n\"G\312W?\2054 \310\313\305\311\n\"\314H\n#\210\310\315\f\n#)\207" [proc socks-connections info str socks-state-authenticated gethash error "socks-filter called on non-SOCKS connection %S" puthash scratch 2 password-auth-status 1 state] 6])
(defalias 'socks-username/password-auth #[(proc) "\306	\"\306\303\n\"\f\204 \307\310\311\306\312\n\"#!\313\314\315\n#\210\316\317\"\210\320\310\321G\fG\f&\"\210\306\303\n\"U\203N \322!\323>\203N \324\"\210\2024 \306\325\n\"\326U*\207" [proc socks-connections info state socks-password socks-username gethash read-passwd format "Password for %s@%s: " server-name puthash scratch "" set-process-filter socks-username/password-auth-filter process-send-string "%c%c%s%c%s" process-status (run open) accept-process-output password-auth-status 0 socks-username/password-auth-version socks-timeout] 9])
(defalias 'socks-gssapi-auth #[(proc) "\300\207" [nil] 1])
(defalias 'socks-chap-auth #[(proc) "\300\207" [nil] 1])
(defalias 'socks-cram-auth #[(proc) "\300\207" [nil] 1])
#@56 *If non-NIL then a string naming the nslookup program.
(custom-declare-variable 'socks-nslookup-program '"nslookup" '(#$ . -15740) :type '(choice (const :tag "None" :value nil) string) :group 'socks)
#@67 Attempt to resolve the given HOSTNAME using nslookup if possible.
(defalias 'socks-nslookup-host #[(host) "\203E \304\305\211	$	\306\307\"\210r\310!q\210\311!\210\312!\313>\204 eb\210\314\315\307\316#\203= \317\224\317\225{\320\321\322\n\323\"\"\324p!\210)\n*\207	\207" [socks-nslookup-program host res proc start-process " *nslookup*" set-process-query-on-exit-flag nil process-buffer accept-process-output process-status (run open) re-search-forward "Name:.*\nAddress\\(es\\)?: *\\([0-9.]+\\)$" t 2 mapcar string-to-int split-string "\\." kill-buffer] 5 (#$ . 15946) "sHost:  "])
(provide 'socks)
