summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-05-05 12:57:32 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-05-06 17:13:10 -0700
commitbc32bb55ca5a9059dec9d9326f34ff372b54f154 (patch)
tree4c3f89e13e7dd371857789fff7630a908633cda5 /common.c
parent50f126f91c12e25e33cb5d8b79c6172ec33765ee (diff)
Delete DECnet support
Diffstat (limited to 'common.c')
-rw-r--r--common.c128
1 files changed, 0 insertions, 128 deletions
diff --git a/common.c b/common.c
index 2605a08..85a14dc 100644
--- a/common.c
+++ b/common.c
@@ -222,16 +222,6 @@ static int ListenTransCount;
#include <netinet/in.h> /* struct sockaddr_in */
#include <netdb.h> /* struct servent * and struct hostent * */
-#ifdef DNETCONN
-#include <X11/dni.h>
-#endif
-#ifdef DNETSVR4
-#include <X11/dni8.h>
-#include <dlfcn.h>
-struct hostent *(*dnet_gethostbyname)();
-int (*dnet_gethostname)();
-short initialize_libdni();
-#endif
static int ON = 1 /* used in ioctl */ ;
#define BACKLOG 5
#endif
@@ -370,121 +360,3 @@ SetUpConnectionSocket(iport, connectionFunc)
#endif
}
-#ifndef USE_XTRANS
-#ifdef DNETSVR4
-SetUpDECnetConnection(display)
-int display;
-{
- struct sockaddr_dn *sdn,sdnn; /* DECnet socket */
- struct hostent *hp;
- int sock;
- char hostname[6];
-
- if (!initialize_libdni()) {
- fprintf(stderr,"Unable to open libdni.so\n");
- exit(0);
- }
- sdn = &sdnn;
- if (!(dnet_gethostname)(hostname)) {
- fprintf(stderr,"Can't get DECnet local host name\n");
- exit(0);
- }
- if ((hp = (struct hostent *)(dnet_gethostbyname)(hostname)) == NULL) {
- fprintf(stderr,"xhost: can't get name %s\n",hostname);
- exit(0);
- }
- sdn->sdn_family = AF_DECnet;
- sdn->sdn_format = DNADDR_FMT1;
- sdn->sdn_port = 0;
- sprintf ((char *)sdn->sdn_name, "X$X%d", display);
- sdn->sdn_namelen = strlen((char *)sdn->sdn_name);
- sdn->sdn_addr = *(u_short *)hp->h_addr_list[0];
-
- if ((sock = socket (AF_DECnet, SOCK_STREAM, 0)) < 0) {
- perror("socket");
- exit(0);
- }
- (void)setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)NULL, 0);
- (void)setsockopt(sock, SOL_SOCKET, SO_USELOOPBACK, (char *)NULL, 0);
-
- if (bind(sock, (struct sockaddr_dn *)sdn,
- sizeof(struct sockaddr_dn)) < 0) {
- perror("DNI Bind");
- exit(0);
- }
- if (listen(sock, 100) < 0) {
- perror("DNI Listen");
- exit(0);
- }
-
- UsingFD(sock, NewConnection, NULL, NULL);
-}
-#endif
-
-#ifdef DNETCONN
-SetUpDECnetConnection(display)
-int display;
-{
- struct ses_io_type sesopts;
- char objname[6];
- FD fd;
-
- enterprocedure("SetUpDECnetConnection");
- sprintf (objname, "X$X%d", display);
- if ((fd = open("/dev/dni", O_RDWR)) < 0) {
- fprintf(stderr,"xscope: dni: open failed\n");
- exit(-1);
- }
- if (ioctl(fd, SES_GET_LINK, 0)) {
- fprintf(stderr,"xscope: dni: can't get link\n");
- exit(-1);
- }
- /* set nonblocking here since dni ignores fcntls */
- /* set asyncronous to avoid blocking on SES_GET_AI */
- sesopts.io_flags = SES_IO_NBIO + SES_IO_ASYNCH_MODE;
- sesopts.io_io_signal = SIGIO;
- sesopts.io_int_signal = 0;
-
- if (ioctl(fd, SES_IO_TYPE, &sesopts) < 0) {
- fprintf(stderr,"xscope: dni: ioctl failed\n");
- exit(-1);
- }
-
- /* register as server */
- if (ioctl(fd, SES_NAME_SERVER, objname) < 0) {
- fprintf(stderr,"xscope: dni: ioctl failed\n");
- exit(-1);
- }
- debug(4,(stderr, "Listening on DECnet FD %d\n", fd));
- UsingFD(fd, NewConnection, NULL, NULL);
-}
-#endif
-
-#ifdef DNETSVR4
-short
-initialize_libdni()
-{
- void *handle;
- char *home;
- char *path;
-
- if (dnet_gethostname && dnet_gethostbyname)
- return(1);
- if (!(handle = dlopen("/etc/openwin/lib/libdni.so",RTLD_NOW))) {
- if ((home = (char *)getenv("DNI_X_ENABLE")) == NULL)
- return(0);
- path = (char *)malloc(strlen(home) + 12);
- sprintf(path, "%s%s",home, "/libdni.so");
- if (!(handle = dlopen(path,RTLD_NOW)))
- return(0);
- free(path);
- }
- if (!(dnet_gethostbyname = (struct hostent *(*)())dlsym(handle,"dni_gethostbyname")))
- return(0);
- if (!(dnet_gethostname = (int (*)())dlsym(handle,"dni_gethostname")))
- return(0);
- return(1);
-}
-#endif
-#endif /* USE_XTRANS */
-