summaryrefslogtreecommitdiffstats
path: root/ax25/axgetput/proto_bin.h
diff options
context:
space:
mode:
authorThomas Osterried <thomas@osterried.de>2006-12-10 19:12:59 +0000
committerThomas Osterried <thomas@osterried.de>2006-12-10 19:12:59 +0000
commitacdb41fa04d40571ee4d84e2607515643d410671 (patch)
treeacf58efd52c6c8360d53f8e57795080089aa4e8f /ax25/axgetput/proto_bin.h
parenta824b0ba5e756660406a8a4648f60692a5cdce30 (diff)
axgetput (bget, bput, ..) for 8bit clean up/download from an
axspawn(8) login session. Initial checkin. Import from http://x-berg.in-berlin.de/cgi-bin/viewcvs.cgi/ampr/axgetput/
Diffstat (limited to 'ax25/axgetput/proto_bin.h')
-rw-r--r--ax25/axgetput/proto_bin.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/ax25/axgetput/proto_bin.h b/ax25/axgetput/proto_bin.h
new file mode 100644
index 0000000..41c43e0
--- /dev/null
+++ b/ax25/axgetput/proto_bin.h
@@ -0,0 +1,34 @@
+/* @(#) $Id: proto_bin.h,v 1.1 2006/12/10 19:12:59 dl9sau Exp $ */
+
+/*
+ * (c) 2002 Thomas Osterried DL9SAU <thomas@x-berg.in-berlin.de>
+ * License: GPL. See http://www.fsf.org/
+ * Sources: http://x-berg.in-berlin.de/cgi-bin/viewcvs.cgi/ampr/axgetput/
+ */
+
+#ifndef PROTO_BIN_H
+#define PROTO_BIN_H
+
+extern int bget(void);
+extern int bput(void);
+
+static const char bin_s_on_ok[] = "#OK#\r";
+static const int bin_len_ok = sizeof(bin_s_on_ok)-1;
+static const char bin_s_on_no[] = "#NO#\r";
+static const int bin_len_no = sizeof(bin_s_on_no)-1;
+static const char bin_s_on_abort[] = "#ABORT#\r";
+static const int bin_len_abort = sizeof(bin_s_on_abort)-1;
+
+#define bin_send_no_on_sig "\r#NO#\r"
+#define bin_send_abort_on_sig "\r#ABORT#\r"
+
+#define IS_BIN_NO(s, len) \
+ len == bin_len_no && !memcmp(s, bin_s_on_no, bin_len_no)
+
+#define IS_BIN_OK(s, len) \
+ len == bin_len_ok && !memcmp(s, bin_s_on_ok, bin_len_ok)
+
+#define IS_BIN_ABORT(s, len) \
+ len == bin_len_abort && !memcmp(s, bin_s_on_abort, bin_len_abort)
+
+#endif /* PROTO_BIN_H */