Consider the following code:
Code:
CLIENT *clnt = NULL;
clnt = clnt_create("s4c",300456,1,"TCP");
if(clnt==NULL) clnt_pcreateerror("Client is\tNULL\n");
if(clnt!=NULL) printf("Client is\tCREATED\n");
if(rpc_createerr.cf_stat==RPC_INTR) printf("RPC_INTR\n");
if(rpc_createerr.cf_stat==RPC_N2AXLATEFAILURE) printf("RPC_N2AXLATEFAILURE\n");
if(rpc_createerr.cf_stat==RPC_SYSTEMERROR) printf("RPC_SYSTEMERROR\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNHOST) printf("RPC_UNKNOWNHOST\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNPROTO) printf("RPC_UNKNOWNPROTO\n");
CLIENT *clnt1 = NULL;
clnt1 = clnt_create("s4c",300456,1,"ncacn_ip_tcp");
if(clnt1==NULL) clnt_pcreateerror("Client1 is\tNULL\n");
if(clnt1!=NULL) printf("Client is\tCREATED\n");
if(rpc_createerr.cf_stat==RPC_INTR) printf("RPC_INTR\n");
if(rpc_createerr.cf_stat==RPC_N2AXLATEFAILURE) printf("RPC_N2AXLATEFAILURE\n");
if(rpc_createerr.cf_stat==RPC_SYSTEMERROR) printf("RPC_SYSTEMERROR\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNHOST) printf("RPC_UNKNOWNHOST\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNPROTO) printf("RPC_UNKNOWNPROTO\n");
CLIENT *clnt2 = NULL;
clnt2 = clnt_create("192.168.1.2",300456,1,"tcp");
if(clnt2==NULL) clnt_pcreateerror("Client2 is\tNULL\n");
if(clnt2!=NULL) printf("Client is\tCREATED\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNPROTO) printf("RPC_UNKNOWNPROTO\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNHOST) printf("RPC_UNKNOWNHOST\n");
if(rpc_createerr.cf_stat==RPC_SYSTEMERROR) printf("RPC_SYSTEMERROR\n");
if(rpc_createerr.cf_stat==RPC_N2AXLATEFAILURE) printf("RPC_N2AXLATEFAILURE\n");
if(rpc_createerr.cf_stat==RPC_INTR) printf("RPC_INTR\n");
CLIENT *clnt4 = NULL;
clnt4 = clnt_create("192.168.1.2:2000",300456,1,"tcp");
if(clnt4==NULL) clnt_pcreateerror("Client4 is\tNULL\n");
if(clnt4!=NULL) printf("Client is\tCREATED\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNPROTO) printf("RPC_UNKNOWNPROTO\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNHOST) printf("RPC_UNKNOWNHOST\n");
if(rpc_createerr.cf_stat==RPC_SYSTEMERROR) printf("RPC_SYSTEMERROR\n");
if(rpc_createerr.cf_stat==RPC_N2AXLATEFAILURE) printf("RPC_N2AXLATEFAILURE\n");
if(rpc_createerr.cf_stat==RPC_INTR) printf("RPC_INTR\n");
When I run it on a computer NOT connected to the RPC server it responds:
Client is NULL
: RPC: Port mapper failure - Timed out
Client1 is NULL
: RPC: Unknown protocol
RPC_UNKNOWNPROTO
Client2 is NULL
: RPC: Port mapper failure - Timed out
Client4 is NULL
: RPC: Unknown host
RPC_UNKNOWNHOST
But when I run it on the computer connected to the RPC server I get This:
Client is NULL
: RPC: Unknown protocol
RPC_UNKNOWNPROTO
Client1 is NULL
: RPC: Unknown protocol
RPC_UNKNOWNPROTO
Client2 is NULL
: RPC: Unknown protocol
RPC_UNKNOWNPROTO
Client4 is NULL
: RPC: Unknown protocol
RPC_UNKNOWNPROTO
Port 111 is the port mapper request port for if the RPC server is going to communicate to several different clients. It tells the clients which port to go to for RPC calls.
I have the robot set to listen only to port 2000 because the 2 are hardwired together (1 server/1 client).
I'll try nmap next.