source: trunk/include/ws_clientII_no_location.h @ 5054

Revision 4855, 6.0 KB checked in by ilya, 6 years ago (diff)

Added ws_clientII_no_location.h from version 6 of EW to support no location versions of executables

Line 
1
2/*
3 *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE
4 *   CHECKED IT OUT USING THE COMMAND CHECKOUT.
5 *
6 *    $Id: ws_clientII.h,v 1.1.1.1 2005/07/14 19:57:46 paulf Exp $
7 *
8 *    Revision history:
9 *     $Log: ws_clientII.h,v $
10 *     Revision 1.1.1.1  2005/07/14 19:57:46  paulf
11 *     Local ISTI CVS copy of EW v6.3
12 *
13 *     Revision 1.2  2000/09/29 19:25:45  alex
14 *     fixed comment re endtime=0 in getAscii call. Alex
15 *
16 *     Revision 1.1  2000/02/14 20:05:54  lucky
17 *     Initial revision
18 *
19 *
20 */
21
22/* This is the include file for the WaveServerIV clientII routines
23and associated structures */
24
25/* 5/17/98: increased wsREPLEN; PNL */
26
27#ifndef WS_CLIENT
28#define WS_CLIENT
29
30/* Return codes used by routines in ws_client.c
31 * Errors (negative values) indicate a problem that will affect other
32 * transactions at least with the same server.
33 * Warnings (positive values) indicate some problem with a transaction that
34 * should not affect other transactions.
35*********************************************/
36#define WS_WRN_FLAGGED               1   /* reply flagged by server */
37#define WS_ERR_NONE                  0   /* All ok */
38#define WS_ERR_INPUT                -1   /* Faulty or missing input */
39#define WS_ERR_EMPTY_MENU           -2   /* Unexpected empty menu */
40#define WS_ERR_SERVER_NOT_IN_MENU   -3   /* Server should have been in menu */
41#define WS_ERR_SCN_NOT_IN_MENU      -4   /* SCN not found in menu */
42#define WS_ERR_BUFFER_OVERFLOW      -5   /* reply truncated at buffer limit */
43#define WS_ERR_MEMORY               -6   /* Couldn't allocate memory */
44#define WS_ERR_PARSE                -7   /* Couldn't parse server's reply */
45/* socket related errors: */
46#define WS_ERR_TIMEOUT             -10   /* Socket transaction timed out */
47#define WS_ERR_BROKEN_CONNECTION   -11   /* An open connection was broken */
48#define WS_ERR_SOCKET              -12   /* problem setting up socket */
49#define WS_ERR_NO_CONNECTION       -13   /* Could not make connection */
50
51
52/* Trace Request structure
53 *************************/
54/* the structure below is the 'form' which must be filled out to request a
55   snippet of trace data. The requester fills out the first part, and the
56   client routines fill out the second part. */
57typedef struct
58{
59        /* the request portion */
60        char    sta[7];         /* Site name */
61        char    chan[9];        /* Component/channel code */
62        char    net[9];         /* Network name */
63        short   pinno;          /* Pin number that maps to sta/net/chan */
64        double  reqStarttime;   /* requested starttime - seconds since 1970 */ 
65        double  reqEndtime;     /* requested endtime - seconds since 1970 */
66        int     partial;        /* 1=> I'll accept partial data;
67                                   0=> all or nothing
68                                *** NOT IMPLEMENTED ***                 */     
69        char*   pBuf;           /* pointer to user supplied buffer for trace */
70        unsigned long   bufLen; /* length of above */
71        long    timeout;        /* seconds after which we must return */
72        long    fill;           /* ASCII only: fill value for gaps in trace */
73
74        /* the reply portion */
75        char    retFlag;        /* return flag (if any) from wave server */
76        double  waitSec;        /* seconds to wait until requested data will be
77                                   available in the wave server.
78                                   *** NOT IMPLEMENTED */
79        double actStarttime;    /* actual start time of supplied trace */
80        double actEndtime;      /* actual end   time of supplied trace
81                                   *** NOT IMPLEMENTED in wsGetTraceAscii() */
82        long   actLen;          /* actual length in bytes */
83        double samprate;        /* nominal sampling rate - samples per second */
84       
85}
86TRACE_REQ;
87
88#define wsADRLEN    16    /* length for ip and port adrress strings */
89#define wsREQLEN   256    /* length for MENU request */
90#define wsREPLEN  20480   /* length for reply to MENU request(up to 256 SCNs) */
91
92
93typedef struct _WS_PSCN_REC *WS_PSCN;
94typedef struct _WS_PSCN_REC
95{
96  char    sta[7];         /* Site name */
97  char    chan[9];        /* Component/channel code */
98  char    net[9];         /* Network name */
99  short   pinno;          /* Pin number that maps to sta/net/chan */
100  double  tankStarttime;  /* starttime for this SCN */ 
101  double  tankEndtime;    /* endtime for this SCN */   
102 
103  WS_PSCN next;
104} WS_PSCN_REC;
105
106typedef struct _WS_MENU_REC *WS_MENU;
107typedef struct _WS_MENU_REC
108{
109  char    addr[wsADRLEN];
110  char    port[wsADRLEN]; 
111  int     sock;
112
113  WS_PSCN pscn;
114  WS_MENU next;
115} WS_MENU_REC;
116
117typedef volatile struct
118{
119  WS_MENU head;
120  WS_MENU tail;
121} WS_MENU_QUEUE_REC;
122
123/* to setup and connect to a list of servers, and get SCN menu of each server
124 ****************************************************************************/
125int wsAppendMenu( char* , char*, WS_MENU_QUEUE_REC*, int );
126
127/* to close all server sockets and deallocate the menus
128 ******************************************************/
129void wsKillMenu( WS_MENU_QUEUE_REC* );
130
131/* to deallocate a PSCN list
132**************************************/
133void wsKillPSCN( WS_PSCN );
134
135/* To open a connection to a server
136***********************************/
137int wsAttachServer( WS_MENU, int );
138
139/* to close a single server socket after an error
140 ************************************************/
141void wsDetachServer( WS_MENU );
142
143/* wsGetServerPSCN: Return the pscn list for this server from the menu queue *
144 *****************************************************************************/
145int wsGetServerPSCN( char*, char*, WS_PSCN*, WS_MENU_QUEUE_REC* );
146
147/* to retrieve the binary trace snippet specified in the structure TRACE_REQ
148 ***************************************************************************/
149int wsGetTraceBin( TRACE_REQ*, WS_MENU_QUEUE_REC*, int );
150
151/* to retrieve the ASCII trace snippet specified in the structure TRACE_REQ
152 **************************************************************************/
153int wsGetTraceAscii( TRACE_REQ*, WS_MENU_QUEUE_REC*, int );
154
155/* return the PSCN list for this server
156***************************************/
157int wsSearchSCN( TRACE_REQ*, WS_MENU*, WS_PSCN*, WS_MENU_QUEUE_REC* );
158
159/* turn debugging on or off for the ws_clientII routines.
160**********************************************************/
161int setWsClient_ewDebug(int debug);
162
163
164#endif /* WS_CLIENT */
Note: See TracBrowser for help on using the repository browser.