|
|
1.1 ! root 1: /* telnet.c */ ! 2: ! 3: /* Synchronet telnet command/option functions */ ! 4: ! 5: /* $Id: telnet.c,v 1.1.1.1 2000/10/10 11:25:51 rswindell Exp $ */ ! 6: ! 7: /**************************************************************************** ! 8: * @format.tab-size 4 (Plain Text/Source Code File Header) * ! 9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * ! 10: * * ! 11: * Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * ! 12: * * ! 13: * This program is free software; you can redistribute it and/or * ! 14: * modify it under the terms of the GNU General Public License * ! 15: * as published by the Free Software Foundation; either version 2 * ! 16: * of the License, or (at your option) any later version. * ! 17: * See the GNU General Public License for more details: gpl.txt or * ! 18: * http://www.fsf.org/copyleft/gpl.html * ! 19: * * ! 20: * Anonymous FTP access to the most recent released source is available at * ! 21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * ! 22: * * ! 23: * Anonymous CVS access to the development source and modification history * ! 24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: * ! 25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login * ! 26: * (just hit return, no password is necessary) * ! 27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src * ! 28: * * ! 29: * For Synchronet coding style and modification guidelines, see * ! 30: * http://www.synchro.net/source.html * ! 31: * * ! 32: * You are encouraged to submit any modifications (preferably in Unix diff * ! 33: * format) via e-mail to [email protected] * ! 34: * * ! 35: * Note: If this box doesn't appear square, then you need to fix your tabs. * ! 36: ****************************************************************************/ ! 37: ! 38: #include <stdio.h> /* sprintf */ ! 39: #include "gen_defs.h" ! 40: #include "telnet.h" ! 41: ! 42: const char *telnet_cmd_desc(uchar cmd) ! 43: { ! 44: static char unknown[32]; ! 45: ! 46: switch(cmd) { ! 47: case TELNET_IAC: return("IAC"); ! 48: case TELNET_DONT: return("DON'T"); ! 49: case TELNET_DO: return("DO"); ! 50: case TELNET_WONT: return("WON'T"); ! 51: case TELNET_WILL: return("WILL"); ! 52: ! 53: case TELNET_SB: return("SB"); ! 54: case TELNET_GA: return("GA"); ! 55: case TELNET_EL: return("EL"); ! 56: case TELNET_EC: return("EC"); ! 57: case TELNET_AYT: return("AYT"); ! 58: case TELNET_AO: return("AO"); ! 59: case TELNET_IP: return("IP"); ! 60: case TELNET_BRK: return("BRK"); ! 61: case TELNET_SYNC: return("SYNC"); ! 62: case TELNET_NOP: return("NOP"); ! 63: ! 64: default: ! 65: sprintf(unknown,"%d",cmd); ! 66: return(unknown); ! 67: } ! 68: } ! 69: ! 70: char* telnet_option_descriptions[]={ ! 71: ! 72: "Binary Transmission" ! 73: ,"Echo" ! 74: ,"Reconnection" ! 75: ,"Suppress Go Ahead" ! 76: ,"Approx Message Size Negotiation" ! 77: ,"Status" ! 78: ,"Timing Mark" ! 79: ,"Remote Controlled Trans and Echo" ! 80: ,"Output Line Width" ! 81: ,"Output Page Size" ! 82: ,"Output Carriage-Return Disposition" ! 83: ,"Output Horizontal Tab Stops" ! 84: ,"Output Horizontal Tab Disposition" ! 85: ,"Output Formfeed Disposition" ! 86: ,"Output Vertical Tabstops" ! 87: ,"Output Vertical Tab Disposition" ! 88: ,"Output Linefeed Disposition" ! 89: ,"Extended ASCII" ! 90: ,"Logout" ! 91: ,"Byte Macro" ! 92: ,"Data Entry Terminal" ! 93: ,"SUPDUP" ! 94: ,"SUPDUP Output" ! 95: ,"Send Location" ! 96: ,"Terminal Type" ! 97: ,"End of Record" ! 98: ,"TACACS User Identification" ! 99: ,"Output Marking" ! 100: ,"Terminal Location Number" ! 101: ,"Telnet 3270 Regime" ! 102: ,"X.3 PAD" ! 103: ,"Negotiate About Window Size" ! 104: ,"Terminal Speed" ! 105: ,"Remote Flow Control" ! 106: ,"Linemode" ! 107: ,"X Display Location" ! 108: ,"Environment Option" ! 109: ,"Authentication Option" ! 110: ,"Encryption Option" ! 111: ,"New Environment Option" ! 112: ,"TN3270E" ! 113: }; ! 114: ! 115: const char *telnet_opt_desc(uchar opt) ! 116: { ! 117: static char unknown[32]; ! 118: ! 119: if(opt<sizeof(telnet_option_descriptions)/sizeof(char*)) ! 120: return(telnet_option_descriptions[opt]); ! 121: ! 122: if(opt==TELNET_EXOPL) ! 123: return("Extended Options List"); ! 124: ! 125: sprintf(unknown,"%d",opt); ! 126: return(unknown); ! 127: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.