Package paramiko :: Module common
[frames] | no frames]

Source Code for Module paramiko.common

  1  # Copyright (C) 2003-2007  Robey Pointer <robey@lag.net> 
  2  # 
  3  # This file is part of paramiko. 
  4  # 
  5  # Paramiko is free software; you can redistribute it and/or modify it under the 
  6  # terms of the GNU Lesser General Public License as published by the Free 
  7  # Software Foundation; either version 2.1 of the License, or (at your option) 
  8  # any later version. 
  9  # 
 10  # Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY 
 11  # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 
 12  # A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more 
 13  # details. 
 14  # 
 15  # You should have received a copy of the GNU Lesser General Public License 
 16  # along with Paramiko; if not, write to the Free Software Foundation, Inc., 
 17  # 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA. 
 18   
 19  """ 
 20  Common constants and global variables. 
 21  """ 
 22   
 23  MSG_DISCONNECT, MSG_IGNORE, MSG_UNIMPLEMENTED, MSG_DEBUG, MSG_SERVICE_REQUEST, \ 
 24      MSG_SERVICE_ACCEPT = range(1, 7) 
 25  MSG_KEXINIT, MSG_NEWKEYS = range(20, 22) 
 26  MSG_USERAUTH_REQUEST, MSG_USERAUTH_FAILURE, MSG_USERAUTH_SUCCESS, \ 
 27          MSG_USERAUTH_BANNER = range(50, 54) 
 28  MSG_USERAUTH_PK_OK = 60 
 29  MSG_USERAUTH_INFO_REQUEST, MSG_USERAUTH_INFO_RESPONSE = range(60, 62) 
 30  MSG_GLOBAL_REQUEST, MSG_REQUEST_SUCCESS, MSG_REQUEST_FAILURE = range(80, 83) 
 31  MSG_CHANNEL_OPEN, MSG_CHANNEL_OPEN_SUCCESS, MSG_CHANNEL_OPEN_FAILURE, \ 
 32      MSG_CHANNEL_WINDOW_ADJUST, MSG_CHANNEL_DATA, MSG_CHANNEL_EXTENDED_DATA, \ 
 33      MSG_CHANNEL_EOF, MSG_CHANNEL_CLOSE, MSG_CHANNEL_REQUEST, \ 
 34      MSG_CHANNEL_SUCCESS, MSG_CHANNEL_FAILURE = range(90, 101) 
 35   
 36   
 37  # for debugging: 
 38  MSG_NAMES = { 
 39      MSG_DISCONNECT: 'disconnect', 
 40      MSG_IGNORE: 'ignore', 
 41      MSG_UNIMPLEMENTED: 'unimplemented', 
 42      MSG_DEBUG: 'debug', 
 43      MSG_SERVICE_REQUEST: 'service-request', 
 44      MSG_SERVICE_ACCEPT: 'service-accept', 
 45      MSG_KEXINIT: 'kexinit', 
 46      MSG_NEWKEYS: 'newkeys', 
 47      30: 'kex30', 
 48      31: 'kex31', 
 49      32: 'kex32', 
 50      33: 'kex33', 
 51      34: 'kex34', 
 52      MSG_USERAUTH_REQUEST: 'userauth-request', 
 53      MSG_USERAUTH_FAILURE: 'userauth-failure', 
 54      MSG_USERAUTH_SUCCESS: 'userauth-success', 
 55      MSG_USERAUTH_BANNER: 'userauth--banner', 
 56      MSG_USERAUTH_PK_OK: 'userauth-60(pk-ok/info-request)', 
 57      MSG_USERAUTH_INFO_RESPONSE: 'userauth-info-response', 
 58      MSG_GLOBAL_REQUEST: 'global-request', 
 59      MSG_REQUEST_SUCCESS: 'request-success', 
 60      MSG_REQUEST_FAILURE: 'request-failure', 
 61      MSG_CHANNEL_OPEN: 'channel-open', 
 62      MSG_CHANNEL_OPEN_SUCCESS: 'channel-open-success', 
 63      MSG_CHANNEL_OPEN_FAILURE: 'channel-open-failure', 
 64      MSG_CHANNEL_WINDOW_ADJUST: 'channel-window-adjust', 
 65      MSG_CHANNEL_DATA: 'channel-data', 
 66      MSG_CHANNEL_EXTENDED_DATA: 'channel-extended-data', 
 67      MSG_CHANNEL_EOF: 'channel-eof', 
 68      MSG_CHANNEL_CLOSE: 'channel-close', 
 69      MSG_CHANNEL_REQUEST: 'channel-request', 
 70      MSG_CHANNEL_SUCCESS: 'channel-success', 
 71      MSG_CHANNEL_FAILURE: 'channel-failure' 
 72      } 
 73   
 74   
 75  # authentication request return codes: 
 76