// $Id: eprotocol.h,v 1.10 2011/05/17 23:01:34 lpoulsen Exp $
//
// Copyright (c) 2003 by AFAR Communications Inc, Santa Barbara, CA 93117, USA
// Copyright (C) 2001 Wi_LAN Technologies, Inc
//
// $Log: eprotocol.h,v $
// Revision 1.10  2011/05/17 23:01:34  lpoulsen
// Be sure to wait for ACK after we send data (by clearing the Receive_ACK
//    event before transmitting, so that we know if it is set we received
//    an ack after we sent this data packet).
//
// Revision 1.9  2008/08/05 23:58:37  lpoulsen
// User interface updates.
//
// Revision 1.8  2008/05/31 00:35:09  lpoulsen
// Econ 4.x preview - now with command shell
//
// Revision 1.7  2003/08/22 01:46:32  lpoulsen
// Make econ compile on Linux again.
//
// Revision 1.6  2003/08/21 23:46:51  lpoulsen
// Improved handling of -r option to allow selection by name
// Miscellaneous minor cleanup
//
// Revision 1.5  2002/05/15 00:22:16  mourlouk
// Ok, finished with the linux compilation
//
// Revision 1.4  2002/05/14 23:44:01  mourlouk
// more minor changes ...
//
// Revision 1.3  2002/04/19 19:04:44  mourlouk
// Release 1.15 - It fixes a bug that was introduced in version 1.13 
// (econ unable to properly read multiple MAC addresses)
//
// Revision 1.2  2001/10/30 01:07:45  lpoulsen
// Add "module ID" statement, audit trail generator and copyright line
// Remove "win_or_linux.h" and use a -D in Linux makefile instead.
//
//
#define TXT_enableDiagnosticMessages "DEBUG"
#define TXT_howToWritePrintFile      "PRINT_MODE"
#define TXT_automaticRadioSelection  "AUTO_SELECT"
#define TXT_showInputPercentage      "SHOW_PROGRESS"
#define TXT_MAC_TAG                  "MAC"

#define SIMULTANEOU_READS       10
#define MAX_ETHERNET_FRAME_SIZE 1514

// timeouts are measured in millisecs
#define ACK_TIMEOUT         300
#define FILE_TIMEOUT       2000
#define PROMPT_TIMEOUT      500
#define KEEP_ALIVE_THRESH  5000
#define CONNECTION_ESTABLISHMENT_TIMEOUT  5000 
#define DISCOVERY_RETRANSMISSION_INTERVAL 700
#define SESSION_IDLE_TIMEOUT              7200000  // a session can remain idle
                                                  // for up to 2 hours - of 
                                                 // course it will time out
                                                // much faster on the server 
                                               // side - so this constant
                                              // here is equivalent to infinity
#define NUM_OF_RETRANSMISSIONS 11
#define PROTO_POSITION         48


#define INVALID_PACKET  -1
#define INVALID_SESSION -2
#define INVALID_ACK     -3
#define INVALID_PDU     -4
#define INTERNAL_ERROR  -5
#define CLOSING_SESSION -6
#define INVALID_VALUE   -7
#define INVALID_PARAMETER -8

#define TERMINATE_GRACEFULLY 29

#define SIZE_OF_ETHER_HEADER 14 // sizeof(epkt_header);
#define SIZE_OF_ECON_HEADER  26 // sizeof(econ_header);
#define PAYLOAD_OFFSET       40 // size_of_ether_header+size_of_econ_header;

extern unsigned char econ_snap_prefix[];
extern const byte    client_protocol_version;
extern boolean       discovery_phase;
extern boolean       FREEZE_HEADER;
extern boolean       FileRetransmissionRequired;

char                *LastReceivedPacketBuf;
// End
