Пример #1
0
        public void DestroySublayer(Sublayer sublayer)
        {
            sublayer.DestroyAllFilters();

            IpFilterNative.DestroySublayer(
                Session.Handle,
                sublayer.Id);
        }
Пример #2
0
        public Sublayer CreateSublayer(DisplayData displayData, uint weight)
        {
            var id = IpFilterNative.CreateSublayer(
                Session.Handle,
                ProviderId,
                displayData,
                weight);

            return(new Sublayer(this, id));
        }
Пример #3
0
        public ProviderContext CreateProviderContext(DisplayData displayData, byte[] data)
        {
            var id = IpFilterNative.CreateProviderContext(
                Session.Handle,
                ProviderId,
                displayData,
                data);

            return(new ProviderContext(id));
        }
Пример #4
0
        public Callout CreateCallout(DisplayData displayData, Guid key, Layer layer)
        {
            var id = IpFilterNative.CreateCallout(
                Session.Handle,
                key,
                ProviderId,
                displayData,
                layer);

            return(new Callout(id));
        }
Пример #5
0
        public void DestroyFilter(Guid filterId)
        {
            try
            {
                IpFilterNative.DestroyFilter(
                    Session.Handle,
                    filterId);
            }
            catch (FilterNotFoundException)
            {
            }

            RemoveFilter(filterId);
        }
Пример #6
0
        public Guid CreateLayerFilter(
            DisplayData displayData,
            Action action,
            Layer layer,
            uint weight)
        {
            var filterId = IpFilterNative.CreateLayerFilter(
                Session.Handle,
                ProviderId,
                Id,
                displayData,
                layer,
                action,
                weight, Guid.Empty, Guid.Empty);

            AddFilter(filterId);

            return(filterId);
        }
Пример #7
0
        public Guid CreateRemoteTcpPortFilter(
            DisplayData displayData,
            Action action,
            Layer layer,
            uint weight,
            uint port)
        {
            var filterId = IpFilterNative.CreateRemoteTcpPortFilter(
                Session.Handle,
                ProviderId,
                Id,
                displayData,
                layer,
                action,
                weight,
                port);

            AddFilter(filterId);

            return(filterId);
        }
Пример #8
0
        public Guid CreateNetInterfaceFilter(
            DisplayData displayData,
            Action action,
            Layer layer,
            uint weight,
            string interfaceId)
        {
            var filterId = IpFilterNative.CreateNetInterfaceFilter(
                Session.Handle,
                ProviderId,
                Id,
                displayData,
                layer,
                action,
                weight,
                interfaceId);

            AddFilter(filterId);

            return(filterId);
        }
Пример #9
0
        public Guid CreateLayerCalloutFilter(
            DisplayData displayData,
            Layer layer,
            uint weight,
            Callout callout,
            ProviderContext providerContext)
        {
            var filterId = IpFilterNative.CreateLayerFilter(
                Session.Handle,
                ProviderId,
                Id,
                displayData,
                layer,
                Action.Callout,
                weight,
                callout.Id,
                providerContext.Id);

            AddFilter(filterId);

            return(filterId);
        }
Пример #10
0
        public Guid CreateRemoteNetworkIPv4Filter(
            DisplayData displayData,
            Action action,
            Layer layer,
            uint weight,
            NetworkAddress addr)
        {
            var filterId = IpFilterNative.CreateRemoteNetworkIPv4Filter(
                Session.Handle,
                ProviderId,
                Id,
                displayData,
                layer,
                action,
                weight,
                Guid.Empty,
                Guid.Empty,
                addr);

            AddFilter(filterId);

            return(filterId);
        }
Пример #11
0
        public Guid CreateRemoteNetworkIPv4CalloutFilter(
            DisplayData displayData,
            Layer layer,
            uint weight,
            Callout callout,
            ProviderContext providerContext,
            NetworkAddress addr)
        {
            var filterId = IpFilterNative.CreateRemoteNetworkIPv4Filter(
                Session.Handle,
                ProviderId,
                Id,
                displayData,
                layer,
                Action.Callout,
                weight,
                callout.Id,
                providerContext.Id,
                addr);

            AddFilter(filterId);

            return(filterId);
        }
Пример #12
0
 public void Close()
 {
     IpFilterNative.DestroySession(Handle);
 }
Пример #13
0
 public void DestroyProviderContext(ProviderContext context)
 {
     IpFilterNative.DestroyProviderContext(
         Session.Handle,
         context.Id);
 }
Пример #14
0
 public void DestroyCallout(Callout callout)
 {
     IpFilterNative.DestroyCallout(
         Session.Handle,
         callout.Id);
 }
Пример #15
0
 public void CommitTransaction()
 {
     IpFilterNative.CommitTransaction(Handle);
 }
Пример #16
0
 public void AbortTransaction()
 {
     IpFilterNative.AbortTransaction(Handle);
 }
Пример #17
0
 public static Session Dynamic()
 {
     return(new Session(IpFilterNative.CreateDynamicSession()));
 }
Пример #18
0
 public void StartTransaction()
 {
     IpFilterNative.StartTransaction(Handle);
 }
Пример #19
0
 public static IpFilter Create(Session session, DisplayData displayData)
 {
     return(new IpFilter(
                session,
                IpFilterNative.CreateProvider(session.Handle, displayData)));
 }