├── .gitignore ├── AUTHORS ├── Apple ├── Frameworks │ ├── confuse.h │ └── iOSlibconfuse.a ├── README.md ├── oor-Bridging-Header.h ├── oor-apple.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── Oriol.xcuserdatad │ │ │ ├── IDEFindNavigatorScopes.plist │ │ │ └── UserInterfaceState (client109-10-192-203.eduroam.upc.edu's conflicted copy 2017-07-26).xcuserstate │ └── xcuserdata │ │ └── Oriol.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── oor-ios.xcscheme │ │ ├── oor-macos.xcscheme │ │ ├── oorPacketTunnelProvider.xcscheme │ │ └── xcschememanagement.plist ├── oor-ios │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-1024.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-20.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-20@2x.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-20@3x.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-29.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-29@2x.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-29@3x.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-40.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-40@2x.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-40@3x.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-60@2x.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-60@3x.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-76.png │ │ │ ├── Screen Shot 2017-11-14 at 20.30.00-76@2x.png │ │ │ └── Screen Shot 2017-11-14 at 20.30.00-83.5@2x.png │ │ ├── Contents.json │ │ └── OOR-logo.imageset │ │ │ ├── Contents.json │ │ │ └── OOR-logo.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── Launchscreenlogo.png │ ├── LogViewController.swift │ ├── SettingsViewController.swift │ ├── ViewController.swift │ └── oor-ios.entitlements ├── oor-macos │ └── main.c └── oorPacketTunnelProvider │ ├── Info.plist │ ├── PacketTunnelProvider.swift │ ├── Reachability.swift │ ├── Result.swift │ ├── Socket.swift │ ├── SwiftSocket.h │ ├── UDPClient.swift │ ├── oorPacketTunnelProvider.entitlements │ └── yudpsocket.c ├── Docker ├── Dockerfile ├── Dockerfile_testing ├── README.md ├── compose-examples │ └── 2xtrs-1msmr │ │ ├── docker-compose-2-xtr-1ms.yml │ │ ├── oor.msmr.conf │ │ ├── oor.xtr1.conf │ │ ├── oor.xtr2.conf │ │ └── scenario.sh ├── docker-compose-network.yml └── files │ ├── start.sh │ └── start_testing.sh ├── FAQ.md ├── LICENSE ├── Makefile ├── README.md ├── RELEASE_NOTES.md ├── VPP ├── README.md ├── oor_ctrl-plugin │ ├── Makefile.am │ ├── configure.ac │ ├── oor_ctrl.am │ └── oor_ctrl │ │ ├── node.c │ │ ├── oor_ctrl.api │ │ ├── oor_ctrl.c │ │ ├── oor_ctrl.h │ │ ├── oor_ctrl_all_api_h.h │ │ ├── oor_ctrl_msg_enum.h │ │ └── oor_ctrl_test.c ├── oor_pkt_miss-plugin │ ├── Makefile.am │ ├── configure.ac │ ├── oor_pkt_miss.am │ └── oor_pkt_miss │ │ ├── node.c │ │ ├── oor_pkt_miss.api │ │ ├── oor_pkt_miss.c │ │ ├── oor_pkt_miss.h │ │ ├── oor_pkt_miss_all_api_h.h │ │ ├── oor_pkt_miss_msg_enum.h │ │ └── oor_pkt_miss_test.c └── vpp.patch ├── Vagrantfile ├── android ├── .gitignore ├── .idea │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── README.md ├── app │ ├── .gitignore │ ├── CMakeLists.txt │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── org │ │ │ └── openoverlayrouter │ │ │ └── noroot │ │ │ ├── AdditionalKeyStore.java │ │ │ ├── ConfigTools.java │ │ │ ├── LoginActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── MultiSelectionSpinner.java │ │ │ ├── OOR.java │ │ │ ├── OORService.java │ │ │ ├── OOR_JNI.java │ │ │ ├── SuShell.java │ │ │ ├── logActivity.java │ │ │ ├── noroot_OOR.java │ │ │ ├── noroot_OORVPNService.java │ │ │ └── updateConfActivity.java │ │ └── res │ │ ├── drawable-hdpi │ │ ├── ic_account.png │ │ ├── ic_refresh.png │ │ ├── oorlogo.png │ │ ├── oorlogolauncher.png │ │ └── oorlogoselected.png │ │ ├── drawable-ldpi │ │ ├── ic_account.png │ │ └── ic_refresh.png │ │ ├── drawable-mdpi │ │ ├── ic_account.png │ │ ├── ic_refresh.png │ │ └── oor_logo_small.png │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xhdpi │ │ ├── ic_account.png │ │ └── ic_refresh.png │ │ ├── drawable-xxhdpi │ │ ├── ic_account.png │ │ └── ic_refresh.png │ │ ├── drawable-xxxhdpi │ │ ├── ic_account.png │ │ └── ic_refresh.png │ │ ├── drawable │ │ ├── empty_tall_divider.xml │ │ ├── ic_launcher_background.xml │ │ └── imageselector.xml │ │ ├── layout │ │ ├── activity_login.xml │ │ ├── log.xml │ │ ├── main.xml │ │ ├── maintabs.xml │ │ └── updateconf2.xml │ │ ├── menu │ │ └── loginmenu.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── raw │ │ └── apache.crt │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── color.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── ids.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jni │ ├── Android.mk │ ├── Application.mk │ ├── confuse_android │ │ ├── ABOUT-NLS │ │ ├── AUTHORS │ │ ├── Android.mk │ │ ├── INSTALL │ │ ├── Makefile │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── NEWS │ │ ├── README │ │ ├── aclocal.m4 │ │ ├── config.h │ │ ├── config.h.in │ │ ├── config.log │ │ ├── config.status │ │ ├── configure │ │ ├── configure.ac │ │ ├── doc │ │ │ ├── Doxyfile │ │ │ ├── Doxyfile.in │ │ │ ├── Makefile │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── css.xsl │ │ │ ├── doxygen-footer.html │ │ │ ├── doxygen-header.html │ │ │ ├── doxygen.css │ │ │ ├── html │ │ │ │ ├── annotated.html │ │ │ │ ├── classes.html │ │ │ │ ├── confuse_8h-source.html │ │ │ │ ├── confuse_8h.html │ │ │ │ ├── doxygen.png │ │ │ │ ├── examples.html │ │ │ │ ├── files.html │ │ │ │ ├── ftpconf_8c-example.html │ │ │ │ ├── functions.html │ │ │ │ ├── functions_vars.html │ │ │ │ ├── globals.html │ │ │ │ ├── globals_defs.html │ │ │ │ ├── globals_enum.html │ │ │ │ ├── globals_eval.html │ │ │ │ ├── globals_func.html │ │ │ │ ├── globals_type.html │ │ │ │ ├── index.html │ │ │ │ ├── reread_8c-example.html │ │ │ │ ├── simple_8c-example.html │ │ │ │ ├── structcfg__defvalue__t.html │ │ │ │ ├── structcfg__opt__t.html │ │ │ │ ├── structcfg__t.html │ │ │ │ ├── tab_b.gif │ │ │ │ ├── tab_l.gif │ │ │ │ ├── tab_r.gif │ │ │ │ ├── tabs.css │ │ │ │ ├── tutorial.css │ │ │ │ └── unioncfg__value__t.html │ │ │ ├── listing1.c │ │ │ ├── listing2.c │ │ │ ├── listing3.c │ │ │ ├── listing4.c │ │ │ ├── listing5.c │ │ │ ├── listing6.c │ │ │ ├── listing7.c │ │ │ ├── listing8.c │ │ │ ├── man │ │ │ │ └── man3 │ │ │ │ │ ├── cfg_defvalue_t.3 │ │ │ │ │ ├── cfg_opt_t.3 │ │ │ │ │ ├── cfg_t.3 │ │ │ │ │ ├── cfg_value_t.3 │ │ │ │ │ └── confuse.h.3 │ │ │ ├── tutorial-html │ │ │ │ ├── ar01s02.html │ │ │ │ ├── ar01s03.html │ │ │ │ ├── ar01s04.html │ │ │ │ ├── ar01s05.html │ │ │ │ ├── ar01s06.html │ │ │ │ ├── ar01s07.html │ │ │ │ ├── ar01s08.html │ │ │ │ ├── ar01s09.html │ │ │ │ ├── index.html │ │ │ │ └── tutorial.css │ │ │ ├── tutorial.css │ │ │ └── tutorial.xml │ │ ├── examples │ │ │ ├── Makefile │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── ftp.conf │ │ │ ├── ftpconf.c │ │ │ ├── reread.c │ │ │ ├── reread.conf │ │ │ ├── simple.c │ │ │ └── simple.conf │ │ ├── libconfuse.pc │ │ ├── libconfuse.pc.in │ │ ├── libconfuse.spec │ │ ├── libconfuse.spec.in │ │ ├── libtool │ │ ├── m4 │ │ │ ├── Makefile │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── codeset.m4 │ │ │ ├── gettext.m4 │ │ │ ├── glibc21.m4 │ │ │ ├── iconv.m4 │ │ │ ├── intdiv0.m4 │ │ │ ├── intmax.m4 │ │ │ ├── inttypes-pri.m4 │ │ │ ├── inttypes_h.m4 │ │ │ ├── lcmessage.m4 │ │ │ ├── lib-ld.m4 │ │ │ ├── lib-link.m4 │ │ │ ├── lib-prefix.m4 │ │ │ ├── libtool.m4 │ │ │ ├── longdouble.m4 │ │ │ ├── longlong.m4 │ │ │ ├── ltoptions.m4 │ │ │ ├── ltsugar.m4 │ │ │ ├── ltversion.m4 │ │ │ ├── lt~obsolete.m4 │ │ │ ├── nls.m4 │ │ │ ├── po.m4 │ │ │ ├── printf-posix.m4 │ │ │ ├── progtest.m4 │ │ │ ├── size_max.m4 │ │ │ ├── stdint_h.m4 │ │ │ ├── uintmax_t.m4 │ │ │ ├── ulonglong.m4 │ │ │ ├── wchar_t.m4 │ │ │ ├── wint_t.m4 │ │ │ └── xsize.m4 │ │ ├── src │ │ │ ├── Android.mk │ │ │ ├── Makefile │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── confuse.c │ │ │ ├── confuse.h │ │ │ ├── lexer.c │ │ │ └── lexer.l │ │ ├── stamp-h1 │ │ ├── support │ │ │ ├── config.guess │ │ │ ├── config.rpath │ │ │ ├── config.sub │ │ │ ├── depcomp │ │ │ ├── install-sh │ │ │ ├── ltmain.sh │ │ │ ├── missing │ │ │ └── ylwrap │ │ └── tests │ │ │ ├── Makefile │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── a.conf │ │ │ ├── b.conf │ │ │ ├── check_confuse.h │ │ │ ├── include.c │ │ │ ├── list_plus_syntax.c │ │ │ ├── quote_before_print.c │ │ │ ├── section_title_dupes.c │ │ │ ├── single_title_sections.c │ │ │ ├── suite_dup.c │ │ │ ├── suite_func.c │ │ │ ├── suite_list.c │ │ │ ├── suite_single.c │ │ │ └── suite_validate.c │ └── norootAndroid.mk └── settings.gradle ├── netconf ├── README ├── datastore.xml ├── iana-afn-safi.yang ├── iana-afn-safi.yin ├── ietf-inet-types.yang ├── ietf-yang-types.yang ├── lispsimple.paths ├── lispsimple.yang ├── netconf.conf.example ├── oor_Makefile ├── oor_api_netconf.c ├── oor_api_netconf.h └── oor_lispsimple.c ├── oor ├── .gitignore ├── .idea │ └── vcs.xml ├── CMakeLists.txt ├── CodingStyle.md ├── Makefile ├── cmdline.c ├── cmdline.h ├── config │ ├── oor_api.c │ ├── oor_api.h │ ├── oor_api_internals.c │ ├── oor_api_internals.h │ ├── oor_config_confuse.c │ ├── oor_config_confuse.h │ ├── oor_config_functions.c │ ├── oor_config_functions.h │ ├── oor_config_uci.c │ └── oor_config_uci.h ├── control │ ├── control-data-plane │ │ ├── apple │ │ │ └── ios │ │ │ │ ├── cdp_ios.c │ │ │ │ └── cdp_ios.h │ │ ├── control-data-plane.c │ │ ├── control-data-plane.h │ │ ├── tun │ │ │ ├── cdp_tun.c │ │ │ └── cdp_tun.h │ │ ├── vpnapi │ │ │ ├── cdp_vpnapi.c │ │ │ └── cdp_vpnapi.h │ │ └── vpp │ │ │ ├── cdp_vpp.c │ │ │ └── cdp_vpp.h │ ├── lisp_ddt_mr.c │ ├── lisp_ddt_mr.h │ ├── lisp_ddt_node.c │ ├── lisp_ddt_node.h │ ├── lisp_ms.c │ ├── lisp_ms.h │ ├── lisp_rtr.c │ ├── lisp_rtr.h │ ├── lisp_tr.c │ ├── lisp_tr.h │ ├── lisp_xtr.c │ ├── lisp_xtr.h │ ├── oor_control.c │ ├── oor_control.h │ ├── oor_ctrl_device.c │ ├── oor_ctrl_device.h │ ├── oor_local_db.c │ ├── oor_local_db.h │ ├── oor_map_cache.c │ └── oor_map_cache.h ├── data-plane │ ├── apple │ │ └── ios │ │ │ ├── ios.c │ │ │ ├── ios.h │ │ │ ├── ios_input.c │ │ │ ├── ios_input.h │ │ │ ├── ios_output.c │ │ │ └── ios_output.h │ ├── data-plane.c │ ├── data-plane.h │ ├── encapsulations │ │ ├── vxlan-gpe.c │ │ └── vxlan-gpe.h │ ├── ttable.c │ ├── ttable.h │ ├── tun │ │ ├── tun.c │ │ ├── tun.h │ │ ├── tun_input.c │ │ ├── tun_input.h │ │ ├── tun_output.c │ │ └── tun_output.h │ ├── vpnapi │ │ ├── vpnapi.c │ │ ├── vpnapi.h │ │ ├── vpnapi_input.c │ │ ├── vpnapi_input.h │ │ ├── vpnapi_output.c │ │ └── vpnapi_output.h │ └── vpp │ │ ├── vpp.c │ │ └── vpp.h ├── defs.h ├── elibs │ ├── bob │ │ └── lookup3.c │ ├── khash │ │ └── khash.h │ ├── mbedtls │ │ ├── md.c │ │ ├── md.h │ │ ├── md_internal.h │ │ ├── md_wrap.c │ │ ├── sha1.c │ │ ├── sha1.h │ │ ├── sha256.c │ │ └── sha256.h │ ├── ovs │ │ ├── list.h │ │ └── ovs_util.h │ └── patricia │ │ ├── patricia.c │ │ └── patricia.h ├── fwd_policies │ ├── balancing_locators.c │ ├── balancing_locators.h │ ├── flow_balancing │ │ ├── fb_addr_func.c │ │ ├── fb_addr_func.h │ │ ├── flow_balancing.c │ │ ├── flow_balancing.h │ │ ├── fwd_entry_tuple.c │ │ └── fwd_entry_tuple.h │ ├── fwd_addr_func.c │ ├── fwd_addr_func.h │ ├── fwd_policy.c │ ├── fwd_policy.h │ ├── fwd_utils.c │ ├── fwd_utils.h │ └── vpp_balancing │ │ ├── fwd_entry_vpp.c │ │ ├── fwd_entry_vpp.h │ │ ├── vpp_balancing.c │ │ └── vpp_balancing.h ├── iface_list.c ├── iface_list.h ├── lib │ ├── cksum.c │ ├── cksum.h │ ├── ddt_map_cache_entry.c │ ├── ddt_map_cache_entry.h │ ├── generic_list.c │ ├── generic_list.h │ ├── hmac.c │ ├── hmac.h │ ├── htable_ptrs.c │ ├── htable_ptrs.h │ ├── iface_locators.c │ ├── iface_locators.h │ ├── int_table.c │ ├── int_table.h │ ├── interfaces_lib.c │ ├── interfaces_lib.h │ ├── ios_packetTunnelProvider_api.c │ ├── ios_packetTunnelProvider_api.h │ ├── ios_packetTunnelProvider_api_l.h │ ├── lbuf.c │ ├── lbuf.h │ ├── lisp_site.c │ ├── lisp_site.h │ ├── map_cache_entry.c │ ├── map_cache_entry.h │ ├── map_cache_rtr_data.c │ ├── map_cache_rtr_data.h │ ├── map_local_entry.c │ ├── map_local_entry.h │ ├── mapping_db.c │ ├── mapping_db.h │ ├── mem_util.c │ ├── mem_util.h │ ├── nonces_table.c │ ├── nonces_table.h │ ├── oor_log.c │ ├── oor_log.h │ ├── packets.c │ ├── packets.h │ ├── prefixes.c │ ├── prefixes.h │ ├── routing_tables_lib.c │ ├── routing_tables_lib.h │ ├── shash.c │ ├── shash.h │ ├── sockets-util.c │ ├── sockets-util.h │ ├── sockets.c │ ├── sockets.h │ ├── timers.c │ ├── timers.h │ ├── timers_utils.c │ ├── timers_utils.h │ ├── util.c │ ├── util.h │ └── vpp_api │ │ ├── ctrl_vpp_plugin.c │ │ ├── pkt_miss_vpp_plugin.c │ │ ├── vpp_api.c │ │ ├── vpp_api.h │ │ ├── vpp_api_reply.c │ │ ├── vpp_api_requests.c │ │ └── vpp_api_requests.h ├── liblisp │ ├── liblisp.c │ ├── liblisp.h │ ├── lisp_address.c │ ├── lisp_address.h │ ├── lisp_data.c │ ├── lisp_data.h │ ├── lisp_ip.c │ ├── lisp_ip.h │ ├── lisp_lcaf.c │ ├── lisp_lcaf.h │ ├── lisp_locator.c │ ├── lisp_locator.h │ ├── lisp_mapping.c │ ├── lisp_mapping.h │ ├── lisp_message_fields.c │ ├── lisp_message_fields.h │ ├── lisp_messages.c │ ├── lisp_messages.h │ ├── lisp_mref_mapping.c │ └── lisp_mref_mapping.h ├── modelines ├── net_mgr │ ├── apple │ │ └── ios │ │ │ ├── netm_ios.c │ │ │ ├── netm_ios.h │ │ │ └── route.h │ ├── kernel │ │ ├── iface_mgmt.c │ │ ├── iface_mgmt.h │ │ ├── netm_kernel.c │ │ └── netm_kernel.h │ ├── net_mgr.c │ ├── net_mgr.h │ ├── net_mgr_proc_fc.c │ ├── net_mgr_proc_fc.h │ └── vpp │ │ ├── netm_vpp.c │ │ └── netm_vpp.h ├── oor.c ├── oor.conf.example ├── oor.ggo ├── oor.h ├── oor.service ├── oor_external.h ├── oor_jni.c └── oor_jni.h ├── openWRT ├── Makefile ├── oor.uci.example └── openwrt.init.script ├── tests ├── .gitignore ├── Makefile ├── clientserver.h ├── tcp_echo.h ├── tcp_echo_client.c ├── tcp_echo_server.c ├── udp_echo_client.c └── udp_echo_server.c └── vagrant ├── .bash_history ├── .gdbinit ├── .tmux.conf ├── README.md ├── TODO.md ├── Vagrantfile ├── bashrc_additions ├── build-oor-apk.sh ├── config-dotfiles.sh ├── config-oor.sh ├── install-android-sdk.sh ├── install-odl.sh ├── install-oor.sh ├── install-optional.sh ├── install-oracle-java8.sh ├── install-prereqs.sh ├── install-unprivileged.sh ├── karaf.history ├── oor.mn1.conf ├── oor.mn2.conf ├── oor.msmr.conf ├── oor.rtr.conf ├── run-oor-android-emulator.sh ├── run-oor.sh └── wireshark-common_config.dat /.gitignore: -------------------------------------------------------------------------------- 1 | Debug 2 | Release 3 | .cproject 4 | .project 5 | .vagrant 6 | *o 7 | .DS_Store 8 | ._.DS_Store 9 | **/.DS_Store 10 | **/._.DS_Store 11 | *.xcuserstate 12 | *.xcuserdata 13 | *.xcbkptlist 14 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | We thank the following people for their contributions to the project. 2 | 3 | David Meyer 4 | Preethi Natarajan 5 | Vina Ermagan 6 | Chris White 7 | Albert Cabellos 8 | Lorand Jakab 9 | Albert Lopez 10 | Marc Portolés 11 | Pranathi Mamidi 12 | Alberto Rodriguez-Natal 13 | Vasileios Lakafosis 14 | Florin Coras 15 | Konrad Gawda 16 | Matthieu Coudron 17 | Rene Bartsch 18 | Michiel Blokzijl 19 | François Cachereul 20 | Lluís García Torres 21 | José Miguel Guzmán 22 | José Ortiz Padilla 23 | Ernest Puigdemont 24 | Oriol Marti 25 | -------------------------------------------------------------------------------- /Apple/Frameworks/iOSlibconfuse.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/Frameworks/iOSlibconfuse.a -------------------------------------------------------------------------------- /Apple/README.md: -------------------------------------------------------------------------------- 1 | # OpenOverlayRouter on Apple iOS 2 | 3 | Open Overlay Router includes support for Apple iOS devices operating as LISP mobile 4 | nodes (LISP-MN). The application is limited to one single EID (IPv4 or IPv6) mapped to one 5 | or more RLOC interfaces (IPv4). Even though several interfaces can be managed by Open Overlay 6 | Router at the same time, they can only be used in an active-backup fashion (no more 7 | than one interface used at once). 8 | You can install the application from the Apple Store: 9 | https://itunes.apple.com/us/app/openoverlayrouter/id1454649703?mt=8 10 | 11 | Or you can follow next steps to compile the application from source code. 12 | 13 | ## Requirements 14 | 15 | Compiling and running OOR on iOS requires the following: 16 | 17 | - Mac running macOS High Sierra 10.13.5 18 | - Xcode 9.4.1 19 | - An iPhone running iOS 11.3.1. **Is not possible to run OOR on simulator.** 20 | - An Apple Developer Account that belongs to Apple Developer Program (**paid account**). 21 | 22 | *We can't guarantee that OOR-iOS works with versions other than those listed.* 23 | 24 | ## Compile and run 25 | 26 | 1. Clone this repo. 27 | 2. Open xcode project located at oor/Apple/oor-apple.xcodeproj 28 | 3. Setup the *Bundle Identifier* and *Team* for **oor-ios** and **oorPacketTunnelProvider** targets. 29 | 4. Define the constant **tunnelBundleId** in *oor/Apple/oor-ios/ViewController.swift* 30 | 5. Be sure that you select oor-ios and your iPhone device in "active scheme" dropdown. 31 | 6. Click build and run button. 32 | 7. Enjoy! 33 | 34 | Here you can see how to build and run it: 35 | 36 | https://www.youtube.com/watch?v=z1LiZ7MFJRk 37 | 38 | 39 | -------------------------------------------------------------------------------- /Apple/oor-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // oor-Bridging-Header.h 3 | // oor-apple 4 | // 5 | // Created by Oriol Marí Marqués on 03/07/2017. 6 | // 7 | // 8 | 9 | #import "oor.h" 10 | #import "ios_packetTunnelProvider_api.h" 11 | -------------------------------------------------------------------------------- /Apple/oor-apple.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Apple/oor-apple.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Apple/oor-apple.xcodeproj/project.xcworkspace/xcuserdata/Oriol.xcuserdatad/IDEFindNavigatorScopes.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Apple/oor-apple.xcodeproj/project.xcworkspace/xcuserdata/Oriol.xcuserdatad/UserInterfaceState (client109-10-192-203.eduroam.upc.edu's conflicted copy 2017-07-26).xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-apple.xcodeproj/project.xcworkspace/xcuserdata/Oriol.xcuserdatad/UserInterfaceState (client109-10-192-203.eduroam.upc.edu's conflicted copy 2017-07-26).xcuserstate -------------------------------------------------------------------------------- /Apple/oor-apple.xcodeproj/xcuserdata/Oriol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Apple/oor-apple.xcodeproj/xcuserdata/Oriol.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | oor-ios.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | oor-macos.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | oorPacketTunnelProvider.xcscheme 18 | 19 | orderHint 20 | 2 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | BB226ADC1F0697520060F531 26 | 27 | primary 28 | 29 | 30 | BB226AE81F06976F0060F531 31 | 32 | primary 33 | 34 | 35 | BB894EF61F1E63A8009E3F8C 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-1024.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-20.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-20@2x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-20@3x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-29.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-29@2x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-29@3x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-40.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-40@2x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-40@3x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-60@2x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-60@3x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-76.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-76@2x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/AppIcon.appiconset/Screen Shot 2017-11-14 at 20.30.00-83.5@2x.png -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/OOR-logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "OOR-logo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Apple/oor-ios/Assets.xcassets/OOR-logo.imageset/OOR-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Assets.xcassets/OOR-logo.imageset/OOR-logo.png -------------------------------------------------------------------------------- /Apple/oor-ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | oor 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.1 21 | CFBundleVersion 22 | 9 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIRequiresFullScreen 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Apple/oor-ios/Launchscreenlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/Apple/oor-ios/Launchscreenlogo.png -------------------------------------------------------------------------------- /Apple/oor-ios/oor-ios.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.networking.networkextension 6 | 7 | packet-tunnel-provider 8 | 9 | com.apple.security.application-groups 10 | 11 | group.oor 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Apple/oor-macos/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // oor-macos 4 | // 5 | // Created by Oriol Marí Marqués on 30/06/2017. 6 | // 7 | // 8 | 9 | #include 10 | 11 | int main(int argc, const char * argv[]) { 12 | // insert code here... 13 | printf("Hello, World!\n"); 14 | oor_start(); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /Apple/oorPacketTunnelProvider/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | oorPacketTunnelProvider 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.1 21 | CFBundleVersion 22 | 9 23 | NSExtension 24 | 25 | NSExtensionPointIdentifier 26 | com.apple.networkextension.packet-tunnel 27 | NSExtensionPrincipalClass 28 | $(PRODUCT_MODULE_NAME).PacketTunnelProvider 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Apple/oorPacketTunnelProvider/Result.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum Result { 4 | case success 5 | case failure(Error) 6 | 7 | public var isSuccess: Bool { 8 | switch self { 9 | case .success: 10 | return true 11 | case .failure: 12 | return false 13 | } 14 | } 15 | 16 | public var isFailure: Bool { 17 | return !isSuccess 18 | } 19 | 20 | public var error: Error? { 21 | switch self { 22 | case .success: 23 | return nil 24 | case .failure(let error): 25 | return error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Apple/oorPacketTunnelProvider/SwiftSocket.h: -------------------------------------------------------------------------------- 1 | @import Foundation; 2 | 3 | //! Project version number for SwiftSocket 4 | FOUNDATION_EXPORT double SwiftSocketVersionNumber; 5 | 6 | //! Project version string for SwiftSocket 7 | FOUNDATION_EXPORT const unsigned char SwiftSocketVersionString[]; 8 | 9 | // In this header, you should import all the public headers of your framework using statements like #import 10 | -------------------------------------------------------------------------------- /Apple/oorPacketTunnelProvider/oorPacketTunnelProvider.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.networking.networkextension 6 | 7 | packet-tunnel-provider 8 | 9 | com.apple.security.application-groups 10 | 11 | group.oor 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER alopez@ac.upc.edu 3 | ENV TERM=xterm 4 | RUN apt-get update -y && apt-get install -y build-essential git-core libconfuse-dev gengetopt libcap2-bin libzmq3-dev libxml2-dev iputils-ping && apt-get autoclean && apt-get autoremove 5 | RUN git clone git://github.com/OpenOverlayRouter/oor.git 6 | WORKDIR /oor 7 | RUN make 8 | RUN make install 9 | RUN rm -rf /oor 10 | COPY files/*.sh /tmp/ 11 | ENV DEBUG 0 12 | ENV OPMODE xTR 13 | ENV IPMAPRESOLVER - 14 | ENV IPMAPSERVER - 15 | ENV KEYMAPSERVER - 16 | ENV IPPROXYETRV4 - 17 | ENV IPPROXYETRV6 - 18 | ENV IPV4EIDPREFFIX - 19 | ENV IPV6EIDPREFFIX - 20 | CMD /tmp/start.sh $DEBUG $OPMODE $IPMAPRESOLVER $IPMAPSERVER $KEYMAPSERVER $IPPROXYETRV4 $IPPROXYETRV6 $IPV4EIDPREFFIX $IPV6EIDPREFFIX 21 | -------------------------------------------------------------------------------- /Docker/Dockerfile_testing: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER alopez@ac.upc.edu 3 | ENV TERM=xterm 4 | RUN apt-get update -y && apt-get install -y build-essential git-core libconfuse-dev gengetopt libcap2-bin libzmq3-dev libxml2-dev iputils-ping && apt-get autoclean && apt-get autoremove 5 | RUN git clone git://github.com/OpenOverlayRouter/oor.git -b testing 6 | WORKDIR /oor 7 | RUN make 8 | RUN make install 9 | RUN rm -rf /oor 10 | COPY files/*.sh /tmp/ 11 | ENV DEBUG 0 12 | ENV OPMODE xTR 13 | ENV IPMAPRESOLVER - 14 | ENV IPMAPSERVER - 15 | ENV KEYMAPSERVER - 16 | ENV IPPROXYETRV4 - 17 | ENV IPPROXYETRV6 - 18 | ENV IPV4EIDPREFFIX - 19 | ENV IPV6EIDPREFFIX - 20 | CMD /tmp/start_testing.sh $DEBUG $OPMODE $IPMAPRESOLVER $IPMAPSERVER $KEYMAPSERVER $IPPROXYETRV4 $IPPROXYETRV6 $IPV4EIDPREFFIX $IPV6EIDPREFFIX 21 | -------------------------------------------------------------------------------- /Docker/compose-examples/2xtrs-1msmr/oor.msmr.conf: -------------------------------------------------------------------------------- 1 | debug = 3 2 | map-request-retries = 2 3 | log-file = /var/log/oor.log 4 | ipv6-scope = SITE 5 | operating-mode = MS 6 | control-iface = eth0 7 | 8 | # xTR1 9 | lisp-site { 10 | eid-prefix = 192.168.1.0/24 11 | key-type = 1 12 | key = password 13 | iid = 0 14 | accept-more-specifics = true 15 | } 16 | 17 | lisp-site { 18 | eid-prefix = fd00:1::/64 19 | key-type = 1 20 | key = password 21 | iid = 0 22 | accept-more-specifics = true 23 | } 24 | 25 | # xTR2 26 | lisp-site { 27 | eid-prefix = 192.168.2.0/24 28 | key-type = 1 29 | key = password 30 | iid = 0 31 | accept-more-specifics = true 32 | } 33 | 34 | lisp-site { 35 | eid-prefix = fd00:2::/64 36 | key-type = 1 37 | key = password 38 | iid = 0 39 | accept-more-specifics = true 40 | } 41 | -------------------------------------------------------------------------------- /Docker/compose-examples/2xtrs-1msmr/oor.xtr1.conf: -------------------------------------------------------------------------------- 1 | debug = 1 2 | map-request-retries = 2 3 | log-file = /var/log/oor.log 4 | ipv6-scope = SITE 5 | operating-mode = xTR 6 | encapsulation = LISP 7 | nat_traversal_support = off 8 | rloc-probing { 9 | rloc-probe-interval = 0 10 | } 11 | map-resolver = { 12 | 10.0.0.2 13 | } 14 | map-server { 15 | address = 10.0.0.2 16 | key-type = 1 17 | key = password 18 | proxy-reply = off 19 | } 20 | database-mapping { 21 | eid-prefix = 192.168.1.0/24 22 | iid = 0 23 | ttl = 10 24 | rloc-address { 25 | address = 10.0.0.3 26 | priority = 1 27 | weight = 100 28 | } 29 | } 30 | database-mapping { 31 | eid-prefix = fd00:1::/64 32 | iid = 0 33 | ttl = 10 34 | rloc-address { 35 | address = 10.0.0.3 36 | priority = 1 37 | weight = 100 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Docker/compose-examples/2xtrs-1msmr/oor.xtr2.conf: -------------------------------------------------------------------------------- 1 | debug = 1 2 | map-request-retries = 2 3 | log-file = /var/log/oor.log 4 | ipv6-scope = SITE 5 | operating-mode = xTR 6 | encapsulation = LISP 7 | nat_traversal_support = off 8 | rloc-probing { 9 | rloc-probe-interval = 0 10 | } 11 | map-resolver = { 12 | 10.0.0.2 13 | } 14 | map-server { 15 | address = 10.0.0.2 16 | key-type = 1 17 | key = password 18 | proxy-reply = off 19 | } 20 | database-mapping { 21 | eid-prefix = 192.168.2.0/24 22 | iid = 0 23 | ttl = 10 24 | rloc-address { 25 | address = 10.0.0.4 26 | priority = 1 27 | weight = 10 28 | } 29 | } 30 | database-mapping { 31 | eid-prefix = fd00:2::/64 32 | iid = 0 33 | ttl = 10 34 | rloc-address { 35 | address = 10.0.0.4 36 | priority = 1 37 | weight = 10 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Docker/compose-examples/2xtrs-1msmr/scenario.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Init 4 | FILE="/tmp/out.$$" 5 | GREP="/bin/grep" 6 | #.... 7 | # Make sure only root can run our script 8 | if [[ $EUID -ne 0 ]]; then 9 | echo "This script must be run as root" 1>&2 10 | exit 11 | fi 12 | 13 | if [ "$#" -ne 1 ]; then 14 | echo "scenario [UP|DOWN]" 15 | exit 16 | fi 17 | 18 | if [ $1 == "UP" -o $1 == "up" ] ; then 19 | docker-compose -f ./docker-compose-2-xtr-1ms.yml up -d 20 | docker exec --privileged client1 ip route del default 21 | docker exec --privileged client1 ip -6 route del default 22 | docker exec --privileged client1 ip route add default via 192.168.1.2 23 | docker exec --privileged client1 ip -6 route add default via fd00:1::2 24 | 25 | docker exec --privileged client2 ip route del default 26 | docker exec --privileged client2 ip -6 route del default 27 | docker exec --privileged client2 ip route add default via 192.168.2.2 28 | docker exec --privileged client2 ip -6 route add default via fd00:2::2 29 | echo "**********************************************" 30 | echo "To access to the clients use: docker exec -it [client1|client2] sh" 31 | elif [ $1 == "DOWN" -o $1 == "down" ] ; then 32 | docker-compose -f ./docker-compose-2-xtr-1ms.yml down 33 | else 34 | echo "scenario [UP|DOWN]" 35 | fi 36 | -------------------------------------------------------------------------------- /Docker/docker-compose-network.yml: -------------------------------------------------------------------------------- 1 | version: "2.3" 2 | services: 3 | oor: 4 | image: openoverlayrouter/oor:latest 5 | cap_add: 6 | - NET_ADMIN 7 | - NET_RAW 8 | sysctls: 9 | - net.ipv4.conf.default.rp_filter=0 10 | - net.ipv4.conf.all.rp_filter=0 11 | - net.ipv4.ip_forward=1 12 | - net.ipv6.conf.all.forwarding=1 13 | - net.ipv6.conf.all.disable_ipv6=0 14 | devices: 15 | - "/dev/net/tun:/dev/net/tun" 16 | networks: 17 | 0rloc: 18 | ipv4_address: 19 | ipv6_address: 20 | 1eids: 21 | ipv4_address: 22 | ipv6_address: 23 | environment: 24 | - IPV4EIDPREFFIX="\/" 25 | - IPV6EIDPREFFIX="\/" 26 | - DEBUG="0" 27 | - OPMODE="xTR" 28 | - IPMAPRESOLVER= 29 | - IPMAPSERVER= 30 | - KEYMAPSERVER= 31 | - IPPROXYETRV4= 32 | - IPPROXYETRV6= 33 | volumes: 34 | - type: bind 35 | source: "./" 36 | target: "/oor/oor.conf" 37 | restart: on-failure 38 | watchtower: 39 | image: v2tec/watchtower 40 | volumes: 41 | - /var/run/docker.sock:/var/run/docker.sock 42 | command: --cleanup --interval 30 43 | 44 | networks: 45 | 1eids: 46 | driver: bridge 47 | enable_ipv6: true 48 | ipam: 49 | driver: default 50 | config: 51 | - subnet: 52 | - subnet: 53 | 0rloc: 54 | driver: macvlan 55 | enable_ipv6: true 56 | ipam: 57 | driver: default 58 | config: 59 | - subnet: 60 | - subnet: 61 | driver_opts: 62 | parent: 63 | macvlan_mode: bridge 64 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | DIRS = oor 2 | BUILDDIRS = $(DIRS:%=build-%) 3 | INSTALLDIRS = $(DIRS:%=install-%) 4 | UNINSTALLDIRS = $(DIRS:%=uninstall-%) 5 | CLEANDIRS = $(DIRS:%=clean-%) android 6 | 7 | 8 | all: $(BUILDDIRS) 9 | $(DIRS): $(BUILDDIRS) 10 | $(BUILDDIRS): 11 | $(MAKE) -C $(@:build-%=%) 12 | 13 | install: $(INSTALLDIRS) all 14 | $(INSTALLDIRS): 15 | $(MAKE) -C $(@:install-%=%) install 16 | 17 | uninstall: $(UNINSTALLDIRS) 18 | $(UNINSTALLDIRS): 19 | $(MAKE) -C $(@:uninstall-%=%) uninstall 20 | 21 | clean: $(CLEANDIRS) 22 | $(CLEANDIRS): 23 | $(MAKE) -C $(@:clean-%=%) clean 24 | 25 | .PHONY: subdirs $(DIRS) 26 | .PHONY: subdirs $(BUILDDIRS) 27 | .PHONY: subdirs $(INSTALLDIRS) 28 | .PHONY: subdirs $(CLEANDIRS) 29 | .PHONY: all install clean 30 | -------------------------------------------------------------------------------- /RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | Release notes 2 | ------------- 3 | 4 | OpenOverlayRouter is a rename of the LISPmob project forked from the last version released (version 0.5.2.). OOR aims to deliver a flexible and modular open-source implementation to deploy programmable overlay networks. Major new functionalities since LISPmob last release include a new control plane to configure xTR devices through NETCONF and a new data plane based on VXLAN-GPE. For the full list of functionalities refer to the features section. 5 | 6 | New functionalities since OOR 1.3 7 | 8 | * Apple iOS application 9 | * DDT Support (RFC 8111): 10 | - DDT node 11 | - DDT MR 12 | - DDT MS 13 | * xTR / MN: Specify allowed destination EID prefixes (Linux and OpenWRT) 14 | * Register remote rloc-address of a database mapping 15 | 16 | New functionalities since OOR 1.2 17 | 18 | * NAT traversal support for RTRs and MSs 19 | * OOR as a container with Dockers 20 | * Quick creation of a VM with OOR using Vagrant 21 | 22 | New functionalities since OOR 1.1 23 | 24 | * VPP data plane support 25 | * Modularize the network manager 26 | * Replace proxy-etr by proxy-etr-ipv4 and proxy-etr-ipv6 27 | 28 | New functionalities since OOR 1.0 29 | 30 | * Experimental NAT traversal (xTR & MN) 31 | * Bug fixes 32 | 33 | New functionalities (since LISPmob 0.5.2): 34 | 35 | * NETCONF support to configure xTR device: 36 | - Add / Remove database mappings 37 | - Add / Remove Map Servers 38 | - Add / Remove Map Resolvers 39 | * Packet encapsulation using VXLAN-GPE. Next protocol can be IPv4 or IPv6. 40 | * Support for InstanceID (IID) and Virtual Network Identifier (VNI) at control and data plane. OOR doesn't support overlapping local prefixes with different IIDs. 41 | -------------------------------------------------------------------------------- /VPP/oor_ctrl-plugin/configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT(oor_ctrl_plugin, 1.0) 2 | LT_INIT 3 | AM_INIT_AUTOMAKE 4 | AM_SILENT_RULES([yes]) 5 | AC_PREFIX_DEFAULT([/usr]) 6 | 7 | AC_PROG_CC 8 | 9 | AC_OUTPUT([Makefile]) 10 | 11 | AC_CONFIG_MACRO_DIR([m4]) 12 | -------------------------------------------------------------------------------- /VPP/oor_ctrl-plugin/oor_ctrl.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Cisco and/or its affiliates. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at: 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | vppapitestplugins_LTLIBRARIES += oor_ctrl_test_plugin.la 15 | vppplugins_LTLIBRARIES += oor_ctrl_plugin.la 16 | 17 | oor_ctrl_plugin_la_SOURCES = \ 18 | oor_ctrl/oor_ctrl.c \ 19 | oor_ctrl/node.c \ 20 | oor_ctrl/oor_ctrl_plugin.api.h 21 | 22 | API_FILES += oor_ctrl/oor_ctrl.api 23 | 24 | nobase_apiinclude_HEADERS += \ 25 | oor_ctrl/oor_ctrl_all_api_h.h \ 26 | oor_ctrl/oor_ctrl_msg_enum.h \ 27 | oor_ctrl/oor_ctrl.api.h 28 | 29 | oor_ctrl_test_plugin_la_SOURCES = oor_ctrl/oor_ctrl_test.c oor_ctrl/oor_ctrl_plugin.api.h 30 | 31 | # vi:syntax=automake -------------------------------------------------------------------------------- /VPP/oor_ctrl-plugin/oor_ctrl/oor_ctrl.api: -------------------------------------------------------------------------------- 1 | 2 | /* Define a simple enable-disable binary API to control the feature */ 3 | 4 | define oor_ctrl_enable_disable { 5 | /* Client identifier, set from api_main.my_client_index */ 6 | u32 client_index; 7 | 8 | /* Arbitrary context, so client can match reply to request */ 9 | u32 context; 10 | 11 | /* Enable / disable the feature */ 12 | u8 enable_disable; 13 | 14 | /* Interface handle */ 15 | u8 host_if_name[64]; 16 | }; 17 | 18 | define oor_ctrl_enable_disable_reply { 19 | /* From the request */ 20 | u32 context; 21 | 22 | /* Return value, zero means all OK */ 23 | i32 retval; 24 | }; 25 | -------------------------------------------------------------------------------- /VPP/oor_ctrl-plugin/oor_ctrl/oor_ctrl_all_api_h.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * oor_ctrl_all_api_h.h - skeleton vpp engine plug-in api #include file 4 | * 5 | * Copyright (c) 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | /* Include the generated file, see BUILT_SOURCES in Makefile.am */ 19 | #include 20 | -------------------------------------------------------------------------------- /VPP/oor_ctrl-plugin/oor_ctrl/oor_ctrl_msg_enum.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * oor_ctrl_msg_enum.h - skeleton vpp engine plug-in message enumeration 4 | * 5 | * Copyright (c) 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef included_oor_ctrl_msg_enum_h 19 | #define included_oor_ctrl_msg_enum_h 20 | 21 | #include 22 | 23 | #define vl_msg_id(n,h) n, 24 | typedef enum { 25 | #include 26 | /* We'll want to know how many messages IDs we need... */ 27 | VL_MSG_FIRST_AVAILABLE, 28 | } vl_msg_id_t; 29 | #undef vl_msg_id 30 | 31 | #endif /* included_oor_ctrl_msg_enum_h */ 32 | -------------------------------------------------------------------------------- /VPP/oor_pkt_miss-plugin/configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT(oor_pkt_miss_plugin, 1.0) 2 | LT_INIT 3 | AM_INIT_AUTOMAKE 4 | AM_SILENT_RULES([yes]) 5 | AC_PREFIX_DEFAULT([/usr]) 6 | 7 | AC_PROG_CC 8 | 9 | AC_OUTPUT([Makefile]) 10 | 11 | AC_CONFIG_MACRO_DIR([m4]) 12 | -------------------------------------------------------------------------------- /VPP/oor_pkt_miss-plugin/oor_pkt_miss.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Cisco and/or its affiliates. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at: 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | vppapitestplugins_LTLIBRARIES += oor_pkt_miss_test_plugin.la 15 | vppplugins_LTLIBRARIES += oor_pkt_miss_plugin.la 16 | 17 | oor_pkt_miss_plugin_la_SOURCES = \ 18 | oor_pkt_miss/oor_pkt_miss.c \ 19 | oor_pkt_miss/node.c \ 20 | oor_pkt_miss/oor_pkt_miss_plugin.api.h 21 | 22 | API_FILES += oor_pkt_miss/oor_pkt_miss.api 23 | 24 | nobase_apiinclude_HEADERS += \ 25 | oor_pkt_miss/oor_pkt_miss_all_api_h.h \ 26 | oor_pkt_miss/oor_pkt_miss_msg_enum.h \ 27 | oor_pkt_miss/oor_pkt_miss.api.h 28 | 29 | oor_pkt_miss_test_plugin_la_SOURCES = oor_pkt_miss/oor_pkt_miss_test.c oor_pkt_miss/oor_pkt_miss_plugin.api.h 30 | 31 | # vi:syntax=automake -------------------------------------------------------------------------------- /VPP/oor_pkt_miss-plugin/oor_pkt_miss/oor_pkt_miss.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * oor_pkt_miss.h - skeleton vpp engine plug-in header file 4 | * 5 | * Copyright (c) 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef __included_oor_pkt_miss_h__ 19 | #define __included_oor_pkt_miss_h__ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | typedef struct { 29 | /* API message ID base */ 30 | u16 msg_id_base; 31 | u32 sw_if_index; 32 | ip46_address_t ipv4_gateway; 33 | u8 has_ipv4_gateway; 34 | ip46_address_t ipv6_gateway; 35 | u8 has_ipv6_gateway; 36 | 37 | /* convenience */ 38 | vlib_main_t * vlib_main; 39 | vnet_main_t * vnet_main; 40 | ethernet_main_t * ethernet_main; 41 | } oor_pkt_miss_main_t; 42 | 43 | oor_pkt_miss_main_t oor_pkt_miss_main; 44 | 45 | vlib_node_registration_t oor_pkt_miss_node; 46 | 47 | #define OOR_PKT_MISS_PLUGIN_BUILD_VER "1.0" 48 | 49 | #endif /* __included_oor_pkt_miss_h__ */ 50 | -------------------------------------------------------------------------------- /VPP/oor_pkt_miss-plugin/oor_pkt_miss/oor_pkt_miss_all_api_h.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * oor_pkt_miss_all_api_h.h - skeleton vpp engine plug-in api #include file 4 | * 5 | * Copyright (c) 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | /* Include the generated file, see BUILT_SOURCES in Makefile.am */ 19 | #include 20 | -------------------------------------------------------------------------------- /VPP/oor_pkt_miss-plugin/oor_pkt_miss/oor_pkt_miss_msg_enum.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * oor_pkt_miss_msg_enum.h - skeleton vpp engine plug-in message enumeration 4 | * 5 | * Copyright (c) 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef included_oor_pkt_miss_msg_enum_h 19 | #define included_oor_pkt_miss_msg_enum_h 20 | 21 | #include 22 | 23 | #define vl_msg_id(n,h) n, 24 | typedef enum { 25 | #include 26 | /* We'll want to know how many messages IDs we need... */ 27 | VL_MSG_FIRST_AVAILABLE, 28 | } vl_msg_id_t; 29 | #undef vl_msg_id 30 | 31 | #endif /* included_oor_pkt_miss_msg_enum_h */ 32 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/misc.xml 5 | /.idea/modules.xml 6 | /.idea/vcs.xml 7 | /.idea/workspace.xml 8 | /.idea/libraries 9 | /.idea/caches 10 | .DS_Store 11 | /build 12 | /libs 13 | /obj 14 | /sdk 15 | /captures 16 | .externalNativeBuild 17 | -------------------------------------------------------------------------------- /android/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /android/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /android/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html 3 | 4 | # Sets the minimum version of CMake required to build the native library. 5 | 6 | cmake_minimum_required(VERSION 3.4.1) 7 | 8 | # Creates and names a library, sets it as either STATIC 9 | # or SHARED, and provides the relative paths to its source code. 10 | # You can define multiple libraries, and CMake builds them for you. 11 | # Gradle automatically packages shared libraries with your APK. 12 | 13 | add_library( # Sets the name of the library. 14 | native-lib 15 | 16 | # Sets the library as a shared library. 17 | SHARED 18 | 19 | # Provides a relative path to your source file(s). 20 | src/main/cpp/native-lib.cpp) 21 | 22 | # Searches for a specified prebuilt library and stores the path as a 23 | # variable. Because CMake includes system libraries in the search path by 24 | # default, you only need to specify the name of the public NDK library 25 | # you want to add. CMake verifies that the library exists before 26 | # completing its build. 27 | 28 | find_library( # Sets the name of the path variable. 29 | log-lib 30 | 31 | # Specifies the name of the NDK library that 32 | # you want CMake to locate. 33 | log) 34 | 35 | # Specifies libraries CMake should link to your target library. You 36 | # can link multiple libraries, such as libraries you define in this 37 | # build script, prebuilt third-party libraries, or system libraries. 38 | 39 | target_link_libraries( # Specifies the target library. 40 | native-lib 41 | 42 | # Links the target library to the log library 43 | # included in the NDK. 44 | ${log-lib}) -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | defaultConfig { 6 | applicationId "org.openoverlayrouter.noroot" 7 | minSdkVersion 15 8 | targetSdkVersion 30 9 | versionCode 7 10 | versionName "1.3.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | externalNativeBuild { 13 | cmake { 14 | cppFlags "" 15 | } 16 | } 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | externalNativeBuild { 25 | ndkBuild { 26 | path '../jni/Android.mk' 27 | } 28 | } 29 | } 30 | 31 | dependencies { 32 | implementation fileTree(dir: 'libs', include: ['*.jar']) 33 | implementation 'com.android.support:appcompat-v7:27.1.1' 34 | testImplementation 'junit:junit:4.12' 35 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 36 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 37 | implementation 'com.rengwuxian.materialedittext:library:2.1.4' 38 | implementation 'com.android.volley:volley:1.1.1' 39 | implementation 'com.android.support:support-v4:27.1.1' 40 | } 41 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-hdpi/ic_account.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-hdpi/ic_refresh.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/oorlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-hdpi/oorlogo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/oorlogolauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-hdpi/oorlogolauncher.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/oorlogoselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-hdpi/oorlogoselected.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-ldpi/ic_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-ldpi/ic_account.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-ldpi/ic_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-ldpi/ic_refresh.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-mdpi/ic_account.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-mdpi/ic_refresh.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/oor_logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-mdpi/oor_logo_small.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-xhdpi/ic_account.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-xhdpi/ic_refresh.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-xxhdpi/ic_account.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-xxhdpi/ic_refresh.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-xxxhdpi/ic_account.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/drawable-xxxhdpi/ic_refresh.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/empty_tall_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/imageselector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 21 | 22 | 26 | 27 | 37 | 38 | 47 | 48 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/maintabs.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 15 | 19 | 20 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /android/app/src/main/res/menu/loginmenu.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/raw/apache.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDzTCCArWgAwIBAgIJAKHAy5WBsiDAMA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNV 3 | BAYTAkVTMRIwEAYDVQQIDAlCYXJjZWxvbmExEjAQBgNVBAcMCUJhcmNlbG9uYTEM 4 | MAoGA1UECgwDT09SMQwwCgYDVQQLDANPT1IxDDAKBgNVBAMMA09PUjEcMBoGCSqG 5 | SIb3DQEJARYNYWRtaW5Ab29yLmNvbTAeFw0xNjEyMjkxOTQwMjBaFw0xNzAxMjgx 6 | OTQwMjBaMH0xCzAJBgNVBAYTAkVTMRIwEAYDVQQIDAlCYXJjZWxvbmExEjAQBgNV 7 | BAcMCUJhcmNlbG9uYTEMMAoGA1UECgwDT09SMQwwCgYDVQQLDANPT1IxDDAKBgNV 8 | BAMMA09PUjEcMBoGCSqGSIb3DQEJARYNYWRtaW5Ab29yLmNvbTCCASIwDQYJKoZI 9 | hvcNAQEBBQADggEPADCCAQoCggEBANCuQmtZ6RjAWoUxoYv+ArwgEOkXKjsDvg1W 10 | J/C2Kk1kig9lzLzgAUcw0S9uKHhOTGXz44+xMF/nUXUHMQdbL5Nxa3QMZTsbFHRi 11 | 7amFY4OSSjWcY5at8KpLJ1K/WZ2iGdWrnqmCMEA8RXvj8qtoEH0bYAqBhdW9LW0y 12 | +0xnyvtfq7GRRB8Cu4HWqOPZn1djtHJIsC9y64AaDoMivmjjLwmkalh+tu7wXms/ 13 | xAMiNYmfp8OmAewYZAbmv1wNPTugFYqKxoB7OMIKbftCb0OlBAb4aNYusDVCL22D 14 | Z1qaKTZQa4U8khOK9wvcT077glNlDJLYnU6QqGy+3Z8xCD6usbMCAwEAAaNQME4w 15 | HQYDVR0OBBYEFHsZKOo7gUXu7p1Py3IbJiwoGGggMB8GA1UdIwQYMBaAFHsZKOo7 16 | gUXu7p1Py3IbJiwoGGggMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB 17 | ABntNU0uImqJTOFgo9W6nR+VXbW3QKKKHb6w4Jkl4wt9J4ZTKRfIsgc4jCawDhzz 18 | gyk2nduqqfInx9WSLEHQKTqNH53cpZr5hiraUoKiz3DHWLJVCmihRGufKHshhTDJ 19 | 1YJHjRuV7KwJZgXptfVo/JzZvrDVGnHq1Hi+GEjku8BlbK6b+7HvhvcbIaSRPTno 20 | w//8UkrAWSjn1RXU/5zyL72TM8YG9//tJZH6GPJ9seaE6CmupgfASJCAO0RqM+3n 21 | 9Fv+sV+RWUM7tdQ6IO594ZHhf96X+CEdUNFWUEDzjeX0WwF+X1hqKE3IQT3TMiWc 22 | p8Pncyw/b//1aAaOF7cuB6I= 23 | -----END CERTIFICATE----- 24 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #00000000 4 | #009688 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.5.1' 11 | 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | 16 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Oct 15 09:30:59 CEST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_PLATFORM := android-16 2 | APP_STL := c++_shared 3 | APP_OPTIM := debug 4 | APP_CFLAGS := -g -------------------------------------------------------------------------------- /android/jni/confuse_android/AUTHORS: -------------------------------------------------------------------------------- 1 | Martin Hedenfalk 2 | 3 | Josh Myer fixed a buffer-checking FIXME 4 | -------------------------------------------------------------------------------- /android/jni/confuse_android/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | include $(CLEAR_VARS) 3 | LOCAL_C_INCLUDES += config.h 4 | LOCAL_SRC_FILES:= src/lexer.c src/confuse.c 5 | 6 | LOCAL_CFLAGS+=-DHAVE_CONFIG_H -Dlinux 7 | LOCAL_MODULE:= libconfuse 8 | 9 | include $(BUILD_STATIC_LIBRARY) 10 | 11 | -------------------------------------------------------------------------------- /android/jni/confuse_android/README: -------------------------------------------------------------------------------- 1 | This is libConfuse, a library for parsing configuration files. It was 2 | called libcfg before, but was changed to not confuse with other 3 | similar libraries. 4 | 5 | See the INSTALL file for installation instructions. By default, only a 6 | static library is built. Specify --enable-shared to the configure 7 | script to also build a shared library. 8 | 9 | With libtool 1.4.2 (and/or automake 1.6.3) there is a problem building 10 | the sources. The libtool script expects the environment variable SED 11 | to point to a usable sed binary, but this variable does not get 12 | set. You'll have to do a "export SED=sed" (if using bash) or "setenv 13 | SED sed" (if using csh) before running make. 14 | 15 | Documentation can be built by running doxygen in the top-level 16 | directory. It is also available at http://www.nongnu.org/confuse/manual/. 17 | 18 | There is a project page at http://sv.nongnu.org/projects/confuse. 19 | Report bugs to 20 | 21 | -------------------------------------------------------------------------------- /android/jni/confuse_android/configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with -*- autoconf -*- to produce a configure script. 2 | 3 | AC_PREREQ(2.50) 4 | 5 | AC_INIT(libConfuse, 2.7, confuse-devel@nongnu.org, confuse) 6 | AC_CONFIG_AUX_DIR(support) 7 | AM_MAINTAINER_MODE 8 | AM_INIT_AUTOMAKE 9 | AM_CONFIG_HEADER(config.h) 10 | AC_CONFIG_SRCDIR(src/confuse.c) 11 | 12 | # Checks for programs. 13 | # disable unnecessary compiler checks 14 | AC_DEFUN([AC_PROG_F77], [:]) 15 | AC_DEFUN([AC_PROG_FC], [:]) 16 | AC_DEFUN([AC_PROG_CXX], [:]) 17 | AC_DEFUN([AC_PROG_CXXCPP], [:]) 18 | AC_DEFUN([AC_PROG_OBJC], [:]) 19 | AC_DEFUN([AC_PROG_OBJCCPP], [:]) 20 | AC_DEFUN([AC_LIBTOOL_CXX], [:]) 21 | AC_DEFUN([AC_LIBTOOL_F77], [:]) 22 | AC_PROG_CC 23 | AM_PROG_LEX 24 | AC_DISABLE_SHARED 25 | AC_PROG_LIBTOOL 26 | 27 | # optional building of examples: 28 | AC_ARG_ENABLE([examples], 29 | [AC_HELP_STRING([--disable-examples], [don't build examples in examples])], 30 | [], [enable_examples=yes]) 31 | AM_CONDITIONAL([ENABLE_EXAMPLES], [test "$enable_examples" = yes]) 32 | 33 | AM_GNU_GETTEXT([external]) 34 | AM_GNU_GETTEXT_VERSION([0.16.1]) 35 | 36 | # Checks for header files. 37 | AC_HEADER_STDC 38 | AC_CHECK_HEADERS([unistd.h]) 39 | 40 | # Checks for typedefs, structures, and compiler characteristics. 41 | AC_C_CONST 42 | 43 | # Checks for library functions. 44 | AC_CHECK_FUNCS([strcasecmp strdup strndup]) 45 | 46 | dnl Check for the library containing inet_aton/inet_ntoa (for tests) 47 | AC_SEARCH_LIBS([inet_ntoa], [socket nsl]) 48 | 49 | AC_CONFIG_FILES([Makefile \ 50 | src/Makefile \ 51 | examples/Makefile \ 52 | po/Makefile.in \ 53 | m4/Makefile \ 54 | tests/Makefile \ 55 | doc/Makefile \ 56 | doc/Doxyfile \ 57 | libconfuse.pc \ 58 | libconfuse.spec]) 59 | AC_OUTPUT 60 | 61 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = doxygen-footer.html doxygen-header.html doxygen.css tutorial.xml \ 2 | $(TUTORIAL_CSOURCES) css.xsl tutorial.css Doxyfile.in Doxyfile 3 | 4 | # I'd like to have these programs only compile at 'make documentation' time. 5 | # How? 6 | # noinst_PROGRAMS = listing1 listing2 listing3 listing4 listing5 listing8 7 | LDADD = ../src/libconfuse.la 8 | INCLUDES = -I$(top_srcdir)/src 9 | AM_LDFLAGS = -L../src/ 10 | LIBS = $(LTLIBINTL) 11 | 12 | TUTORIAL_CSOURCES = listing1.c listing2.c listing3.c listing4.c \ 13 | listing5.c listing6.c listing7.c listing8.c 14 | TUTORIAL_LISTINGS = $(TUTORIAL_CSOURCES:.c=.xml) 15 | 16 | .c.xml: 17 | echo " $@ 18 | sed = $< | sed 'N;s/\n/\t/' >> $@ 19 | echo ']]>' >> $@ 20 | 21 | tutorial-html/index.html: tutorial.xml $(TUTORIAL_LISTINGS) css.xsl tutorial.css 22 | xmllint --valid --noout $< && xmlto -o tutorial-html --extensions -m css.xsl xhtml $< 23 | cp -f tutorial.css tutorial-html/ 24 | 25 | tutorial.pdf: tutorial.xml $(TUTORIAL_LISTINGS) 26 | xmllint --valid --noout $< && xmlto pdf $< 27 | 28 | tutorial: tutorial-html 29 | tutorial-html: tutorial-html/index.html 30 | tutorial-pdf: tutorial.pdf 31 | 32 | html/index.html: Doxyfile 33 | doxygen 34 | doxygen-manual: html/index.html ../src/confuse.h 35 | 36 | documentation: tutorial doxygen-manual 37 | 38 | dist-hook: tutorial doxygen-manual 39 | cp -pr html $(distdir) 40 | cp -pr man $(distdir) 41 | cp -pr tutorial-html $(distdir) 42 | 43 | CLEANFILES=*~ '\#*\#' $(TUTORIAL_LISTINGS) 44 | DISTCLEANFILES= 45 | MOSTLYCLEANFILES=tutorial.pdf 46 | 47 | celan: clean 48 | 49 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/css.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/doxygen-footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/doxygen-header.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | $title 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/jni/confuse_android/doc/html/doxygen.png -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/html/examples.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | confuse: Examples 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 25 |
26 |

Examples

Here is a list of all examples: 31 |
32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/html/files.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | confuse: File Index 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 31 |
32 |

File List

Here is a list of all documented files with brief descriptions: 33 | 34 |
confuse.h [code]A configuration file parser library
35 |
36 | 37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/html/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | confuse: libConfuse Documentation 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 25 |
26 |

libConfuse Documentation

27 |

28 |

2.7

29 | intro

30 | Copyright © 2002-2003 Martin Hedenfalk <martin@bzero.se>

31 | The latest versions of this manual and the libConfuse software are available at http://www.nongnu.org/confuse/

32 | If you can't convince, confuse.

33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/html/tab_b.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/jni/confuse_android/doc/html/tab_b.gif -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/html/tab_l.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/jni/confuse_android/doc/html/tab_l.gif -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/html/tab_r.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenOverlayRouter/oor/e5fdf59bfa9c84cc0aa849db685c709a6e7c9565/android/jni/confuse_android/doc/html/tab_r.gif -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/html/tutorial.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 1em; 3 | margin: 1em; 4 | } 5 | 6 | body p { 7 | margin-left: 1em; 8 | margin-right: 1em; 9 | text-align: justify; 10 | } 11 | 12 | p.copyright 13 | { 14 | margin-left: 0em; 15 | } 16 | 17 | h1, h2 { 18 | /*letter-spacing: 0.15em;*/ 19 | border-bottom: 1px solid black; 20 | } 21 | 22 | hr { display: none; } 23 | 24 | a[href] { 25 | background: transparent; 26 | color: #04D; 27 | text-decoration: none; 28 | } 29 | 30 | a[href]:hover { text-decoration: underline; } 31 | 32 | pre.programlisting 33 | { 34 | margin-left: 1em; 35 | margin-right: 1em; 36 | border: 1px solid #DDDDDD; 37 | background: #F4F4F4; 38 | padding: 1em; 39 | } 40 | 41 | /*.copyright { 42 | color: #777; 43 | background: transparent; 44 | font-size: x-small; 45 | margin-left: 1em; 46 | margin-right: 1em; 47 | text-align: right; 48 | border-top: 1px solid black; 49 | }*/ 50 | 51 | a img { border: 0px; } 52 | 53 | div.sflogo { 54 | text-align: right; 55 | padding-left: 1em; 56 | } 57 | 58 | hr { clear: both; } 59 | 60 | .warn { 61 | color: red; 62 | background: transparent; 63 | } 64 | 65 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/listing1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | printf("Hello, World!\n"); 6 | return 0; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/listing2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t opts[] = 7 | { 8 | CFG_STR("target", "World", CFGF_NONE), 9 | CFG_END() 10 | }; 11 | cfg_t *cfg; 12 | 13 | cfg = cfg_init(opts, CFGF_NONE); 14 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 15 | return 1; 16 | 17 | printf("Hello, %s!\n", cfg_getstr(cfg, "target")); 18 | 19 | cfg_free(cfg); 20 | return 0; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/listing3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t opts[] = 7 | { 8 | CFG_STR("target", "World", CFGF_NONE), 9 | CFG_INT("repeat", 1, CFGF_NONE), 10 | CFG_END() 11 | }; 12 | cfg_t *cfg; 13 | int repeat; 14 | 15 | cfg = cfg_init(opts, CFGF_NONE); 16 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 17 | return 1; 18 | 19 | repeat = cfg_getint(cfg, "repeat"); 20 | while(repeat--) 21 | printf("Hello, %s!\n", cfg_getstr(cfg, "target")); 22 | 23 | cfg_free(cfg); 24 | return 0; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/listing4.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t opts[] = 7 | { 8 | CFG_STR_LIST("targets", "{World}", CFGF_NONE), 9 | CFG_INT("repeat", 1, CFGF_NONE), 10 | CFG_END() 11 | }; 12 | cfg_t *cfg; 13 | int repeat; 14 | int i; 15 | 16 | cfg = cfg_init(opts, CFGF_NONE); 17 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 18 | return 1; 19 | 20 | repeat = cfg_getint(cfg, "repeat"); 21 | while(repeat--) 22 | { 23 | printf("Hello"); 24 | for(i = 0; i < cfg_size(cfg, "targets"); i++) 25 | printf(", %s", cfg_getnstr(cfg, "targets", i)); 26 | printf("!\n"); 27 | } 28 | 29 | cfg_free(cfg); 30 | return 0; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/listing5.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t greet_opts[] = 7 | { 8 | CFG_STR_LIST("targets", "{World}", CFGF_NONE), 9 | CFG_INT("repeat", 1, CFGF_NONE), 10 | CFG_END() 11 | }; 12 | cfg_opt_t opts[] = 13 | { 14 | CFG_SEC("greeting", greet_opts, CFGF_TITLE | CFGF_MULTI), 15 | CFG_END() 16 | }; 17 | cfg_t *cfg, *cfg_greet; 18 | int repeat; 19 | int i, j; 20 | 21 | cfg = cfg_init(opts, CFGF_NONE); 22 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 23 | return 1; 24 | 25 | for(j = 0; j < cfg_size(cfg, "greeting"); j++) 26 | { 27 | cfg_greet = cfg_getnsec(cfg, "greeting", j); 28 | 29 | repeat = cfg_getint(cfg_greet, "repeat"); 30 | while(repeat--) 31 | { 32 | printf("%s", cfg_title(cfg_greet)); 33 | for(i = 0; i < cfg_size(cfg_greet, "targets"); i++) 34 | printf(", %s", cfg_getnstr(cfg_greet, "targets", i)); 35 | printf("!\n"); 36 | } 37 | } 38 | 39 | cfg_free(cfg); 40 | return 0; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/listing6.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | /* ... setup options ... */ 7 | 8 | cfg = cfg_init(opts, CFGF_NONE); 9 | cfg_parse(cfg, "hello.conf"); 10 | 11 | if(cfg_size(cfg, "greeting") == 0) 12 | { 13 | cfg_parse_buf(cfg, "greeting Hello {}"); 14 | } 15 | 16 | /* ... print the greetings ... */ 17 | } 18 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/listing7.c: -------------------------------------------------------------------------------- 1 | int validate_unsigned_int(cfg_t *cfg, cfg_opt_t *opt) 2 | { 3 | int value = cfg_opt_getnint(opt, cfg_opt_size(opt) - 1); 4 | if(value < 0) 5 | { 6 | cfg_error(cfg, "integer option '%s' must be positive in section '%s'", 7 | opt->name, cfg->name); 8 | return -1; 9 | } 10 | return 0; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/listing8.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int validate_unsigned_int(cfg_t *cfg, cfg_opt_t *opt) 5 | { 6 | int value = cfg_opt_getnint(opt, cfg_opt_size(opt) - 1); 7 | if(value < 0) 8 | { 9 | cfg_error(cfg, "integer option '%s' must be positive in section '%s'", 10 | opt->name, cfg->name); 11 | return -1; 12 | } 13 | return 0; 14 | } 15 | 16 | int main(void) 17 | { 18 | cfg_opt_t greet_opts[] = 19 | { 20 | CFG_STR_LIST("targets", "{World}", CFGF_NONE), 21 | CFG_INT("repeat", 1, CFGF_NONE), 22 | CFG_END() 23 | }; 24 | cfg_opt_t opts[] = 25 | { 26 | CFG_SEC("greeting", greet_opts, CFGF_TITLE | CFGF_MULTI), 27 | CFG_END() 28 | }; 29 | cfg_t *cfg, *cfg_greet; 30 | int repeat; 31 | int i, j; 32 | 33 | cfg = cfg_init(opts, CFGF_NONE); 34 | cfg_set_validate_func(cfg, "greeting|repeat", validate_unsigned_int); 35 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 36 | return 1; 37 | 38 | for(j = 0; j < cfg_size(cfg, "greeting"); j++) 39 | { 40 | cfg_greet = cfg_getnsec(cfg, "greeting", j); 41 | 42 | repeat = cfg_getint(cfg_greet, "repeat"); 43 | while(repeat--) 44 | { 45 | printf("%s", cfg_title(cfg_greet)); 46 | for(i = 0; i < cfg_size(cfg_greet, "targets"); i++) 47 | printf(", %s", cfg_getnstr(cfg_greet, "targets", i)); 48 | printf("!\n"); 49 | } 50 | } 51 | 52 | cfg_free(cfg); 53 | return 0; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/man/man3/cfg_defvalue_t.3: -------------------------------------------------------------------------------- 1 | .TH "cfg_defvalue_t" 3 "21 Feb 2010" "Version 2.7" "confuse" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | cfg_defvalue_t \- Data structure holding the default value given by the initialization macros. 6 | 7 | .PP 8 | .SH SYNOPSIS 9 | .br 10 | .PP 11 | \fC#include \fP 12 | .PP 13 | .SS "Data Fields" 14 | 15 | .in +1c 16 | .ti -1c 17 | .RI "long int \fBnumber\fP" 18 | .br 19 | .RI "\fIdefault integer value \fP" 20 | .ti -1c 21 | .RI "double \fBfpnumber\fP" 22 | .br 23 | .RI "\fIdefault floating point value \fP" 24 | .ti -1c 25 | .RI "\fBcfg_bool_t\fP \fBboolean\fP" 26 | .br 27 | .RI "\fIdefault boolean value \fP" 28 | .ti -1c 29 | .RI "char * \fBstring\fP" 30 | .br 31 | .RI "\fIdefault string value \fP" 32 | .ti -1c 33 | .RI "char * \fBparsed\fP" 34 | .br 35 | .RI "\fIdefault value that is parsed by libConfuse, used for lists and functions \fP" 36 | .in -1c 37 | .SH "Detailed Description" 38 | .PP 39 | Data structure holding the default value given by the initialization macros. 40 | 41 | .SH "Author" 42 | .PP 43 | Generated automatically by Doxygen for confuse from the source code. 44 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/man/man3/cfg_value_t.3: -------------------------------------------------------------------------------- 1 | .TH "cfg_value_t" 3 "21 Feb 2010" "Version 2.7" "confuse" \" -*- nroff -*- 2 | .ad l 3 | .nh 4 | .SH NAME 5 | cfg_value_t \- Data structure holding the value of a fundamental option value. 6 | 7 | .PP 8 | .SH SYNOPSIS 9 | .br 10 | .PP 11 | \fC#include \fP 12 | .PP 13 | .SS "Data Fields" 14 | 15 | .in +1c 16 | .ti -1c 17 | .RI "long int \fBnumber\fP" 18 | .br 19 | .RI "\fIinteger value \fP" 20 | .ti -1c 21 | .RI "double \fBfpnumber\fP" 22 | .br 23 | .RI "\fIfloating point value \fP" 24 | .ti -1c 25 | .RI "\fBcfg_bool_t\fP \fBboolean\fP" 26 | .br 27 | .RI "\fIboolean value \fP" 28 | .ti -1c 29 | .RI "char * \fBstring\fP" 30 | .br 31 | .RI "\fIstring value \fP" 32 | .ti -1c 33 | .RI "\fBcfg_t\fP * \fBsection\fP" 34 | .br 35 | .RI "\fIsection value \fP" 36 | .ti -1c 37 | .RI "void * \fBptr\fP" 38 | .br 39 | .RI "\fIuser-defined value \fP" 40 | .in -1c 41 | .SH "Detailed Description" 42 | .PP 43 | Data structure holding the value of a fundamental option value. 44 | 45 | .SH "Author" 46 | .PP 47 | Generated automatically by Doxygen for confuse from the source code. 48 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/tutorial-html/tutorial.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 1em; 3 | margin: 1em; 4 | } 5 | 6 | body p { 7 | margin-left: 1em; 8 | margin-right: 1em; 9 | text-align: justify; 10 | } 11 | 12 | p.copyright 13 | { 14 | margin-left: 0em; 15 | } 16 | 17 | h1, h2 { 18 | /*letter-spacing: 0.15em;*/ 19 | border-bottom: 1px solid black; 20 | } 21 | 22 | hr { display: none; } 23 | 24 | a[href] { 25 | background: transparent; 26 | color: #04D; 27 | text-decoration: none; 28 | } 29 | 30 | a[href]:hover { text-decoration: underline; } 31 | 32 | pre.programlisting 33 | { 34 | margin-left: 1em; 35 | margin-right: 1em; 36 | border: 1px solid #DDDDDD; 37 | background: #F4F4F4; 38 | padding: 1em; 39 | } 40 | 41 | /*.copyright { 42 | color: #777; 43 | background: transparent; 44 | font-size: x-small; 45 | margin-left: 1em; 46 | margin-right: 1em; 47 | text-align: right; 48 | border-top: 1px solid black; 49 | }*/ 50 | 51 | a img { border: 0px; } 52 | 53 | div.sflogo { 54 | text-align: right; 55 | padding-left: 1em; 56 | } 57 | 58 | hr { clear: both; } 59 | 60 | .warn { 61 | color: red; 62 | background: transparent; 63 | } 64 | 65 | -------------------------------------------------------------------------------- /android/jni/confuse_android/doc/tutorial.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 1em; 3 | margin: 1em; 4 | } 5 | 6 | body p { 7 | margin-left: 1em; 8 | margin-right: 1em; 9 | text-align: justify; 10 | } 11 | 12 | p.copyright 13 | { 14 | margin-left: 0em; 15 | } 16 | 17 | h1, h2 { 18 | /*letter-spacing: 0.15em;*/ 19 | border-bottom: 1px solid black; 20 | } 21 | 22 | hr { display: none; } 23 | 24 | a[href] { 25 | background: transparent; 26 | color: #04D; 27 | text-decoration: none; 28 | } 29 | 30 | a[href]:hover { text-decoration: underline; } 31 | 32 | pre.programlisting 33 | { 34 | margin-left: 1em; 35 | margin-right: 1em; 36 | border: 1px solid #DDDDDD; 37 | background: #F4F4F4; 38 | padding: 1em; 39 | } 40 | 41 | /*.copyright { 42 | color: #777; 43 | background: transparent; 44 | font-size: x-small; 45 | margin-left: 1em; 46 | margin-right: 1em; 47 | text-align: right; 48 | border-top: 1px solid black; 49 | }*/ 50 | 51 | a img { border: 0px; } 52 | 53 | div.sflogo { 54 | text-align: right; 55 | padding-left: 1em; 56 | } 57 | 58 | hr { clear: both; } 59 | 60 | .warn { 61 | color: red; 62 | background: transparent; 63 | } 64 | 65 | -------------------------------------------------------------------------------- /android/jni/confuse_android/examples/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = simple.conf reread.conf ftp.conf 2 | noinst_PROGRAMS = simple reread ftpconf 3 | INCLUDES = -I$(top_srcdir)/src 4 | AM_LDFLAGS = -L../src/ 5 | LDADD = ../src/libconfuse.la 6 | CLEANFILES=*~ \#*\# 7 | LIBS = $(LTLIBINTL) 8 | -------------------------------------------------------------------------------- /android/jni/confuse_android/examples/ftp.conf: -------------------------------------------------------------------------------- 1 | # test config file 2 | 3 | passive-mode = on 4 | remote-completion = off 5 | 6 | # sections 7 | bookmark gnu 8 | { 9 | login = "anonymous" 10 | password = ${ANONPASS:-secret} 11 | directory = "/pub/gnu" 12 | host = "ftp.gnu.org" 13 | } 14 | 15 | bookmark kernel 16 | { 17 | host = "ftp.kernel.org" 18 | directory = "/pub/linux/kernel/v2.6" 19 | port = 8021 20 | } 21 | 22 | # functions 23 | alias("ls", "ls -F") 24 | alias("ll", "ls -lF") 25 | 26 | # lists 27 | xterm-terminals = {"xterm", "rxvt", "xterm-debian"} 28 | 29 | # possible values are yes/no/ask 30 | auto-create-bookmark = ask 31 | 32 | -------------------------------------------------------------------------------- /android/jni/confuse_android/examples/reread.c: -------------------------------------------------------------------------------- 1 | #include "confuse.h" 2 | #include 3 | #include 4 | #include 5 | 6 | cfg_t *cfg = 0; 7 | const char *config_filename = "./reread.conf"; 8 | 9 | void read_config(void) 10 | { 11 | cfg_opt_t arg_opts[] = { 12 | CFG_STR("value", "default", CFGF_NONE), 13 | CFG_END() 14 | }; 15 | cfg_opt_t opts[] = { 16 | CFG_INT("delay", 3, CFGF_NONE), 17 | CFG_STR("message", "This is a message", CFGF_NONE), 18 | CFG_SEC("argument", arg_opts, CFGF_MULTI | CFGF_TITLE), 19 | CFG_END() 20 | }; 21 | int ret; 22 | 23 | char *buf = "" \ 24 | " delay = 3\n" \ 25 | "# message = \"asdfasfasfd tersf\"\n" \ 26 | " argument one { value = 1 }\n" \ 27 | " argument two { value=foo}\n"; 28 | 29 | cfg_free(cfg); 30 | 31 | cfg = cfg_init(opts, 0); 32 | ret = cfg_parse_buf(cfg, buf); 33 | ret = cfg_parse(cfg, config_filename); 34 | } 35 | 36 | void sighandler(int sig) 37 | { 38 | read_config(); 39 | signal(SIGHUP, sighandler); 40 | } 41 | 42 | static int loop = 1; 43 | 44 | void usr1handler(int sig) 45 | { 46 | loop = 0; 47 | } 48 | 49 | int main(void) 50 | { 51 | unsigned int i; 52 | 53 | read_config(); 54 | signal(SIGHUP, sighandler); 55 | signal(SIGUSR1, usr1handler); 56 | 57 | while(loop) 58 | { 59 | printf("Message: %s", cfg_getstr(cfg, "message")); 60 | for(i = 0; i < cfg_size(cfg, "argument"); i++) 61 | { 62 | cfg_t *arg = cfg_getnsec(cfg, "argument", i); 63 | printf(", %s", cfg_getstr(arg, "value")); 64 | } 65 | printf("\n"); 66 | 67 | sleep(cfg_getint(cfg, "delay")); 68 | } 69 | 70 | cfg_free(cfg); 71 | cfg = 0; 72 | 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /android/jni/confuse_android/examples/reread.conf: -------------------------------------------------------------------------------- 1 | delay = 1 2 | message = "another message" 3 | argument one { 4 | value = "arghh!" 5 | } 6 | argument three { 7 | value = "gazonk" 8 | } 9 | -------------------------------------------------------------------------------- /android/jni/confuse_android/examples/simple.conf: -------------------------------------------------------------------------------- 1 | # this is a comment 2 | 3 | verbose=true 4 | #server = "localhost" 5 | user = "joe" 6 | debug = 17 7 | #delay = 6.77712472349623E-139 8 | -------------------------------------------------------------------------------- /android/jni/confuse_android/libconfuse.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr/local 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | 7 | Name: confuse 8 | Version: 2.7 9 | Description: configuration file parser library 10 | Requires: 11 | Libs: -L${libdir} -lconfuse 12 | Cflags: -I${includedir} 13 | 14 | -------------------------------------------------------------------------------- /android/jni/confuse_android/libconfuse.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | 7 | Name: @PACKAGE@ 8 | Version: @VERSION@ 9 | Description: configuration file parser library 10 | Requires: 11 | Libs: -L${libdir} -lconfuse @LTLIBINTL@ 12 | Cflags: -I${includedir} 13 | 14 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = intdiv0.m4 inttypes_h.m4 inttypes-pri.m4 nls.m4 \ 2 | po.m4 stdint_h.m4 uintmax_t.m4 intmax.m4 ulonglong.m4 codeset.m4 \ 3 | gettext.m4 glibc21.m4 iconv.m4 lcmessage.m4 \ 4 | lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 \ 5 | longdouble.m4 longlong.m4 \ 6 | printf-posix.m4 size_max.m4 wchar_t.m4 wint_t.m4 \ 7 | xsize.m4 8 | 9 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/codeset.m4: -------------------------------------------------------------------------------- 1 | # codeset.m4 serial 2 (gettext-0.16) 2 | dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([AM_LANGINFO_CODESET], 10 | [ 11 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 12 | [AC_TRY_LINK([#include ], 13 | [char* cs = nl_langinfo(CODESET); return !cs;], 14 | am_cv_langinfo_codeset=yes, 15 | am_cv_langinfo_codeset=no) 16 | ]) 17 | if test $am_cv_langinfo_codeset = yes; then 18 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 19 | [Define if you have and nl_langinfo(CODESET).]) 20 | fi 21 | ]) 22 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/glibc21.m4: -------------------------------------------------------------------------------- 1 | # glibc21.m4 serial 3 2 | dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.1 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gl_GLIBC21], 11 | [ 12 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, 13 | ac_cv_gnu_library_2_1, 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | ac_cv_gnu_library_2_1=yes, 24 | ac_cv_gnu_library_2_1=no) 25 | ] 26 | ) 27 | AC_SUBST(GLIBC21) 28 | GLIBC21="$ac_cv_gnu_library_2_1" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/intmax.m4: -------------------------------------------------------------------------------- 1 | # intmax.m4 serial 3 (gettext-0.16) 2 | dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the system has the 'intmax_t' type, but don't attempt to 9 | dnl find a replacement if it is lacking. 10 | 11 | AC_DEFUN([gt_TYPE_INTMAX_T], 12 | [ 13 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 14 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 15 | AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, 16 | [AC_TRY_COMPILE([ 17 | #include 18 | #include 19 | #if HAVE_STDINT_H_WITH_UINTMAX 20 | #include 21 | #endif 22 | #if HAVE_INTTYPES_H_WITH_UINTMAX 23 | #include 24 | #endif 25 | ], [intmax_t x = -1; 26 | return !x;], 27 | gt_cv_c_intmax_t=yes, 28 | gt_cv_c_intmax_t=no)]) 29 | if test $gt_cv_c_intmax_t = yes; then 30 | AC_DEFINE(HAVE_INTMAX_T, 1, 31 | [Define if you have the 'intmax_t' type in or .]) 32 | fi 33 | ]) 34 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/inttypes-pri.m4: -------------------------------------------------------------------------------- 1 | # inttypes-pri.m4 serial 4 (gettext-0.16) 2 | dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_PREREQ(2.52) 10 | 11 | # Define PRI_MACROS_BROKEN if exists and defines the PRI* 12 | # macros to non-string values. This is the case on AIX 4.3.3. 13 | 14 | AC_DEFUN([gt_INTTYPES_PRI], 15 | [ 16 | AC_CHECK_HEADERS([inttypes.h]) 17 | if test $ac_cv_header_inttypes_h = yes; then 18 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], 19 | gt_cv_inttypes_pri_broken, 20 | [ 21 | AC_TRY_COMPILE([#include 22 | #ifdef PRId32 23 | char *p = PRId32; 24 | #endif 25 | ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) 26 | ]) 27 | fi 28 | if test "$gt_cv_inttypes_pri_broken" = yes; then 29 | AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, 30 | [Define if exists and defines unusable PRI* macros.]) 31 | PRI_MACROS_BROKEN=1 32 | else 33 | PRI_MACROS_BROKEN=0 34 | fi 35 | AC_SUBST([PRI_MACROS_BROKEN]) 36 | ]) 37 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/inttypes_h.m4: -------------------------------------------------------------------------------- 1 | # inttypes_h.m4 serial 7 2 | dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_INTTYPES_H], 13 | [ 14 | AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1; return !i;], 19 | gl_cv_header_inttypes_h=yes, 20 | gl_cv_header_inttypes_h=no)]) 21 | if test $gl_cv_header_inttypes_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/lcmessage.m4: -------------------------------------------------------------------------------- 1 | # lcmessage.m4 serial 4 (gettext-0.14.2) 2 | dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1995. 18 | 19 | # Check whether LC_MESSAGES is available in . 20 | 21 | AC_DEFUN([gt_LC_MESSAGES], 22 | [ 23 | AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, 24 | [AC_TRY_LINK([#include ], [return LC_MESSAGES], 25 | gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) 26 | if test $gt_cv_val_LC_MESSAGES = yes; then 27 | AC_DEFINE(HAVE_LC_MESSAGES, 1, 28 | [Define if your file defines LC_MESSAGES.]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/longdouble.m4: -------------------------------------------------------------------------------- 1 | # longdouble.m4 serial 2 (gettext-0.15) 2 | dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the compiler supports the 'long double' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf 12 | dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics. 13 | 14 | AC_DEFUN([gt_TYPE_LONGDOUBLE], 15 | [ 16 | AC_CACHE_CHECK([for long double], gt_cv_c_long_double, 17 | [if test "$GCC" = yes; then 18 | gt_cv_c_long_double=yes 19 | else 20 | AC_TRY_COMPILE([ 21 | /* The Stardent Vistra knows sizeof(long double), but does not support it. */ 22 | long double foo = 0.0; 23 | /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ 24 | int array [2*(sizeof(long double) >= sizeof(double)) - 1]; 25 | ], , 26 | gt_cv_c_long_double=yes, gt_cv_c_long_double=no) 27 | fi]) 28 | if test $gt_cv_c_long_double = yes; then 29 | AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) 30 | fi 31 | ]) 32 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3017 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6b]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3017]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.6b' 20 | macro_revision='1.3017' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/nls.m4: -------------------------------------------------------------------------------- 1 | # nls.m4 serial 3 (gettext-0.15) 2 | dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1995-2000. 18 | dnl Bruno Haible , 2000-2003. 19 | 20 | AC_PREREQ(2.50) 21 | 22 | AC_DEFUN([AM_NLS], 23 | [ 24 | AC_MSG_CHECKING([whether NLS is requested]) 25 | dnl Default is enabled NLS 26 | AC_ARG_ENABLE(nls, 27 | [ --disable-nls do not use Native Language Support], 28 | USE_NLS=$enableval, USE_NLS=yes) 29 | AC_MSG_RESULT($USE_NLS) 30 | AC_SUBST(USE_NLS) 31 | ]) 32 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/printf-posix.m4: -------------------------------------------------------------------------------- 1 | # printf-posix.m4 serial 2 (gettext-0.13.1) 2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the printf() function supports POSIX/XSI format strings with 9 | dnl positions. 10 | 11 | AC_DEFUN([gt_PRINTF_POSIX], 12 | [ 13 | AC_REQUIRE([AC_PROG_CC]) 14 | AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], 15 | gt_cv_func_printf_posix, 16 | [ 17 | AC_TRY_RUN([ 18 | #include 19 | #include 20 | /* The string "%2$d %1$d", with dollar characters protected from the shell's 21 | dollar expansion (possibly an autoconf bug). */ 22 | static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; 23 | static char buf[100]; 24 | int main () 25 | { 26 | sprintf (buf, format, 33, 55); 27 | return (strcmp (buf, "55 33") != 0); 28 | }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, 29 | [ 30 | AC_EGREP_CPP(notposix, [ 31 | #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ 32 | notposix 33 | #endif 34 | ], gt_cv_func_printf_posix="guessing no", 35 | gt_cv_func_printf_posix="guessing yes") 36 | ]) 37 | ]) 38 | case $gt_cv_func_printf_posix in 39 | *yes) 40 | AC_DEFINE(HAVE_POSIX_PRINTF, 1, 41 | [Define if your printf() function supports format strings with positions.]) 42 | ;; 43 | esac 44 | ]) 45 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/stdint_h.m4: -------------------------------------------------------------------------------- 1 | # stdint_h.m4 serial 6 2 | dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_STDINT_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_STDINT_H], 13 | [ 14 | AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1; return !i;], 19 | gl_cv_header_stdint_h=yes, 20 | gl_cv_header_stdint_h=no)]) 21 | if test $gl_cv_header_stdint_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/uintmax_t.m4: -------------------------------------------------------------------------------- 1 | # uintmax_t.m4 serial 9 2 | dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | AC_PREREQ(2.13) 10 | 11 | # Define uintmax_t to 'unsigned long' or 'unsigned long long' 12 | # if it is not already defined in or . 13 | 14 | AC_DEFUN([gl_AC_TYPE_UINTMAX_T], 15 | [ 16 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 17 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 18 | if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then 19 | AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) 20 | test $ac_cv_type_unsigned_long_long = yes \ 21 | && ac_type='unsigned long long' \ 22 | || ac_type='unsigned long' 23 | AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, 24 | [Define to unsigned long or unsigned long long 25 | if and don't define.]) 26 | else 27 | AC_DEFINE(HAVE_UINTMAX_T, 1, 28 | [Define if you have the 'uintmax_t' type in or .]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/wchar_t.m4: -------------------------------------------------------------------------------- 1 | # wchar_t.m4 serial 1 (gettext-0.12) 2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wchar_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WCHAR_T], 12 | [ 13 | AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, 14 | [AC_TRY_COMPILE([#include 15 | wchar_t foo = (wchar_t)'\0';], , 16 | gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) 17 | if test $gt_cv_c_wchar_t = yes; then 18 | AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) 19 | fi 20 | ]) 21 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/wint_t.m4: -------------------------------------------------------------------------------- 1 | # wint_t.m4 serial 1 (gettext-0.12) 2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wint_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WINT_T], 12 | [ 13 | AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, 14 | [AC_TRY_COMPILE([#include 15 | wint_t foo = (wchar_t)'\0';], , 16 | gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) 17 | if test $gt_cv_c_wint_t = yes; then 18 | AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) 19 | fi 20 | ]) 21 | -------------------------------------------------------------------------------- /android/jni/confuse_android/m4/xsize.m4: -------------------------------------------------------------------------------- 1 | # xsize.m4 serial 3 2 | dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | AC_DEFUN([gl_XSIZE], 8 | [ 9 | dnl Prerequisites of lib/xsize.h. 10 | AC_REQUIRE([gl_SIZE_MAX]) 11 | AC_REQUIRE([AC_C_INLINE]) 12 | AC_CHECK_HEADERS(stdint.h) 13 | ]) 14 | -------------------------------------------------------------------------------- /android/jni/confuse_android/src/Android.mk: -------------------------------------------------------------------------------- 1 | # Android makefile for lispd module 2 | 3 | ifneq ($(TARGET_SIMULATOR),true) 4 | 5 | LOCAL_PATH:= $(call my-dir) 6 | include $(CLEAR_VARS) 7 | LOCAL_SRC_FILES:= confuse.c lexer.c 8 | LOCAL_MODULE:= libconfuse 9 | include $(BUILD_STATIC_LIBRARY) 10 | endif 11 | -------------------------------------------------------------------------------- /android/jni/confuse_android/src/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libconfuse.la 2 | 3 | libconfuse_la_SOURCES = confuse.c lexer.l 4 | libconfuse_la_LIBADD = $(LTLIBINTL) 5 | 6 | include_HEADERS = confuse.h 7 | 8 | datadir = @datadir@ 9 | localedir = $(datadir)/locale 10 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 11 | 12 | LIBS = @LIBS@ 13 | 14 | CLEANFILES=*~ \#*\# 15 | AM_LFLAGS=-Pcfg_yy -olex.yy.c 16 | lexer.c: lexer.l 17 | 18 | celan: clean 19 | -------------------------------------------------------------------------------- /android/jni/confuse_android/stamp-h1: -------------------------------------------------------------------------------- 1 | timestamp for config.h 2 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | TESTS = suite_single suite_dup suite_func suite_list \ 2 | suite_validate list_plus_syntax section_title_dupes \ 3 | single_title_sections quote_before_print include 4 | check_PROGRAMS=$(TESTS) 5 | 6 | LDADD=-L../src ../src/libconfuse.la $(LTLIBINTL) 7 | 8 | EXTRA_DIST=a.conf b.conf check_confuse.h 9 | CLEANFILES=*~ 10 | 11 | DEFS=-DSRC_DIR='"$(srcdir)"' 12 | 13 | celan: clean 14 | 15 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/a.conf: -------------------------------------------------------------------------------- 1 | sec "acfg" 2 | { 3 | a = 5 4 | # b = 7 5 | } 6 | 7 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/b.conf: -------------------------------------------------------------------------------- 1 | sec "bcfg" 2 | { 3 | # a = 3 4 | b = 9 5 | } 6 | 7 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/check_confuse.h: -------------------------------------------------------------------------------- 1 | #ifndef _check_confuse_h_ 2 | #define _check_confuse_h_ 3 | 4 | #include "../src/confuse.h" 5 | #include 6 | 7 | #define fail_unless(test) \ 8 | do { if(!(test)) { \ 9 | fprintf(stderr, \ 10 | "----------------------------------------------\n" \ 11 | "%s:%d: test FAILED:\nFailed test: %s\n" \ 12 | "----------------------------------------------\n", \ 13 | __FILE__, __LINE__, #test); \ 14 | exit(1); \ 15 | } } while(0) 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/include.c: -------------------------------------------------------------------------------- 1 | /* Test cfg_include when called from a buffer 2 | */ 3 | 4 | #include 5 | #include "check_confuse.h" 6 | 7 | /* reuse suite_dup.c profile so that a.conf could be used for testing */ 8 | cfg_opt_t sec_opts[] = { 9 | CFG_INT("a", 1, CFGF_NONE), 10 | CFG_INT("b", 2, CFGF_NONE), 11 | CFG_END() 12 | }; 13 | 14 | cfg_opt_t opts[] = { 15 | CFG_SEC("sec", sec_opts, CFGF_MULTI | CFGF_TITLE), 16 | CFG_FUNC("include", &cfg_include), 17 | CFG_END() 18 | }; 19 | 20 | int 21 | main(void) 22 | { 23 | char *buf = "include (\"a.conf\")\n"; 24 | cfg_t *cfg = cfg_init(opts, CFGF_NONE); 25 | fail_unless(cfg); 26 | fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS); 27 | fail_unless(cfg_size(cfg, "sec") == 1); 28 | fail_unless(cfg_getint(cfg, "sec|a") == 5); 29 | fail_unless(cfg_getint(cfg, "sec|b") == 2); 30 | cfg_free(cfg); 31 | 32 | return 0; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/list_plus_syntax.c: -------------------------------------------------------------------------------- 1 | #include "check_confuse.h" 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t opts[] = { 7 | CFG_STR_LIST("stringproperty", 0, CFGF_NONE), 8 | CFG_END() 9 | }; 10 | 11 | cfg_t *cfg = cfg_init(opts, CFGF_NONE); 12 | fail_unless(cfg); 13 | 14 | int rc = cfg_parse_buf(cfg, 15 | " stringproperty = {\"this\"}\n" 16 | " stringproperty += {\"that\"}\n" 17 | " stringproperty += {\"other\"}\n"); 18 | 19 | fail_unless(rc == CFG_SUCCESS); 20 | 21 | fail_unless(cfg_size(cfg, "stringproperty") == 3); 22 | 23 | fail_unless(strcmp(cfg_getnstr(cfg, "stringproperty", 0), "this") == 0); 24 | fail_unless(strcmp(cfg_getnstr(cfg, "stringproperty", 1), "that") == 0); 25 | fail_unless(strcmp(cfg_getnstr(cfg, "stringproperty", 2), "other") == 0); 26 | 27 | rc = cfg_parse_buf(cfg, 28 | " stringproperty = \"this\"\n" 29 | " stringproperty += \"that\"\n" 30 | " stringproperty += \"other\"\n"); 31 | 32 | fail_unless(rc == CFG_SUCCESS); 33 | 34 | fail_unless(cfg_size(cfg, "stringproperty") == 3); 35 | 36 | fail_unless(strcmp(cfg_getnstr(cfg, "stringproperty", 0), "this") == 0); 37 | fail_unless(strcmp(cfg_getnstr(cfg, "stringproperty", 1), "that") == 0); 38 | fail_unless(strcmp(cfg_getnstr(cfg, "stringproperty", 2), "other") == 0); 39 | 40 | cfg_free(cfg); 41 | 42 | return 0; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/quote_before_print.c: -------------------------------------------------------------------------------- 1 | /* Check that double quotes gets escaped when printing the config with 2 | * cfg_print. Also backslashes needs to be escaped. 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | #include "check_confuse.h" 9 | 10 | cfg_opt_t opts[] = 11 | { 12 | CFG_STR("parameter", NULL, CFGF_NONE), 13 | CFG_END() 14 | }; 15 | 16 | int 17 | main(void) 18 | { 19 | cfg_t *cfg = cfg_init(opts, CFGF_NONE); 20 | fail_unless(cfg); 21 | 22 | /* set a string parameter to a string including a quote character 23 | */ 24 | cfg_setstr(cfg, "parameter", "text \" with quotes and \\"); 25 | 26 | /* print the config to a temporary file 27 | */ 28 | FILE *fp = tmpfile(); 29 | fail_unless(fp); 30 | cfg_print(cfg, fp); 31 | cfg_free(cfg); 32 | 33 | /* read it back, we expect 'parameter' to include a quote character 34 | */ 35 | rewind(fp); 36 | cfg = cfg_init(opts, CFGF_NONE); 37 | fail_unless(cfg); 38 | fail_unless(cfg_parse_fp(cfg, fp) == CFG_SUCCESS); 39 | fail_unless(fclose(fp) == 0); 40 | 41 | char *param = cfg_getstr(cfg, "parameter"); 42 | fail_unless(param); 43 | 44 | fail_unless(strcmp(param, "text \" with quotes and \\") == 0); 45 | cfg_free(cfg); 46 | 47 | return 0; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/section_title_dupes.c: -------------------------------------------------------------------------------- 1 | #include "check_confuse.h" 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t section_opts[] = { 7 | CFG_STR("prop", 0, CFGF_NONE), 8 | CFG_END() 9 | }; 10 | 11 | cfg_opt_t opts[] = { 12 | CFG_SEC("section", section_opts, CFGF_TITLE | CFGF_MULTI), 13 | CFG_END() 14 | }; 15 | 16 | cfg_opt_t opts_no_dupes[] = { 17 | CFG_SEC("section", section_opts, 18 | CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES), 19 | CFG_END() 20 | }; 21 | 22 | const char *config_data = 23 | "section title_one { prop = 'value_one' }\n" 24 | "section title_two { prop = 'value_two' }\n" 25 | "section title_one { prop = 'value_one' }\n"; 26 | 27 | int rc; 28 | cfg_t *cfg = cfg_init(opts, CFGF_NONE); 29 | fail_unless(cfg); 30 | 31 | rc = cfg_parse_buf(cfg, config_data); 32 | 33 | fail_unless(rc == CFG_SUCCESS); 34 | 35 | fail_unless(cfg_size(cfg, "section") == 2); 36 | 37 | fail_unless( 38 | strcmp(cfg_title(cfg_getnsec(cfg, "section", 0)), "title_one") == 0); 39 | fail_unless( 40 | strcmp(cfg_title(cfg_getnsec(cfg, "section", 1)), "title_two") == 0); 41 | 42 | cfg_free(cfg); 43 | 44 | cfg = cfg_init(opts_no_dupes, CFGF_NONE); 45 | fail_unless(cfg); 46 | 47 | rc = cfg_parse_buf(cfg, config_data); 48 | fail_unless(rc == CFG_PARSE_ERROR); 49 | 50 | cfg_free(cfg); 51 | 52 | return 0; 53 | } 54 | 55 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/single_title_sections.c: -------------------------------------------------------------------------------- 1 | /* Test sections with the CFGF_TITLE flag set but without CFGF_MULTI. 2 | * There's no reason this shouldn't work. Noticed by Josh Kropf. 3 | */ 4 | 5 | #include "check_confuse.h" 6 | 7 | cfg_opt_t root_opts[] = { 8 | CFG_END() 9 | }; 10 | 11 | cfg_opt_t opts[] = { 12 | CFG_SEC("root", root_opts, CFGF_TITLE), 13 | CFG_END() 14 | }; 15 | 16 | int 17 | main(void) 18 | { 19 | cfg_t *cfg = cfg_init(opts, CFGF_NONE); 20 | fail_unless(cfg); 21 | cfg_free(cfg); 22 | 23 | return 0; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/suite_dup.c: -------------------------------------------------------------------------------- 1 | #include "check_confuse.h" 2 | #include 3 | 4 | static cfg_t *create_config(void) 5 | { 6 | cfg_opt_t sec_opts[] = 7 | { 8 | CFG_INT("a", 1, CFGF_NONE), 9 | CFG_INT("b", 2, CFGF_NONE), 10 | CFG_END() 11 | }; 12 | 13 | cfg_opt_t opts[] = 14 | { 15 | CFG_SEC("sec", sec_opts, CFGF_MULTI | CFGF_TITLE), 16 | CFG_END() 17 | }; 18 | 19 | return cfg_init(opts, 0); 20 | } 21 | 22 | int 23 | main(void) 24 | { 25 | cfg_t *acfg, *bcfg; 26 | cfg_t *sec; 27 | 28 | acfg = create_config(); 29 | fail_unless(cfg_parse(acfg, SRC_DIR "/a.conf") == 0); 30 | 31 | bcfg = create_config(); 32 | fail_unless(cfg_parse(bcfg, SRC_DIR "/b.conf") == 0); 33 | 34 | sec = cfg_getnsec(acfg, "sec", 0); 35 | fail_unless(sec != 0); 36 | fail_unless(cfg_size(acfg, "sec") == 1); 37 | fail_unless(strcmp(cfg_title(sec), "acfg") == 0); 38 | fail_unless(cfg_getint(sec, "a") == 5); 39 | fail_unless(cfg_getint(sec, "b") == 2); 40 | 41 | sec = cfg_getnsec(bcfg, "sec", 0); 42 | fail_unless(sec != 0); 43 | fail_unless(cfg_size(bcfg, "sec") == 1); 44 | fail_unless(strcmp(cfg_title(sec), "bcfg") == 0); 45 | fail_unless(cfg_getint(sec, "a") == 1); 46 | fail_unless(cfg_getint(sec, "b") == 9); 47 | 48 | cfg_free(acfg); 49 | cfg_free(bcfg); 50 | 51 | return 0; 52 | } 53 | 54 | -------------------------------------------------------------------------------- /android/jni/confuse_android/tests/suite_func.c: -------------------------------------------------------------------------------- 1 | #include "check_confuse.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void suppress_errors(cfg_t *cfg, const char *fmt, va_list ap); 9 | 10 | static cfg_t *cfg = 0; 11 | static int func_alias_called = 0; 12 | 13 | static int func_alias(cfg_t *cfg, cfg_opt_t *opt, int argc, const char **argv) 14 | { 15 | func_alias_called = 1; 16 | 17 | fail_unless(cfg != 0); 18 | fail_unless(opt != 0); 19 | fail_unless(strcmp(opt->name, "alias") == 0); 20 | fail_unless(opt->type == CFGT_FUNC); 21 | fail_unless(argv != 0); 22 | fail_unless(strcmp(argv[0], "ll") == 0); 23 | fail_unless(strcmp(argv[1], "ls -l") == 0); 24 | 25 | if(argc != 2) 26 | return -1; 27 | 28 | return 0; 29 | } 30 | 31 | static void func_setup(void) 32 | { 33 | cfg_opt_t opts[] = 34 | { 35 | CFG_FUNC("alias", func_alias), 36 | CFG_END() 37 | }; 38 | 39 | cfg = cfg_init(opts, 0); 40 | /* cfg_set_error_function(cfg, suppress_errors); */ 41 | } 42 | 43 | static void func_teardown(void) 44 | { 45 | cfg_free(cfg); 46 | } 47 | 48 | static void func_test(void) 49 | { 50 | char *buf; 51 | 52 | func_alias_called = 0; 53 | buf = "alias(ll, 'ls -l')"; 54 | fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS); 55 | fail_unless(func_alias_called == 1); 56 | 57 | func_alias_called = 0; 58 | buf = "alias(ll, 'ls -l', 2)"; 59 | fail_unless(cfg_parse_buf(cfg, buf) == CFG_PARSE_ERROR); 60 | fail_unless(func_alias_called == 1); 61 | 62 | buf = "unalias(ll, 'ls -l')"; 63 | fail_unless(cfg_parse_buf(cfg, buf) == CFG_PARSE_ERROR); 64 | } 65 | 66 | int 67 | main(void) 68 | { 69 | func_setup(); 70 | func_test(); 71 | func_teardown(); 72 | 73 | return 0; 74 | } 75 | 76 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /netconf/datastore.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /netconf/lispsimple.paths: -------------------------------------------------------------------------------- 1 | lispsimple=urn:ietf:params:xml:ns:yang:lispsimple 2 | /lispsimple:itr-cfg/lispsimple:map-resolvers 3 | /lispsimple:itr-cfg/lispsimple:proxy-etrs 4 | /lispsimple:etr-cfg/lispsimple:local-eids 5 | /lispsimple:etr-cfg/lispsimple:map-servers 6 | /lispsimple:rtr-cfg/lispsimple:map-resolvers 7 | 8 | -------------------------------------------------------------------------------- /netconf/oor_api_netconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_API_NETCONF_H_ 21 | #define OOR_API_NETCONF_H_ 22 | 23 | #include "../oor/defs.h" 24 | #include "../oor/config/oor_api.h" 25 | 26 | int oor_api_nc_node_accessed(oor_api_connection_t *conn, int dev, int trgt, 27 | XMLDIFF_OP op, xmlNodePtr node, struct nc_err** error); 28 | 29 | #endif /*OOR_API_NETCONF_H_*/ 30 | -------------------------------------------------------------------------------- /oor/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Vi(m) swap files 5 | .*.swp 6 | 7 | # CScope file 8 | cscope.out 9 | 10 | # Compiled executable 11 | oor 12 | 13 | # Local configuration file 14 | oor.conf 15 | 16 | #temp kate files 17 | *~ 18 | 19 | #kdev 20 | *.kdev4 21 | 22 | # CLion/CMake 23 | .idea/ 24 | cmake-build-debug/ 25 | -------------------------------------------------------------------------------- /oor/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /oor/config/oor_api_internals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | #ifndef OOR_API_INTERNALS_H_ 20 | #define OOR_API_INTERNALS_H_ 21 | 22 | #include "oor_api.h" 23 | 24 | 25 | /* API main loop */ 26 | void oor_api_loop(oor_api_connection_t *conn); 27 | 28 | /* Initialize API system (server) */ 29 | int oor_api_init_server(oor_api_connection_t *conn); 30 | 31 | #endif /*OOR_API_INTERNALS_H_*/ 32 | -------------------------------------------------------------------------------- /oor/config/oor_config_confuse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_CONFIG_CONFUSE_H_ 21 | #define OOR_CONFIG_CONFUSE_H_ 22 | 23 | /* 24 | * Parse config file and set up whatever is needed 25 | */ 26 | int handle_config_file(); 27 | 28 | 29 | 30 | #endif /*OOR_CONFIG_CONFUSE_H_*/ 31 | -------------------------------------------------------------------------------- /oor/config/oor_config_uci.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_CONFIG_UCI_H_ 21 | #define OOR_CONFIG_UCI_H_ 22 | 23 | int handle_config_file(); 24 | 25 | #endif /* OOR_CONFIG_UCI_H_ */ 26 | -------------------------------------------------------------------------------- /oor/control/control-data-plane/apple/ios/cdp_ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef CDP_IOS_H_ 21 | #define CDP_IOS_H_ 22 | 23 | #include "../../../../iface_list.h" 24 | 25 | typedef struct ios_ctr_dplane_data_{ 26 | int ipv4_ctrl_socket; 27 | int ipv6_ctrl_socket; 28 | int ipv4_data_socket; /* To send Encap Map Register */ 29 | }ios_ctr_dplane_data_t; 30 | 31 | #endif /* CDP_IOS_H_ */ 32 | -------------------------------------------------------------------------------- /oor/control/control-data-plane/control-data-plane.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #include "control-data-plane.h" 21 | 22 | 23 | control_dplane_struct_t * 24 | control_dp_select() 25 | { 26 | #ifdef VPNAPI 27 | return &control_dp_vpnapi; 28 | #elif VPP 29 | return &control_dp_vpp; 30 | #elif __APPLE__ 31 | return &control_dp_apple; 32 | #else 33 | return &control_dp_tun; 34 | #endif 35 | } 36 | -------------------------------------------------------------------------------- /oor/control/control-data-plane/tun/cdp_tun.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef CDP_TUN_H_ 21 | #define CDP_TUN_H_ 22 | 23 | #include "../../../iface_list.h" 24 | 25 | typedef struct tun_ctr_dplane_data_{ 26 | iface_t *default_ctrl_iface_v4; 27 | iface_t *default_ctrl_iface_v6; 28 | }tun_ctr_dplane_data_t; 29 | 30 | 31 | #endif /* CDP_TUN_H_ */ 32 | -------------------------------------------------------------------------------- /oor/control/control-data-plane/vpnapi/cdp_vpnapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef CDP_VPNAPI_H_ 21 | #define CDP_VPNAPI_H_ 22 | 23 | typedef struct vpnapi_ctr_dplane_data_{ 24 | int ipv4_ctrl_socket; 25 | int ipv6_ctrl_socket; 26 | int ipv4_data_socket; /* To send Encap Map Register */ 27 | }vpnapi_ctr_dplane_data_t; 28 | 29 | #endif /* CDP_VPNAPI_H_ */ 30 | -------------------------------------------------------------------------------- /oor/control/control-data-plane/vpp/cdp_vpp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef CDP_VPP_H_ 21 | #define CDP_VPP_H_ 22 | 23 | #include "../../../iface_list.h" 24 | 25 | #define TAP_CTRL_IFACE_NAME "oorCtap0" 26 | #define TAP_MTU_CTRL_VPP 1500 27 | 28 | typedef struct vpp_ctr_dplane_data_{ 29 | iface_t *default_ctrl_iface_v4; 30 | iface_t *default_ctrl_iface_v6; 31 | }vpp_ctr_dplane_data_t; 32 | 33 | #endif /* CDP_VPP_H_ */ 34 | -------------------------------------------------------------------------------- /oor/control/lisp_rtr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_CONTROL_LISP_RTR_H_ 21 | #define OOR_CONTROL_LISP_RTR_H_ 22 | 23 | #include "lisp_tr.h" 24 | #include "oor_ctrl_device.h" 25 | 26 | 27 | 28 | 29 | typedef struct lisp_rtr { 30 | oor_ctrl_dev_t super; /* base "class" , Don't change order*/ 31 | 32 | lisp_tr_t tr; /* Don't change order */ 33 | 34 | /* LOCAL IFACE MAPPING */ 35 | /* in case of RTR can be used for outgoing load balancing */ 36 | map_local_entry_t *all_locs_map; 37 | shash_t *rtr_ms_table; //< IP char * , rtr_ms_node_t *> 38 | } lisp_rtr_t; 39 | 40 | typedef struct rtr_ms_node { 41 | lisp_addr_t * addr; 42 | char * key; 43 | lisp_key_type_e key_type; 44 | nat_version nat_version; 45 | }rtr_ms_node_t; 46 | 47 | lisp_rtr_t * lisp_rtr_cast(oor_ctrl_dev_t *dev); 48 | 49 | /************************** rtr_ms_node_t functions **************************/ 50 | 51 | rtr_ms_node_t * rtr_ms_node_new_init(lisp_addr_t *addr, char *key, nat_version version); 52 | void rtr_ms_node_destroy(rtr_ms_node_t *ms_node); 53 | char *rtr_ms_node_to_char(rtr_ms_node_t *ms_node); 54 | 55 | #endif /* OOR_CONTROL_LISP_RTR_H_ */ 56 | -------------------------------------------------------------------------------- /oor/data-plane/apple/ios/ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | 21 | #ifndef IOS_H_ 22 | #define IOS_H_ 23 | 24 | #include "../../ttable.h" 25 | #include "../../../lib/shash.h" 26 | 27 | typedef struct ios_data_ { 28 | oor_encap_t encap_type; 29 | int tun_socket; 30 | int ipv4_data_socket; 31 | int ipv6_data_socket; 32 | /* < char *eid -> glist_t > Used to find the fwd entries to be removed 33 | * of the data plane when there is a change with the mapping of the eid */ 34 | shash_t *eid_to_dp_entries; //< char *eid -> glist_t > 35 | /* Hash table containg the forward info from a tupla */ 36 | ttable_t ttable; 37 | } ios_data_t; 38 | 39 | ios_data_t * ios_get_datap_data(); 40 | int ios_reset_all_fwd(); 41 | #endif /* VPN_API_H_ */ 42 | -------------------------------------------------------------------------------- /oor/data-plane/apple/ios/ios_input.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | 21 | #ifndef IOS_INPUT_H_ 22 | #define IOS_INPUT_H_ 23 | 24 | #include "../../../lib/sockets.h" 25 | 26 | int ios_process_input_packet(sock_t *sl); 27 | int ios_rtr_process_input_packet(sock_t *sl); 28 | 29 | #endif /* ios_INPUT_H_ */ 30 | -------------------------------------------------------------------------------- /oor/data-plane/apple/ios/ios_output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef IOS_OUTPUT_H_ 21 | #define IOS_OUTPUT_H_ 22 | 23 | #include "../../../lib/sockets.h" 24 | 25 | #define IOS_RECEIVE_SIZE 2048 // Should probably tune to match largest MTU 26 | 27 | int ios_output(lbuf_t *b, packet_tuple_t *tpl); 28 | int ios_output_recv(struct sock *sl); 29 | int ios_output_recv2(struct sock *sl); 30 | int ios_send_ctrl_msg(lbuf_t *buf, uconn_t *udp_conn); 31 | 32 | #endif /* ios_OUTPUT_H_ */ 33 | -------------------------------------------------------------------------------- /oor/data-plane/data-plane.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | 21 | #include "data-plane.h" 22 | 23 | data_plane_struct_t *data_plane = NULL; 24 | 25 | void data_plane_select() 26 | { 27 | #ifdef VPNAPI 28 | data_plane = &dplane_vpnapi; 29 | #elif VPP 30 | data_plane = &dplane_vpp; 31 | #elif __APPLE__ 32 | data_plane = &dplane_apple; 33 | #else 34 | data_plane = &dplane_tun; 35 | #endif 36 | } 37 | -------------------------------------------------------------------------------- /oor/data-plane/ttable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef TTABLE_H_ 21 | #define TTABLE_H_ 22 | 23 | #include 24 | #include "../elibs/khash/khash.h" 25 | #include "../elibs/ovs/list.h" 26 | #include "../lib/packets.h" 27 | 28 | typedef struct fwd_info_ fwd_info_t; 29 | 30 | 31 | KHASH_INIT(ttable, packet_tuple_t *, fwd_info_t *, 1, pkt_tuple_hash, pkt_tuple_cmp) 32 | 33 | typedef struct ttable { 34 | khash_t(ttable) *htable; // 35 | struct ovs_list head_list; /* To order flows */ 36 | } ttable_t; 37 | 38 | void ttable_init(ttable_t *tt); 39 | void ttable_uninit(ttable_t *tt); 40 | ttable_t *ttable_create(); 41 | void ttable_destroy(ttable_t *tt); 42 | int ttable_insert(ttable_t *, packet_tuple_t *tpl, fwd_info_t *fe); 43 | void ttable_remove(ttable_t *tt, packet_tuple_t *tpl); 44 | fwd_info_t *ttable_lookup(ttable_t *tt, packet_tuple_t *tpl); 45 | 46 | 47 | #endif /* TTABLE_H_ */ 48 | -------------------------------------------------------------------------------- /oor/data-plane/tun/tun_input.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef TUN_INPUT_H_ 21 | #define TUN_INPUT_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include "tun_output.h" 30 | #include "../../defs.h" 31 | #include "../../lib/sockets.h" 32 | #include "../../lib/cksum.h" 33 | 34 | int tun_process_input_packet(struct sock *sl); 35 | int tun_rtr_process_input_packet(struct sock *sl); 36 | 37 | #endif /*TUN_IFACE_LIST_H_*/ 38 | -------------------------------------------------------------------------------- /oor/data-plane/tun/tun_output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | 21 | #ifndef TUN_OUTPUT_H_ 22 | #define TUN_OUTPUT_H_ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include "../../defs.h" 32 | #include "../../iface_list.h" 33 | #include "../../oor_external.h" 34 | #include "../../lib/cksum.h" 35 | 36 | 37 | int tun_output_recv(sock_t *sl); 38 | int tun_output(lbuf_t *, packet_tuple_t *); 39 | 40 | #endif /*TUN_OUTPUT_H_*/ 41 | -------------------------------------------------------------------------------- /oor/data-plane/vpnapi/vpnapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | 21 | #ifndef VPN_API_H_ 22 | #define VPN_API_H_ 23 | 24 | #include "../ttable.h" 25 | #include "../../lib/shash.h" 26 | 27 | typedef struct vpnapi_data_ { 28 | oor_encap_t encap_type; 29 | int tun_socket; 30 | int ipv4_data_socket; 31 | int ipv6_data_socket; 32 | /* < char *eid -> glist_t > Used to find the fwd entries to be removed 33 | * of the data plane when there is a change with the mapping of the eid */ 34 | shash_t *eid_to_dp_entries; //< char *eid -> glist_t > 35 | /* Hash table containg the forward info from a tupla */ 36 | ttable_t ttable; 37 | } vpnapi_data_t; 38 | 39 | vpnapi_data_t * vpnapi_get_datap_data(); 40 | int vpnapi_reset_all_fwd(); 41 | #endif /* VPN_API_H_ */ 42 | -------------------------------------------------------------------------------- /oor/data-plane/vpnapi/vpnapi_input.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | 21 | #ifndef VPNAPI_INPUT_H_ 22 | #define VPNAPI_INPUT_H_ 23 | 24 | #include "../../lib/sockets.h" 25 | 26 | int vpnapi_process_input_packet(sock_t *sl); 27 | int vpnapi_rtr_process_input_packet(sock_t *sl); 28 | 29 | #endif /* VPNAPI_INPUT_H_ */ 30 | -------------------------------------------------------------------------------- /oor/data-plane/vpnapi/vpnapi_output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef VPNAPI_OUTPUT_H_ 21 | #define VPNAPI_OUTPUT_H_ 22 | 23 | #include "../../lib/sockets.h" 24 | 25 | #define VPNAPI_RECEIVE_SIZE 2048 // Should probably tune to match largest MTU 26 | 27 | int vpnapi_output(lbuf_t *b, packet_tuple_t *tpl); 28 | int vpnapi_output_recv(struct sock *sl); 29 | int vpnapi_send_ctrl_msg(lbuf_t *buf, uconn_t *udp_conn); 30 | 31 | 32 | #endif /* VPNAPI_OUTPUT_H_ */ 33 | -------------------------------------------------------------------------------- /oor/data-plane/vpp/vpp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | #ifndef VPP_H_ 20 | #define VPP_H_ 21 | 22 | #include "../../lib/shash.h" 23 | 24 | #define TAP_VPP_MISS_IFACE_NAME "oorDtap0" 25 | #define TAP_MTU_VPP 1440 26 | #define TAP_VPP_BUFFER_SIZE 2048 27 | 28 | 29 | typedef struct vpp_dplane_data_{ 30 | /* < char *eid -> glist_t > Used to find the fwd entries to be removed 31 | * of the data plane when there is a change with the mapping of the eid */ 32 | shash_t *eid_to_dp_entries; //< char *eid -> glist_t > 33 | shash_t *iid_lst; //< char *iid , glist of eids> 34 | }vpp_dplane_data_t; 35 | 36 | #endif /* VPP_H_ */ 37 | -------------------------------------------------------------------------------- /oor/fwd_policies/flow_balancing/fb_addr_func.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef FB_ADDR_FUNC_H_ 21 | #define FB_ADDR_FUNC_H_ 22 | 23 | #include "../../liblisp/liblisp.h" 24 | 25 | 26 | lisp_addr_t *fb_addr_get_fwd_ip_addr(lisp_addr_t *addr, 27 | glist_t *locl_rlocs_addr); 28 | 29 | lisp_addr_t *fb_lcaf_get_fwd_ip_addr(lcaf_addr_t *lcaf, glist_t *locl_rlocs_addr); 30 | 31 | #endif /* FB_ADDR_FUNC_H_ */ 32 | -------------------------------------------------------------------------------- /oor/fwd_policies/flow_balancing/flow_balancing.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | #ifndef FLOW_BALANCING_H_ 20 | #define FLOW_BALANCING_H_ 21 | 22 | #include "../../defs.h" 23 | #include "../../lib/generic_list.h" 24 | 25 | 26 | typedef struct fb_dev_parm_ { 27 | oor_dev_type_e dev_type; 28 | glist_t * loc_loct; 29 | }fb_dev_parm; 30 | 31 | 32 | #endif /* FLOW_BALANCING_H_ */ 33 | -------------------------------------------------------------------------------- /oor/fwd_policies/flow_balancing/fwd_entry_tuple.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #include "fwd_entry_tuple.h" 21 | 22 | inline fwd_entry_tuple_t * 23 | fwd_entry_tuple_new_init(packet_tuple_t *tuple, lisp_addr_t *srloc, 24 | lisp_addr_t *drloc, uint16_t src_port, uint16_t dst_port, uint32_t iid, int *out_socket) 25 | { 26 | fwd_entry_tuple_t *fw_entry = xzalloc(sizeof(fwd_entry_tuple_t)); 27 | if (!fw_entry){ 28 | return (NULL); 29 | } 30 | fw_entry->tuple = pkt_tuple_clone(tuple); 31 | fw_entry->srloc = lisp_addr_clone(srloc); 32 | fw_entry->drloc = lisp_addr_clone(drloc); 33 | fw_entry->src_port = src_port; 34 | fw_entry->dst_port = dst_port; 35 | fw_entry->iid = iid; 36 | fw_entry->out_sock = out_socket; 37 | return (fw_entry); 38 | } 39 | 40 | inline void 41 | fwd_entry_tuple_del(fwd_entry_tuple_t *fwd_entry) 42 | { 43 | if (fwd_entry == NULL){ 44 | return; 45 | } 46 | pkt_tuple_del(fwd_entry->tuple); 47 | lisp_addr_del(fwd_entry->srloc); 48 | lisp_addr_del(fwd_entry->drloc); 49 | free(fwd_entry); 50 | fwd_entry = NULL; 51 | } 52 | -------------------------------------------------------------------------------- /oor/fwd_policies/flow_balancing/fwd_entry_tuple.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_FWD_POLICIES_FLOW_BALANCING_FWD_ENTRY_TUPLE_H_ 21 | #define OOR_FWD_POLICIES_FLOW_BALANCING_FWD_ENTRY_TUPLE_H_ 22 | 23 | #include "../../lib/packets.h" 24 | #include "../../liblisp/lisp_address.h" 25 | 26 | 27 | typedef struct fwd_entry_tuple_ { 28 | packet_tuple_t *tuple; // Must be the first element 29 | lisp_addr_t *srloc; 30 | lisp_addr_t *drloc; 31 | uint16_t src_port; 32 | uint16_t dst_port; 33 | int *out_sock; 34 | uint32_t iid; 35 | } fwd_entry_tuple_t; 36 | 37 | fwd_entry_tuple_t *fwd_entry_tuple_new_init(packet_tuple_t *tuple, lisp_addr_t *srloc, 38 | lisp_addr_t *drloc, uint16_t src_port, uint16_t dst_port, uint32_t iid, int *out_socket); 39 | void fwd_entry_tuple_del(fwd_entry_tuple_t *fwd_entry); 40 | 41 | #endif /* OOR_FWD_POLICIES_FLOW_BALANCING_FWD_ENTRY_TUPLE_H_ */ 42 | -------------------------------------------------------------------------------- /oor/fwd_policies/fwd_addr_func.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_FWD_POLICIES_FWD_ADDR_FUNC_H_ 21 | #define OOR_FWD_POLICIES_FWD_ADDR_FUNC_H_ 22 | 23 | #include "../liblisp/lisp_address.h" 24 | 25 | lisp_addr_t *laddr_get_fwd_ip_addr(lisp_addr_t *addr, 26 | glist_t *locl_rlocs_addr); 27 | 28 | 29 | #endif /* OOR_FWD_POLICIES_FWD_ADDR_FUNC_H_ */ 30 | -------------------------------------------------------------------------------- /oor/fwd_policies/fwd_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_FWD_POLICIES_FWD_UTILS_H_ 21 | #define OOR_FWD_POLICIES_FWD_UTILS_H_ 22 | 23 | #include "fwd_policy.h" 24 | #include "../liblisp/liblisp.h" 25 | 26 | typedef lisp_addr_t * (*get_fwd_ip_addr)(lisp_addr_t *, glist_t *); 27 | 28 | 29 | void locators_classify_in_4_6(mapping_t *mapping, glist_t *loc_loct_addr, 30 | glist_t *ipv4_loct_list, glist_t *ipv6_loct_list, get_fwd_ip_addr fn); 31 | 32 | 33 | #endif /* OOR_FWD_POLICIES_FWD_UTILS_H_ */ 34 | -------------------------------------------------------------------------------- /oor/fwd_policies/vpp_balancing/fwd_entry_vpp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | 21 | #ifndef OOR_FWD_POLICIES_VPP_BALANCING_FWD_ENTRY_VPP_H_ 22 | #define OOR_FWD_POLICIES_VPP_BALANCING_FWD_ENTRY_VPP_H_ 23 | 24 | #include "../../liblisp/lisp_address.h" 25 | 26 | 27 | typedef struct fwd_entry_vpp_ { 28 | lisp_addr_t *seid; 29 | lisp_addr_t *deid; 30 | glist_t *loc_pair_lst; // 31 | uint32_t iid; 32 | } fwd_entry_vpp_t; 33 | 34 | typedef struct vpp_loc_pair_ { 35 | lisp_addr_t *srloc; 36 | lisp_addr_t *drloc; 37 | int weight; 38 | } vpp_loct_pair; 39 | 40 | fwd_entry_vpp_t *fwd_entry_vpp_new_init(lisp_addr_t *seid,lisp_addr_t *deid,int iid); 41 | void fwd_entry_vpp_del(fwd_entry_vpp_t *fwd_entry); 42 | vpp_loct_pair *vpp_loct_pair_new_init(lisp_addr_t *srloc,lisp_addr_t *drloc,int weight); 43 | void vpp_loct_pair_del(vpp_loct_pair *loc_pair); 44 | void fwd_entry_vpp_dump(fwd_entry_vpp_t *fwd_entry, int log_level); 45 | 46 | #endif /* OOR_FWD_POLICIES_VPP_BALANCING_FWD_ENTRY_VPP_H_ */ 47 | -------------------------------------------------------------------------------- /oor/fwd_policies/vpp_balancing/vpp_balancing.h: -------------------------------------------------------------------------------- 1 | /* 2 | * vpp_balancing.h 3 | * 4 | * Created on: Sep 14, 2016 5 | * Author: alopez 6 | */ 7 | 8 | #ifndef OOR_FWD_POLICIES_VPP_BALANCING_VPP_BALANCING_H_ 9 | #define OOR_FWD_POLICIES_VPP_BALANCING_VPP_BALANCING_H_ 10 | 11 | 12 | #include "../../lib/generic_list.h" 13 | 14 | typedef struct vpp_dev_parm_ { 15 | oor_dev_type_e dev_type; 16 | glist_t * loc_loct; 17 | }vpp_dev_parm; 18 | 19 | 20 | typedef struct vpp_map_policy_inf_ { 21 | glist_t *ipv4_loct_lst; 22 | glist_t *ipv6_loct_lst; 23 | int priority4; 24 | int priority6; 25 | int sum_weight4; 26 | int sum_weight6; 27 | }vpp_map_policy_inf; 28 | 29 | #endif /* OOR_FWD_POLICIES_VPP_BALANCING_VPP_BALANCING_H_ */ 30 | -------------------------------------------------------------------------------- /oor/lib/cksum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef CKSUM_H_ 21 | #define CKSUM_H_ 22 | 23 | #include 24 | #include 25 | #include "../defs.h" 26 | 27 | uint16_t ip_checksum(uint16_t *buffer, int size); 28 | 29 | /* Calculate the IPv4 or IPv6 UDP checksum */ 30 | uint16_t udp_checksum(struct udphdr *udph, int udp_len, void *iphdr, int afi); 31 | 32 | 33 | #endif /* CKSUM_H_ */ 34 | -------------------------------------------------------------------------------- /oor/lib/hmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef HMAC_H_ 21 | #define HMAC_H_ 22 | 23 | #include 24 | 25 | #define SHA1_AUTH_DATA_LEN 20 26 | #define SHA256_AUTH_DATA_LEN 32 27 | 28 | int complete_auth_fields(uint8_t key_id, const char *key, void *packet, size_t pckt_len, 29 | void *auth_data_pos); 30 | 31 | int check_auth_field(uint8_t key_id, const char *key, void *packet, size_t pckt_len, 32 | void *auth_data_pos); 33 | 34 | #endif /* HMAC_H_ */ 35 | -------------------------------------------------------------------------------- /oor/lib/htable_ptrs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_HTABLE_PTRS_H_ 21 | #define OOR_HTABLE_PTRS_H_ 22 | 23 | #include "../elibs/khash/khash.h" 24 | #include "generic_list.h" 25 | 26 | #if UINTPTR_MAX == 0xffffffff 27 | KHASH_INIT(ptrs, void *, void *, 1, kh_int_hash_func, kh_int_hash_equal) 28 | #elif UINTPTR_MAX == 0xffffffffffffffff 29 | KHASH_INIT(ptrs, void *, void *, 1, kh_int64_hash_func, kh_int64_hash_equal) 30 | #endif 31 | 32 | /* Prototype for a pointer to a free key function. */ 33 | typedef void (*free_value_fn_t)(const void *key); 34 | 35 | 36 | typedef struct htable_ptrs{ 37 | khash_t(ptrs) *htable; 38 | free_value_fn_t free_value_fn; 39 | } htable_ptrs_t; 40 | 41 | 42 | 43 | 44 | htable_ptrs_t *htable_ptrs_new(); 45 | htable_ptrs_t *htable_ptrs_new_managed(free_value_fn_t df); 46 | void htable_ptrs_insert(htable_ptrs_t *ht, void *key, void *val); 47 | void *htable_ptrs_remove(htable_ptrs_t *, void *); 48 | void *htable_ptrs_lookup(htable_ptrs_t *, void *); 49 | void htable_ptrs_destroy(htable_ptrs_t *sh); 50 | glist_t *htable_ptrs_keys(htable_ptrs_t *sh); 51 | glist_t *htable_ptrs_values(htable_ptrs_t *ht); 52 | 53 | 54 | #endif /* OOR_HTABLE_PTRS_H_ */ 55 | -------------------------------------------------------------------------------- /oor/lib/interfaces_lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Universal TUN/TAP device driver. 3 | * Copyright (C) 1999-2000 Maxim Krasnyansky 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | #ifndef INTERFACES_LIB_H_ 17 | #define INTERFACES_LIB_H_ 18 | 19 | #include "../liblisp/lisp_address.h" 20 | 21 | typedef enum { 22 | TUN, 23 | TAP 24 | } iface_type_t; 25 | 26 | #ifdef ANDROID 27 | #define CLONEDEV "/dev/tun" 28 | #else 29 | #define CLONEDEV "/dev/net/tun" 30 | #endif 31 | 32 | int create_tun_tap(iface_type_t type, const char *iface_name, int mtu); 33 | int bring_up_iface(const char *iface_name); 34 | int add_addr_to_iface(const char *iface_name, lisp_addr_t *addr); 35 | int del_addr_from_iface(const char *iface_name, lisp_addr_t *addr); 36 | 37 | #endif /* INTERFACES_LIB_H_ */ 38 | -------------------------------------------------------------------------------- /oor/lib/ios_packetTunnelProvider_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef ios_packetTunnelProvider_api_h 21 | #define ios_packetTunnelProvider_api_h 22 | 23 | typedef struct iOS_CLibCallbacks iOS_CLibCallbacks; 24 | 25 | struct iOS_CLibCallbacks { 26 | const void * _Nonnull packetTunnelProviderPtr; 27 | void (* _Nonnull ptp_write_to_tun)(char * _Nonnull buffer, int length, int afi, void * _Nonnull ptp); 28 | }; 29 | 30 | extern void iOS_init_out_packet_buffer(); 31 | extern void iOS_init_semaphore(); 32 | extern void iOS_end_semaphore(); 33 | 34 | extern void iOS_CLibCallbacks_setup(const iOS_CLibCallbacks * _Nonnull callbacks); 35 | 36 | 37 | extern void oor_ptp_read_from_tun (const void * _Nonnull buffer, int length); 38 | 39 | 40 | #endif /* ios_packetTunnelProvider_api_h */ 41 | -------------------------------------------------------------------------------- /oor/lib/ios_packetTunnelProvider_api_l.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef ios_packetTunnelProvider_api_l_h 21 | #define ios_packetTunnelProvider_api_l_h 22 | 23 | #include "generic_list.h" 24 | 25 | void oor_ptp_write_to_tun (const char * buffer,int length, int afi); 26 | glist_t * oor_ptp_get_packets_to_process(); 27 | 28 | #endif /* ios_packetTunnelProvider_api_l_h */ 29 | -------------------------------------------------------------------------------- /oor/lib/prefixes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef PREFIXES_H_ 21 | #define PREFIXES_H_ 22 | 23 | #include "../liblisp/lisp_address.h" 24 | 25 | /* 26 | * True if address belongs to the prefix 27 | */ 28 | int pref_is_addr_part_of_prefix(lisp_addr_t *addr, lisp_addr_t *pref); 29 | 30 | /* 31 | * If prefix b is contained in prefix a, then return TRUE. Otherwise return FALSE. 32 | * If both prefixs are the same it also returns TRUE 33 | */ 34 | int pref_is_prefix_b_part_of_a (lisp_addr_t *a_prefix,lisp_addr_t *b_prefix); 35 | 36 | lisp_addr_t *pref_get_network_address(lisp_addr_t *address); 37 | 38 | /* 39 | * pref_get_network_prefix returns a prefix address from an IP prefix. 40 | * For instance: 10.0.1.1/8 -> 10.0.0.0/8 41 | */ 42 | lisp_addr_t * pref_get_network_prefix(lisp_addr_t *address); 43 | 44 | int pref_conv_to_netw_pref(lisp_addr_t *addr); 45 | 46 | /* 47 | * Convert a mask expresset in address format to length: 48 | * For instance: 255.255.0.0 -> 16 49 | */ 50 | int pref_mask_addr_to_length(lisp_addr_t *mask); 51 | 52 | 53 | 54 | #endif /* PREFIXES_H_ */ 55 | -------------------------------------------------------------------------------- /oor/lib/shash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef SHASH_H_ 21 | #define SHASH_H_ 22 | 23 | #include "../elibs/khash/khash.h" 24 | #include "generic_list.h" 25 | 26 | //KHASH_MAP_INIT_STR(str, void *) 27 | KHASH_INIT(str, char *, void *, 1, kh_str_hash_func, kh_str_hash_equal) 28 | 29 | /* Prototype for a pointer to a free function. */ 30 | typedef void (*free_value_fn_t)(const void *value); 31 | 32 | 33 | typedef struct shash { 34 | khash_t(str) *htable; 35 | free_value_fn_t free_value_fn; 36 | } shash_t; 37 | 38 | 39 | 40 | 41 | shash_t *shash_new(); 42 | shash_t *shash_new_managed(free_value_fn_t df); 43 | void shash_del(shash_t *); 44 | void shash_insert(shash_t *, char *, void *); 45 | void shash_remove(shash_t *, char *); 46 | void *shash_lookup(shash_t *, char *); 47 | void shash_destroy(shash_t *sh); 48 | glist_t *shash_keys(shash_t *sh); 49 | glist_t *shash_values(shash_t *sh); 50 | 51 | 52 | 53 | #endif /* SHASH_H_ */ 54 | -------------------------------------------------------------------------------- /oor/lib/sockets-util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | 21 | #ifndef SOCKETS_UTIL_H_ 22 | #define SOCKETS_UTIL_H_ 23 | 24 | #include "../liblisp/lisp_address.h" 25 | 26 | int open_ip_raw_socket(int afi); 27 | int open_udp_raw_socket(int afi); 28 | int opent_netlink_socket(); 29 | 30 | int open_udp_datagram_socket(int afi); 31 | int socket_bindtodevice(int sock, char *device); 32 | int socket_conf_req_ttl_tos(int sock, int afi); 33 | int socket_conf_set_ttl_tos(int sock, int afi, int ttl, int tos); 34 | 35 | int bind_socket(int sock,int afi, lisp_addr_t *src_addr, int src_port); 36 | int send_raw_packet(int, const void *, int, ip_addr_t *); 37 | int send_datagram_packet (int sock, const void *packet, int packet_length, 38 | lisp_addr_t *addr_dest, int port_dest); 39 | int sockaddr_to_lisp_addr (struct sockaddr *sock_addr, lisp_addr_t *addr); 40 | struct sockaddr * lisp_addr_to_scockaddr(lisp_addr_t *addr); 41 | 42 | #endif /* SOCKETS_UTIL_H_ */ 43 | -------------------------------------------------------------------------------- /oor/lib/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef UTIL_H_ 21 | #define UTIL_H_ 22 | 23 | #include "../liblisp/lisp_address.h" 24 | 25 | int convert_hex_string_to_bytes(char *hex, uint8_t *bytes, int bytes_len); 26 | 27 | char *get_char_from_xTR_ID (lisp_xtr_id *xtrid); 28 | 29 | /* Remove the address from the list not compatible with the local RLOCs */ 30 | void addr_list_rm_not_compatible_addr(glist_t *addr_lst, int compatible_addr_flags); 31 | uint8_t is_compatible_addr(lisp_addr_t *addr, int compatible_addr_flags); 32 | void str_rm_spaces(char *src, char *dst); 33 | void str_rm_double_spaces(char *src, char *dst); 34 | char *str_to_lower_case(char *str); 35 | /* 36 | * Convert the str to TRUE or FALSE. If str is not recognized return UNKNOWN 37 | */ 38 | int8_t str_to_boolean(char *str); 39 | 40 | lisp_addr_t *laddr_get_full_space_pref_from_type(lisp_addr_t *addr); 41 | uint8_t laddr_is_full_space_pref(lisp_addr_t *addr); 42 | 43 | 44 | #endif /* UTIL_H_ */ 45 | 46 | 47 | -------------------------------------------------------------------------------- /oor/lib/vpp_api/vpp_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * vpp_api.h 3 | * 4 | * Created on: Feb 22, 2017 5 | * Author: alopez 6 | */ 7 | 8 | #ifndef OOR_LIB_VPP_API_VPP_API_H_ 9 | #define OOR_LIB_VPP_API_VPP_API_H_ 10 | 11 | int vpp_is_enabled(); 12 | int vpp_init_api(); 13 | int vpp_uninit_api(); 14 | 15 | #endif /* OOR_LIB_VPP_API_VPP_API_H_ */ 16 | -------------------------------------------------------------------------------- /oor/liblisp/lisp_data.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | 21 | #include "lisp_data.h" 22 | #include "../lib/packets.h" 23 | 24 | uint32_t 25 | lisp_data_hdr_get_iid(lisp_data_hdr_t *hdr) 26 | { 27 | return (pkt_get_uint32_from_3bytes(hdr->iid)); 28 | } 29 | 30 | void 31 | lisp_data_hdr_init(lisp_data_hdr_t *lhdr, uint32_t iid) 32 | { 33 | lhdr->echo_nonce = 0; 34 | lhdr->lsb = 0; 35 | lhdr->lsb_bits = 0; 36 | lhdr->map_version = 0; 37 | lhdr->nonce[0] = 0; 38 | lhdr->nonce[1] = 0; 39 | lhdr->nonce[2] = 0; 40 | if (iid > 0){ 41 | lhdr->instance_id = 1; 42 | pkt_add_uint32_in_3bytes (lhdr->iid, iid);; 43 | }else{ 44 | lhdr->instance_id = 0; 45 | lhdr->iid[0] = 0; 46 | lhdr->iid[1] = 0; 47 | lhdr->iid[2] = 0; 48 | } 49 | lhdr->nonce_present = 0; 50 | lhdr->rflags = 0; 51 | } 52 | -------------------------------------------------------------------------------- /oor/liblisp/lisp_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef LISP_DATA_H_ 21 | #define LISP_DATA_H_ 22 | 23 | 24 | #include "../lib/mem_util.h" 25 | 26 | /* LISP data packet header */ 27 | 28 | typedef struct lisp_data_hdr { 29 | #ifdef LITTLE_ENDIANS 30 | uint8_t rflags:3; 31 | uint8_t instance_id:1; 32 | uint8_t map_version:1; 33 | uint8_t echo_nonce:1; 34 | uint8_t lsb:1; 35 | uint8_t nonce_present:1; 36 | #else 37 | uint8_t nonce_present:1; 38 | uint8_t lsb:1; 39 | uint8_t echo_nonce:1; 40 | uint8_t map_version:1; 41 | uint8_t instance_id:1; 42 | uint8_t rflags:3; 43 | #endif 44 | uint8_t nonce[3]; 45 | uint8_t iid[3]; 46 | uint8_t lsb_bits; 47 | } lisp_data_hdr_t; 48 | 49 | uint32_t lisp_data_hdr_get_iid(lisp_data_hdr_t *hdr); 50 | 51 | void lisp_data_hdr_init(lisp_data_hdr_t *lhdr, uint32_t iid); 52 | 53 | #define LISPDATA_HDR_CAST(h_) ((lisp_data_hdr_t *)(h_)) 54 | #define LDHDR_LSB_BIT(h_) (LISPDATA_HDR_CAST((h_)))->instance_id 55 | 56 | #endif /* LISP_DATA_H_ */ 57 | -------------------------------------------------------------------------------- /oor/modelines: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Editor modelines 4 | * 5 | * vi: set shiftwidth=4 tabstop=4 expandtab: 6 | * :indentSize=4:tabSize=4:noTabs=true: 7 | */ 8 | -------------------------------------------------------------------------------- /oor/net_mgr/apple/ios/netm_ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef netm_ios_h 21 | #define netm_ios_h 22 | 23 | #include 24 | 25 | int getdefaultgateway(in_addr_t * addr, char *TypeEN); 26 | 27 | #endif /* netm_ios_h */ 28 | -------------------------------------------------------------------------------- /oor/net_mgr/kernel/iface_mgmt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef IFACE_MGMT_H_ 21 | #define IFACE_MGMT_H_ 22 | 23 | #include "iface_list.h" 24 | #include "../../lib/sockets.h" 25 | 26 | 27 | int process_netlink_msg(sock_t *sl); 28 | int get_all_ifaces_name_list(char ***ifaces,int *count); 29 | lisp_addr_t * get_network_pref_of_host(lisp_addr_t *address); 30 | lisp_addr_t * iface_get_getway(int iface_index, int afi); 31 | 32 | #endif /* IFACE_MGMT_H_ */ 33 | -------------------------------------------------------------------------------- /oor/net_mgr/kernel/netm_kernel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef NETM_KERNEL_H_ 21 | #define NETM_KERNEL_H_ 22 | 23 | #ifdef ANDROID 24 | #include 25 | #include 26 | #endif 27 | 28 | typedef struct netm_data_type_ { 29 | int netlink_fd; 30 | }netm_data_type; 31 | 32 | 33 | #ifdef ANDROID 34 | 35 | /* 36 | * Different from oor_if_t to maintain 37 | * linux system call compatibility. 38 | */ 39 | typedef struct ifaddrs { 40 | struct ifaddrs *ifa_next; 41 | char *ifa_name; 42 | unsigned int ifa_flags; 43 | struct sockaddr *ifa_addr; 44 | int ifa_index; 45 | } ifaddrs; 46 | 47 | 48 | typedef struct { 49 | struct nlmsghdr nlh; 50 | struct rtgenmsg rtmsg; 51 | } request_struct; 52 | 53 | #endif 54 | 55 | 56 | #endif /* NETM_KERNEL_H_ */ 57 | -------------------------------------------------------------------------------- /oor/net_mgr/net_mgr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #include "net_mgr.h" 21 | 22 | net_mgr_class_t *net_mgr = NULL; 23 | 24 | void net_mgr_select() 25 | { 26 | #ifdef VPP 27 | net_mgr = &netm_vpp; 28 | #elif __APPLE__ 29 | net_mgr = &netm_apple; 30 | #else 31 | net_mgr = &netm_kernel; 32 | #endif 33 | } 34 | -------------------------------------------------------------------------------- /oor/net_mgr/net_mgr_proc_fc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_NET_MGR_NET_MGR_PROC_FC_H_ 21 | #define OOR_NET_MGR_NET_MGR_PROC_FC_H_ 22 | 23 | #include "../iface_list.h" 24 | 25 | 26 | /* Change the address of the interface. If the address belongs to a not 27 | * initialized locator, activate it. Program SMR */ 28 | void nm_process_address_change(uint8_t act, uint32_t iface_index, lisp_addr_t *new_addr); 29 | void nm_process_link_change(uint32_t old_iface_index, uint32_t new_iface_index, 30 | uint8_t new_status); 31 | void nm_process_route_change(uint8_t act, uint32_t iface_index, lisp_addr_t *src, 32 | lisp_addr_t *dst, lisp_addr_t *gateway); 33 | #endif /* OOR_NET_MGR_NET_MGR_PROC_FC_H_ */ 34 | -------------------------------------------------------------------------------- /oor/net_mgr/vpp/netm_vpp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef NETM_VPP_H_ 21 | #define NETM_VPP_H_ 22 | 23 | #include 24 | 25 | #define VPP_IPC_FILE "ipc:///tmp/oor-vpp-ipc" 26 | 27 | typedef struct netm_vpp_data_ { 28 | void *zmq_context; 29 | void *zmq_socket; 30 | } netm_vpp_data_t; 31 | 32 | 33 | typedef enum vpp_netlink_msg_type_ { 34 | VPP_NEWADDR, 35 | VPP_DELADDR, 36 | VPP_NEWLINK, 37 | VPP_DELLINK, 38 | VPP_NEWROUTE, 39 | VPP_DELROUTE 40 | } vpp_netlink_msg_type_e; 41 | 42 | 43 | typedef struct vpp_nl_msg_{ 44 | vpp_netlink_msg_type_e type; 45 | uint32_t len; 46 | }vpp_nl_msg; 47 | 48 | typedef struct{ 49 | uint32_t ifi_index; 50 | }vpp_nl_link_info; 51 | 52 | typedef struct{ 53 | uint8_t ifa_family; 54 | uint8_t ifa_prefixlen; 55 | uint32_t ifa_index; 56 | }vpp_nl_addr_info; 57 | 58 | #endif /* NETM_VPP_H_ */ 59 | -------------------------------------------------------------------------------- /oor/oor.ggo: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | # Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at: 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # 19 | 20 | 21 | package "oor" 22 | version "1.3.0" 23 | 24 | defmode "oorconfig" 25 | 26 | modeoption "debug" d "Debugging output [0..3]" 27 | int values="0","1","2","3" enum mode="oorconfig" optional 28 | 29 | modeoption "afi" a "Default RLOCs afi [4,6]" 30 | int values="4","6" enum mode="oorconfig" optional 31 | 32 | modeoption "daemonize" D "Daemonize oor" mode="oorconfig" optional 33 | 34 | modeoption "config-file" f "Alternate config file" 35 | string typestr="config-file" mode="oorconfig" optional 36 | 37 | -------------------------------------------------------------------------------- /oor/oor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | int oor_start(); 21 | void oor_loop(); 22 | void oor_stop(); 23 | void setLogPath(const char *path); 24 | void setConfPath(const char *path); 25 | 26 | #ifndef OOR_H_ 27 | #define OOR_H_ 28 | 29 | #include "defs.h" 30 | 31 | /* 32 | * Netlink mcast groups oor is interested in 33 | * for interface management 34 | */ 35 | #define OOR_IFACE_NLMGRPS (RTMGRP_LINK | RTMGRP_IPV4_IFADDR | RTMGRP_IPV4_ROUTE) 36 | /* #define OOR_IFACE_NLMGRPS (RTMGRP_LINK | RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR \ 37 | | RTMGRP_IPV4_ROUTE | RTMGRP_IPV6_ROUTE ) 38 | */ 39 | 40 | void exit_cleanup(void); 41 | 42 | 43 | #endif /*OOR_H_*/ 44 | 45 | /* 46 | * Editor modelines 47 | * 48 | * vi: set shiftwidth=4 tabstop=4 expandtab: 49 | * :indentSize=4:tabSize=4:noTabs=true: 50 | */ 51 | -------------------------------------------------------------------------------- /oor/oor.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=OpenOverlayRouter service 3 | After=network.target 4 | StartLimitIntervalSec=0 5 | 6 | [Service] 7 | Type=forking 8 | ExecStart=+/usr/local/sbin/oor -D 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | 13 | -------------------------------------------------------------------------------- /oor/oor_external.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #ifndef OOR_EXTERNAL_H_ 21 | #define OOR_EXTERNAL_H_ 22 | 23 | #include "defs.h" 24 | 25 | extern char *config_file; 26 | extern int daemonize; 27 | extern int default_rloc_afi; 28 | 29 | extern sockmstr_t *smaster; 30 | extern int netlink_fd; 31 | extern oor_ctrl_dev_t *ctrl_dev; 32 | extern oor_ctrl_t *lctrl; 33 | extern data_plane_struct_t *data_plane; 34 | extern net_mgr_class_t *net_mgr; 35 | 36 | extern void exit_cleanup(); 37 | extern htable_nonces_t *nonces_ht; 38 | extern htable_ptrs_t *ptrs_to_timers_ht; 39 | 40 | #endif /*OOR_EXTERNAL_H_*/ 41 | 42 | /* 43 | * Editor modelines 44 | * 45 | * vi: set shiftwidth=4 tabstop=4 expandtab: 46 | * :indentSize=4:tabSize=4:noTabs=true: 47 | */ 48 | -------------------------------------------------------------------------------- /oor/oor_jni.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2011, 2015 Cisco Systems, Inc. 4 | * Copyright (C) 2015 CBA research group, Technical University of Catalonia. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #include 21 | 22 | #ifndef OOR_JNI_H_ 23 | #define OOR_JNI_H_ 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* 30 | * Class: org_openoverlayrouter_noroot_OOR_JNI 31 | * Method: oor_start 32 | * Signature: (I)[I 33 | */ 34 | JNIEXPORT jint JNICALL Java_org_openoverlayrouter_noroot_OOR_1JNI_oor_1start 35 | (JNIEnv * env, jobject thisObj, jint vpn_tun_fd, jstring storage_path); 36 | 37 | /* 38 | * Class: org_openoverlayrouter_noroot_OOR_JNI 39 | * Method: oor_loop 40 | * Signature: ()V 41 | */ 42 | JNIEXPORT void JNICALL Java_org_openoverlayrouter_noroot_OOR_1JNI_oor_1loop 43 | (JNIEnv * env, jclass cl); 44 | 45 | /* 46 | * Class: org_openoverlayrouter_noroot_OOR_JNI 47 | * Method: oor_exit 48 | * Signature: ()V 49 | */ 50 | JNIEXPORT void JNICALL Java_org_openoverlayrouter_noroot_OOR_1JNI_oor_1exit 51 | (JNIEnv * env, jclass cl); 52 | 53 | 54 | void jni_init(JNIEnv *env, jobject object); 55 | void jni_uninit(); 56 | void oor_jni_protect_socket(int socket); 57 | 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* OOR_JNI_H_ */ 64 | -------------------------------------------------------------------------------- /openWRT/openwrt.init.script: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=70 4 | STOP=80 5 | USE_PROCD=1 6 | 7 | start_service() { 8 | procd_open_instance 9 | procd_set_param command /usr/sbin/oor 10 | procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-20} 11 | procd_set_param stdout 1 12 | procd_set_param stderr 1 13 | procd_close_instance 14 | } 15 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | # Vi(m) swap files 2 | .*.swp 3 | 4 | # Compiled executables 5 | udp_echo_server 6 | udp_echo_client 7 | tcp_echo_server 8 | tcp_echo_client 9 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | all: tests 2 | 3 | tests: udp tcp 4 | 5 | udp: 6 | gcc -o udp_echo_server udp_echo_server.c 7 | gcc -o udp_echo_client udp_echo_client.c 8 | 9 | tcp: 10 | gcc -o tcp_echo_server tcp_echo_server.c 11 | gcc -o tcp_echo_client tcp_echo_client.c 12 | 13 | clean: 14 | rm -f udp_echo_server udp_echo_client tcp_echo_server tcp_echo_client 15 | -------------------------------------------------------------------------------- /tests/clientserver.h: -------------------------------------------------------------------------------- 1 | #define BUFLEN 512 2 | #define NPACK 1000000 3 | -------------------------------------------------------------------------------- /tests/tcp_echo.h: -------------------------------------------------------------------------------- 1 | #define BUFLEN 512 2 | #define NPACK 1000000 3 | #define SPORT 50000 4 | #define SADDR "127.0.0.1" /* Server address */ 5 | 6 | /* Max pending connection requests (TCP only)*/ 7 | #define QUEUELENGTH 2 8 | -------------------------------------------------------------------------------- /vagrant/.bash_history: -------------------------------------------------------------------------------- 1 | lig 192.0.2.1 2 | lig 192.0.2.2 3 | tshark -n -i eth1 -i eth2 -Y "icmp || lisp || lisp-data || vxlan" 4 | ping 192.0.2.1 5 | ping 192.0.2.2 6 | sudo oor -D 7 | tail -f /var/log/oor.log 8 | -------------------------------------------------------------------------------- /vagrant/.gdbinit: -------------------------------------------------------------------------------- 1 | # We want Ctrl-C to be passed to oor 2 | handle SIGINT pass 3 | 4 | # Print IPv4 address; argument is (struct in_addr*) 5 | define pip 6 | print (char*) inet_ntoa($arg0) 7 | end 8 | 9 | # Print IPv6 address; argument is (struct in6_addr*) 10 | define pip6 11 | set $_buf = (void*) malloc(64) 12 | print (char*) inet_ntop(10,$arg0,$_buf,64) 13 | end 14 | -------------------------------------------------------------------------------- /vagrant/.tmux.conf: -------------------------------------------------------------------------------- 1 | # ~/.tmux.conf 2 | 3 | # Set prefix for key bindings same as 'screen' (Ctrl-A) 4 | set-option -g prefix C-a 5 | 6 | # Create a new session when invoked with 'attach' and no session exists 7 | new-session 8 | -------------------------------------------------------------------------------- /vagrant/TODO.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | 3 | * Create two xTR VMs with one EID-only VM behind each 4 | * Maybe make it possible to connect the testbed to the LISP Beta Network 5 | * Maybe use the testbed for automated testing 6 | * Explore, automate, and document the usage of NETCONF between OOR and ODL 7 | -------------------------------------------------------------------------------- /vagrant/bashrc_additions: -------------------------------------------------------------------------------- 1 | 2 | # Configure Map-Resolver for lig 3 | export LISP_MAP_RESOLVER=192.168.127.2 4 | 5 | # Set Gradle home directory to some place in the source tree 6 | # The reason is that the source tree is from a shared folder on the host disk 7 | # so we save spoce on the VM disk 8 | export GRADLE_USER_HOME=/vagrant/android/.gradle 9 | 10 | # Set the Android SDK root/home directory 11 | export ANDROID_SDK_ROOT=/vagrant/android/sdk 12 | export ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk-bundle 13 | #export ANDROID_SDK_HOME=$ANDROID_SDK_ROOT 14 | #export ANDROID_EMULATOR_HOME=$ANDROID_SDK_ROOT/.android 15 | #export ANDROID_AVD_HOME=$ANDROID_EMULATOR_HOME/avd 16 | -------------------------------------------------------------------------------- /vagrant/build-oor-apk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | unset -v _JAVA_OPTIONS 4 | 5 | # Build OOR Android .apk 6 | echo "Building OOR Android .apk ..." 7 | #export GRADLE_USER_HOME=/vagrant/android/.gradle 8 | cd /vagrant/android 9 | ./gradlew --console=plain --quiet :app:assembleDebug 10 | mv app/build/outputs/apk/debug/app-debug.apk $HOME/oor.apk 11 | -------------------------------------------------------------------------------- /vagrant/config-dotfiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Setting up dot files..." 4 | cat /vagrant/vagrant/bashrc_additions >> $HOME/.bashrc 5 | cp /vagrant/vagrant/.bash_history $HOME 6 | cp /vagrant/vagrant/.tmux.conf $HOME 7 | -------------------------------------------------------------------------------- /vagrant/config-oor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cp /vagrant/vagrant/oor.$1.conf /etc/oor.conf 4 | -------------------------------------------------------------------------------- /vagrant/install-odl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -o pipefail 4 | 5 | # If the ODL release is changed (e.g., Nitrogen -> Oxygen) links in the 6 | # README.md file should be updated too. Search for 7 | # 'http://docs.opendaylight.org/en/stable-nitrogen/' and update accordingly 8 | KARAF_VERSION=0.7.1 9 | KARAF=karaf-$KARAF_VERSION 10 | ODL=OpenDaylight-Nitrogen-SR1 11 | 12 | echo "Installing OpenDaylight ..." 13 | if [ ! -s "/tmp/vagrant-cache/$ODL.tar.gz" ]; then 14 | wget --no-verbose https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/karaf/$KARAF_VERSION/$KARAF.tar.gz -O /tmp/vagrant-cache/$ODL.tar.gz 15 | fi 16 | rm -rf $HOME/$ODL 17 | tar xvf /tmp/vagrant-cache/$ODL.tar.gz -C $HOME >/dev/null 18 | mv $HOME/$KARAF $HOME/$ODL 19 | # Make lispflowmapping autostart in OpenDaylight 20 | sed -i 's/featuresBoot =/featuresBoot = odl-lispflowmapping-mappingservice-shell,/g' $HOME/$ODL/etc/org.apache.karaf.features.cfg 21 | mkdir $HOME/.karaf 22 | cp /vagrant/karaf.history $HOME/.karaf 23 | echo "client" >> $HOME/.bash_history 24 | echo "" >> $HOME/.bashrc 25 | echo "# Add OpenDaylight binaries to the PATH" >> $HOME/.bashrc 26 | echo "export PATH=\$PATH:\$HOME/$ODL/bin" >> $HOME/.bashrc 27 | echo "Installing OpenDaylight done. Starting as a daemon ..." 28 | $HOME/$ODL/bin/start 29 | -------------------------------------------------------------------------------- /vagrant/install-oor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -o pipefail 4 | 5 | cd $HOME/oor && make clean && make && sudo make install 6 | -------------------------------------------------------------------------------- /vagrant/install-optional.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script expects the non-privileged username as the first argument 4 | 5 | set -e 6 | set -o pipefail 7 | 8 | export DEBIAN_FRONTEND=noninteractive 9 | 10 | # Install various utilities 11 | apt-get -y -q install htop tmux unzip 12 | # Install TShark for network packet analysis 13 | export DEBCONF_DB_FALLBACK=/vagrant/vagrant/wireshark-common_config.dat 14 | apt-get -y -q install tshark 15 | groupadd wireshark || true 16 | usermod -a -G wireshark $1 17 | chgrp wireshark /usr/bin/dumpcap 18 | chmod 4750 /usr/bin/dumpcap 19 | -------------------------------------------------------------------------------- /vagrant/install-oracle-java8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -o pipefail 4 | 5 | export DEBIAN_FRONTEND=noninteractive 6 | 7 | echo "Adding WebUpd8 PPA for Oracle Java 8 ..." 8 | add-apt-repository -y ppa:webupd8team/java 2>/dev/null 9 | echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections 10 | apt-get -y -q update 11 | apt-get -y -q -o Dpkg::Options::="--force-confnew" upgrade 12 | echo "Downloading and installing Oracle Java 8 ..." 13 | apt-get -y install oracle-java8-installer >/dev/null 14 | echo "Installing Oracle Java 8 done." 15 | -------------------------------------------------------------------------------- /vagrant/install-prereqs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -o pipefail 4 | 5 | export DEBIAN_FRONTEND=noninteractive 6 | 7 | echo "Upgrading existing packages and installing OOR build prerequisites ..." 8 | # Update packages 9 | apt-get -y -q update 10 | apt-get -y -q -o Dpkg::Options::="--force-confnew" upgrade 11 | # Install build depndencies 12 | apt-get -y -q install build-essential cmake gengetopt libconfuse-dev libzmq3-dev libxml2-dev 13 | # Install GNU debugger 14 | apt-get -y -q install gdb 15 | # Install the Clang compiler to be able to test build with that too 16 | apt-get -y -q install clang 17 | echo "Prerequisites installed." 18 | -------------------------------------------------------------------------------- /vagrant/install-unprivileged.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -o pipefail 4 | 5 | echo "Installing lig from source..." 6 | rm -rf $HOME/lig 7 | git clone -q https://github.com/davidmeyer/lig.git $HOME/lig 8 | cd $HOME/lig 9 | make > /dev/null 2>&1 10 | sudo cp lig /usr/local/bin 11 | echo "Installing lig finished successfully." 12 | -------------------------------------------------------------------------------- /vagrant/karaf.history: -------------------------------------------------------------------------------- 1 | mappings -d 2 | help mappings 3 | bundle:list -s | grep lispflowmapping 4 | feature:list -i 5 | log:display 6 | keys 7 | addkey 8 | mappings 9 | log:tail 10 | log:set DEBUG org.opendaylight.lispflowmapping 11 | -------------------------------------------------------------------------------- /vagrant/oor.msmr.conf: -------------------------------------------------------------------------------- 1 | debug = 1 2 | map-request-retries = 2 3 | log-file = /var/log/oor.log 4 | ipv6-scope = SITE 5 | operating-mode = MS 6 | control-iface = eth1 7 | # Only one control interface is supported for now. To use the IPv6 control 8 | # interface, comment the line above, and uncomment the line below. 9 | #control-iface = eth2 10 | 11 | # MN1 12 | lisp-site { 13 | eid-prefix = 192.0.2.1/32 14 | key-type = 1 15 | key = password 16 | iid = 0 17 | accept-more-specifics = false 18 | } 19 | 20 | lisp-site { 21 | eid-prefix = 2001:DB8::1/128 22 | key-type = 1 23 | key = password 24 | iid = 0 25 | accept-more-specifics = false 26 | } 27 | 28 | # MN2 29 | lisp-site { 30 | eid-prefix = 192.0.2.2/32 31 | key-type = 1 32 | key = password 33 | iid = 0 34 | accept-more-specifics = false 35 | } 36 | 37 | lisp-site { 38 | eid-prefix = 2001:DB8::2/128 39 | key-type = 1 40 | key = password 41 | iid = 0 42 | accept-more-specifics = false 43 | } 44 | 45 | # MN3 46 | lisp-site { 47 | eid-prefix = 192.0.2.3/32 48 | key-type = 1 49 | key = password 50 | iid = 0 51 | accept-more-specifics = false 52 | } 53 | 54 | lisp-site { 55 | eid-prefix = 2001:DB8::3/128 56 | key-type = 1 57 | key = password 58 | iid = 0 59 | accept-more-specifics = false 60 | } 61 | -------------------------------------------------------------------------------- /vagrant/run-oor-android-emulator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | unset -v _JAVA_OPTIONS 4 | 5 | # Run the Android Emulator with the AVD created in the SDK install script 6 | cd $ANDROID_SDK_ROOT/tools 7 | emulator -avd Nexus_5X_API_27_x86 -no-accel -no-audio -no-window -no-snapshot -netdelay none -netspeed full & 8 | #while [ "`adb shell getprop init.svc.bootanim | tr -d '\r' `" != "stopped" ] ; do sleep 1; done 9 | #adb shell getprop init.svc.bootanim 10 | -------------------------------------------------------------------------------- /vagrant/run-oor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /usr/local/sbin/oor -D -f /etc/oor.conf 4 | -------------------------------------------------------------------------------- /vagrant/wireshark-common_config.dat: -------------------------------------------------------------------------------- 1 | Name: wireshark-common/install-setuid 2 | Template: wireshark-common/install-setuid 3 | Value: false 4 | Owners: wireshark-common 5 | Flags: seen 6 | --------------------------------------------------------------------------------