aboutsummaryrefslogtreecommitdiff
path: root/SrcShared/SLP.h
diff options
context:
space:
mode:
Diffstat (limited to 'SrcShared/SLP.h')
-rw-r--r--SrcShared/SLP.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/SrcShared/SLP.h b/SrcShared/SLP.h
new file mode 100644
index 0000000..4546364
--- /dev/null
+++ b/SrcShared/SLP.h
@@ -0,0 +1,74 @@
+/* -*- mode: C++; tab-width: 4 -*- */
+/* ===================================================================== *\
+ Copyright (c) 1999-2001 Palm, Inc. or its subsidiaries.
+ All rights reserved.
+
+ This file is part of the Palm OS Emulator.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+\* ===================================================================== */
+
+#ifndef SLP_H_
+#define SLP_H_
+
+#include "EmPalmStructs.h" // SlkPktHeaderType, SysPktBodyType, LAS
+#include "EmTypes.h" // ErrCode
+
+class CSocket;
+
+class SLP
+{
+ public:
+ SLP (void);
+ SLP (CSocket*);
+ SLP (const SLP&);
+ ~SLP (void);
+
+ static void EventCallback (CSocket* s, int event);
+ ErrCode HandleDataReceived (void);
+
+ ErrCode HandleNewPacket (void);
+ ErrCode SendPacket (const void* body, long size);
+
+ Bool HavePacket (void) const;
+ long GetPacketSize (void) const;
+
+ const EmProxySlkPktHeaderType& Header (void) const;
+ const EmProxySysPktBodyType& Body (void) const;
+ const EmProxySlkPktFooterType& Footer (void) const;
+
+ EmProxySlkPktHeaderType& Header (void);
+ EmProxySysPktBodyType& Body (void);
+ EmProxySlkPktFooterType& Footer (void);
+
+ void DeferReply (Bool);
+
+ Bool HasSocket (CSocket* s) { return s == fSocket; }
+
+ private:
+ void SetHeader (void);
+ void SetBody (void);
+ void SetFooter (void);
+
+ SlkPktHeaderChecksum CalcHdrChecksum (SlkPktHeaderChecksum start,
+ UInt8* bufP, Int32 count);
+
+ Bool LogData (void);
+ Bool LogFlow (void);
+
+ private:
+ CSocket* fSocket;
+
+ EmProxySlkPktHeaderType fHeader;
+ EmProxySysPktBodyType fBody;
+ EmProxySlkPktFooterType fFooter;
+
+ Bool fHavePacket;
+ Bool fSendReply;
+};
+
+
+#endif // SPL_H_