aboutsummaryrefslogtreecommitdiffstats
path: root/ncpd/packet.h
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>1999-06-29 02:23:31 +0000
committerFritz Elfert <felfert@to.com>1999-06-29 02:23:31 +0000
commit6ab1aa5f2156ef781da6e1b57a183825b88bef9a (patch)
tree76d2b37e54731e68c9855e5658ac18558a369313 /ncpd/packet.h
parentf3e248b6e75c7ce5beda577f5712915417313b0a (diff)
downloadplptools-6ab1aa5f2156ef781da6e1b57a183825b88bef9a.tar.gz
plptools-6ab1aa5f2156ef781da6e1b57a183825b88bef9a.tar.bz2
plptools-6ab1aa5f2156ef781da6e1b57a183825b88bef9a.zip
Initial import
Diffstat (limited to 'ncpd/packet.h')
-rw-r--r--ncpd/packet.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/ncpd/packet.h b/ncpd/packet.h
new file mode 100644
index 0000000..cd02513
--- /dev/null
+++ b/ncpd/packet.h
@@ -0,0 +1,43 @@
+#ifndef _packet_h
+#define _packet_h
+
+#include <stdio.h>
+
+#include "bool.h"
+class psiEmul;
+class bufferStore;
+class IOWatch;
+
+class packet {
+ public:
+ packet(const char *fname, int baud, IOWatch &iow, bool verbose = false);
+ ~packet();
+ void send(unsigned char type, const bufferStore &b);
+ bool get(unsigned char &type, bufferStore &b);
+
+ private:
+ bool terminated();
+ void addToCrc(unsigned short a, unsigned short *crc);
+ void opByte(unsigned char a);
+ void realWrite();
+
+ unsigned short crcOut;
+ unsigned short crcIn;
+ unsigned char *inPtr;
+ unsigned char *outPtr;
+ unsigned char *endPtr;
+ unsigned char *inBuffer;
+ unsigned char *outBuffer;
+ bufferStore rcv;
+ int inLen;
+ int outLen;
+ int termLen;
+ int fd;
+ bool verbose;
+ bool esc;
+ char *devname;
+ int baud;
+ IOWatch &iow;
+};
+
+#endif