I have added a feature to OpenORB that my company
needs, so I hereby submit the changes.
Feature info:
Problem:
We are integrating one of our products with a
customer's CORBA service. Since the components are only
connected through the public internet, they are
protected with firewalls, and a NAT router. The router
rewrites network addresses in TCP packets, so what the
NamingService behind the router sees as one address is
not visible from the other side of the router. The
problem is that the NamingService redirects connections
to business objects using the addresses it sees, but
which are unusable from behind the router.
As a possible solution, there are commercial IIOP
proxies in the market that analyze IIOP messages and
rewrite network addresses using rules similar to those
the router uses to rewrite addresses in TCP packets.
The patch contains code that implements network address
rewriting in OpenORB, in a layer between sockets and
IIOPTransport. I think this is the appropriate layer
because this rewriting is in fact only a network
service. The rewriting mechanism is very simple, but
sufficient for our needs. If more complex requirements
arise, the mechanism can be easily expanded.
To configure rewriting, one should edit his OpenORB.xml
file and modify the user-mods profile, like this:
<profile name="user-mods" >
<import
xlink:href="${openorb.home}config/default.xml#InitRef">
<property name="NameService"
value="corbaloc:iiop:1.2@192.168.180.20:22001/NameService"
/>
<property name="iiop.addressRewritingRule.1"
value="192.168.180.20->10.48.11.30"/>
<property name="iiop.addressRewritingRule.2"
value="192.168.180.21->10.48.11.30"/>
</import>
</profile>
The "192.168.180.20" addresses are what the
NamingService sees, and "10.48.11.30" is what the
client sees from the other side of the router. Human
readable addresses can also be used, it is only
neccessary to use the arrow ("->") to separate
addresses and specify what is being rewritten to what.
The changes are against the OpenORB 1.3.1 release, but
modifyintg them to 1.4 should be no problem. My company
needs a stable release right now, hence 1.3.1.
Patch