bglibs: socket.h Source File

- Main Page
- Modules
- Data Structures
- Files
- Directories
- Related Pages
- Examples

# socket.h

    00001 /* $Id: socket.h 616 2005-08-19 20:11:01Z bruce $ */
    00002 #ifndef NET__SOCKET__H__
    00003 #define NET__SOCKET__H__
    00004
    00005 #include "ipv4.h"
    00006 #include "ipv6.h"
    00007
    00023 int socket_tcp4(void);
    00024 int socket_tcp6(void);
    00025 int socket_tcp(void);
    00026 int socket_udp4(void);
    00027 int socket_udp6(void);
    00028 int socket_udp(void);
    00029 int socket_connect4(int sock, const ipv4addr* ip, ipv4port port);
    00030 int socket_connect4_timeout(int sock, const ipv4addr* ip, ipv4port port,
    00031                             int timeout);
    00032 int socket_connect6(int sock, const ipv6addr* ip, ipv6port port);
    00033 int socket_connect6_timeout(int sock, const ipv6addr* ip, ipv6port port,
    00034                             int timeout);
    00035 int socket_bind4(int sock, const ipv4addr* ip, ipv4port port);
    00036 int socket_bind6(int sock, const ipv6addr* ip, ipv6port port);
    00037 int socket_accept4(int sock, ipv4addr* ip, ipv4port* port);
    00038 int socket_accept6(int sock, ipv6addr* ip, ipv6port* port);
    00039 int socket_recv4(int sock, char* buffer, unsigned buflen,
    00040                  ipv4addr* ip, ipv4port* port);
    00041 int socket_recv6(int sock, char* buffer, unsigned buflen,
    00042                  ipv6addr* ip, ipv6port* port);
    00043 int socket_send4(int sock, const char* buffer, unsigned buflen,
    00044                  const ipv4addr* ip, ipv4port port);
    00045 int socket_send6(int sock, const char* buffer, unsigned buflen,
    00046                  const ipv6addr* ip, ipv6port port);
    00047 int socket_getaddr4(int sock, ipv4addr* ip, ipv4port* port);
    00048 int socket_getaddr6(int sock, ipv6addr* ip, ipv6port* port);
    00049 int socket_cork(int sock);
    00050 int socket_uncork(int sock);
    00051 int socket_notcpdelay(int sock, int enable);
    00056 int socket_unixdgm(void);
    00057 int socket_unixstr(void);
    00058 int socket_connectu(int sock, const char* path);
    00059 int socket_connectu_timeout(int sock, const char* path, int timeout);
    00060 int socket_bindu(int sock, const char* path);
    00061 int socket_acceptu(int sock);
    00062 int socket_recvu(int sock, char* buffer, unsigned buflen);
    00063 int socket_sendu(int sock, const char* buffer, unsigned buflen);
    00064
    00065 int socket_pairstr(int fd[2]);
    00066 int socket_pairdgm(int fd[2]);
    00071 int socket_broadcast(int sock);
    00072 int socket_connected(int sock);
    00073 int socket_linger(int fd, int onoff, int seconds);
    00074 int socket_listen(int sock, int backlog);
    00075 int socket_reuse(int sock);
    00076 int socket_shutdown(int sock, int shut_rd, int shut_wr);
    00077
    00078 int socket_sendfd(int sock, int fd);
    00079 int socket_recvfd(int sock);
    00084 #endif