Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!snorkelwacker!bloom-beacon!sunbim.be!db From: db@sunbim.be (Danny Backx) Newsgroups: comp.windows.x Subject: DECnet Xlib on SunOS ? Message-ID: <9009281640.AA25243@sunbim.be> Date: 28 Sep 90 16:59:00 GMT Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 94 Hi all, I am trying to make my SunOS (with Sun's DECnet option installed) talk X over DECnet. The approach I try to use is take one of Sun's demo programs, and try to merge the connection opening code with the Xlib routine MakeDECnetConnection(). It doesn't seem to work, though. I have included the relevant code below. Does anybody have any clues/advice ? I am not very familiar with DECnet protocols... By the way, this is SunOS 4.0.3c on a SparcStation 1+, with Sunlink DNI version 6.0. Thank you, Danny Backx BIM Networks System Engineer E-Mail: db@sunbim.be (or uunet!mcsun!ub4b!sunbim!db) Telephone: +32(2)759.59.25 Fax : +32(2)759.47.95 Postal Mail : Danny Backx BIM Kwikstraat 4 3078 Everberg Belgium The code listed here belongs in mit/lib/X/XConnDis.c : #ifdef DNETCONN #ifdef sun static int MakeDECnetConnection (phostname, idisplay, retries, familyp, saddrlenp, saddrp) char *phostname; int idisplay; int retries; int *familyp; /* RETURN */ int *saddrlenp; /* RETURN */ char **saddrp; /* RETURN */ { int fd; char objname[20]; OpenBlock opblk; if (!phostname) phostname = "0"; /* * build the target object name. */ sprintf (objname, "X$X%d", idisplay); /* * Attempt to open the DECnet connection, return -1 if fails; ought to * do some retries here.... */ if ((fd = open("/dev/dni", O_RDWR)) < 0) return -1; if (ioctl(fd, SES_GET_LINK, 0) < 0) return -1; *familyp = FamilyDECnet; strcpy(opblk.op_node_name, phostname); strcpy(opblk.op_task_name, objname); opblk.op_userid[0] = '\0'; opblk.op_object_nbr = 0; opblk.op_account[0] = '\0'; opblk.op_password[0] = '\0'; opblk.op_opt_data.im_length = 0; if (ioctl(fd, SES_LINK_ACCESS, &opblk)) { Image16 opt; int i; dnierror("Ioctl link access failed"); ioctl(fd, SES_GET_OPT_DATA, &opt); fprintf(stderr, "%d bytes of reject data :", opt.im_length); for (i=0; i