Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
* DCE rpc error athwart
@ 1994-03-16 21:08 Steven Noyd Jones
  1994-03-17 18:07 ` Greg Brail
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Steven Noyd Jones @ 1994-03-16 21:08 UTC (permalink / raw)


I'm porting an rpc client and server from NCS to DCE and have 
run into a problem I can't see anyway around.  I've got 
my rpcd, secd, cdsd, nsid, gdad and other friends running
so I'm assuming the the DCE products are installed correctly on my
OSF 1.3A system.  
 
I am using the IDL compiler to generate the stubs, and that 
works well enough, though I needed to seperate the "main()" from
rpc called routines in order to include the IDL generated include
file.

When I run the client, the "rpc_call_start()" routine in the client 
stub returns with the error status 0x16c9a042, and triggers a core 
dump.  When I run the server, the "rpc_server_listen()" routine in my 
server "main()" program returns with the error status 0x16c9a042 and 
continues.  
 
I've been unable to locate any documented reference to this error
code or code type.  I've reduced the client/server to the most
simple case to no effect; the code is simple enough, but I can't help
but think I'm overlooking something especially basic to the
DCE RPC initialization.    

Any assistance or examples of working programs using well known
endpoints would be appreciated.  Many thanks!

-Steve Jones <noyd@u.washington.edu>
 University of Washington, Seattle  (206) 543-5852
 
** The build procedure:  *********************************************
#!/bin/sh
/usr/bin/idl -no_warn -keep all x.idl
cc -c -g main.c
cc -c -g x.c
cc -c -g -I. x_cstub.c
cc -c -g -I. x_sstub.c
cc -c -g client.c
cc -o client client.o x_cstub.o -ldce -lpthreads  -lc_r -lmach
cc -o server main.o x.o x_sstub.o -ldce -lpthreads  -lc_r -lmach

** The x.idl file:     ************************************************
 
[ 
uuid(5DBA73AC-264D-0000-028C-8E3802000000),
version(1),
endpoint("ncacn_ip_udp:[617]")
] 
interface x {
 
[idempotent]
long int xx(
  [in] handle_t h
);
 
} 
 
** The client.c client main program:    *******************************
#include <stdio.h>
#include <rpc/rpc.h>
#include <dce/rpc.h>
#include <dce/dce_error.h>
 
main(int argc,char **argv)
{ 
  long int rc;
  rpc_binding_handle_t h;
 
  unsigned32 s1,s2;
 
  dce_error_string_t line;
 
  s1 = 0;
  rc = 0;
 
  strcpy(line,"ncacn_ip_tcp:goren1.u.washington.edu[endpoint=617]");
  rpc_binding_from_string_binding(line,&h,&s1);
 
  if (  s1 != rpc_s_ok) {
    dce_error_inq_text(s1,line,&s2);
    fputs("Cannot generate binding handle.\n",stderr);
    exit(0);
  }
 
  rc = xx(h);
  exit(rc);
} 
 
** The main.c server main program:    *********************************
#include <stdio.h>
 
#include <rpc/rpc.h>
#include <exc_handling.h>
#include <dce/rpc.h>
#include <dce/dce_error.h>
#include <dce/rpcexc.h>
 
/* IDL generated include file */
#include "x.h"
 
main(int argc, char **argv)
{ 
  unsigned32 s1,s2;
  dce_error_string_t line;
  
  s1 = 0;
 
/* register the server with the rpc runtime */
  rpc_server_register_if(x_v1_0_s_ifspec,NULL,NULL,&s1);
 
  if (s1 != rpc_s_ok ) {
    dce_error_inq_text(s1,line,&s2);
    fprintf(stderr,"%s\n",line);
    exit(1);
  }
 
/* enable use of protocols and defined well known end points */
  rpc_server_use_all_protseqs_if(rpc_c_protseq_max_reqs_default,
                        x_v1_0_s_ifspec,&s1);
  if (s1 != rpc_s_ok) {
    dce_error_inq_text(s1,line,&s2);
    fprintf(stderr,"%s\n",line);
    exit(1);
  }
 
  rpc_server_listen(1,&s1);
  
  dce_error_inq_text(s1,line,&s2);
  fprintf(stderr,"%s\n",line);
  exit(0);
} 
 
** The x.c server rpc function:       ********************************
long int xx(rpc_binding_handle_t h)
{ 
  return(1);
} 
-- 
--
  Steven Jones
  Computing & Communications JE-30,  University of Washington
  E-mail:  noyd@cac.washington.edu    Phone:  (206) 543-5852


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: DCE rpc error athwart
  1994-03-16 21:08 DCE rpc error athwart Steven Noyd Jones
@ 1994-03-17 18:07 ` Greg Brail
  1994-03-17 20:44 ` Henry Lee
  1994-03-18  0:15 ` DCE rpc error athwart (summary) Steven Noyd Jones
  2 siblings, 0 replies; 6+ messages in thread
