This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
deb-mbse/mbcico/binkp.h

102 lines
2.6 KiB
C
Raw Normal View History

2004-01-25 13:42:05 +00:00
#ifndef _BINKP_H
#define _BINKP_H
2001-08-17 05:46:24 +00:00
2003-12-27 16:51:42 +00:00
2003-09-07 20:25:33 +00:00
/* $Id$ */
2001-08-17 05:46:24 +00:00
/*
binkp's frames:
+---------------------- 0=data block, 1=message(command)
2004-01-25 13:42:05 +00:00
| +----- data block size / msg's argument size
2001-08-17 05:46:24 +00:00
| |
2004-01-25 13:42:05 +00:00
7 6543210 76543210
2001-08-17 05:46:24 +00:00
+-+-------+--------+--- ... ---+
| | HI LO | | -- data block / msg's argument
+-+-------+--------+--- ... ---+
2004-01-25 13:42:05 +00:00
binkp's frames in PLZ mode:
+---------------------- 0=data block, 1=message(command)
| +-------------------- 0=standard block, 1=zlib compressed block
| | +---- data block size / msg's argument size
| | |
7 6 543210 76543210
+-+-+------+--------+--- ... ---+
| | | HI LO | | -- data block / msg's argument
+-+-+------+--------+--- ... ---+
2001-08-17 05:46:24 +00:00
*/
/* protocol version */
2003-09-07 20:25:33 +00:00
#define PRTCLNAME "binkp"
2004-01-14 21:06:49 +00:00
#define PRTCLVER "1.1"
#define PRTCLOLD "1.0"
2001-08-17 05:46:24 +00:00
#define MAX_BLKSIZE 0x7fff /* Don't change! */
#define BLK_HDR_SIZE 2 /* 2 bytes header */
2005-07-03 19:00:52 +00:00
#define BINKP_TIMEOUT 300 /* Global timeout value */
2001-08-17 05:46:24 +00:00
#define SND_BLKSIZE 4096 /* Blocksize transmitter */
#define MM_NUL 0 /* Ignored by binkp (data optionally logged) */
#define MM_ADR 1 /* System aka's */
#define MM_PWD 2 /* Password */
#define MM_FILE 3
2003-09-07 20:25:33 +00:00
#define MM_OK 4 /* The password is ok */
2001-08-17 05:46:24 +00:00
#define MM_EOB 5 /* End-of-batch (data ignored) */
#define MM_GOT 6 /* File received */
#define MM_ERR 7 /* Misc errors */
#define MM_BSY 8 /* All AKAs are busy */
#define MM_GET 9 /* Get a file from offset */
#define MM_SKIP 10 /* Skip a file */
#define MM_MAX 10
#define MM_DATA 0xff
#define BINKP_DATA_BLOCK 0x0000
#define BINKP_CONTROL_BLOCK 0x8000
2004-01-25 13:42:05 +00:00
#define BINKP_PLZ_BLOCK 0x4000
2004-01-25 14:51:44 +00:00
#define BINKP_ZIPBUFLEN (((BINKP_PLZ_BLOCK * 11) / 10) + 12)
2001-08-17 05:46:24 +00:00
typedef struct _binkp_frame {
unsigned short header;
unsigned char id;
unsigned char *data;
} binkp_frame;
/*
* Linked list of files to send and responses from the receiver.
*/
typedef struct _binkp_list {
struct _binkp_list *next;
char *remote; /* Remote filename */
char *local; /* Local filename */
int state; /* File state */
int get; /* Boolean GET flag */
off_t size; /* File size */
time_t date; /* File date & time */
off_t offset; /* Start offset */
int compress; /* Compression state */
2001-08-17 05:46:24 +00:00
} binkp_list;
2004-01-14 21:06:49 +00:00
/*
* Linked FIFO list of received commands to be processed by the transmitter.
*/
typedef struct _the_queue {
struct _the_queue *next;
int cmd; /* M_xxx command id */
char *data; /* Frame data in the queue */
} the_queue;
int binkp(int);
2003-12-27 16:51:42 +00:00
#endif