00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef Socket_h
00035 #define Socket_h
00036
00038 extern "C" {
00039 #include <stdio.h>
00040 #include <stdlib.h>
00041 #include <sys/types.h>
00042 #include <sys/socket.h>
00043 #include <netinet/in.h>
00044 #include <string.h>
00045 #include <unistd.h>
00046 #include <netdb.h>
00047 #include <netinet/in.h>
00048 #include <arpa/inet.h>
00049 }
00050
00051 #include <iostream.h>
00052 #include <bool.h>
00053
00054 #define MAX_UDP_DATAGRAM 9126
00055 #define MAX_INET_ADDR 28
00056
00057 #ifdef _ALPHA
00058
00059 extern "C" int gethostname (char *name, int namelen);
00060 #else
00061
00062 extern "C" int gethostname (char *name, unsigned int namelen);
00063 #endif
00064
00066 extern "C" int INET_getsockname(int socket,
00067 struct sockaddr_in *address,
00068 int *address_len );
00069
00071 extern "C" int INET_sendto (int socket,
00072 char *message_addr,
00073 int length,
00074 int flags,
00075 struct sockaddr_in *dest_addr,
00076 int dest_len );
00077
00079 extern "C" int INET_recvfrom(int socket,
00080 char *buffer,
00081 int length,
00082 int flags,
00083 struct sockaddr_in *address,
00084 int *address_len) ;
00086 extern "C" int INET_bind (int socket,
00087 struct sockaddr_in *address,
00088 int address_len );
00089
00090
00091
00092 #endif
00093
00094
00095 ÿ