[Xorp-hackers] Xorp for embedded applications

Ben Greear greearb at candelatech.com
Wed Oct 3 10:14:22 PDT 2007

Sonia wrote:
> Hi all, 
> Recently I wrote to this list asking for help to
> reduce the size of xorp binaries in order to make them
> fit in an embedded platform. 
> http://mailman.icsi.berkeley.edu/pipermail/xorp-hackers/2007-September/001180.html
> First of all, thank you Pavlin for your quick answer!
> As said in the previous post, we only need some
> functionalities of xorp. Specifically we want to
> implement the feature of multicast router, so as
> Pavlin said, we need only some of the binaries of xorp
> (xorp_igmp, xorp_finder, xorp_fea and the template
> files). 
> We don't mind to have few binaries in our system, but
> the size of them is prohibitive (We have 4MB of
> Flash). For example, we've tried disabling IPv6, but
> adding the compilation flag doesn't remove all the
> functions related to IPv6 and the size is not reduced.
> We think also that it could be very interesting to use
> shared libraries, or to have the choice to make a
> single binary with the selected features. Obviously we
> focus on embedded world.
> I don't know if there is some work on this. Although
> we would like to contribute to it, unfortunatly we
> don't have time.
> To sum up, we ask for ideas to reduce the size of the
> binaries or if anyone is interested in doing this work
> we're considering to make a donation. 

Once you strip the executables and use shared libraries,
I think if you want to make it smaller, you'll need
to start modifying code.  Xorp uses lots of templates
and these tend to bloat executable size.  You
might be able to replace some of the template code
with regular classes.

There is also a lot of mostly trivial classes..like for
each of the xlr commands (I think that terminology is right).

These classes could be re-written to become methods of a larger class.

You could remove much of the inline implementations in header files
and move that to .cc files.  This is generally trivial work that does
not require a real understanding of the code.

The stl, especially the string class, does much of it's work inline
as well.  If you replace the string class with something simpler
that does not inline everything, you will likely save a lot of space.


Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

More information about the Xorp-hackers mailing list