//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//------------------------------------------------------------------------------
namespace System.Net.Sockets
{
using System;
//
// Option names per-socket.
//
///
///
/// Defines socket option names for the class.
///
///
//UEUE
public enum SocketOptionName {
//
// good for SocketOptionLevel.Socket
//
///
/// Record debugging information.
///
Debug = 0x0001, // turn on debugging info recording
///
/// Socket is listening.
///
AcceptConnection = 0x0002, // socket has had listen()
///
///
/// Allows the socket to be bound to an address that is already in use.
///
///
ReuseAddress = 0x0004, // allow local address reuse
///
///
/// Send keep-alives.
///
///
KeepAlive = 0x0008, // keep connections alive
///
///
/// Do not route, send directly to interface addresses.
///
///
DontRoute = 0x0010, // just use interface addresses
///
///
/// Permit sending broadcast messages on the socket.
///
///
Broadcast = 0x0020, // permit sending of broadcast msgs
///
///
/// Bypass hardware when possible.
///
///
UseLoopback = 0x0040, // bypass hardware when possible
///
///
/// Linger on close if unsent data is present.
///
///
Linger = 0x0080, // linger on close if data present
///
///
/// Receives out-of-band data in the normal data stream.
///
///
OutOfBandInline = 0x0100, // leave received OOB data in line
///
///
/// Close socket gracefully without lingering.
///
///
DontLinger = 0xFF7F, // ~Linger
///
///
/// Enables a socket to be bound for exclusive access.
///
///
ExclusiveAddressUse = 0xFFFB, // ~ReuseAddress; disallow local address reuse
///
///
/// Specifies the total per-socket buffer space reserved for sends. This is
/// unrelated to the maximum message size or the size of a TCP window.
///
///
SendBuffer = 0x1001, // send buffer size
///
///
/// Send low water mark.
///
///
ReceiveBuffer = 0x1002, // receive buffer size
///
///
/// Specifies the total per-socket buffer space reserved for receives. This is unrelated to the maximum message size or the size of a TCP window.
///
///
SendLowWater = 0x1003, // send low-water mark
///
///
/// Receive low water mark.
///
///
ReceiveLowWater = 0x1004, // receive low-water mark
///
///
/// Send timeout.
///
///
SendTimeout = 0x1005, // send timeout
///
///
/// Receive timeout.
///
///
ReceiveTimeout = 0x1006, // receive timeout
///
///
/// Get error status and clear.
///
///
Error = 0x1007, // get error status and clear
///
///
/// Get socket type.
///
///
Type = 0x1008, // get socket type
///
///
/// Maximum queue length that can be specified by .
///
///
MaxConnections = 0x7fffffff, // Maximum queue length specifiable by listen.
//
// the following values are taken from ws2tcpip.h,
// note that these are understood only by ws2_32.dll and are not backwards compatible
// with the values found in winsock.h which are understood by wsock32.dll.
//
//
// good for SocketOptionLevel.IP
//
///
///
/// IP options.
///
///
IPOptions = 1,
///
///
/// Header is included with data.
///
///
HeaderIncluded = 2,
///
///
/// IP type of service and preced.
///
///
TypeOfService = 3,
///
///
/// IP time to live.
///
///
IpTimeToLive = 4,
///
///
/// IP multicast interface.
/// - Additional comments by mbolien:
/// multicast interface You provide it with an SOCKADDR_IN, and that tells the
/// system that it should receive multicast messages on that interface (if you
/// have more than one interface). Binding the socket is not sufficient, since
/// if the Ethernet hardware isn't set up to grab the multicast packets, it won't
/// do good to bind the socket. Kinda like raw sockets. Unless you
/// put the Ethernet card in promiscuous mode, you'll only get stuff sent to and
/// from your machine.
///
///
MulticastInterface = 9,
///
///
/// IP multicast time to live.
///
///
MulticastTimeToLive = 10,
///
///
/// IP Multicast loopback.
///
///
MulticastLoopback = 11,
///
///
/// Add an IP group membership.
///
///
AddMembership = 12,
///
///
/// Drop an IP group membership.
///
///
DropMembership = 13,
///
///
/// Don't fragment IP datagrams.
///
///
DontFragment = 14,
///
///
/// Join IP group/source.
///
///
AddSourceMembership = 15,
///
///
/// Leave IP group/source.
///
///
DropSourceMembership = 16,
///
///
/// Block IP group/source.
///
///
BlockSource = 17,
///
///
/// Unblock IP group/source.
///
///
UnblockSource = 18,
///
///
/// Receive packet information for ipv4.
///
///
PacketInformation = 19,
//
//good for ipv6
//
HopLimit = 21, //IPV6_HOPLIMIT
IPv6ProtectionLevel = 23, //IPV6_PROTECTION_LEVEL
// values for ProtectionLevel that may need an enum.
//#define PROTECTION_LEVEL_UNRESTRICTED 10 /* For peer-to-peer apps */
//#define PROTECTION_LEVEL_DEFAULT 20 /* Default level */
//#define PROTECTION_LEVEL_RESTRICTED 30 /* For Intranet apps */
//
// good for SocketOptionLevel.Tcp
//
///
///
/// Disables the Nagle algorithm for send coalescing.
///
///
NoDelay = 1,
///
/// [To be supplied.]
///
BsdUrgent = 2,
Expedited = 2,
//
// good for SocketOptionLevel.Udp
//
///
/// [To be supplied.]
///
NoChecksum = 1,
///
///
/// Udp-Lite checksum coverage.
///
///
ChecksumCoverage = 20,
UpdateAcceptContext = 0x700B,
UpdateConnectContext = 0x7010,
}; // enum SocketOptionName
} // namespace System.Net.Sockets