summaryrefslogtreecommitdiffstats
path: root/ax25io.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-04-21 09:15:52 +0200
committerRalf Baechle <ralf@linux-mips.org>1999-04-21 09:15:52 +0200
commit5c8a43ce348cdac4fac0a6ee470342ff7dab3a64 (patch)
treed72fee9ca8a12695bec247fa64288703ebf8aa27 /ax25io.h
parent60368d2e0bd1a81c64b1a30b0819232866ccedb4 (diff)
Import ax25-lib 0.0.2 from tarballax25-lib-0.0.2
Diffstat (limited to 'ax25io.h')
-rw-r--r--ax25io.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/ax25io.h b/ax25io.h
new file mode 100644
index 0000000..a067670
--- /dev/null
+++ b/ax25io.h
@@ -0,0 +1,78 @@
+#ifndef _AX25IO_H
+#define _AX25IO_H
+
+#ifdef HAVE_ZLIB_H
+#include <zlib.h>
+#endif
+
+#define AXBUFLEN 4096
+
+typedef struct ax25io_s {
+ int ifd; /* stdin socket index */
+ int ofd; /* stdout socket index */
+ char eol[4]; /* end-of-line sequence */
+ int eolmode; /* end-of-line translation on/off */
+ int telnetmode; /* telnet option negotiation on/off */
+ int tn_echo; /* will/wont echo */
+ int tn_linemode; /* will/wont linemode */
+ int size; /* size of the packet in input buffer */
+ int paclen; /* paclen */
+ unsigned char ibuf[AXBUFLEN]; /* input buffer */
+ unsigned char obuf[AXBUFLEN]; /* output buffer */
+ int iptr; /* input pointer */
+ int optr; /* output pointer */
+
+#ifdef HAVE_ZLIB_H
+ int compr; /* compression on/off */
+ int z_error; /* "(de)compression error" flag */
+ unsigned char char_buf; /* temporary character buffer */
+ z_stream zin; /* decompressor structure */
+ z_stream zout; /* compressor structure */
+#endif
+
+ struct ax25io_s *next; /* linked list pointer */
+} ax25io;
+
+#define EOLMODE_TEXT 0
+#define EOLMODE_BINARY 1
+#define EOLMODE_GW 2
+
+#define AX25_EOL "\r"
+#define NETROM_EOL AX25_EOL
+#define ROSE_EOL AX25_EOL
+#define INET_EOL "\r\n"
+#define UNSPEC_EOL "\n"
+#define INTERNAL_EOL 021271
+
+#define ZERR_STREAM_END 1024
+#define ZERR_STREAM_ERROR 1025
+#define ZERR_DATA_ERROR 1026
+#define ZERR_MEM_ERROR 1027
+#define ZERR_BUF_ERROR 1028
+#define ZERR_UNKNOWN 1029
+
+extern ax25io *axio_init(int, int, int, char *);
+extern void axio_end(ax25io *);
+extern void axio_end_all(void);
+
+extern int axio_compr(ax25io *, int);
+extern int axio_paclen(ax25io *, int);
+extern int axio_eolmode(ax25io *, int);
+extern int axio_cmpeol(ax25io *, ax25io *);
+extern int axio_tnmode(ax25io *, int);
+extern int axio_flush(ax25io *);
+
+extern int axio_getc(ax25io *);
+extern int axio_putc(int, ax25io *);
+
+extern char *axio_getline(ax25io *);
+extern char *axio_gets(char *, int, ax25io *);
+extern int axio_puts(const char *, ax25io *);
+
+extern int axio_printf(ax25io *, const char *, ...);
+
+extern void axio_tn_do_linemode(ax25io *);
+extern void axio_tn_will_echo(ax25io *);
+extern void axio_tn_wont_echo(ax25io *);
+
+#endif _AX25IO_H