Exemplo n.º 1
0
        public void AddWillOption(TelnetSubject Option)
        {
            var negOptn = new NegotiateOption(Option, CommandCode.WILL);

            this.OptionList.Add(negOptn);

            this.OptionDict.Add(Option, CommandCode.WILL);
        }
Exemplo n.º 2
0
 public bool IsEqual(TelnetSubject Code)
 {
     if (this.Code == null)
     {
         return(false);
     }
     else
     {
         return(this.Code.Value == Code);
     }
 }
Exemplo n.º 3
0
        public CommandCode GetOptionResponse(TelnetSubject Option)
        {
            CommandCode resp = CommandCode.WILL;

            if (this.OptionDict.ContainsKey(Option) == false)
            {
                resp = CommandCode.WONT;
            }
            else
            {
                resp = this.OptionDict[Option];
            }
            return(resp);
        }
Exemplo n.º 4
0
 public static bool IsEqual(this TelnetSubject?Fac1, TelnetSubject Fac2)
 {
     if (Fac1 == null)
     {
         return(false);
     }
     else if (Fac1.Value == Fac2)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 5
0
        public static string ToString(this TelnetSubject Optn)
        {
            switch (Optn)
            {
            case TelnetSubject.SUPPRESS_GO_AHEAD:
                return("SUPPRESS_GO_AHEAD");

            case TelnetSubject.NewEnviron:
                return("NEW_ENVIRON");

            case TelnetSubject.TERMINAL_TYPE:
                return("TERMINAL_TYPE");

            default:
                return("");
            }
        }
Exemplo n.º 6
0
 public SubjectByte(TelnetSubject Code)
 {
     this.Code  = Code;
     this.Value = (byte)Code;
 }
Exemplo n.º 7
0
 public TelnetCommand(CommandCode CmdCode, TelnetSubject Subject)
     : this(CmdCode)
 {
     this.Subject = Subject;
 }
Exemplo n.º 8
0
 public TelnetCommand(InputByteArray InputArray, CommandCode CmdCode, TelnetSubject Subject)
     : this(InputArray, CmdCode)
 {
     this.Subject = Subject;
     this.RawBytes.Append(InputArray.GetByte());
 }
Exemplo n.º 9
0
 public NegotiateOption(TelnetSubject Option, CommandCode Response)
 {
     this.Option   = Option;
     this.Response = Response;
 }