diff options
Diffstat (limited to 'ncpd/packet.h')
-rw-r--r-- | ncpd/packet.h | 43 |
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 |