1 /*
2  * pp_telnet.h
3  *
4  * Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
5  * Copyright (C) 2004-2013 Sourcefire, Inc.
6  * Steven A. Sturges <ssturges@sourcefire.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License Version 2 as
10  * published by the Free Software Foundation.  You may not use, modify or
11  * distribute this program under any other version of the GNU General
12  * Public License.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22  *
23  * Description:
24  *
25  * Header file for FTPTelnet telnet Module
26  *
27  * This file defines the telnet checking functions
28  *
29  * NOTES:
30  *  - 20.09.04:  Initial Development.  SAS
31  *
32  */
33 #ifndef __PP_TELNET_H__
34 #define __PP_TELNET_H__
35 
36 #ifdef HAVE_CONFIG_H
37 #include "config.h"
38 #endif
39 
40 #include <sys/types.h>
41 
42 /* RFC 885 defines an End of Record telnet option */
43 #define RFC885
44 /* RFC 1184 defines Abort, Suspend, and End of File telnet optinos */
45 #define RFC1184
46 
47 //#include "decode.h"
48 #include "ftpp_ui_config.h"
49 #include "ftpp_si.h"
50 
51 /* define the telnet negotiation codes (TNC) that we're interested in */
52 #define TNC_IAC  0xFF
53 #define TNC_DONT 0xFE
54 #define TNC_DO   0xFD
55 #define TNC_WONT 0xFC
56 #define TNC_WILL 0xFB
57 #define TNC_SB   0xFA
58 #define TNC_GA   0xF9
59 #define TNC_EAL  0xF8
60 #define TNC_EAC  0xF7
61 #define TNC_AYT  0xF6
62 #define TNC_AO   0xF5
63 #define TNC_IP   0xF4
64 #define TNC_BRK  0xF3
65 #define TNC_DM   0xF2
66 #define TNC_NOP  0xF1
67 #define TNC_SE   0xF0
68 #ifdef RFC885
69 #define TNC_EOR  0xEF
70 #endif
71 #ifdef RFC1184
72 #define TNC_ABOR 0xEE
73 #define TNC_SUSP 0xED
74 #define TNC_EOF  0xEC
75 #endif
76 
77 #define FTPP_APPLY_TNC_ERASE_CMDS 0
78 #define FTPP_IGNORE_TNC_ERASE_CMDS 1
79 
80 /* list of function prototypes for this preprocessor */
81 extern int normalize_telnet(FTPTELNET_GLOBAL_CONF *GlobalConf,
82                             TELNET_SESSION *Session, SFSnortPacket *p,
83                             int iMode,
84                             char ignoreEraseCmd);
85 
86 #endif
87