Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Stinginess with privileges is kindness in disguise. -- Guide to VAX/VMS Security, Sep. 1984


computers / comp.sys.tandem / Re: PATHSEND/SERVERCLASS SEND procedure from C

Re: PATHSEND/SERVERCLASS SEND procedure from C

<s9aqo4$vie$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=175&group=comp.sys.tandem#175

  copy link   Newsgroups: comp.sys.tandem
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: inva...@nowhere.com (JShepherd)
Newsgroups: comp.sys.tandem
Subject: Re: PATHSEND/SERVERCLASS SEND procedure from C
Date: Thu, 3 Jun 2021 14:59:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 365
Message-ID: <s9aqo4$vie$1@dont-email.me>
References: <5be026f4-cadf-46c5-b40d-8d16f689cdc4n@googlegroups.com>
<b0i2bg1gapv2mahulce8cab2qdlcrpht0c@4ax.com> <94ebc487-3d70-4424-a339-5dfc7604a0a5n@googlegroups.com>
<828d83e3-fdd2-4095-9641-ebdbfe13999an@googlegroups.com> <fvfabghrs9m70j629fs6lsj2df9l8lt7uu@4ax.com>
<34f0e5fb-cf04-4b4c-804d-5d9453a8f795n@googlegroups.com> <5a57cdcd-079b-4b84-80ac-e30337104bc3n@googlegroups.com>
<09b4463e-7df3-4a59-a62c-6040a6f29082n@googlegroups.com> <s98kmb$2li$1@dont-email.me> <74247541-a672-4653-9eae-a3007a8b9b21n@googlegroups.com>
Mime-Version: 1.0
Content-Type: Text/Plain; charset=US-ASCII
Injection-Date: Thu, 3 Jun 2021 14:59:16 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3be54402e85886b9e3f4883d98f54934";
logging-data="32334"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UBpUWvrR5SmC7OTDfIOfB9zaNZ1pADws="
Cancel-Lock: sha1:iib8gs3JO2koJX4N0sZqTDy8+go=
 by: JShepherd - Thu, 3 Jun 2021 14:59 UTC

