AF_INET

The AF_INET address family is the address family for IPv4.

Socket Address Structure

An IPv4 transport address is specified with the SOCKADDR_IN structure.

Socket Types

IPv4 supports the following socket types:

SOCK_STREAM

Supports reliable connection-oriented byte stream communication.

SOCK_DGRAM

Supports unreliable connectionless datagram communication.

SOCK_RAW

Supports raw access to the transport protocol.

A WSK application specifies a socket type when it calls the WskSocket function or the WskSocketConnect function to create a new socket.

Protocols

The following IPv4 IPPROTO_XXX protocol values of the IPPROTO enumeration are defined in the WSK header files:

IPPROTO_IP

Internet protocol options

IPPROTO_ICMP

Internet control message protocol

IPPROTO_IGMP

Internet group management protocol

IPPROTO_GGP

Gateway to gateway protocol

IPPROTO_IPV4

IPv4 encapsulation

IPPROTO_ST

Stream protocol

IPPROTO_TCP

Transmission control protocol

IPPROTO_CBT

Core based trees protocol

IPPROTO_EGP

Exterior gateway protocol

IPPROTO_IGP

Private interior gateway protocol

IPPROTO_PUP

PARC universal packet protocol

IPPROTO_UDP

User datagram protocol

IPPROTO_IDP

Internet datagram protocol

IPPROTO_RDP

Reliable data protocol

IPPROTO_ND

Net disk protocol

IPPROTO_ICLFXBM

Wideband monitoring

IPPROTO_PIM

Protocol independent multicast

IPPROTO_PGM

Pragmatic general multicast

IPPROTO_L2TP

Level 2 tunneling protocol

IPPROTO_SCTP

Stream control transmission protocol

IPPROTO_RAW

Raw IP packets

Additional protocols are supported through the use of raw sockets.

A WSK application specifies a protocol when it calls the WskSocket function or the WskSocketConnect function to create a new socket.

A WSK application also specifies a protocol (as the Level parameter) when it calls the WskControlSocket function to set or retrieve transport protocol level or network protocol level socket options.

Combinations

IPv4 supports the following combinations of socket types and protocols for each WSK socket category:

Basic Sockets
SOCK_STREAM + IPPROTO_TCP
SOCK_DGRAM + IPPROTO_UDP
SOCK_RAW + IPPROTO_Xxx
Listening Sockets

SOCK_STREAM + IPPROTO_TCP

Datagram Sockets
SOCK_DGRAM + IPPROTO_UDP
SOCK_RAW + IPPROTO_Xxx
Connection-Oriented Sockets

SOCK_STREAM + IPPROTO_TCP

Requirements

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

Ws2def.h (include Wsk.h)

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft