From acdb41fa04d40571ee4d84e2607515643d410671 Mon Sep 17 00:00:00 2001 From: Thomas Osterried Date: Sun, 10 Dec 2006 19:12:59 +0000 Subject: 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/ --- ax25/axgetput/proto_bin.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ax25/axgetput/proto_bin.h (limited to 'ax25/axgetput/proto_bin.h') 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 + * 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 */ -- cgit v1.2.3