Init
This commit is contained in:
41
diagnostics/lib/libxdr/Makefile
Normal file
41
diagnostics/lib/libxdr/Makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
#
|
||||
# @(#)Makefile 1.1 94/10/31 SMI;
|
||||
#
|
||||
|
||||
.DEFAULT:
|
||||
sccs get -G$@ $@
|
||||
|
||||
INCDIR = ../include
|
||||
INCLUDES = $(INCDIR)/tcm_dtm.h $(INCDIR)/dtm_tcm.h $(INCDIR)/probe_sundiag.h
|
||||
|
||||
XSRCS = xdr_probe.c tcm_dtm.c dtm_tcm.c
|
||||
XOBJS = $(XSRCS:.c=.o)
|
||||
|
||||
XDRLIB = libxdr.a
|
||||
|
||||
DBX = -O
|
||||
# = -g for dbx version
|
||||
CFLAGS = $(DBX) -I$(INCDIR)
|
||||
LDFLAGS = $(DBX)
|
||||
|
||||
.KEEP_STATE:
|
||||
|
||||
##### beginning of dependency lines #####
|
||||
|
||||
all: $(XDRLIB)
|
||||
|
||||
$(XDRLIB): $(INCLUDES) $(XOBJS)
|
||||
ar cru $(XDRLIB) $(XOBJS)
|
||||
ranlib $(XDRLIB)
|
||||
|
||||
install: all
|
||||
|
||||
clean: FRC
|
||||
rm -f $(XDRLIB) *.o
|
||||
|
||||
lint:
|
||||
|
||||
info: FRC
|
||||
sccs info
|
||||
|
||||
FRC:
|
||||
52
diagnostics/lib/libxdr/dtm_tcm.c
Normal file
52
diagnostics/lib/libxdr/dtm_tcm.c
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)ATS dtm_tcm.c 1.1 94/10/31 Copyright Sun Microsystems Inc.";
|
||||
#endif
|
||||
|
||||
|
||||
#include <rpc/rpc.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include "dtm_tcm.h"
|
||||
|
||||
xdr_failure(xdrsp,failure)
|
||||
XDR *xdrsp;
|
||||
struct failure *failure;
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
if (!xdr_long(xdrsp, &failure->hostid))
|
||||
return(0);
|
||||
if (!xdr_int(xdrsp, &failure->run_status))
|
||||
return(0);
|
||||
ptr=failure->testname;
|
||||
if (!xdr_wrapstring(xdrsp,&ptr))
|
||||
return(0);
|
||||
ptr=failure->devname;
|
||||
if (!xdr_wrapstring(xdrsp,&ptr))
|
||||
return(0);
|
||||
ptr=failure->message;
|
||||
if (!xdr_wrapstring(xdrsp,&ptr))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
xdr_test(xdrsp,test)
|
||||
XDR *xdrsp;
|
||||
struct test *test;
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
if (!xdr_long(xdrsp, &test->hostid))
|
||||
return(0);
|
||||
ptr=test->testname;
|
||||
if (!xdr_wrapstring(xdrsp,&ptr))
|
||||
return(0);
|
||||
ptr=test->devname;
|
||||
if (!xdr_wrapstring(xdrsp,&ptr))
|
||||
return(0);
|
||||
if (!xdr_int(xdrsp,&test->pass_count))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
49
diagnostics/lib/libxdr/tcm_dtm.c
Normal file
49
diagnostics/lib/libxdr/tcm_dtm.c
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)ATS tcm_dtm.c 1.1 94/10/31 Copyright Sun Microsystems Inc.";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* tcm_dtm.c
|
||||
*
|
||||
* The xdr routines that tcm uses to send data
|
||||
* structures to dtm.
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include "tcm_dtm.h"
|
||||
|
||||
xdr_option(xdrs, pt)
|
||||
XDR *xdrs;
|
||||
struct option_file *pt;
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
ptr=pt->fname;
|
||||
if (!xdr_wrapstring(xdrs, &ptr))
|
||||
return(0);
|
||||
if (!xdr_int(xdrs, &pt->action))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
xdr_strings(xdrs, strings)
|
||||
XDR *xdrs;
|
||||
struct strings *strings;
|
||||
{
|
||||
char *ptr;
|
||||
int i;
|
||||
|
||||
if (!xdr_int(xdrs,&strings->num))
|
||||
return(0);
|
||||
if (strings->num>5)
|
||||
return(0);
|
||||
for(i=0;i<strings->num;i++) {
|
||||
ptr=strings->op[i];
|
||||
if (!xdr_wrapstring(xdrs, &ptr))
|
||||
return(0);
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
122
diagnostics/lib/libxdr/xdr_probe.c
Normal file
122
diagnostics/lib/libxdr/xdr_probe.c
Normal file
@@ -0,0 +1,122 @@
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)xdr_probe.c 1.1 94/10/31 Copyright Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include "probe_sundiag.h"
|
||||
|
||||
/*
|
||||
* xdr_devinfo XDR encodes/decodes the gendev_info struct
|
||||
*/
|
||||
xdr_devinfo(xdrs, pd)
|
||||
XDR *xdrs;
|
||||
struct gendev_info *pd;
|
||||
{
|
||||
if (!xdr_int(xdrs, &pd->status))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* xdr_meminfo XDR encodes/decodes the mem_info struct
|
||||
*/
|
||||
xdr_meminfo(xdrs, pd)
|
||||
XDR *xdrs;
|
||||
struct mem_info *pd;
|
||||
{
|
||||
if (!xdr_int(xdrs, &pd->amt))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* xdr_tapeinfo XDR encodes/decodes the tape_info struct
|
||||
*/
|
||||
xdr_tapeinfo(xdrs, pd)
|
||||
XDR *xdrs;
|
||||
struct tape_info *pd;
|
||||
{
|
||||
if (!xdr_int(xdrs, &pd->status))
|
||||
return(0);
|
||||
if (!xdr_wrapstring(xdrs, &pd->ctlr))
|
||||
return(0);
|
||||
if (!xdr_int(xdrs, &pd->ctlr_num))
|
||||
return(0);
|
||||
if (!xdr_short(xdrs, &pd->t_type))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* xdr_diskinfo XDR encodes/decodes the disk_info struct
|
||||
*/
|
||||
xdr_diskinfo(xdrs, pd)
|
||||
XDR *xdrs;
|
||||
struct disk_info *pd;
|
||||
{
|
||||
if (!xdr_int(xdrs, &pd->amt))
|
||||
return(0);
|
||||
if (!xdr_int(xdrs, &pd->status))
|
||||
return(0);
|
||||
if (!xdr_wrapstring(xdrs, &pd->ctlr))
|
||||
return(0);
|
||||
if (!xdr_int(xdrs, &pd->ctlr_num))
|
||||
return(0);
|
||||
if (!xdr_int(xdrs, &pd->ctlr_type))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
struct xdr_discrim u_tag_arms[5] = {
|
||||
{ (int) GENERAL_DEV, xdr_devinfo },
|
||||
{ (int) MEM_DEV, xdr_meminfo },
|
||||
{ (int) TAPE_DEV, xdr_tapeinfo },
|
||||
{ (int) DISK_DEV, xdr_diskinfo },
|
||||
{ (int) MAXDEVS, NULL }
|
||||
};
|
||||
|
||||
/*
|
||||
* xdr_u_tag XDR encodes/decodes the u_tag struct
|
||||
*/
|
||||
xdr_u_tag(xdrs, utp)
|
||||
XDR *xdrs;
|
||||
struct u_tag *utp;
|
||||
{
|
||||
return(xdr_union(xdrs, &utp->utype, &utp->uval, u_tag_arms, NULL));
|
||||
}
|
||||
|
||||
/*
|
||||
* xdr_found_dev XDR encodes/decodes the found_dev struct
|
||||
*/
|
||||
xdr_found_dev(xdrs, pd)
|
||||
XDR *xdrs;
|
||||
struct found_dev *pd;
|
||||
{
|
||||
if (!xdr_wrapstring(xdrs, &pd->device_name))
|
||||
return(0);
|
||||
if (!xdr_int(xdrs, &pd->unit))
|
||||
return(0);
|
||||
if (!xdr_u_tag(xdrs, &pd->u_tag))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* xdr_f_devs XDR encodes/decodes the f_devs struct
|
||||
*/
|
||||
xdr_f_devs(xdrs, pds)
|
||||
XDR *xdrs;
|
||||
struct f_devs *pds;
|
||||
{
|
||||
if (!xdr_int(xdrs, &pds->cputype))
|
||||
return(0);
|
||||
if (!xdr_wrapstring(xdrs, &pds->cpuname))
|
||||
return(0);
|
||||
return(xdr_array(xdrs, &pds->found_dev, &pds->num, MAXDEVS,
|
||||
sizeof(struct found_dev), xdr_found_dev));
|
||||
}
|
||||
Reference in New Issue
Block a user