#include <NVT.h>
Inheritance diagram for TelnetOption:


Public Member Functions | |
| TelnetOption (TCP_NVT *endp, unsigned int code) | |
| unsigned int | Code () const |
| int | IsActive () const |
| int | SaidWill () const |
| int | SaidWont () const |
| int | SaidDo () const |
| int | SaidDont () const |
| void | SetWill () |
| void | SetWont () |
| void | SetDo () |
| void | SetDont () |
| void | RecvOption (unsigned int type) |
| virtual void | RecvSubOption (u_char *data, int len) |
| virtual void | SetActive (int is_active) |
| const TCP_NVT * | Endpoint () const |
Protected Member Functions | |
| virtual void | InconsistentOption (unsigned int type) |
| virtual void | BadOption () |
Protected Attributes | |
| TCP_NVT * | endp |
| unsigned int | code |
| int | flags |
| int | active |
Friends | |
| class | TCP_NVT |
|
||||||||||||
|
Definition at line 45 of file NVT.cc. References active.
|
|
|
Definition at line 120 of file NVT.cc. References TCP_Contents::Conn(), and Connection::Event(). Referenced by TelnetEnvironmentOption::RecvSubOption(), TelnetAuthenticateOption::RecvSubOption(), TelnetEncryptOption::RecvSubOption(), and TelnetTerminalOption::RecvSubOption().
|
|
|
Definition at line 48 of file NVT.h. Referenced by TCP_NVT::FindOption().
00048 { return code; }
|
|
|
Definition at line 67 of file NVT.h. Referenced by TelnetEncryptOption::RecvSubOption().
00067 { return endp; }
|
|
|
Reimplemented in TelnetBinaryOption. Definition at line 115 of file NVT.cc. References TCP_Contents::Conn(), and Connection::Event(). Referenced by RecvOption(), TelnetAuthenticateOption::RecvSubOption(), and TelnetEncryptOption::RecvSubOption().
|
|
|
Definition at line 50 of file NVT.h. References active. Referenced by RecvOption().
00050 { return active; }
|
|
|
Definition at line 53 of file NVT.cc. References TCP_NVT::FindPeerOption(), InconsistentOption(), internal_error(), IsActive(), SaidDo(), SaidDont(), SaidWill(), SaidWont(), SetActive(), SetDo(), SetDont(), SetWill(), SetWont(), TELNET_OPT_DO, TELNET_OPT_DONT, TELNET_OPT_WILL, and TELNET_OPT_WONT. Referenced by TCP_NVT::SawOption().
00054 {
00055 TelnetOption* peer = endp->FindPeerOption(code);
00056 if ( ! peer )
00057 internal_error("option peer missing in TelnetOption::RecvOption");
00058
00059 // WILL/WONT/DO/DONT are messages we've *received* from our peer.
00060 switch ( type ) {
00061 case TELNET_OPT_WILL:
00062 if ( SaidDont() || peer->SaidWont() || peer->IsActive() )
00063 InconsistentOption(type);
00064
00065 peer->SetWill();
00066
00067 if ( SaidDo() )
00068 peer->SetActive(1);
00069 break;
00070
00071 case TELNET_OPT_WONT:
00072 if ( peer->SaidWill() && ! SaidDont() )
00073 InconsistentOption(type);
00074
00075 peer->SetWont();
00076
00077 if ( SaidDont() )
00078 peer->SetActive(0);
00079 break;
00080
00081 case TELNET_OPT_DO:
00082 if ( SaidWont() || peer->SaidDont() || IsActive() )
00083 InconsistentOption(type);
00084
00085 peer->SetDo();
00086
00087 if ( SaidWill() )
00088 SetActive(1);
00089 break;
00090
00091 case TELNET_OPT_DONT:
00092 if ( peer->SaidDo() && ! SaidWont() )
00093 InconsistentOption(type);
00094
00095 peer->SetDont();
00096
00097 if ( SaidWont() )
00098 SetActive(0);
00099 break;
00100
00101 default:
00102 internal_error("bad option type in TelnetOption::RecvOption");
00103 }
00104 }
|
|
||||||||||||
|
Reimplemented in TelnetTerminalOption, TelnetEncryptOption, TelnetAuthenticateOption, and TelnetEnvironmentOption. Definition at line 106 of file NVT.cc. Referenced by TCP_NVT::SawSubOption().
00107 {
00108 }
|
|
|
Definition at line 54 of file NVT.h. References OPT_SAID_DO. Referenced by RecvOption().
00054 { return flags & OPT_SAID_DO; }
|
|
|
Definition at line 55 of file NVT.h. References OPT_SAID_DONT. Referenced by RecvOption().
00055 { return flags & OPT_SAID_DONT; }
|
|
|
Definition at line 52 of file NVT.h. References OPT_SAID_WILL. Referenced by RecvOption().
00052 { return flags & OPT_SAID_WILL; }
|
|
|
Definition at line 53 of file NVT.h. References OPT_SAID_WONT. Referenced by RecvOption().
00053 { return flags & OPT_SAID_WONT; }
|
|
|
Reimplemented in TelnetBinaryOption. Definition at line 110 of file NVT.cc. References active. Referenced by RecvOption().
00111 {
00112 active = is_active;
00113 }
|
|
|
Definition at line 59 of file NVT.h. References OPT_SAID_DO. Referenced by RecvOption().
00059 { flags |= OPT_SAID_DO; }
|
|
|
Definition at line 60 of file NVT.h. References OPT_SAID_DONT. Referenced by RecvOption().
00060 { flags |= OPT_SAID_DONT; }
|
|
|
Definition at line 57 of file NVT.h. References OPT_SAID_WILL. Referenced by RecvOption().
00057 { flags |= OPT_SAID_WILL; }
|
|
|
Definition at line 58 of file NVT.h. References OPT_SAID_WONT. Referenced by RecvOption().
00058 { flags |= OPT_SAID_WONT; }
|
|
|
Reimplemented in TelnetEncryptOption, and TelnetAuthenticateOption. |
|
|
Definition at line 77 of file NVT.h. Referenced by IsActive(), SetActive(), and TelnetOption(). |
|
|
|
|
|
|
|
|
|
1.3.6