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

89 lines
2.0 KiB
C
Raw Normal View History

2004-01-14 21:06:49 +00:00
#ifndef _BINKPNEW_H
#define _BINKPNEW_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)
| +---- data block size / msg's argument size
| |
7 6543210 76543210
+-+-------+--------+--- ... ---+
| | HI LO | | -- data block / msg's argument
+-+-------+--------+--- ... ---+
*/
/* 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 */
#define BINKP_TIMEOUT 180 /* Global timeout value */
#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
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 */
} 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