From: Greg Brail @ 1994-03-17 18:07 UTC (permalink / raw)


In article <2m7sgp$23u@news.u.washington.edu>,
Steven Noyd Jones <noyd@u.washington.edu> wrote:

>When I run the client, the "rpc_call_start()" routine in the client 
>stub returns with the error status 0x16c9a042, and triggers a core 
>dump.  When I run the server, the "rpc_server_listen()" routine in my 
>server "main()" program returns with the error status 0x16c9a042 and 
>continues.  

The error code you mentioned is "connection request rejected". 

>[ 
>uuid(5DBA73AC-264D-0000-028C-8E3802000000),
>version(1),
>endpoint("ncacn_ip_udp:[617]")
>] 

"ncacn_ip_udp" isn't a valid protocol sequence. All DCE
implementations that I know of support "ncadg_ip_udp", and some also
support "ncacn_ip_tcp". Your use of this as your protocol is certainly
part of the problem.

>  strcpy(line,"ncacn_ip_tcp:goren1.u.washington.edu[endpoint=617]");

Is that a legal string binding? Try taking out the "endpoint=" and see
if that helps. But this will never work unless you change the protocol
of the endpoint in your .idl file to a valid protocol sequence, like I
mentioned above. Good luck!

				greg

-- 
Greg Brail ------------------ Citibank -------------------- gjb@fig.citib.com
"All seven million Austrians and half the cows in Switzerland can
 ski faster than the U.S. Ski Team."
		-- Sports Illustrated, before the Winter Olympics


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: DCE rpc error athwart
  1994-03-16 21:08 DCE rpc error athwart Steven Noyd Jones
  1994-03-17 18:07 ` Greg Brail
@ 1994-03-17 20:44 ` Henry Lee
  1994-03-18  0:15 ` DCE rpc error athwart (summary) Steven Noyd Jones
  2 siblings, 0 replies; 6+ messages in thread
From: Henry Lee @ 1994-03-17 20:44 UTC (permalink / raw)



In article <2m7sgp$23u@news.u.washington.edu>, noyd@u.washington.edu (Steven Noyd Jones) writes:
>  
> 
> When I run the client, the "rpc_call_start()" routine in the client 
> stub returns with the error status 0x16c9a042, and triggers a core 
> dump.  When I run the server, the "rpc_server_listen()" routine in my 
> server "main()" program returns with the error status 0x16c9a042 and 
> continues.  
>  
  
If you are using IBM's DCE, you can convert the error code to decimal,
and type "dce_err 382312514".  It means "connect request rejected".
Make sure your servers are listening on valid protocol sequences,
and make sure your client uses a compatible binding.

> 
> ** The x.idl file:     ************************************************
>  
> [ 
> uuid(5DBA73AC-264D-0000-028C-8E3802000000),
> version(1),
> endpoint("ncacn_ip_udp:[617]")
  
This is not a valid protocol sequence.  Use ncacn_ip_tcp or ncadg_ip_udp.
   
Henry Lee,  
IBM DCE development


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: DCE rpc error athwart (summary)
  1994-03-16 21:08 DCE rpc error athwart Steven Noyd Jones
  1994-03-17 18:07 ` Greg Brail
  1994-03-17 20:44 ` Henry Lee
@ 1994-03-18  0:15 ` Steven Noyd Jones
  1994-03-22 18:33   ` Steven Noyd Jones
  2 siblings, 1 reply; 6+ messages in thread
From: Steven Noyd Jones @ 1994-03-18  0:15 UTC (permalink / raw)


Many thanks for all the excellent assistance in resolving my 
DCE rpc problem. I've received responses which I will summarize from:

  gjb@fig.citib.com (Greg Brail)
  Phil_Hirsch@transarc.com
  "Helmut Duschinger (CIP 90)" <htduschi@cip.informatik.uni-erlangen.de>
  Johannes Kroupa <kroupa@argos.kapsch.co.at>
  Kevin Coffman <kwc@citi.umich.edu>

Concerning what does "Exception: status 0x16c9a042 (dce / rpc)" mean:

(1) The error code 0x16c9a042 is to be found in it's decimal equivalent
    in the /usr/include/dce/rpcsts.h file and translates to:
      rpc_s_connect_rejected.  

DEC if you are listening, the online manuals explanation for that 
error code could be more enlightening and the IDL manual merely says an
error will result at runtime if the endpoint family declaration isn't valid.


(2) Set the NLSPATH environment variable to /usr/lib/nls/msg/en_US.88591/%N
    in order to have the error code messages translated to the 
    English text messages.  

This is documented in the online manual for dce_error_inq_text().
I've tried setting the NLSPATH environment variable and had no luck
in getting the dce_error_inq_text() function to spit out the
proper text.  The file /usr/lib/nls/msg/en_US.88591/dcerpc.cat 
contains the error message text, so that is still a puzzle.


(3) The endpoint family "ncacn_ip_udp" is invalid. Valid families
    are "ncacn_ip_tcp" and "ncadp_ip_udp".  This is 
    documented in 17.7.3 of the DCE application development Guide.

Using the correct endpoint family "ncadg_ip_udp" fixed the 
programs and the rpc client and server are now working.

-- 
--
  Steven Jones
  Computing & Communications JE-30,  University of Washington
  E-mail:  noyd@cac.washington.edu    Phone:  (206) 543-5852


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: DCE rpc error athwart (summary)
  1994-03-18  0:15 ` DCE rpc error athwart (summary) Steven Noyd Jones
