Beispiel #1
0
 public I2PRouterAddress(BufRef buf)
 {
     Cost           = buf.Read8();
     Expiration     = new I2PDate(buf);
     TransportStyle = new I2PString(buf);
     Options        = new I2PMapping(buf);
 }
Beispiel #2
0
        public I2PRouterAddress(IPAddress addr, int port, byte cost, string transportstyle)
        {
            Cost           = cost;
            Expiration     = I2PDate.Zero;
            TransportStyle = new I2PString(transportstyle);
            Options        = new I2PMapping();

            Options["host"] = addr.ToString();
            Options["port"] = port.ToString();
        }
Beispiel #3
0
 public string this [string key]
 {
     set
     {
         Mappings[new I2PString(key)] = new I2PString(value);
     }
     get
     {
         return(Mappings[new I2PString(key)].ToString());
     }
 }
Beispiel #4
0
        public I2PMapping(BufRef buf)
        {
            var bytes  = buf.ReadFlip16();
            var endpos = buf.BaseArrayOffset + bytes;

            while (buf.BaseArrayOffset < endpos)
            {
                var key = new I2PString(buf);
                if (buf.Peek8(0) == '=')
                {
                    buf.Seek(1);
                }
                var value = new I2PString(buf);
                if (buf.Peek8(0) == ';')
                {
                    buf.Seek(1);
                }
                Mappings[key] = value;
            }
        }
Beispiel #5
0
 internal int CompareTo(I2PString other)
 {
     return(string.CompareOrdinal(Str, other.Str));
 }
Beispiel #6
0
 public I2PString(I2PString src)
 {
     Str = src.Str;
 }
Beispiel #7
0
 internal int CompareTo(I2PString other)
 {
     return(Str.CompareTo(other.Str));
 }