demarshalling messages
Dafydd Harries
daf at rhydd.org
Thu Mar 22 21:16:41 PDT 2007
Ar 23/03/2007 am 00:02, ysgrifennodd Havoc Pennington:
> Hi,
>
> Dafydd Harries wrote:
> >
> >I'm working on implementing a D-Bus based RPC mechanism for One Laptop Per
> >Child activities. It works by forwarding messages it receives between a
> >local
> >unix socket and the network. In order to route messages efficiently, I
> >need to
> >be able to examine the recipient address of outgoing messages, which
> >entails
> >demarshalling the message. libdbus doesn't currently provide any API for
> >this;
> >how would people recommend I do this?
> >
>
> I'm not sure I understand what you mean, maybe try rephrasing?
>
> dbus_message_get_destination() should give you the recipient's bus name.
>
> Maybe if you clarify more what a D-Bus based RPC mechanism is and what
> your layer is doing on top of what libdbus does.
I'll try to elaborate. The goal is to allow the OLPC activities to make D-Bus
calls over the network, without having to understand how the D-Bus messages
are transmitted. Hence my service should act like a normal bus service,
listening on a local unix socket, except that messages sent over that socket
are sent to the network, and messages received over that socket have come over
the network.
When I receive a message on the local unix socket I need to
- validate the sender field in the message header, or add one if it's not
there
- extract the destination field in the message header, so I know where to
send it to
Doing these things entail demarshalling the message, examining it, possibly
modifying it, and marshalling it. As far as I can tell, this is not possible
with the current libdbus API. If libdbus' API were to be extended to allow
this, how would you propose it be done?
--
Dafydd
More information about the dbus
mailing list