@ 1994-03-22 18:33   ` Steven Noyd Jones
  1994-03-25 14:23     ` Dave Skeen
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Noyd Jones @ 1994-03-22 18:33 UTC (permalink / raw)


The problem I had with getting text messages from dce_error_inq_text()
was that both the NLSPATH and LANG enviroment variables must be defined.

The relevant excerpt from the DEC man page for dce_error_inq_text() reads:

  Before calling this routine, the environment variable NLSPATH must be set
  to point to DCE message catalog files.  A general C-shell command to set
  this environment variable follows:

       % setenv NLSPATH dceshared/nls/msg/LANG/%N

  Note that LANG is a variable instead of a literal.  A specific example of
  this general command follows:

       % setenv NLSPATH /usr/lib/nls/msg/en_US.88591/%N

This should be ammended to include setting the LANG variable as well.

       % setenv LANG en_SU.88591

Thanks to Henry Lee of IBM DCE development for his assistance in
pinpointing the the LANG variable requirement. 


-- 
--
  Steven Jones
  Computing & Communications JE-30,  University of Washington
  E-mail:  noyd@cac.washington.edu    Phone:  (206) 543-5852


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: DCE rpc error athwart (summary)
  1994-03-22 18:33   ` Steven Noyd Jones
@ 1994-03-25 14:23     ` Dave Skeen
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Skeen @ 1994-03-25 14:23 UTC (permalink / raw)


In article <2mndlm$r6c@news.u.washington.edu> noyd@u.washington.edu (Steven Noyd Jones) writes:
   The problem I had with getting text messages from dce_error_inq_text()
   was that both the NLSPATH and LANG enviroment variables must be defined.

However, your vendor should provide default messages if NLSPATH or
LANG aren't set; it that's not happening, you should complain.
--
Dave Skeen, Mead Data Central	Internet: dls@meaddata.com
9555 Springboro Pike		UUCP: ...!uunet!meaddata!dls
Miamisburg, OH 45342		(800)253-5624 ext 2895


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1994-03-25 14:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-03-16 21:08 DCE rpc error athwart Steven Noyd Jones
1994-03-17 18:07 ` Greg Brail
1994-03-17 20:44 ` Henry Lee
1994-03-18  0:15 ` DCE rpc error athwart (summary) Steven Noyd Jones
1994-03-22 18:33   ` Steven Noyd Jones
1994-03-25 14:23     ` Dave Skeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox