LDFLAGS =
LIBDIR = -L../libtrbnet
-LOADLIBES = -ltrbnet
+LOADLIBES = -ltrbnet -lm
# ------------ TARGETS -------------------------------------------------
LDFLAGS =
LIBDIR =
-LOADLIBES =
+LOADLIBES = -lm
# ------------ TARGETS -------------------------------------------------
LDFLAGS =
LIBDIR = -L../../libtrbnet
-LOADLIBES = -ltrbnet
+LOADLIBES = -ltrbnet -lm
# ------------ TARGETS -------------------------------------------------
#include "trbrpc.h"
-static const char trbnetd_version[] = "$Revision: 1.12 $";
+static const char trbnetd_version[] = "$Revision: 1.13 $";
static int daemon_lock = 0;
return TRUE;
}
+bool_t nettrace_1_svc(uint16_t trb_address,
+ u_int dsize,
+ RetVal * retVal,
+ struct svc_req * rqstp)
+{
+ int status;
+
+ /* allocate buffer memory */
+ retVal->data.Buffer_len = 0;
+ retVal->data.Buffer_val = (uint32_t *) malloc(sizeof(uint32_t) * dsize);
+ if (retVal->data.Buffer_val == NULL) {
+ fprintf(stderr, "nettrace: malloc failed\n");
+ retVal->status.trb_errno = TRB_RPC_ERROR;
+ retVal->status.retVal = -1;
+ return TRUE;
+ }
+
+ if (daemon_lock == 1) {
+ retVal->status.retVal = -128;
+ return TRUE;
+ }
+
+ status = trb_nettrace(trb_address,
+ (uint32_t *) retVal->data.Buffer_val, dsize);
+ retVal->data.Buffer_len = status == -1 ? 0 : status;
+ retVal->status.retVal = status;
+ copyStatus(&retVal->status);
+
+ return TRUE;
+}
+
extern void trbnetrpcprog_1(struct svc_req *rqstp, register SVCXPRT * transp);
/* ------ MAIN ---------------------------------------------------------- */
#include "trbnet.h"
-const char trbnet_version[] = "$Revision: 1.11 $ RPC";
+const char trbnet_version[] = "$Revision: 1.12 $ RPC";
unsigned int trb_debug = 0;
unsigned int trb_dma = 0;
static CLIENT *trb_client = NULL;
copyStatus(&retVal);
return retVal.retVal;
}
+
+int trb_nettrace(uint16_t trb_address,
+ uint32_t * data, unsigned int dsize)
+{
+ enum clnt_stat status;
+ RetVal retVal;
+
+ if (trb_client == NULL) return -1;
+ do {
+ retVal.data.Buffer_val = data;
+ retVal.data.Buffer_len = dsize;
+ status =
+ nettrace_1(trb_address, dsize,
+ &retVal, trb_client);
+
+ if (status != RPC_SUCCESS) {
+ /*
+ * An error occurred while calling the server.
+ * Print error message and stop.
+ */
+ trb_errno = status + 256;
+ return -1;
+ }
+ if (retVal.status.retVal != -128) break;
+ sleep(SLEEP_TIME);
+ } while (1);
+
+ copyStatus(&retVal.status);
+ return retVal.status.retVal;
+}
+
int,
uint32_t,
uint32_t) = 17;
+
+ RetVal NETTRACE(uint16_t,
+ unsigned int) = 18;
+
} = 1;
} = 0x20000099;
LD = $(CC)
LDFLAGS =
LIBDIR = -L../libtrbnet
-LOADLIBES = -ltrbnet
+LOADLIBES = -ltrbnet -lm
# ------------ TARGETS -------------------------------------------------