16

Is there some (working) example how to create RPC from windows to linux?

Client should be windows NT application, server is linux.

It needs to be MSRPC.

No Corba, no XML-RPC, SUN-RPC etc

MSDN says this:

RPC can be used in all client/server applications based on Windows operating systems. It can also be used to create client and server programs for heterogeneous network environments that include such operating systems as Unix and Apple.

Unfortunately after spending few hours on google I'm giving up.

My expectation:

  • Linux node should have samba installed, because their MSRPC implementation works.
  • Using IDL file I generate stubs for both client and server
  • Client is built using MSVC
  • Server is build using gcc with some includes/libraries from samba (or other libs)
  • Linux node must have such RPC port mapper

Can someone point me out?

rkosegi
  • 14,165
  • 5
  • 50
  • 83
  • 3
    I cannot understand how come this question got a close vote... if this question deserves to be closed, then better close stackoverflow altogether. – yms Oct 26 '12 at 14:50
  • Since the samba server implementation is advanced enough to even allow integration to an Active Directory Domain, I would say that what you want to do is feasible, but the part of "using an IDL file to generete stubs for server" I am not so sure... I hope I am wrong. – yms Oct 26 '12 at 15:02
  • @yms thank you for your comment.I'm pretty sure that key part of solution is samba, but I don't have exact idea.I will offer bounty for my question in 2 days to gain more attention and maybe some working code sample :) – rkosegi Oct 26 '12 at 17:55
  • You may also want to look into FreeDCE and OpenDCE. – ninjalj Oct 27 '12 at 10:07
  • It would be simplier to use native sockets with your own text based protocol. Compile an NT service for Windows and a daemon for nix systems. – pcunite Oct 28 '12 at 03:14
  • @pcunite there is lot of simpler ways.I said it MUST be MSRPC/DCOM,also I don't need service on NT side, just client. – rkosegi Oct 28 '12 at 11:31

1 Answers1

6

I think you have 2 possible ways to deal with this:

1- You can try using DCOM with wine, which means that you will actually write your code for windows, but at the same time you can test your results in the process and avoid using WinAPI calls that wine is not able to handle properly. This approach will allow you to generate stubs code from your IDL files.

2- You can try using Samba RPC Pluggable Modules, but I am afraid in this case the RPC communication will be more primitive.

Edit:

It seems there are many other ways. I found a list of libraries in DCOM-Wikipedia, j-Interop for example looks particularly promising.

yms
  • 10,361
  • 3
  • 38
  • 68
  • By the way I just found these two pieces of information, is not like I waited for the bounty to post this :) – yms Oct 29 '12 at 17:39
  • Thank you, I read about wine and I heard that it's binary compatible, but not network (wire) compatible with MS-RPC.However, today I study Samba4 source and it looks very promising.I will try your suggestion with pluggable modules, once I'm done with it, reward is yours :).Looks nobody else can said anything valuable except you.If you find something else, please keep my updated.Thanks !!! – rkosegi Oct 29 '12 at 17:55
  • @rkosegi I found something else that looks interesting. – yms Oct 29 '12 at 19:04
  • I already read this articles, it looks fine, but for my project I need to use C/C++ and also, main idea is to utilize existing infrastructure which is MSRPC/DCOM on win nt and samba on linux side.I hope I'm quite close to run "hello world" rpc-lugin based on samba source and link you provided.This is way I feel it should be :) – rkosegi Oct 29 '12 at 19:48
  • I have some progress, it looks it will work that way.Now I just need to design interface to make it flexible for my purposes.Also there will be long way to work on authentication in AD environments.Once again thanks. – rkosegi Oct 31 '12 at 05:53
  • Hello @rkosegi, I realize that this post is old, however, did you ever figure this problem out? I am doing something very similar and I am stuck. If you did figure this out, could you provide me some literature that you referenced. I hate to ask for an example, but I am in desperation mode right now and would appreciate anything you can provide for me. Thank you! – SudoObey Oct 25 '18 at 14:50
  • Hi @Diesel15 , idea was abandoned long ago, sorry. I believe nowadays Samba should provide at least same capabilities like in time I was asking this. – rkosegi Oct 25 '18 at 15:07
  • @rkosegi Okay! Thank you! – SudoObey Oct 25 '18 at 15:14