Пример #1
0
        private static IEnumerable <DhcpServerOptionValue> EnumGlobalOptionValues(DhcpServer Server, string ClassName, string VendorName)
        {
            var scopeInfo = new DHCP_OPTION_SCOPE_INFO_GLOBAL()
            {
                ScopeType       = DHCP_OPTION_SCOPE_TYPE.DhcpGlobalOptions,
                GlobalScopeInfo = IntPtr.Zero
            };

            var scopeInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf(scopeInfo));

            Marshal.StructureToPtr(scopeInfo, scopeInfoPtr, true);

            return(EnumOptionValues(Server, scopeInfoPtr, ClassName, VendorName));
        }
Пример #2
0
        internal static DhcpServerOptionValue GetGlobalOptionValue(DhcpServer Server, int OptionId, string ClassName, string VendorName)
        {
            var scopeInfo = new DHCP_OPTION_SCOPE_INFO_GLOBAL()
            {
                ScopeType       = DHCP_OPTION_SCOPE_TYPE.DhcpGlobalOptions,
                GlobalScopeInfo = IntPtr.Zero
            };

            var scopeInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf(scopeInfo));

            Marshal.StructureToPtr(scopeInfo, scopeInfoPtr, true);

            return(GetOptionValue(Server, scopeInfoPtr, OptionId, ClassName, VendorName));
        }
Пример #3
0
        internal static IEnumerable <DhcpServerOptionValue> GetAllGlobalOptionValues(DhcpServer Server)
        {
            var scopeInfo = new DHCP_OPTION_SCOPE_INFO_GLOBAL()
            {
                ScopeType       = DHCP_OPTION_SCOPE_TYPE.DhcpGlobalOptions,
                GlobalScopeInfo = IntPtr.Zero
            };

            var scopeInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf(scopeInfo));

            Marshal.StructureToPtr(scopeInfo, scopeInfoPtr, true);

            return(GetAllOptionValues(Server, scopeInfoPtr));
        }