In article <74247541-a672-4653-9eae-a3007a8b9b21n@googlegroups.com>,
uros.kusar@gmail.com says...
>
>sreda, 02. junij 2021 ob 21:03:41 UTC+2 je oseba JShepherd napisala:
>> In article <09b4463e-7df3-4a59...@googlegroups.com>,
>> uros....@gmail.com says...
>> >
>> >sreda, 02. junij 2021 ob 10:54:14 UTC+2 je oseba uros kusar napisala:
>> >> torek, 01. junij 2021 ob 14:10:00 UTC+2 je oseba Dave Bossi napisala:
>> >> > On Monday, May 31, 2021 at 3:59:31 PM UTC-4, Bill Honaker wrote:=20
>> >> > > On Mon, 31 May 2021 04:07:05 -0700 (PDT), uros kusar
<uros....@gmail.=
>> >com> wrote:=20
>> >> > >=20
>> >> > > >petek, 28. maj 2021 ob 22:22:59 UTC+2 je oseba rkd...@gmail.com
napi=
>> >sala:=20
>> >> > > >> On Friday, May 28, 2021 at 12:49:03 PM UTC-7, Bill Honaker
wrote:=
>> >=20
>> >> > > >> > On Fri, 28 May 2021 00:06:17 -0700 (PDT), uros kusar
<uros....@g=
>> >mail.com> wrote:=20
>> >> > > >> >=20
>> >> > > >> > >Hi,=20
>> >> > > >> > >I'm writing C program that would get the status of the xpnet
ob=
>> >jects (stations,processes,node...). I'm using procedures described in the
H=
>> >P manuals(Pathsend and Server programming Manual, C/C++ programmer's
Guide.=
>> >..) but I can't get anyting from Pathway except errors. Can you tell me
wha=
>> >t am I doing wrong?=20
>> >> > > >> > >=20
>> >> > > >> > >This is the code that I'm working on:=20
>> >> > > >> >
>---------------------------------------------------------------=
>> >-------------------------------------------------=20
>> >> > > >> > >include <stdlib.h>=20
>> >> > > >> > >#include <stdio.h>=20
>> >> > > >> > >#include <string.h>=20
>> >> > > >> > >#include <cextdecs (SERVERCLASS_SEND_,
SERVERCLASS_SEND_INFO_)>=
>> > nolist=20
>> >> > > >> > >#include <tal.h>=20
>> >> > > >> > >=20
>> >> > > >> > >main()=20
>> >> > > >> > >{=20
>> >> > > >> > >short error, error2,pserror, fserror,countread;=20
>> >> > > >> > >char *pmon;=20
>> >> > > >> > >char *buffer;=20
>> >> > > >> > >char *sname;=20
>> >> > > >> > >=20
>> >> > > >> > >pmon =3D"$D1MN";=20
>> >> > > >> > >sname =3D "SERVER-NCPI-1A";=20
>> >> > > >> > >buffer =3D"STATUS PROCESS P1A^BICUNI1";=20
>> >> > > >> > >=20
>> >> > > >> > >error =3D SERVERCLASS_SEND_ (pmon,=20
>> >> > > >> > > (short) strlen(pmon), /* pathmon */=20
>> >> > > >> > > sname,=20
>> >> > > >> > > (short) strlen(sname), /* server class */=20
>> >> > > >> > > buffer,=20
>> >> > > >> > > (short) strlen(buffer),=20
>> >> > > >> > > 200,=20
>> >> > > >> > > &countread,=20
>> >> > > >> > > -1); /* timeout =3D forever */=20
>> >> > > >> > >=20
>> >> > > >> > >if (error !=3D 0)=20
>> >> > > >> > > {=20
>> >> > > >> > > error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
>> >> > > >> > > printf ("\nSERVERCLASS_SEND_ error =3D %d, pathsend error
=3D =
>> >%d, fs error =3D %d\n", error, pserror, fserror);=20
>> >> > > >> > > exit (1);=20
>> >> > > >> > > }=20
>> >> > > >> > >else=20
>> >> > > >> > > {=20
>> >> > > >> > > buffer [countread] =3D 0;=20
>> >> > > >> > > printf ("\nReply =3D %s\n", buffer);=20
>> >> > > >> > > }=20
>> >> > > >> > >}=20
>> >> > > >> >
>---------------------------------------------------------------=
>> >-------------------------------------------------=20
>> >> > > >> > >Response:=20
>> >> > > >> > >SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs
err=
>> >or =3D 12=20
>> >> > > >> > >=20
>> >> > > >> > >Best Regards,=20
>> >> > > >> > >Uros=20
>> >> > > >> > Uros,=20
>> >> > > >> >=20
>> >> > > >> > Keith and Randall gave very valuable responses.=20
>> >> > > >> >=20
>> >> > > >> > Also one other possibility is that, in creating the link, the
PA=
>> >THMON tried to start a server process.=20
>> >> > > >> > If that server process has a fixed PROCESS NAME for each
isntanc=
>> >e, and if there is already a running process with that name,=20
>> >> > > >> > the attempt to start the process would get an error 12. Look
at =
>> >the info ("PATHCOM $D1MN;INFO SERVER-NCPI-1A") and=20
>> >> > > >> > check what is in the "PROCESS". If it's present, there will
eith=
>> >er be one process name, or a list in paraentheses.=20
>> >> > > >> > From a TACL prompt, issue a status command for each process in
t=
>> >he list.=20
>> >> > > >> >=20
>> >> > > >> > Bill=20
>> >> > > >> Bill,=20
>> >> > > >>=20
>> >> > > >> Very good remembering that filesystem error 12 is used for
attempt=
>> >ing to start a process with a name that already exists. I should have
remem=
>> >bered that myself. Unless Pathway's link management also uses filesystem
er=
>> >ror 12 for other problems, I'd say a duplicate process name is likely to
be=
>> > the explanation for this problem. Perhaps Uros has set up a test
environme=
>> >nt by duplicating the configuration of an existing environment and did
not =
>> >know to change the configured fixed server process names.=20
>> >> > > >Hi,=20
>> >> > > >=20
>> >> > > >Thank you all for your help.=20
>> >> > > >=20
>> >> > > >I changed the code:=20
>> >> > > >1) I added SERVERCLASS_SEND_INFO output error number to see if
comma=
>> >nd was succsesfully processed.=20
>> >> > > >2) I changed the buffer to a 200-byte array.=20
>> >> > > >3) I find some tal example of a similar program and I noticed that
t=
>> >his tal program, sends the command to a different pathway server. I send
it=
>> > to the SERVER-NCPI-1A server, which is a server for P1A^NODE. But the
tal =
>> >program sends the command to the server SERVER-NCP, which sees all "node"
s=
>> >ervers.=20
>> >> > > >=20
>> >> > > >It is interesting because if I send a command to SERVER-NCP I get
a =
>> >different error code.=20
>> >> > > >SERVER-NCP:=20
>> >> > > >SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error
=
>> >=3D 21=20
>> >> > > >=20
>> >> > > >SERVER-NCP-1A:=20
>> >> > > >SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error
=
>> >=3D 12=20
>> >> > > >=20
>> >> > > >I think that the correct server is a SERVER-NCP.=20
>> >> > > >=20
>> >> > >
>--------------------------------------------------------------------=
>>
>-------------------------------------------------------------------------=
>> >=20
>> >> > > >Pahway server configuration:=20
>> >> > > >MAXLINKMONS 20 [CURRENTLY 2]=20
>> >> > > >=20
>> >> > > >SERVER SERVER-NCPI-1A=20
>> >> > > >LINKDEPTH 1=20
>> >> > > >MAXLINKS 32=20
>> >> > > >MAXSERVERS 3=20
>> >> > > >PROCESS $D1AU (ASSOCIATIVE ON)=20
>> >> > > >=20
>> >> > > >SERVER SERVER-NCP=20
>> >> > > > LINKDEPTH 32=20
>> >> > > > MAXLINKS 32=20
>> >> > > > MAXSERVERS 3=20
>> >> > > > PROCESS $D1C1=20
>> >> > > > PROCESS $D1C2=20
>> >> > > > PROCESS $D1C3=20
>> >> > >
>--------------------------------------------------------------------=
>>
>-------------------------------------------------------------------------=
>> >=20
>> >> > > >code:=20
>> >> > > >#include <stdlib.h>=20
>> >> > > >#include <stdio.h>=20
>> >> > > >#include <string.h>=20
>> >> > > >#include <tal.h>=20
>> >> > > >#include <cextdecs (SERVERCLASS_SEND_, SERVERCLASS_SEND_INFO_)>
noli=
>> >st=20
>> >> > > >main()=20
>> >> > > >{=20
>> >> > > >short error, error2, pserror, fserror,countread;=20
>> >> > > >char *pmon;=20
>> >> > > >char buffer [200]=3D{0};=20
>> >> > > >char *sname;=20
>> >> > > >=20
>> >> > > >pmon =3D"$D1MN";=20
>> >> > > >sname =3D "SERVER-NCP";=20
>> >> > > >strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
>> >> > > >=20
>> >> > > >error =3D SERVERCLASS_SEND_ (pmon,=20
>> >> > > > (short)strlen(pmon), /* pathmon */=20
>> >> > > > sname,=20
>> >> > > > (short)strlen(sname), /* server class */=20
>> >> > > > buffer,=20
>> >> > > > (short)strlen(buffer),=20
>> >> > > > 200,=20
>> >> > > > &countread,=20
>> >> > > > -1); /* timeout =3D forever */=20
>> >> > > >if (error !=3D 0)=20
>> >> > > > {=20
>> >> > > > error2 =3D SERVERCLASS_SEND_INFO_ (&pserror, &fserror);=20
>> >> > > > printf("\nSERVERCLASS_SEND_INFO error =3D %d \nSERVERCLASS_SEND_
er=
>> >ror =3D %d, pathsend error =3D %d, fs error =3D %d\n",error2, error,
pserro=
>> >r, fserror);=20
>> >> > > > printf("\nBuffer size =3D %d\n", strlen(buffer));=20
>> >> > > >=20
>> >> > > > int i;=20
>> >> > > > for(i=3D0; i<strlen(buffer); i++)=20
>> >> > > > {=20
>> >> > > > printf("%c",buffer[i]);=20
>> >> > > > }=20
>> >> > > > printf("\n\n\n");=20
>> >> > > > exit (1);=20
>> >> > > > }=20
>> >> > > >else=20
>> >> > > > {=20
>> >> > > > buffer [countread] =3D 0;=20
>> >> > > > printf ("\nReply =3D %s\n", buffer);=20
>> >> > > > }=20
>> >> > > >}=20
>> >> > > I see the original server was setup with 'Asoociative On' It's
possib=
>> >le the open table in the server can't accept another open.=20
>> >> > >=20
>> >> > > Can't explain the error 21.=20
>> >> > I would try changing PMON and SNAME from pointers to arrays and see
if =
>> >it doesn't help with the error 21.=20
>> >> >
>> >> > char pmon[] =3D "$D1MN";
>> >> > char sname[] =3D "SERVER-NCP";=20
>> >> >=20
>> >> > Dave
>> >> Hi,=20
>> >>=20
>> >> Keith, I don't find anything in the manuals, that would show me what to
s=
>> >end to the server.=20
>> >>=20
>> >> I did not post the complete output to make this thread readable as
possib=
>> >le. The SERVERCLASS_SEND_INFO returns 0(OK) and I tried different data
type=
>> >s, also arrays instead of pointers. The result is the same. I'm almost
sure=
>> > that I need to send command to the SERVER-NCP server instead the
SERVER-NC=
>> >PI-1A.=20
>> >>=20
>> >> Currently I'm using arrays:=20
>> >>=20
>> >> char pmon[5]=3D{0};
>> >> char buffer [200]=3D{0};
>> >> char sname[20]=3D{0};=20
>> >>=20
>> >> strcpy(pmon,"$D1MN");=20
>> >> strcpy(sname,"SERVER-NCP");
>> >> strcpy(buffer,"STATUS PROCESS P1A^BICUNI1");=20
>> >>=20
>> >> error =3D SERVERCLASS_SEND_ (pmon,=20
>> >> (short)strlen(pmon), /* pathmon */=20
>> >> sname,=20
>> >> (short)strlen(sname), /* server class */=20
>> >> buffer,=20
>> >> (short)strlen(buffer),=20
>> >> 200,=20
>> >> &countread,=20
>> >> -1); /* timeout =3D forever */
>> >> OUTPUT:=20
>> >> SERVERCLASS_SEND_INFO error =3D 0
>> >> SERVERCLASS_SEND_ error =3D 233, pathsend error =3D 904, fs error =3D
21
>> >> Buffer size =3D 26=20
>> >> STATUS PROCESS P1A^BICUNI1=20
>> >>=20
>> >>=20
>> >> EMS messages:=20
>> >>=20
>> >> 21-06-02;10:03:23.101 \PERUN.$D1MN TANDEM.PATHWAY.L01 3116=20
>> >> \PERUN.$D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01,=20
>> >> ERROR DURING SERVER I/O (21) - SERVER SERVER-NCP=20
>> >>=20
>> >> 21-06-02;10:03:23.102 \PERUN.$D1SUD TANDEM.VHS.L01 6=20
>> >> DEV1VHS:=20
>> >> 02JUN21,10:03 $D1MN: ERROR - *3116* LINKMON L\PERUN.$ZP01, ERROR=20
>> >> DURING SERVER I/O (21) - SERVER SERVER-NCP. Display text received=20
>> >> from process $D1MN. Program file \PERUN.$SYSTEM.SYSTEM.PATHMON.=20
>> >> Primary log file \PERUN.$DATA01.DEV1VHS.LOG0000.=20
>> >>=20
>> >> I'm losing ideas what else to try.=20
>> >>=20
>> >> Uros
>> >
>> >I just notice another EMS error in collector $0
>> >
>> > 21-06-02;11:39:59.662 \PERUN.$ZL01 TANDEM.APPCLSTR.L01 1038
>> > WARNING 1038 - Server \PERUN.$D1MN.SERVER-NCP file
>> > operation ACS_FS_PSWRITEREAD_() failed, process
>> > \PERUN.$D1C1:115841149, file \PERUN.$D1C1, error 21
>> >
>> >Uros
>> Are you sure that server accepts a command line text buffer as input ?
>> Maybe it requires a structured message.
>>
>>
>>
>> =status SERVER-NCPI-1A
>> SERVER-NCPI-1A 1
>>
>> PROCESS STATE ERROR INFO #LINKS WEIGHT
>> $S1AU RUNNING 1 3
>>
>> 10> wake /highpin off/ $s1au
>> WRITE error 21 on $S1AU
>>
>> 11> wake /highpin off/ $s1au send STATUS
>> WRITE error 21 on $S1AU
>
>
>Hi,
>
>I'm still trying to understand why my code doesn't work. I think that
something
>is wrong with the structures.
>
>This tal program was written by my coworker.
>
>Uros

From that code it looks like you have to correctly populate the
request struct and send it
struct .ncp^rqst( ncp^lex^struct^def );

Then handle the potentially multi-item response coming back

int .ncp^resp( ncp^resp^struct^def ),

You will need C versions of all those TAL structs or
do it in TAL

SubjectRepliesAuthor
o PATHSEND/SERVERCLASS SEND procedure from C

By: uros kusar on Fri, 28 May 2021

24uros kusar
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor