isisclient.h
Go to the documentation of this file.00001
#ifndef ISISCLIENT_H
00002
#define ISISCLIENT_H
00003
00071
00072
00073
#include <stdio.h>
00074
#include <stdlib.h>
00075
#include <unistd.h>
00076
#include <ctype.h>
00077
#include <string.h>
00078
#include <time.h>
00079
#include <math.h>
00080
#include <errno.h>
00081
#include <termios.h>
00082
#include <fcntl.h>
00083
#include <sys/time.h>
00084
#include <sys/times.h>
00085
#include <sys/file.h>
00086
#include <sys/types.h>
00087
#include <sys/stat.h>
00088
#include <arpa/inet.h>
00089
#include <netinet/in.h>
00090
#include <sys/socket.h>
00091
#include <sys/types.h>
00092
#include <netdb.h>
00093
00094
00095
00096 #define ISIS_MSGSIZE 2048
00097 #define ISIS_NODESIZE 9
00098
00099
00100
00101 #define LONG_STR_SIZE 4096
00102 #define MED_STR_SIZE 256
00103 #define BIG_STR_SIZE 512
00104 #define SHORT_STR_SIZE 32
00105
00106
00107
00108
00109
00110
00119 typedef struct client_info
00120 {
00121
00122 int useISIS;
00123 char isisID[
ISIS_NODESIZE];
00124 char isisHost[
MED_STR_SIZE];
00125 int isisPort;
00126 sockaddr_in
isisAddr;
00127
00128
00129 int FD;
00130 char ID[
ISIS_NODESIZE];
00131 char Host[
MED_STR_SIZE];
00132 int Port;
00133
00134
00135 char remHost[
MED_STR_SIZE];
00136 int remPort;
00137 sockaddr_in
remAddr;
00138
00139
00140 char rcFile[
MED_STR_SIZE];
00141 int KeepGoing;
00142 int isVerbose;
00143 int Debug;
00144 int doLogging;
00145 char logFile[
MED_STR_SIZE];
00146
00147 }
isisclient_t;
00148
00149
00150
00151
00152
00153
00168
00169
00170 enum IMPv2_MsgType {
00171
REQ,
00172
EXEC,
00173
STATUS,
00174
DONE,
00175
ERROR,
00176
WARNING,
00177
FATAL
00178 };
00179
00180 typedef enum IMPv2_MsgType MsgType;
00181
00182
00183
00184
00185
00186
00187
00188
00189
char *
ISISMessage(
char *fromID,
char *destID, MsgType msgtype,
char *msgbody);
00190
int SplitMessage(
char *msgstr,
char *fromID,
char *destID,
00191 MsgType *msgtype,
char *msgbody);
00192
00193
00194
00195
int InitISISServer(
isisclient_t *);
00196
int OpenClientSocket(
isisclient_t *);
00197
int ReadClientSocket(
isisclient_t *,
char *);
00198
int SendToISISServer(
isisclient_t *,
char *);
00199
int ReplyToRemHost(
isisclient_t *,
char *);
00200
void CloseClientSocket(
isisclient_t *);
00201
00202
00203
00204
int OpenSerialPort(
char *);
00205
void CloseSerialPort(
int);
00206
int SetSerialPort(
int,
int,
int,
int,
int);
00207
int WriteSerialPort(
int,
char *);
00208
int ReadSerialPort(
int,
char *);
00209
void FlushSerialPort(
int,
int);
00210
00211
00212
00213
void LeftStr(
char *substr,
char *str,
int nchar);
00214
void RightStr(
char *substr,
char *str,
int nchar);
00215
void MidStr(
char *substr,
char *str,
int start,
int nchar);
00216
void SubStr(
char *substr,
char *str,
int first,
int last);
00217
void UpperCase(
char *str);
00218
void GetArg(
char *cmdstr,
int argnum,
char *argstr);
00219
char *
UTCDate(
void);
00220
char *
UTCTime(
void);
00221
char *
ISODate(
void);
00222
char *
UTCDateTag(
void);
00223
char *
GetFineTime(
void);
00224
double SysTimestamp(
void);
00225
int MilliSleep(
long);
00226
00227
#endif // ISISCLIENT_H
00228
00229
Generated on Thu Jul 22 20:28:28 2004 for ISIS Client API by
1.3.7