Esempio n. 1
0
        internal static unsafe ContainerNetworkConfigDescription CreateFromNative(IntPtr nativePtr)
        {
            ReleaseAssert.AssertIfNot(nativePtr != IntPtr.Zero, "ContainerNetworkConfigDescription.CreateFromNative() has null pointer.");

            var nativeArgs = *((NativeTypes.FABRIC_CONTAINER_NETWORK_CONFIG_DESCRIPTION *)nativePtr);

            return(new ContainerNetworkConfigDescription
            {
                OpenNetworkAssignedIp = NativeTypes.FromNativeString(nativeArgs.OpenNetworkAssignedIp),
                OverlayNetworkResources = NativeTypes.FromNativeStringPairList(nativeArgs.OverlayNetworkResources),
                PortBindings = NativeTypes.FromNativeStringPairList(nativeArgs.PortBindings),
                NodeId = NativeTypes.FromNativeString(nativeArgs.NodeId),
                NodeName = NativeTypes.FromNativeString(nativeArgs.NodeName),
                NodeIpAddress = NativeTypes.FromNativeString(nativeArgs.NodeIpAddress),
                NetworkType = InteropHelpers.FromNativeContainerNetworkType(nativeArgs.NetworkType)
            });
        }
Esempio n. 2
0
        internal static unsafe ContainerUpdateRouteArgs CreateFromNative(IntPtr nativePtr)
        {
            ReleaseAssert.AssertIfNot(nativePtr != IntPtr.Zero, "ContainerUpdateRouteArgs.CreateFromNative() has null pointer.");

            var nativeUpdateRouteArgs = *((NativeTypes.FABRIC_CONTAINER_UPDATE_ROUTE_ARGS *)nativePtr);

            return(new ContainerUpdateRouteArgs
            {
                ContainerId = NativeTypes.FromNativeString(nativeUpdateRouteArgs.ContainerId),
                ContainerName = NativeTypes.FromNativeString(nativeUpdateRouteArgs.ContainerName),
                ApplicationId = NativeTypes.FromNativeString(nativeUpdateRouteArgs.ApplicationId),
                ApplicationName = NativeTypes.FromNativeString(nativeUpdateRouteArgs.ApplicationName),
                NetworkType = InteropHelpers.FromNativeContainerNetworkType(nativeUpdateRouteArgs.NetworkType),
                GatewayIpAddresses = NativeTypes.FromNativeStringList(nativeUpdateRouteArgs.GatewayIpAddresses),
                AutoRemove = NativeTypes.FromBOOLEAN(nativeUpdateRouteArgs.AutoRemove),
                IsContainerRoot = NativeTypes.FromBOOLEAN(nativeUpdateRouteArgs.IsContainerRoot),
                CgroupName = NativeTypes.FromNativeString(nativeUpdateRouteArgs.CgroupName)
            });
        }