Added upstream from http://ftp.icm.edu.pl/pub/loglan/
[loglan.git] / sources / int / net / ip / sock.h
1 # include       <stdio.h>
2 # include       <string.h>
3 #ifndef NO_PROTOTYPES
4 # include       <stdlib.h>
5 #endif
6 # include       <sys/types.h>
7 # include       <signal.h>
8 # include       <sys/socket.h>
9 # include       <sys/time.h>
10 # include       <netinet/in.h>
11 # include       <netdb.h>
12 # include       <errno.h>
13
14
15 #define AS_CLIENT 0
16 #define AS_SERVER 1
17
18
19 #ifndef NO_PROTOTYPES
20 int  sock_open( int socket_type, char *protocol,
21                 char *host, char *service, int port,
22                 int as_server );
23 int  sock_cli_send( int sock, void *m, int size );
24 int  sock_cli_recv( int sock, void *m, int size );
25 int  sock_srv_recv( int sock, void *m, int size,
26                     struct sockaddr_in *addr, int *namelen );
27 int  sock_srv_send( int sock, void *m, int size,
28                     struct sockaddr_in *addr, int  namelen );
29 void set_cli_recv_timeout( int miliseconds );
30 void set_srv_send_delay  ( int miliseconds );
31 int  poll_socket( int sock, int miliseconds );
32 #else
33 int  sock_open();
34 int  sock_cli_send();
35 int  sock_cli_recv();
36 int  sock_srv_recv();
37 int  sock_srv_send();
38 void set_cli_recv_timeout();
39 void set_srv_send_delay  ();
40 int  poll_socket();
41 #endif
42
43
44 #ifndef NO_PROTOTYPES
45 int  sock_cli_crc_send( int sock, void *m, int size );
46 int  sock_cli_crc_recv( int sock, void *m, int size );
47 int  sock_srv_crc_recv( int sock, void *m, int size,
48                         struct sockaddr_in *addr, int *namelen );
49 int  sock_srv_crc_send( int sock, void *m, int size,
50                         struct sockaddr_in *addr, int  namelen );
51 #else
52 int  sock_cli_crc_send();
53 int  sock_cli_crc_recv();
54 int  sock_srv_crc_recv();
55 int  sock_srv_crc_send();
56 #endif
57