pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/comms/tn3270/files Import tn3270 from base as of 20100...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ac9a2e4d1b36
branches:  trunk
changeset: 569709:ac9a2e4d1b36
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Sun Jan 17 01:33:16 2010 +0000

description:
Import tn3270 from base as of 20100114, just before its removal. This
is just the sources, and they're unchanged from base except that the
rcsids have been preserved. The package will be along shortly.

diffstat:

 comms/tn3270/files/Makefile                      |     6 +
 comms/tn3270/files/Makefile.inc                  |    14 +
 comms/tn3270/files/api/api.order                 |     8 +
 comms/tn3270/files/api/api_bsd.c                 |   295 ++
 comms/tn3270/files/api/api_exch.c                |   446 +++
 comms/tn3270/files/api/api_exch.h                |   168 +
 comms/tn3270/files/api/apilib.c                  |   435 +++
 comms/tn3270/files/api/apilib.h                  |    58 +
 comms/tn3270/files/api/asc_ebc.c                 |   116 +
 comms/tn3270/files/api/asc_ebc.h                 |    50 +
 comms/tn3270/files/api/astosc.c                  |   106 +
 comms/tn3270/files/api/astosc.h                  |    57 +
 comms/tn3270/files/api/dctype.c                  |   249 +
 comms/tn3270/files/api/dctype.h                  |    53 +
 comms/tn3270/files/api/disp_asc.c                |    49 +
 comms/tn3270/files/api/disp_asc.h                |    42 +
 comms/tn3270/files/api/ebc_disp.c                |   112 +
 comms/tn3270/files/api/ebc_disp.h                |    37 +
 comms/tn3270/files/ascii/ascii.order             |     2 +
 comms/tn3270/files/ascii/default.map             |    75 +
 comms/tn3270/files/ascii/map3270.c               |   957 +++++++
 comms/tn3270/files/ascii/map3270.h               |    44 +
 comms/tn3270/files/ascii/mset.c                  |   419 +++
 comms/tn3270/files/ascii/state.h                 |    56 +
 comms/tn3270/files/ascii/termin.c                |   299 ++
 comms/tn3270/files/ctlr/3180.kbd                 |   178 +
 comms/tn3270/files/ctlr/3270pc.kbd               |   178 +
 comms/tn3270/files/ctlr/api.c                    |   778 +++++
 comms/tn3270/files/ctlr/api.h                    |   410 +++
 comms/tn3270/files/ctlr/ctlr.order               |     5 +
 comms/tn3270/files/ctlr/declare.h                |    58 +
 comms/tn3270/files/ctlr/function.c               |    53 +
 comms/tn3270/files/ctlr/function.h               |   165 +
 comms/tn3270/files/ctlr/hostctlr.h               |   221 +
 comms/tn3270/files/ctlr/inbound.c                |  1214 +++++++++
 comms/tn3270/files/ctlr/oia.c                    |    56 +
 comms/tn3270/files/ctlr/oia.h                    |   192 +
 comms/tn3270/files/ctlr/options.c                |   186 +
 comms/tn3270/files/ctlr/options.h                |    43 +
 comms/tn3270/files/ctlr/outbound.c               |   618 ++++
 comms/tn3270/files/ctlr/screen.h                 |   141 +
 comms/tn3270/files/ctlr/scrnctlr.h               |    47 +
 comms/tn3270/files/ctlr/unix.kbd                 |   180 +
 comms/tn3270/files/general/genbsubs.c            |   131 +
 comms/tn3270/files/general/general.h             |    52 +
 comms/tn3270/files/general/general.order         |     2 +
 comms/tn3270/files/general/globals.c             |    78 +
 comms/tn3270/files/general/globals.h             |   131 +
 comms/tn3270/files/general/vaxbsubs.s            |   101 +
 comms/tn3270/files/mset/Makefile                 |    30 +
 comms/tn3270/files/mset/map3270                  |  1028 +++++++
 comms/tn3270/files/mset/map3270.5                |   341 ++
 comms/tn3270/files/mset/mset.1                   |   189 +
 comms/tn3270/files/sys_curses/system.c           |   763 +++++
 comms/tn3270/files/sys_curses/telextrn.h         |    72 +
 comms/tn3270/files/sys_curses/terminal.h         |    80 +
 comms/tn3270/files/sys_curses/termout.c          |   948 +++++++
 comms/tn3270/files/telnet/commands.c             |  2906 ++++++++++++++++++++++
 comms/tn3270/files/telnet/defines.h              |    60 +
 comms/tn3270/files/telnet/externs.h              |   414 +++
 comms/tn3270/files/telnet/general.h              |    44 +
 comms/tn3270/files/telnet/libtelnet/genget.c     |   109 +
 comms/tn3270/files/telnet/libtelnet/misc-proto.h |    73 +
 comms/tn3270/files/telnet/libtelnet/misc.h       |    47 +
 comms/tn3270/files/telnet/main.c                 |   361 ++
 comms/tn3270/files/telnet/network.c              |   180 +
 comms/tn3270/files/telnet/ring.c                 |   340 ++
 comms/tn3270/files/telnet/ring.h                 |   105 +
 comms/tn3270/files/telnet/sys_bsd.c              |   740 +++++
 comms/tn3270/files/telnet/telnet.c               |  2651 ++++++++++++++++++++
 comms/tn3270/files/telnet/terminal.c             |   221 +
 comms/tn3270/files/telnet/tn3270.c               |   395 ++
 comms/tn3270/files/telnet/types.h                |    51 +
 comms/tn3270/files/telnet/utilities.c            |   925 +++++++
 comms/tn3270/files/tn3270/Makefile               |    87 +
 comms/tn3270/files/tn3270/tn3270.1               |   340 ++
 comms/tn3270/files/tools/Makefile                |     6 +
 comms/tn3270/files/tools/Makefile.inc            |    13 +
 comms/tn3270/files/tools/mkastods/Makefile       |     8 +
 comms/tn3270/files/tools/mkastods/mkastods.c     |    77 +
 comms/tn3270/files/tools/mkastosc/Makefile       |    12 +
 comms/tn3270/files/tools/mkastosc/mkastosc.c     |   165 +
 comms/tn3270/files/tools/mkdctype/Makefile       |     8 +
 comms/tn3270/files/tools/mkdctype/ectype.c       |   319 ++
 comms/tn3270/files/tools/mkdctype/ectype.h       |    54 +
 comms/tn3270/files/tools/mkdctype/mkdctype.c     |   105 +
 comms/tn3270/files/tools/mkdstoas/Makefile       |     8 +
 comms/tn3270/files/tools/mkdstoas/mkdstoas.c     |    77 +
 comms/tn3270/files/tools/mkhits/Makefile         |     8 +
 comms/tn3270/files/tools/mkhits/dohits.c         |   300 ++
 comms/tn3270/files/tools/mkhits/dohits.h         |    56 +
 comms/tn3270/files/tools/mkhits/mkhits.c         |   144 +
 comms/tn3270/files/tools/mkmake/Makefile         |    10 +
 comms/tn3270/files/tools/mkmake/mkmake.y         |  1138 ++++++++
 comms/tn3270/files/tools/prt3270/Makefile        |    47 +
 comms/tn3270/files/tools/prt3270/prt3270.c       |   647 ++++
 96 files changed, 26073 insertions(+), 0 deletions(-)

