[Ns-developers] Linking ns-3 with openflow

Josh Pelkey jpelkey at gatech.edu
Wed Mar 9 14:06:24 PST 2011


Hi all,

Blake's ns-3-openflow code links an outside static library called
libopenflow.a to ns-3. Everything seems to build just fine, including
ns-3 files and examples that use openflow specific functions, but at
the very end I get this:

debug/libns3.so: undefined reference to `set_vlan_pcp'
debug/libns3.so: undefined reference to `set_dl_addr'
debug/libns3.so: undefined reference to `ofp_logdir'
debug/libns3.so: undefined reference to `retrieve_buffer'
debug/libns3.so: undefined reference to `discard_buffer'
debug/libns3.so: undefined reference to `set_tp_port'
debug/libns3.so: undefined reference to `set_mpls_exp'
debug/libns3.so: undefined reference to `strip_vlan'
debug/libns3.so: undefined reference to `set_mpls_label'
debug/libns3.so: undefined reference to `set_vlan_vid'
debug/libns3.so: undefined reference to `set_nw_addr'
debug/libns3.so: undefined reference to `ofp_rundir'
collect2: ld returned 1 exit status

I thought this might be waf/wscript related, but I just spent hours
doing basically trial and error, and I didn't get any farther. I also
thought it might have to do with the fact that I'm trying to link a
static library, so I tried to build openflow as a shared library, but
then ./waf configure refused to see the library -- even though it was
there. So then I thought that might have to do with the
"conf.check(fragment=...)" within the openflow wscript, but I really
have no idea where to start with that. Obviously, I'm kind of lost
when it comes to this waf/wscript/libraries thing. Does anybody have
any thoughts or suggestions? Below is a link to the wscript used to
link openflow, as well as the wscript which is used outside of ns-3 to
create the static library in the stand-alone openflow source:

http://code.nsnam.org/bhurd/ns-3-openflow/file/c8e9530fcbdb/src/devices/switch/wscript
<--- This basically follows what ns-3-click did for its wscript
http://code.nsnam.org/bhurd/ns-3-openflow/file/c8e9530fcbdb/src/devices/switch/openflow/wscript

Thanks for any help.

--
Josh Pelkey


More information about the Ns-developers mailing list