1/* rcmd.c --- execute a command on a remote host from OS/2 2 Karl Fogel <kfogel@cyclic.com> --- November 1995 */ 3 4/* This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2, or (at your option) 7 any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. */ 13 14#include <io.h> 15#include <stdio.h> 16#include <fcntl.h> 17#include <malloc.h> 18#include <errno.h> 19/* <sys/socket.h> wants `off_t': */ 20#include <sys/types.h> 21/* This should get us ibmtcpip\include\sys\socket.h: */ 22#include <sys/socket.h> 23#include <assert.h> 24 25#include "rcmd.h" 26 27void 28init_sockets () 29{ 30 int rc; 31 32 rc = sock_init (); 33 if (rc != 0) 34 { 35 fprintf (stderr, "sock_init() failed -- returned %d!\n", rc); 36 exit (1); 37 } 38} 39 40 41static int 42resolve_address (const char **ahost, struct sockaddr_in *sai) 43{ 44 fprintf (stderr, 45 "Error: resolve_address() doesn't work.\n"); 46 exit (1); 47} 48 49static int 50bind_and_connect (struct sockaddr_in *server_sai) 51{ 52 fprintf (stderr, 53 "Error: bind_and_connect() doesn't work.\n"); 54 exit (1); 55} 56 57static int 58rcmd_authenticate (int fd, char *locuser, char *remuser, char *command) 59{ 60 fprintf (stderr, 61 "Error: rcmd_authenticate() doesn't work.\n"); 62 exit (1); 63} 64 65int 66rcmd (const char **ahost, 67 unsigned short inport, 68 char *locuser, 69 char *remuser, 70 char *cmd, 71 int *fd2p) 72{ 73 fprintf (stderr, 74 "Error: rcmd() doesn't work.\n"); 75 exit (1); 76} 77