1 | #ifndef READ_SOCKET 2 | #define READ_SOCKET 3 | /*************************************** 4 | $Revision: 1.4 $ 5 | 6 | Socket module (sk) 7 | 8 | Status: NOT REVUED, NOT TESTED 9 | 10 | ******************/ /****************** 11 | Copyright (c) 1999 RIPE NCC 12 | 13 | All Rights Reserved 14 | 15 | Permission to use, copy, modify, and distribute this software and its 16 | documentation for any purpose and without fee is hereby granted, 17 | provided that the above copyright notice appear in all copies and that 18 | both that copyright notice and this permission notice appear in 19 | supporting documentation, and that the name of the author not be 20 | used in advertising or publicity pertaining to distribution of the 21 | software without specific, written prior permission. 22 | 23 | THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 24 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL 25 | AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 26 | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 27 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 28 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 29 | ***************************************/ 30 | #include <sys/types.h> 31 | #include <sys/socket.h> 32 | #include <netinet/in.h> 33 | 34 | #include <stdlib.h> 35 | #include <errno.h> 36 | #include <netdb.h> 37 | 38 | #include <signal.h> 39 | 40 | #include <stdio.h> 41 | 42 | 43 | int SK_atoport(const char *service, const char *proto); 44 | void SK_close(int socket); 45 | int SK_getsock(int socket_type, u_short port, uint32_t bind_address); 46 | int SK_accept_connection(int listening_socket); 47 | int SK_gets(int sockfd, char *str, size_t count); 48 | int SK_puts(int sockfd, const char *str); 49 | 50 | #endif /* READ_SOCKET */