root/include/sys/socket.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _SOCKET_H
   2 #define _SOCKET_H
   3 
   4 struct sockaddr {
   5         u_short sa_family;              /* address family, AF_xxx */
   6         char sa_data[14];               /* 14 bytes of protocol address */
   7 };
   8 
   9 /*
  10  * socket types
  11  */
  12 #define SOCK_STREAM     1               /* stream (connection) socket */
  13 #define SOCK_DGRAM      2               /* datagram (connectionless) socket */
  14 #define SOCK_SEQPACKET  3               /* sequential packet socket */
  15 #define SOCK_RAW        4               /* raw socket */
  16 
  17 /*
  18  * supported address families
  19  */
  20 #define AF_UNSPEC       0
  21 #define AF_UNIX         1
  22 #define AF_INET         2
  23 
  24 /*
  25  * protocol families, same as address families
  26  */
  27 #define PF_UNIX         AF_UNIX
  28 #define PF_INET         AF_INET
  29 
  30 int socket(int family, int type, int protocol);
  31 int socketpair(int family, int type, int protocol, int sockvec[2]);
  32 int bind(int sockfd, struct sockaddr *my_addr, int addrlen);
  33 int connect(int sockfd, struct sockaddr *serv_addr, int addrlen);
  34 int listen(int sockfd, int backlog);
  35 int accept(int sockfd, struct sockaddr *peer, int *paddrlen);
  36 int getsockname(int sockfd, struct sockaddr *addr, int *paddrlen);
  37 int getpeername(int sockfd, struct sockaddr *peer, int *paddrlen);
  38 
  39 #endif /* _SOCKET_H */

/* [previous][next][first][last][top][bottom][index][help] */