Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
internal string Host
{
get
{
var local = this;
var length = (uint) 256;
var builder = new StringBuilder((int) length);
[FieldOffset(0)]
public ushort s_w1;
[FieldOffset(2)]
public ushort s_w2;
var data = new WSAData();
WSAStartup(2, ref data);
WSAAddressToString(ref local, (uint) Marshal.SizeOf(local), IntPtr.Zero, builder,
ref length);
WSACleanup();
[FieldOffset(0)]
public uint S_addr;
return builder.ToString().Split(':')[0];
}
/// <summary>
/// can be used for most tcp & ip code
/// </summary>
public uint s_addr { get { return S_addr; } }
}
/// <summary>
/// host on imp
/// </summary>
public byte s_host { get { return s_b2; } }
internal string Port
{
get
{
var local = this;
var length = (uint) 256;
var builder = new StringBuilder((int) length);
/// <summary>
/// network
/// </summary>
public byte s_net { get { return s_b1; } }
var data = new WSAData();
WSAStartup(2, ref data);
WSAAddressToString(ref local, (uint) Marshal.SizeOf(local), IntPtr.Zero, builder,
ref length);
WSACleanup();
/// <summary>
/// imp
/// </summary>
public ushort s_imp { get { return s_w2; } }
return builder.ToString().Split(':')[1];
}
/// <summary>
/// imp #
/// </summary>
public byte s_impno { get { return s_b4; } }
}
internal static sockaddr_in6 FromString(string host, int port)
{
var sockaddr = new sockaddr_in6();
var lpAddressLength = Marshal.SizeOf(sockaddr);
WSAStringToAddress(host + ":" + port, EnumLib.ADDRESS_FAMILIES.AF_INET6, IntPtr.Zero,
ref sockaddr, ref lpAddressLength);
return sockaddr;
}
/// <summary>
/// logical host
/// </summary>
public byte s_lh { get { return s_b3; } }
}
[StructLayout(LayoutKind.Explicit, Size = 28)]
internal struct sockaddr_in6_UNSAFE
[StructLayout(LayoutKind.Sequential)]
public struct sockaddr_in
{
[FieldOffset(0)] internal EnumLib.ADDRESS_FAMILIES sin6_family;
[FieldOffset(2)] internal ushort sin6_port;
[FieldOffset(4)] internal uint sin6_flowinfo;
[FieldOffset(8)] internal in6_addr sin6_addr;
[FieldOffset(24)] internal uint sin6_scope_id;
public ADDRESS_FAMILIES sin_family;
public ushort sin_port;
public in_addr sin_addr;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] sin_zero;
}
VB Definition:
Structure sockaddr_in
Public TODO
End Structure
User-Defined Field Types:
None.
internal string Host
{
get
{
var local = this;
var length = (uint) 256;
var builder = new StringBuilder((int) length);
Notes:
None.
var data = new WSAData();
WSAStartup(2, ref data);
WSAAddressToString(ref local, (uint) Marshal.SizeOf(local), IntPtr.Zero, builder,
ref length);
WSACleanup();
return builder.ToString().Split(':')[0];
}
}
internal string Port
{
get
{
var local = this;
var length = (uint) 256;
var builder = new StringBuilder((int) length);
var data = new WSAData();
WSAStartup(2, ref data);
WSAAddressToString(ref local, (uint) Marshal.SizeOf(local), IntPtr.Zero, builder,
ref length);
WSACleanup();
return builder.ToString().Split(':')[1];
}
}
internal static sockaddr_in6 FromString(string host, int port)
{
var sockaddr = new sockaddr_in6();
var lpAddressLength = Marshal.SizeOf(sockaddr);
WSAStringToAddress(host + ":" + port, EnumLib.ADDRESS_FAMILIES.AF_INET6, IntPtr.Zero,
ref sockaddr, ref lpAddressLength);
return sockaddr;
}
}