add a webpage for the smb backend
[tridge/dbench.git] / socklib.c
index 595885cc231ce3c18104aeeb16b0189610b1ba30..1059d70d33367121eed37555864af5bb0e6360ed 100644 (file)
--- a/socklib.c
+++ b/socklib.c
@@ -4,7 +4,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -13,8 +13,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "dbench.h"
@@ -27,7 +26,6 @@ int open_socket_in(int type, int port)
        struct sockaddr_in sock;
        int res;
        int one=1;
-       extern char *tcp_options;
 
        memset((char *)&sock,0, sizeof(sock));
        sock.sin_port = htons(port);
@@ -45,7 +43,7 @@ int open_socket_in(int type, int port)
                return(-1); 
        }
 
-       set_socket_options(res, tcp_options);
+       set_socket_options(res, options.tcp_options);
 
        return res;
 }
@@ -53,13 +51,12 @@ int open_socket_in(int type, int port)
 
 /* open a socket to a tcp remote host with the specified port 
    based on code from Warren */
-int open_socket_out(char *host, int port)
+int open_socket_out(const char *host, int port)
 {
        int type = SOCK_STREAM;
        struct sockaddr_in sock_out;
        int res;
        struct hostent *hp;  
-       extern char *tcp_options;
 
        res = socket(PF_INET, type, 0);
        if (res == -1) {
@@ -76,7 +73,7 @@ int open_socket_out(char *host, int port)
        sock_out.sin_port = htons(port);
        sock_out.sin_family = PF_INET;
 
-       set_socket_options(res, tcp_options);
+       set_socket_options(res, options.tcp_options);
 
        if (connect(res,(struct sockaddr *)&sock_out,sizeof(sock_out))) {
                close(res);