/* * This is sample code generated by rpcgen. * These are only templates and you can use them * as a guideline for developing your own functions. */ #include "square.h" void square_prog_2(char *host) { CLIENT *clnt; enum clnt_stat retval_1; square_out result_1; square_in squareproc_2_arg; #ifndef DEBUG clnt = clnt_create (host, SQUARE_PROG, SQUARE_VERS, "udp"); if (clnt == NULL) { clnt_pcreateerror (host); exit (1); } #endif /* DEBUG */ retval_1 = squareproc_2(&squareproc_2_arg, &result_1, clnt); if (retval_1 != RPC_SUCCESS) { clnt_perror (clnt, "call failed"); } #ifndef DEBUG clnt_destroy (clnt); #endif /* DEBUG */ } int main (int argc, char *argv[]) { char *host; if (argc < 2) { printf ("usage: %s server_host\n", argv[0]); exit (1); } host = argv[1]; square_prog_2 (host); exit (0); }