socket.h File Reference

Socket addresses. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  sockaddr
 Generalized socket address structure. More...

Defines

#define TCP_SOCK_STREAM   0x1
#define SOCK_STREAM   tcp_sock_stream
#define UDP_SOCK_DGRAM   0x2
#define SOCK_DGRAM   udp_sock_dgram
#define AF_INET   1
 IPv4 Internet addresses.
#define AF_INET6   2
 IPv6 Internet addresses.
#define SA_LEN   32
 Length of a struct sockaddr.

Typedefs

typedef uint16_t sa_family_t
 A socket address family.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static __attribute__ ((always_inline)) const char *socket_semantics_name(int semantics)
 Name communication semantics.

Variables

int tcp_sock_stream
 Connection-based, reliable streams.
int udp_sock_dgram
 Connectionless, unreliable streams.
struct sockaddr may_alias
 Generalized socket address structure.


Detailed Description

Socket addresses.

Definition in file socket.h.


Define Documentation

#define SA_LEN   32

Length of a struct sockaddr.

Definition at line 78 of file socket.h.


Typedef Documentation

A socket address family.

Definition at line 75 of file socket.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

static __attribute__ ( (always_inline)   )  const [inline, static]

Name communication semantics.

Name address family.

Parameters:
semantics Communication semantics (e.g. SOCK_STREAM)
Return values:
name Name of communication semantics
Parameters:
family Address family (e.g. AF_INET)
Return values:
name Name of address family

Definition at line 38 of file socket.h.

References SOCK_DGRAM, and SOCK_STREAM.

00039                                         {
00040         /* Cannot use a switch() because of the {TCP_UDP}_SOCK_XXX hack */
00041         if ( semantics == SOCK_STREAM ) {
00042                 return "SOCK_STREAM";
00043         } else if ( semantics == SOCK_DGRAM ) {
00044                 return "SOCK_DGRAM";
00045         } else {
00046                 return "SOCK_UNKNOWN";
00047         }
00048 }


Variable Documentation

Generalized socket address structure.

This contains the fields common to socket addresses for all address families.


Generated on Tue Apr 6 20:01:52 2010 for gPXE by  doxygen 1.5.7.1