/*ProfiPacket - packet radio terminal program
  Copyright (C) 1999  Alexander Feigl

  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.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

  Author:

  Alexander Feigl
  Burachstraße 51

  D-88250 Weingarten

  Mail : Alexander.Feigl@gmx.de
*/

#ifndef QSO_INCLUDE

#define QSO_INCLUDE



#ifdef AmigaOS

#include <dos/dos.h>
#include <exec/lists.h>

#else /*AmigaOS*/

#include "amigaemu.h"

#endif /*AmigaOS*/

#include "SID.h"
#include "GUI/MUI/Editor.h"

struct V1Serv 
 {
  struct QSO    *ThisQSO;
  long int       Channel;
  struct V1Serv *OldServer;
  void          *QSOBase;
 };

struct QSO
 {
     unsigned long  CallSet;
     unsigned long  HardwareUnit;
     unsigned long  HardwareChannel;
     unsigned long  HardwarePort;
     unsigned long  SkipChannel;
     unsigned char  MyCall[10];
     unsigned long  LinkStatus;
     unsigned long  NotDisplayedLink;
     unsigned long  NotDisplayed;
     unsigned long  NotSent;
     unsigned long  Unack;
     unsigned long  Tries;
     unsigned char  HardCall[10];
     unsigned char  HardPath[8][10];
     unsigned short StartupFlag;
     unsigned long  StartupMsg;
     unsigned char  UpdateFlag;
     unsigned char  Pad0[3];
     struct List    ChannelInPackets;
     unsigned char  Pad3[2];
     struct List    ChannelOutPackets;
     unsigned char  Pad4[2];
     unsigned short SelfConnect;
     unsigned long  ChannelUpdate;
     unsigned char  Call[10];
     unsigned char  Path[8][10];
     unsigned char  Name[32];
     struct V1Serv *Server;
     unsigned long  IncomingMessage;
     void           *Pad1;

#ifdef AmigaOS
     struct ANSIStream EditInStream;
     struct ANSIStream EditOutStream;
     struct ANSIStream PacketOutStream;
#endif /*AmigaOS*/


     unsigned char  XPDecompress[260];

     struct List       ServerBuffer;       /* Spy is incommon */
     unsigned char     Pad2[2];
     unsigned char     CurrentDir[196];
     unsigned char     FileName[256];
     BPTR              FileID;
     unsigned long     TransferMode;
     struct DateStamp  TransferStart;
       signed long     TransferElapsed;
       signed long     TransferEstimated;
       signed long     TransferTotal;
       signed long     TransferPercent;
       signed long     TransferRBytes;
       signed long     TransferBytes;
       signed long     TransferTotBytes;
       signed long     TransferBaud;
     struct DateStamp  TransferFileDate;
     unsigned long     TransferCRC;
     unsigned long     OnlyPrepared;
     unsigned long     WriteMode;

     struct User      *User;
     unsigned long     CompressedMode;
     unsigned long     PasswordRemote;
     unsigned long     SendPrompt;
     struct DateStamp  ConnectTime;
     struct DateStamp  ActivityTime;

     unsigned long  SysopMode;
     unsigned long  PasswordTemporary[16];
     unsigned long  TransferOffset;
     void           *PrPaPointer;
     unsigned long  PrPaLength;
     unsigned long  PrPaType;
     unsigned long  PrPaVersion;
     unsigned long  PrPaReceived;
     unsigned long  PrivateDir;
     unsigned char  CipherInputBuffer[1536];
     unsigned char  CipherOutputBuffer[1536];
     struct StationID StationID;
     unsigned long  ForwardFlag;
     void           *XPKLibrary;
     unsigned char  XPKType[4];
     unsigned long  XPKEfficiency;
     unsigned long  XPKSublibrary;
     struct DateStamp  LastLogin;
     unsigned char  XPacketKey[128];
     void           *XPacketDelay;
 };

#define COMPRESSFLAG_SEND_SPCOMPRESS 0
#define COMPRESSFLAG_RECEIVE_SPCOMPRESS 1
#define COMPRESSFLAG_SEND_ENCRYPTED 2
#define COMPRESSFLAG_RECEIVE_ENCRYPTED 3
#define COMPRESSFLAG_SEND_XPCOMPRESS 4
#define COMPRESSFLAG_RECEIVE_XPCOMPRESS 5
#define COMPRESSFLAG_SPECIAL_XPCOMPRESS 6
#define COMPRESSFLAG_XPTABLE_COMPLETE 7

struct Spy {
     unsigned long  Unused1;
     unsigned long  HardwareUnit;
       signed long  OtherReceive1;
     unsigned long  AutoCompXPFollow;
     unsigned long  SkipChannel;
     unsigned char  MyCall[10];
     unsigned long  LinkStatus;
       signed long  ReceiveCount1;
       signed long  ReceiveCount2;
       signed long  InCollector1;
       signed long  InCollector2;
       signed long  OtherReceive2;
     unsigned char  HardCall[10];
     unsigned char  HardPath[8][10];
     unsigned short Unused8;
     unsigned long  CompressedMode;
     unsigned long  AutoCompressFollow;
       signed short CollectorLength1[8];
       signed short CollectorCRC1[8];
     unsigned short Unused13;
     unsigned long  Port;
     unsigned char  Call[10];
     unsigned char  Path[8][10];
     unsigned short CollectorLength2[8];
     unsigned short CollectorCRC2[8];
     unsigned char *FrameCollector2;
     unsigned long  IncomingMessage;
     unsigned char *FrameCollector;


#ifdef AmigaOS
     struct ANSIStream EditInStream;
     struct ANSIStream EditOutStream;
     struct ANSIStream PacketOutStream;
#endif /*AmigaOS*/

     unsigned char XPDecompress1[260];
     unsigned char XPDecompress2[260];

 };

#endif
