xref: /openbsd/gnu/usr.bin/cvs/os2/rcmd.c (revision 2770ece5)
113571821Stholo /* rcmd.c --- execute a command on a remote host from OS/2
213571821Stholo    Karl Fogel <kfogel@cyclic.com> --- November 1995  */
313571821Stholo 
4*2770ece5Stholo /* This program is free software; you can redistribute it and/or modify
5*2770ece5Stholo    it under the terms of the GNU General Public License as published by
6*2770ece5Stholo    the Free Software Foundation; either version 2, or (at your option)
7*2770ece5Stholo    any later version.
8*2770ece5Stholo 
9*2770ece5Stholo    This program is distributed in the hope that it will be useful,
10*2770ece5Stholo    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*2770ece5Stholo    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*2770ece5Stholo    GNU General Public License for more details.  */
13*2770ece5Stholo 
1413571821Stholo #include <io.h>
1513571821Stholo #include <stdio.h>
1613571821Stholo #include <fcntl.h>
1713571821Stholo #include <malloc.h>
1813571821Stholo #include <errno.h>
1913571821Stholo /* <sys/socket.h> wants `off_t': */
2013571821Stholo #include <sys/types.h>
2113571821Stholo /* This should get us ibmtcpip\include\sys\socket.h: */
2213571821Stholo #include <sys/socket.h>
2313571821Stholo #include <assert.h>
2413571821Stholo 
2513571821Stholo #include "rcmd.h"
2613571821Stholo 
2713571821Stholo void
init_sockets()2813571821Stholo init_sockets ()
2913571821Stholo {
3013571821Stholo 	int rc;
3113571821Stholo 
3213571821Stholo 	rc = sock_init ();
3313571821Stholo     if (rc != 0)
3413571821Stholo     {
3513571821Stholo       fprintf (stderr, "sock_init() failed -- returned %d!\n", rc);
3613571821Stholo       exit (1);
3713571821Stholo     }
3813571821Stholo }
3913571821Stholo 
4013571821Stholo 
4113571821Stholo static int
resolve_address(const char ** ahost,struct sockaddr_in * sai)4213571821Stholo resolve_address (const char **ahost, struct sockaddr_in *sai)
4313571821Stholo {
4413571821Stholo     fprintf (stderr,
4513571821Stholo              "Error: resolve_address() doesn't work.\n");
4613571821Stholo     exit (1);
4713571821Stholo }
4813571821Stholo 
4913571821Stholo static int
bind_and_connect(struct sockaddr_in * server_sai)5013571821Stholo bind_and_connect (struct sockaddr_in *server_sai)
5113571821Stholo {
5213571821Stholo     fprintf (stderr,
5313571821Stholo              "Error: bind_and_connect() doesn't work.\n");
5413571821Stholo     exit (1);
5513571821Stholo }
5613571821Stholo 
5713571821Stholo static int
rcmd_authenticate(int fd,char * locuser,char * remuser,char * command)5813571821Stholo rcmd_authenticate (int fd, char *locuser, char *remuser, char *command)
5913571821Stholo {
6013571821Stholo     fprintf (stderr,
6113571821Stholo              "Error: rcmd_authenticate() doesn't work.\n");
6213571821Stholo     exit (1);
6313571821Stholo }
6413571821Stholo 
6513571821Stholo int
rcmd(const char ** ahost,unsigned short inport,char * locuser,char * remuser,char * cmd,int * fd2p)6613571821Stholo rcmd (const char **ahost,
6713571821Stholo       unsigned short inport,
6813571821Stholo       char *locuser,
6913571821Stholo       char *remuser,
7013571821Stholo       char *cmd,
7113571821Stholo       int *fd2p)
7213571821Stholo {
7313571821Stholo     fprintf (stderr,
7413571821Stholo              "Error: rcmd() doesn't work.\n");
7513571821Stholo     exit (1);
7613571821Stholo }
77