示例#1
0
        /// <summary>
        /// Connect to the required service with the token
        /// </summary> 
        /// <param name="token">The token recevied from proxy</param>
        /// <param name="globalMeta">The global meta</param>
        /// <param name="logger">The logger</param>
        /// <param name="meta">The meta</param>
        /// <param name="properties">Property bag to add any information to</param>
        /// <param name="credmgr">Credentials manager</param>
        /// <returns>The connected data adapter</returns>
        public override IDataAdapter Connect(ProxyToken token, Logger logger, MetaDictionary meta, MetaDictionary globalMeta, PropertyBag properties, CredentialsManagerService credmgr)
        {
            IpProxyToken iptoken = token as IpProxyToken;

            if ((iptoken != null) && IsFiltered(iptoken))
            {
                return base.Connect(token, logger, meta, globalMeta, properties, credmgr);
            }
            else
            {
                token.Status = NetStatusCodes.Blocked;
                return null;
            }
        }
示例#2
0
 public override IDataAdapter Connect(ProxyToken token, Logger logger, MetaDictionary meta, MetaDictionary globalMeta, PropertyBag properties, CredentialsManagerService credmgr)
 {
     return new SerialPortDataAdapter(_config.Create());
 }
示例#3
0
 /// <summary>
 /// Connect to the required service with the token
 /// </summary> 
 /// <param name="token">The token recevied from proxy</param>
 /// <param name="globalMeta">The global meta</param>
 /// <param name="logger">The logger</param>
 /// <param name="meta">The meta</param>
 /// <param name="properties">Property bag to add any information to</param>        
 /// <param name="credmgr">Credentials manager</param>
 /// <returns>The connected data adapter</returns>
 public abstract IDataAdapter Connect(ProxyToken token, Logger logger, MetaDictionary meta, MetaDictionary globalMeta, PropertyBag properties, CredentialsManagerService credmgr);
示例#4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="root"></param>
 /// <param name="logger"></param>
 /// <returns></returns>
 public string ToDisplayString(DataKey root, Logger logger)
 {
     return "DNS Packet";
 }
示例#5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="root"></param>
 /// <param name="logger"></param>
 /// <returns></returns>
 public byte[] ToArray(DataKey root, Logger logger)
 {
     return DNSPacket.FromDataKey(root).ToArray();
 }
示例#6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="data"></param>
        /// <param name="root"></param>
        /// <param name="logger"></param>
        public void FromArray(byte[] data, DataKey root, Logger logger)
        {
            DNSPacket packet = DNSPacket.FromArray(data);

            packet.ToDataKey(root);
        }
示例#7
0
 /// <summary>
 /// Protected constructor
 /// </summary>
 /// <param name="logger"></param>
 protected ProxyServer(Logger logger)
 {
     _logger = logger;
 }