diffs (truncated from 26457 to 300 lines):

diff -r 51cfeb7d0d6b -r ac9a2e4d1b36 comms/tn3270/files/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/tn3270/files/Makefile       Sun Jan 17 01:33:16 2010 +0000
@@ -0,0 +1,6 @@
+#      $NetBSD: Makefile,v 1.1.1.1 2010/01/17 01:33:16 dholland Exp $
+#      From NetBSD: Makefile,v 1.8 2005/09/17 16:52:02 chs Exp 
+
+SUBDIR = tools .WAIT tn3270 mset
+
+.include <bsd.subdir.mk>
diff -r 51cfeb7d0d6b -r ac9a2e4d1b36 comms/tn3270/files/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/tn3270/files/Makefile.inc   Sun Jan 17 01:33:16 2010 +0000
@@ -0,0 +1,14 @@
+#      $NetBSD: Makefile.inc,v 1.1.1.1 2010/01/17 01:33:16 dholland Exp $
+#      From NetBSD: Makefile.inc,v 1.12 2009/04/14 22:15:27 lukem Exp 
+
+WARNS?=        1       # XXX -Wcast-qual -Wshadow issues
+
+USE_FORT?= yes # network client
+
+CPPFLAGS+=-DTERMCAP -DSRCRT -DKLUDGELINEMODE -DUSE_TERMIO -DTN3270 -Dunix
+CPPFLAGS+=-I${.CURDIR} -I.
+KBD=   unix.kbd
+
+.if exists(${.CURDIR}/../../Makefile.inc)
+.include "${.CURDIR}/../../Makefile.inc"
+.endif
diff -r 51cfeb7d0d6b -r ac9a2e4d1b36 comms/tn3270/files/api/api.order
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/tn3270/files/api/api.order  Sun Jan 17 01:33:16 2010 +0000
@@ -0,0 +1,8 @@
+ebc_disp.o
+disp_asc.o
+dctype.o
+astosc.o
+asc_ebc.o
+apilib.o
+api_bsd.o
+api_exch.o
diff -r 51cfeb7d0d6b -r ac9a2e4d1b36 comms/tn3270/files/api/api_bsd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/tn3270/files/api/api_bsd.c  Sun Jan 17 01:33:16 2010 +0000
@@ -0,0 +1,295 @@
+/*     $NetBSD: api_bsd.c,v 1.1.1.1 2010/01/17 01:33:16 dholland Exp $ */
+/*     From NetBSD: api_bsd.c,v 1.13 2006/05/24 16:57:12 christos Exp  */
+
+/*-
+ * Copyright (c) 1988 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if defined(__RCSID) && !defined(lint)
+#if 0
+static char sccsid[] = "@(#)api_bsd.c  4.2 (Berkeley) 4/26/91";
+#else
+__RCSID("$NetBSD: api_bsd.c,v 1.1.1.1 2010/01/17 01:33:16 dholland Exp $");
+#endif
+#endif /* not lint */
+
+#if    defined(unix)
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "../ctlr/api.h"
+#include "api_exch.h"
+
+
+int
+api_close_api()
+{
+    if (api_exch_outcommand(EXCH_CMD_DISASSOCIATE) == -1) {
+       return -1;
+    } else if (api_exch_flush() == -1) {
+       return -1;
+    } else {
+       return 0;
+    }
+}
+
+
+int
+api_open_api(string)
+char   *string;                /* if non-zero, where to connect to */
+{
+    struct sockaddr_in server;
+    struct hostent *hp;
+    struct storage_descriptor sd;
+    char thehostname[100];
+    char keyname[100];
+    char inkey[100];
+    FILE *keyfile;
+    int sock;
+    unsigned int port;
+    int i;
+
+    if (string == 0) {
+       string = getenv("API3270");     /* Get API */
+       if (string == 0) {
+           fprintf(stderr,
+                       "API3270 environmental variable not set - no API.\n");
+           return -1;                  /* Nothing */
+       }
+    }
+
+    if (sscanf(string, "%[^:]:%d:%99s", thehostname,
+                               (int *)&port, keyname) != 3) {
+       fprintf(stderr, "API3270 environmental variable has bad format.\n");
+       return -1;
+    }
+    /* Now, try to connect */
+    sock = socket(AF_INET, SOCK_STREAM, 0);
+    if (sock < 0) {
+       perror("opening API socket");
+       return -1;
+    }
+    server.sin_family = AF_INET;
+    hp = gethostbyname(thehostname);
+    if (hp == 0) {
+       fprintf(stderr, "%s specifies bad host name.\n", string);
+       return -1;
+    }
+    if (sizeof(server.sin_addr.s_addr) < hp->h_length)
+           hp->h_length = sizeof(server.sin_addr.s_addr);
+    (void)memcpy(&server.sin_addr.s_addr, hp->h_addr, hp->h_length);
+    server.sin_port = htons(port);
+
+    if (connect(sock, (struct sockaddr *)&server, sizeof server) < 0) {
+       perror("connecting to API server");
+       return -1;
+    }
+    /* Now, try application level connection */
+    if (api_exch_init(sock, "client") == -1) {
+       return -1;
+    }
+    if (api_exch_outcommand(EXCH_CMD_ASSOCIATE) == -1) {
+       return -1;
+    }
+    keyfile = fopen(keyname, "r");
+    if (keyfile == 0) {
+       perror("fopen");
+       return -1;
+    }
+    if (fscanf(keyfile, "%99s\n", inkey) != 1) {
+       perror("fscanf");
+       goto out;
+    }
+    sd.length = strlen(inkey)+1;
+    if (api_exch_outtype(EXCH_TYPE_STORE_DESC, sizeof sd, (char *)&sd) == -1) {
+       goto out;
+    }
+    if (api_exch_outtype(EXCH_TYPE_BYTES, sd.length, inkey) == -1) {
+       goto out;
+    }
+    while ((i = api_exch_nextcommand()) != EXCH_CMD_ASSOCIATED) {
+       int passwd_length;
+       char *passwd;
+       char buffer[200];
+
+       switch (i) {
+       case EXCH_CMD_REJECTED:
+           if (api_exch_intype(EXCH_TYPE_STORE_DESC,
+                                       sizeof sd, (char *)&sd) == -1) {
+               goto out;
+           }
+           if (api_exch_intype(EXCH_TYPE_BYTES, sd.length, buffer) == -1) {
+               goto out;
+           }
+           buffer[sd.length] = 0;
+           fprintf(stderr, "%s\n", buffer);
+           if (api_exch_outcommand(EXCH_CMD_ASSOCIATE) == -1) {
+               goto out;
+           }
+           break;
+       case EXCH_CMD_SEND_AUTH:
+           if (api_exch_intype(EXCH_TYPE_STORE_DESC, sizeof sd, (char *)&sd) == -1) {
+               goto out;
+           }
+           if (api_exch_intype(EXCH_TYPE_BYTES, sd.length, buffer) == -1) {
+               goto out;
+           }
+           buffer[sd.length] = 0;
+           passwd = getpass(buffer);           /* Go to terminal */
+           passwd_length = strlen(passwd);
+           if (api_exch_intype(EXCH_TYPE_STORE_DESC, sizeof sd, (char *)&sd) == -1) {
+               goto out;
+           }
+           if (api_exch_intype(EXCH_TYPE_BYTES, sd.length, buffer) == -1) {
+               goto out;
+           }
+           buffer[sd.length] = 0;
+           if (sd.length) {
+               char *ptr;
+
+               ptr = passwd;
+               i = 0;
+               while (*ptr) {
+                   *ptr++ ^= buffer[i++];
+                   if (i >= sd.length) {
+                       i = 0;
+                   }
+               }
+           }
+           sd.length = passwd_length;
+           if (api_exch_outcommand(EXCH_CMD_AUTH) == -1) {
+               goto out;
+           }
+           if (api_exch_outtype(EXCH_TYPE_STORE_DESC, sizeof sd, (char *)&sd) == -1) {
+               goto out;
+           }
+           if (api_exch_outtype(EXCH_TYPE_BYTES, passwd_length, passwd) == -1) {
+               goto out;
+           }
+           break;
+       case -1:
+           goto out;
+       default:
+           fprintf(stderr,
+                   "Waiting for connection indicator, received 0x%x.\n", i);
+           break;
+       }
+    }
+    /* YEAH */
+    fclose(keyfile);
+    return 0;          /* Happiness! */
+    /* NOPE */
+out:
+    fclose(keyfile);
+    return -1;
+}
+
+
+int
+api_exch_api(regs, sregs, parms, length)
+union REGS *regs;
+struct SREGS *sregs;
+char *parms;
+int length;
+{
+    struct storage_descriptor sd;
+    int i;
+
+    if (api_exch_outcommand(EXCH_CMD_REQUEST) == -1) {
+       return -1;
+    }
+    if (api_exch_outtype(EXCH_TYPE_REGS, sizeof *regs, (char *)regs) == -1) {
+       return -1;
+    }
+    if (api_exch_outtype(EXCH_TYPE_SREGS, sizeof *sregs, (char *)sregs) == -1) {
+       return -1;
+    }
+    sd.length = length;
+    sd.location = (long) parms;
+    if (api_exch_outtype(EXCH_TYPE_STORE_DESC, sizeof sd, (char *)&sd) == -1) {
+       return -1;
+    }
+    if (api_exch_outtype(EXCH_TYPE_BYTES, length, parms) == -1) {
+       return -1;
+    }
+    while ((i = api_exch_nextcommand()) != EXCH_CMD_REPLY) {
+       switch (i) {
+       case EXCH_CMD_GIMME:
+           if (api_exch_intype(EXCH_TYPE_STORE_DESC, sizeof sd, (char *)&sd)
+                                       == -1) {
+               return -1;
+           }
+           /*XXX validity check GIMME? */
+           if (api_exch_outcommand(EXCH_CMD_HEREIS) == -1) {



Home | Main Index | Thread Index | Old Index