Move network modules from the netutils folder to external
authorkang <pilseob.kang@samsung.com>
Fri, 1 Sep 2017 02:34:30 +0000 (11:34 +0900)
committerkang <pilseob.kang@samsung.com>
Fri, 1 Sep 2017 05:40:30 +0000 (14:40 +0900)
342 files changed:
apps/examples/artik_demo/artik_demo.c
apps/examples/easysetup/easysetup_main.c
apps/examples/ftpd/ftpd_main.c
apps/examples/iotivity_simpleserver/simpleServer.c
apps/examples/libcoap_client/libcoap-client.c
apps/examples/libcoap_server/libcoap-server.c
apps/examples/mdns_test/mdns_main.c
apps/examples/mqtt_test/mqtt_client_pub.c
apps/examples/mqtt_test/mqtt_client_sub.c
apps/examples/nettest/nettest.c
apps/examples/ntpclient_test/ntpclient_main.c
apps/examples/slsiwifi/nettest_functions.c
apps/examples/telnetd/telnetd.c
apps/examples/testcase/le_tc/network/tc_net_accept.c
apps/examples/testcase/le_tc/network/tc_net_bind.c
apps/examples/testcase/le_tc/network/tc_net_close.c
apps/examples/testcase/le_tc/network/tc_net_connect.c
apps/examples/testcase/le_tc/network/tc_net_dhcpc.c
apps/examples/testcase/le_tc/network/tc_net_ether.c
apps/examples/testcase/le_tc/network/tc_net_fcntl.c
apps/examples/testcase/le_tc/network/tc_net_getpeername.c
apps/examples/testcase/le_tc/network/tc_net_getsockname.c
apps/examples/testcase/le_tc/network/tc_net_getsockopt.c
apps/examples/testcase/le_tc/network/tc_net_inet.c
apps/examples/testcase/le_tc/network/tc_net_ioctl.c
apps/examples/testcase/le_tc/network/tc_net_listen.c
apps/examples/testcase/le_tc/network/tc_net_netdb.c
apps/examples/testcase/le_tc/network/tc_net_recv.c
apps/examples/testcase/le_tc/network/tc_net_recvfrom.c
apps/examples/testcase/le_tc/network/tc_net_send.c
apps/examples/testcase/le_tc/network/tc_net_sendto.c
apps/examples/testcase/le_tc/network/tc_net_setsockopt.c
apps/examples/testcase/le_tc/network/tc_net_shutdown.c
apps/examples/testcase/le_tc/network/tc_net_socket.c
apps/examples/testcase/ta_tc/device_management/itc/itc_dm_conn.c
apps/examples/testcase/ta_tc/device_management/itc/itc_dm_lwm2m.c
apps/examples/testcase/ta_tc/device_management/itc/itc_dm_main.c
apps/examples/testcase/ta_tc/device_management/utc/utc_dm_conn.c
apps/examples/testcase/ta_tc/device_management/utc/utc_dm_lwm2m.c
apps/examples/testcase/ta_tc/device_management/utc/utc_dm_main.c
apps/examples/wakaama_client/wakaama_client.c
apps/examples/webclient/webclient_main.c
apps/examples/webserver/webserver_main.c
apps/examples/websocket/websocket_main.c
apps/examples/xmlrpc/calls.c
apps/examples/xmlrpc/xmlrpc_main.c
apps/system/utils/netcmd.c
apps/system/utils/netcmd_dhcpd.c
apps/system/utils/netcmd_tftpc.c
external/Kconfig
external/Makefile
external/codecs/.gitignore [moved from apps/netutils/codecs/.gitignore with 100% similarity]
external/codecs/Kconfig [moved from apps/netutils/codecs/Kconfig with 100% similarity]
external/codecs/Make.defs [moved from apps/netutils/ftpc/Make.defs with 88% similarity]
external/codecs/Makefile [moved from apps/netutils/codecs/Makefile with 100% similarity]
external/codecs/base64.c [moved from apps/netutils/codecs/base64.c with 100% similarity]
external/codecs/md5.c [moved from apps/netutils/codecs/md5.c with 100% similarity]
external/codecs/urldecode.c [moved from apps/netutils/codecs/urldecode.c with 100% similarity]
external/dhcpc/.gitignore [moved from apps/netutils/xmlrpc/.gitignore with 100% similarity]
external/dhcpc/Kconfig.protocol [moved from apps/netutils/dhcpc/Kconfig with 100% similarity]
external/dhcpc/Make.defs [moved from apps/netutils/dhcpc/Make.defs with 97% similarity]
external/dhcpc/Makefile [moved from apps/netutils/dhcpc/Makefile with 100% similarity]
external/dhcpc/dhcpc.c [moved from apps/netutils/dhcpc/dhcpc.c with 99% similarity]
external/dhcpd/.gitignore [moved from apps/netutils/webclient/.gitignore with 100% similarity]
external/dhcpd/Kconfig.protocol [new file with mode: 0644]
external/dhcpd/Make.defs [moved from apps/netutils/codecs/Make.defs with 94% similarity]
external/dhcpd/dhcpd.c [new file with mode: 0644]
external/ftpc/.gitignore [moved from apps/netutils/tftpc/.gitignore with 100% similarity]
external/ftpc/Kconfig.protocol [moved from apps/netutils/ftpc/Kconfig with 100% similarity]
external/ftpc/Make.defs [new file with mode: 0644]
external/ftpc/Makefile [moved from apps/netutils/ftpc/Makefile with 100% similarity]
external/ftpc/README.txt [moved from apps/netutils/ftpc/README.txt with 100% similarity]
external/ftpc/ftpc_cdup.c [moved from apps/netutils/ftpc/ftpc_cdup.c with 100% similarity]
external/ftpc/ftpc_chdir.c [moved from apps/netutils/ftpc/ftpc_chdir.c with 100% similarity]
external/ftpc/ftpc_chmod.c [moved from apps/netutils/ftpc/ftpc_chmod.c with 100% similarity]
external/ftpc/ftpc_cmd.c [moved from apps/netutils/ftpc/ftpc_cmd.c with 100% similarity]
external/ftpc/ftpc_config.h [moved from apps/netutils/ftpc/ftpc_config.h with 100% similarity]
external/ftpc/ftpc_connect.c [moved from apps/netutils/ftpc/ftpc_connect.c with 100% similarity]
external/ftpc/ftpc_disconnect.c [moved from apps/netutils/ftpc/ftpc_disconnect.c with 100% similarity]
external/ftpc/ftpc_filesize.c [moved from apps/netutils/ftpc/ftpc_filesize.c with 100% similarity]
external/ftpc/ftpc_filetime.c [moved from apps/netutils/ftpc/ftpc_filetime.c with 100% similarity]
external/ftpc/ftpc_getfile.c [moved from apps/netutils/ftpc/ftpc_getfile.c with 100% similarity]
external/ftpc/ftpc_getreply.c [moved from apps/netutils/ftpc/ftpc_getreply.c with 100% similarity]
external/ftpc/ftpc_help.c [moved from apps/netutils/ftpc/ftpc_help.c with 100% similarity]
external/ftpc/ftpc_idle.c [moved from apps/netutils/ftpc/ftpc_idle.c with 100% similarity]
external/ftpc/ftpc_internal.h [moved from apps/netutils/ftpc/ftpc_internal.h with 100% similarity]
external/ftpc/ftpc_listdir.c [moved from apps/netutils/ftpc/ftpc_listdir.c with 100% similarity]
external/ftpc/ftpc_login.c [moved from apps/netutils/ftpc/ftpc_login.c with 100% similarity]
external/ftpc/ftpc_mkdir.c [moved from apps/netutils/ftpc/ftpc_mkdir.c with 100% similarity]
external/ftpc/ftpc_noop.c [moved from apps/netutils/ftpc/ftpc_noop.c with 100% similarity]
external/ftpc/ftpc_putfile.c [moved from apps/netutils/ftpc/ftpc_putfile.c with 100% similarity]
external/ftpc/ftpc_quit.c [moved from apps/netutils/ftpc/ftpc_quit.c with 100% similarity]
external/ftpc/ftpc_rename.c [moved from apps/netutils/ftpc/ftpc_rename.c with 100% similarity]
external/ftpc/ftpc_response.c [moved from apps/netutils/ftpc/ftpc_response.c with 100% similarity]
external/ftpc/ftpc_rmdir.c [moved from apps/netutils/ftpc/ftpc_rmdir.c with 100% similarity]
external/ftpc/ftpc_rpwd.c [moved from apps/netutils/ftpc/ftpc_rpwd.c with 100% similarity]
external/ftpc/ftpc_socket.c [moved from apps/netutils/ftpc/ftpc_socket.c with 100% similarity]
external/ftpc/ftpc_transfer.c [moved from apps/netutils/ftpc/ftpc_transfer.c with 100% similarity]
external/ftpc/ftpc_unlink.c [moved from apps/netutils/ftpc/ftpc_unlink.c with 100% similarity]
external/ftpc/ftpc_utils.c [moved from apps/netutils/ftpc/ftpc_utils.c with 100% similarity]
external/ftpd/.gitignore [moved from apps/netutils/telnetd/.gitignore with 100% similarity]
external/ftpd/Kconfig.protocol [moved from apps/netutils/ftpd/Kconfig with 100% similarity]
external/ftpd/Make.defs [moved from apps/netutils/ftpd/Make.defs with 96% similarity]
external/ftpd/Makefile [moved from apps/netutils/ftpd/Makefile with 100% similarity]
external/ftpd/ftpd.c [moved from apps/netutils/ftpd/ftpd.c with 99% similarity]
external/ftpd/ftpd.h [moved from apps/netutils/ftpd/ftpd.h with 100% similarity]
external/include/json/cJSON.h [moved from apps/include/netutils/cJSON.h with 100% similarity, mode: 0755]
external/include/protocols/base64.h [moved from apps/include/netutils/base64.h with 100% similarity, mode: 0755]
external/include/protocols/dhcpc.h [moved from apps/include/netutils/dhcpc.h with 100% similarity, mode: 0755]
external/include/protocols/dhcpd.h [new file with mode: 0755]
external/include/protocols/discover.h [moved from apps/include/netutils/discover.h with 100% similarity, mode: 0755]
external/include/protocols/ftpd.h [moved from apps/include/netutils/ftpd.h with 100% similarity, mode: 0755]
external/include/protocols/ipmsfilter.h [moved from apps/include/netutils/ipmsfilter.h with 100% similarity, mode: 0755]
external/include/protocols/libcoap/LICENSE.BSD [moved from apps/netutils/libcoap/LICENSE.BSD with 100% similarity]
external/include/protocols/libcoap/LICENSE.GPL [moved from apps/netutils/libcoap/LICENSE.GPL with 100% similarity]
external/include/protocols/libcoap/address.h [moved from apps/include/netutils/libcoap/address.h with 99% similarity]
external/include/protocols/libcoap/async.h [moved from apps/include/netutils/libcoap/async.h with 98% similarity]
external/include/protocols/libcoap/bits.h [moved from apps/include/netutils/libcoap/bits.h with 100% similarity]
external/include/protocols/libcoap/block.h [moved from apps/include/netutils/libcoap/block.h with 98% similarity]
external/include/protocols/libcoap/coap.h [moved from apps/include/netutils/libcoap/coap.h with 65% similarity]
external/include/protocols/libcoap/coap_list.h [moved from apps/include/netutils/libcoap/coap_list.h with 100% similarity]
external/include/protocols/libcoap/coap_time.h [moved from apps/include/netutils/libcoap/coap_time.h with 98% similarity]
external/include/protocols/libcoap/config.h [moved from apps/include/netutils/libcoap/config.h with 100% similarity]
external/include/protocols/libcoap/debug.h [moved from apps/include/netutils/libcoap/debug.h with 96% similarity]
external/include/protocols/libcoap/encode.h [moved from apps/include/netutils/libcoap/encode.h with 98% similarity]
external/include/protocols/libcoap/hashkey.h [moved from apps/include/netutils/libcoap/hashkey.h with 98% similarity]
external/include/protocols/libcoap/mem.h [moved from apps/include/netutils/libcoap/mem.h with 100% similarity]
external/include/protocols/libcoap/net.h [moved from apps/include/netutils/libcoap/net.h with 98% similarity]
external/include/protocols/libcoap/option.h [moved from apps/include/netutils/libcoap/option.h with 99% similarity]
external/include/protocols/libcoap/pdu.h [moved from apps/include/netutils/libcoap/pdu.h with 99% similarity]
external/include/protocols/libcoap/prng.h [moved from apps/include/netutils/libcoap/prng.h with 98% similarity]
external/include/protocols/libcoap/resource.h [moved from apps/include/netutils/libcoap/resource.h with 96% similarity]
external/include/protocols/libcoap/str.h [moved from apps/include/netutils/libcoap/str.h with 100% similarity]
external/include/protocols/libcoap/subscribe.h [moved from apps/include/netutils/libcoap/subscribe.h with 98% similarity]
external/include/protocols/libcoap/t_list.h [moved from apps/include/netutils/libcoap/t_list.h with 99% similarity]
external/include/protocols/libcoap/uri.h [moved from apps/include/netutils/libcoap/uri.h with 98% similarity]
external/include/protocols/libcoap/uthash.h [moved from apps/include/netutils/libcoap/uthash.h with 100% similarity]
external/include/protocols/libcoap/utlist.h [moved from apps/include/netutils/libcoap/utlist.h with 100% similarity]
external/include/protocols/liblwm2m.h [moved from apps/include/netutils/liblwm2m.h with 100% similarity, mode: 0755]
external/include/protocols/md5.h [moved from apps/include/netutils/md5.h with 100% similarity, mode: 0755]
external/include/protocols/mdnsd.h [moved from apps/include/netutils/mdnsd.h with 100% similarity, mode: 0755]
external/include/protocols/netlib.h [moved from apps/include/netutils/netlib.h with 100% similarity, mode: 0755]
external/include/protocols/ntpclient.h [moved from apps/include/netutils/ntpclient.h with 100% similarity, mode: 0755]
external/include/protocols/smtp.h [moved from apps/include/netutils/smtp.h with 100% similarity, mode: 0755]
external/include/protocols/telnetd.h [moved from apps/include/netutils/telnetd.h with 100% similarity, mode: 0755]
external/include/protocols/tftp.h [moved from apps/include/netutils/tftp.h with 100% similarity, mode: 0755]
external/include/protocols/urldecode.h [moved from apps/include/netutils/urldecode.h with 100% similarity, mode: 0755]
external/include/protocols/webclient.h [moved from apps/include/netutils/webclient.h with 99% similarity, mode: 0755]
external/include/protocols/webserver/http_err.h [moved from apps/include/netutils/webserver/http_err.h with 100% similarity]
external/include/protocols/webserver/http_keyvalue_list.h [moved from apps/include/netutils/webserver/http_keyvalue_list.h with 98% similarity]
external/include/protocols/webserver/http_server.h [moved from apps/include/netutils/webserver/http_server.h with 99% similarity]
external/include/protocols/websocket.h [moved from apps/include/netutils/websocket.h with 99% similarity, mode: 0755]
external/include/protocols/wslay/wslay.h [moved from apps/include/netutils/wslay/wslay.h with 100% similarity]
external/include/protocols/xmlrpc.h [moved from apps/include/netutils/xmlrpc.h with 100% similarity, mode: 0755]
external/iotivity/iotivity_1.2-rel/extlibs/tinycbor/tinycbor/tools/json2cbor/json2cbor.c
external/iotivity/iotivity_1.2-rel/resource/csdk/security/include/internal/psinterface.h
external/iotivity/iotivity_1.2-rel/resource/csdk/security/include/srmutility.h
external/iotivity/iotivity_1.2-rel/resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c
external/iotivity/iotivity_1.2-rel/resource/csdk/security/provisioning/src/ownershiptransfermanager.c
external/iotivity/iotivity_1.2-rel/resource/csdk/security/provisioning/src/pmutility.c
external/iotivity/iotivity_1.2-rel/resource/csdk/security/provisioning/src/secureresourceprovider.c
external/iotivity/iotivity_1.2-rel/resource/csdk/security/src/directpairing.c
external/iotivity/iotivity_1.2-rel/resource/csdk/security/src/dpairingresource.c
external/iotivity/iotivity_1.2-rel/resource/csdk/security/src/pconfresource.c
external/iotivity/iotivity_1.2-rel/resource/csdk/security/tool/json2cbor.c
external/iotivity/iotivity_1.2-rel/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverslow.cpp
external/iotivity/iotivity_1.2-rel/resource/csdk/stack/src/oicgroup.c
external/iotivity/iotivity_1.2-rel/service/coap-http-proxy/include/CoapHttpMap.h
external/iotivity/iotivity_1.2-rel/service/coap-http-proxy/src/CoapHttpHandler.c
external/iotivity/iotivity_1.2-rel/service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp
external/iotivity/iotivity_1.2-rel/service/simulator/ramlparser/raml/IncludeResolver.h
external/iotivity/iotivity_1.2-rel/service/simulator/ramlparser/raml/jsonSchemaParser/JsonSchema.h
external/iotivity/iotivity_1.2-rel/service/simulator/ramlparser/raml/jsonSchemaParser/Properties.h
external/iotivity/iotivity_1.2-rel/service/simulator/ramlparser/raml/model/Raml.h
external/iotivity/iotivity_1.2-rel/service/simulator/ramlparser/raml/model/Schema.h
external/json/.gitignore [moved from apps/netutils/json/.gitignore with 100% similarity]
external/json/Kconfig [moved from apps/netutils/json/Kconfig with 100% similarity]
external/json/Make.defs [moved from apps/netutils/json/Make.defs with 97% similarity]
external/json/Makefile [moved from apps/netutils/json/Makefile with 100% similarity]
external/json/README [moved from apps/netutils/json/README with 100% similarity]
external/json/cJSON.c [moved from apps/netutils/json/cJSON.c with 99% similarity]
external/libcoap/Kconfig.protocol [moved from apps/netutils/libcoap/Kconfig with 100% similarity]
external/libcoap/LICENSE.BSD [moved from apps/include/netutils/libcoap/LICENSE.BSD with 100% similarity]
external/libcoap/LICENSE.GPL [moved from apps/include/netutils/libcoap/LICENSE.GPL with 100% similarity]
external/libcoap/Make.defs [moved from apps/netutils/libcoap/Make.defs with 86% similarity]
external/libcoap/Makefile [moved from apps/netutils/libcoap/Makefile with 100% similarity]
external/libcoap/README [moved from apps/netutils/libcoap/README with 100% similarity]
external/libcoap/async.c [moved from apps/netutils/libcoap/async.c with 94% similarity]
external/libcoap/block.c [moved from apps/netutils/libcoap/block.c with 97% similarity]
external/libcoap/coap_list.c [moved from apps/netutils/libcoap/coap_list.c with 93% similarity]
external/libcoap/debug.c [moved from apps/netutils/libcoap/debug.c with 98% similarity]
external/libcoap/encode.c [moved from apps/netutils/libcoap/encode.c with 96% similarity]
external/libcoap/hashkey.c [moved from apps/netutils/libcoap/hashkey.c with 96% similarity]
external/libcoap/net.c [moved from apps/netutils/libcoap/net.c with 99% similarity]
external/libcoap/option.c [moved from apps/netutils/libcoap/option.c with 98% similarity]
external/libcoap/pdu.c [moved from apps/netutils/libcoap/pdu.c with 99% similarity]
external/libcoap/resource.c [moved from apps/netutils/libcoap/resource.c with 98% similarity]
external/libcoap/str.c [moved from apps/netutils/libcoap/str.c with 89% similarity]
external/libcoap/subscribe.c [moved from apps/netutils/libcoap/subscribe.c with 97% similarity]
external/libcoap/uri.c [moved from apps/netutils/libcoap/uri.c with 98% similarity]
external/mdns/Kconfig.protocol [moved from apps/netutils/mdns/Kconfig with 100% similarity]
external/mdns/Make.defs [moved from apps/netutils/mdns/Make.defs with 90% similarity]
external/mdns/Makefile [moved from apps/netutils/mdns/Makefile with 100% similarity]
external/mdns/mdns.c [moved from apps/netutils/mdns/mdns.c with 100% similarity]
external/mdns/mdns.h [moved from apps/netutils/mdns/mdns.h with 100% similarity]
external/mdns/mdnsd.c [moved from apps/netutils/mdns/mdnsd.c with 99% similarity]
external/mosquitto/Make.defs [new file with mode: 0644]
external/mosquitto/config.h [moved from apps/netutils/mqtt/config.h with 100% similarity]
external/mosquitto/config.mk [new file with mode: 0644]
external/mosquitto/logging_mosq.c [moved from apps/netutils/mqtt/lib/logging_mosq.c with 100% similarity]
external/mosquitto/logging_mosq.h [moved from apps/netutils/mqtt/lib/logging_mosq.h with 100% similarity]
external/mosquitto/memory_mosq.c [moved from apps/netutils/mqtt/lib/memory_mosq.c with 100% similarity]
external/mosquitto/memory_mosq.h [moved from apps/netutils/mqtt/lib/memory_mosq.h with 100% similarity]
external/mosquitto/messages_mosq.c [moved from apps/netutils/mqtt/lib/messages_mosq.c with 100% similarity]
external/mosquitto/messages_mosq.h [moved from apps/netutils/mqtt/lib/messages_mosq.h with 100% similarity]
external/mosquitto/mosquitto.c [moved from apps/netutils/mqtt/lib/mosquitto.c with 100% similarity]
external/mosquitto/mosquitto.h [moved from apps/netutils/mqtt/lib/mosquitto.h with 100% similarity]
external/mosquitto/mosquitto_internal.h [moved from apps/netutils/mqtt/lib/mosquitto_internal.h with 100% similarity]
external/mosquitto/mqtt3_protocol.h [moved from apps/netutils/mqtt/lib/mqtt3_protocol.h with 100% similarity]
external/mosquitto/net_mosq.c [moved from apps/netutils/mqtt/lib/net_mosq.c with 100% similarity]
external/mosquitto/net_mosq.h [moved from apps/netutils/mqtt/lib/net_mosq.h with 100% similarity]
external/mosquitto/read_handle.c [moved from apps/netutils/mqtt/lib/read_handle.c with 100% similarity]
external/mosquitto/read_handle.h [moved from apps/netutils/mqtt/lib/read_handle.h with 100% similarity]
external/mosquitto/read_handle_client.c [moved from apps/netutils/mqtt/lib/read_handle_client.c with 100% similarity]
external/mosquitto/read_handle_shared.c [moved from apps/netutils/mqtt/lib/read_handle_shared.c with 100% similarity]
external/mosquitto/send_client_mosq.c [moved from apps/netutils/mqtt/lib/send_client_mosq.c with 100% similarity]
external/mosquitto/send_mosq.c [moved from apps/netutils/mqtt/lib/send_mosq.c with 100% similarity]
external/mosquitto/send_mosq.h [moved from apps/netutils/mqtt/lib/send_mosq.h with 100% similarity]
external/mosquitto/socks_mosq.c [moved from apps/netutils/mqtt/lib/socks_mosq.c with 100% similarity]
external/mosquitto/socks_mosq.h [moved from apps/netutils/mqtt/lib/socks_mosq.h with 100% similarity]
external/mosquitto/srv_mosq.c [moved from apps/netutils/mqtt/lib/srv_mosq.c with 100% similarity]
external/mosquitto/thread_mosq.c [moved from apps/netutils/mqtt/lib/thread_mosq.c with 100% similarity]
external/mosquitto/time_mosq.c [moved from apps/netutils/mqtt/lib/time_mosq.c with 100% similarity]
external/mosquitto/time_mosq.h [moved from apps/netutils/mqtt/lib/time_mosq.h with 100% similarity]
external/mosquitto/tls_mosq.c [moved from apps/netutils/mqtt/lib/tls_mosq.c with 100% similarity]
external/mosquitto/tls_mosq.h [moved from apps/netutils/mqtt/lib/tls_mosq.h with 100% similarity]
external/mosquitto/util_mosq.c [moved from apps/netutils/mqtt/lib/util_mosq.c with 100% similarity]
external/mosquitto/util_mosq.h [moved from apps/netutils/mqtt/lib/util_mosq.h with 100% similarity]
external/mosquitto/will_mosq.c [moved from apps/netutils/mqtt/lib/will_mosq.c with 100% similarity]
external/mosquitto/will_mosq.h [moved from apps/netutils/mqtt/lib/will_mosq.h with 100% similarity]
external/netlib/.gitignore [moved from apps/netutils/smtp/.gitignore with 100% similarity]
external/netlib/Kconfig.protocl [moved from apps/netutils/netlib/Kconfig with 100% similarity]
external/netlib/Make.defs [moved from apps/netutils/netlib/Make.defs with 72% similarity]
external/netlib/Makefile [moved from apps/netutils/netlib/Makefile with 100% similarity]
external/netlib/netlib.c [moved from apps/netutils/netlib/netlib.c with 99% similarity]
external/netlib/netlib_getdripv4addr.c [moved from apps/netutils/netlib/netlib_getdripv4addr.c with 99% similarity]
external/netlib/netlib_getdripv6addr.c [moved from apps/netutils/netlib/netlib_getdripv6addr.c with 99% similarity]
external/netlib/netlib_getifstatus.c [moved from apps/netutils/netlib/netlib_getifstatus.c with 99% similarity]
external/netlib/netlib_getipv4addr.c [moved from apps/netutils/netlib/netlib_getipv4addr.c with 99% similarity]
external/netlib/netlib_getipv6addr.c [moved from apps/netutils/netlib/netlib_getipv6addr.c with 99% similarity]
external/netlib/netlib_getmacaddr.c [moved from apps/netutils/netlib/netlib_getmacaddr.c with 99% similarity]
external/netlib/netlib_ipmsfilter.c [moved from apps/netutils/netlib/netlib_ipmsfilter.c with 98% similarity]
external/netlib/netlib_ipv6netmask2prefix.c [moved from apps/netutils/netlib/netlib_ipv6netmask2prefix.c with 99% similarity]
external/netlib/netlib_listenon.c [moved from apps/netutils/netlib/netlib_listenon.c with 99% similarity]
external/netlib/netlib_parsehttpurl.c [moved from apps/netutils/netlib/netlib_parsehttpurl.c with 99% similarity]
external/netlib/netlib_prefix2ipv6netmask.c [moved from apps/netutils/netlib/netlib_prefix2ipv6netmask.c with 99% similarity]
external/netlib/netlib_server.c [moved from apps/netutils/netlib/netlib_server.c with 99% similarity]
external/netlib/netlib_setdripv4addr.c [moved from apps/netutils/netlib/netlib_setdripv4addr.c with 99% similarity]
external/netlib/netlib_setdripv6addr.c [moved from apps/netutils/netlib/netlib_setdripv6addr.c with 99% similarity]
external/netlib/netlib_setifstatus.c [moved from apps/netutils/netlib/netlib_setifstatus.c with 99% similarity]
external/netlib/netlib_setipv4addr.c [moved from apps/netutils/netlib/netlib_setipv4addr.c with 99% similarity]
external/netlib/netlib_setipv4netmask.c [moved from apps/netutils/netlib/netlib_setipv4netmask.c with 99% similarity]
external/netlib/netlib_setipv6addr.c [moved from apps/netutils/netlib/netlib_setipv6addr.c with 99% similarity]
external/netlib/netlib_setipv6netmask.c [moved from apps/netutils/netlib/netlib_setipv6netmask.c with 99% similarity]
external/netlib/netlib_setmacaddr.c [moved from apps/netutils/netlib/netlib_setmacaddr.c with 99% similarity]
external/ntpclient/.gitignore [moved from apps/netutils/ntpclient/.gitignore with 100% similarity]
external/ntpclient/Kconfig.protocol [moved from apps/netutils/ntpclient/Kconfig with 100% similarity]
external/ntpclient/Make.defs [moved from apps/netutils/ntpclient/Make.defs with 96% similarity]
external/ntpclient/Makefile [moved from apps/netutils/ntpclient/Makefile with 100% similarity]
external/ntpclient/ntpclient.c [moved from apps/netutils/ntpclient/ntpclient.c with 99% similarity]
external/ntpclient/ntpv3.h [moved from apps/netutils/ntpclient/ntpv3.h with 100% similarity]
external/smtp/.gitignore [moved from apps/netutils/netlib/.gitignore with 100% similarity]
external/smtp/Kconfig.protocol [moved from apps/netutils/smtp/Kconfig with 100% similarity]
external/smtp/Make.defs [moved from apps/netutils/smtp/Make.defs with 97% similarity]
external/smtp/Makefile [moved from apps/netutils/smtp/Makefile with 100% similarity]
external/smtp/smtp.c [moved from apps/netutils/smtp/smtp.c with 99% similarity]
external/telnetd/.gitignore [moved from apps/netutils/ftpd/.gitignore with 100% similarity]
external/telnetd/Kconfig.protocol [moved from apps/netutils/telnetd/Kconfig with 100% similarity]
external/telnetd/Make.defs [moved from apps/netutils/telnetd/Make.defs with 96% similarity]
external/telnetd/Makefile [moved from apps/netutils/telnetd/Makefile with 100% similarity]
external/telnetd/README.txt [moved from apps/netutils/telnetd/README.txt with 100% similarity]
external/telnetd/telnetd_daemon.c [moved from apps/netutils/telnetd/telnetd_daemon.c with 99% similarity]
external/tftpc/.gitignore [moved from apps/netutils/ftpc/.gitignore with 100% similarity]
external/tftpc/Kconfig.protocol [moved from apps/netutils/tftpc/Kconfig with 100% similarity]
external/tftpc/Make.defs [moved from apps/netutils/tftpc/Make.defs with 95% similarity]
external/tftpc/Makefile [moved from apps/netutils/tftpc/Makefile with 100% similarity]
external/tftpc/tftpc_get.c [moved from apps/netutils/tftpc/tftpc_get.c with 99% similarity]
external/tftpc/tftpc_internal.h [moved from apps/netutils/tftpc/tftpc_internal.h with 100% similarity]
external/tftpc/tftpc_packets.c [moved from apps/netutils/tftpc/tftpc_packets.c with 99% similarity]
external/tftpc/tftpc_put.c [moved from apps/netutils/tftpc/tftpc_put.c with 99% similarity]
external/webclient/.gitignore [moved from apps/netutils/dhcpc/.gitignore with 100% similarity]
external/webclient/Kconfig.protocol [moved from apps/netutils/webclient/Kconfig with 100% similarity]
external/webclient/Make.defs [moved from apps/netutils/webclient/Make.defs with 95% similarity]
external/webclient/Makefile [moved from apps/netutils/webclient/Makefile with 100% similarity]
external/webclient/webclient.c [moved from apps/netutils/webclient/webclient.c with 99% similarity]
external/webserver/Kconfig.protocol [moved from apps/netutils/webserver/Kconfig with 100% similarity]
external/webserver/Make.defs [moved from apps/netutils/webserver/Make.defs with 85% similarity]
external/webserver/Makefile [moved from apps/netutils/webserver/Makefile with 100% similarity]
external/webserver/http.c [moved from apps/netutils/webserver/http.c with 98% similarity]
external/webserver/http.h [moved from apps/netutils/webserver/http.h with 100% similarity]
external/webserver/http_arch.h [moved from apps/netutils/webserver/http_arch.h with 100% similarity]
external/webserver/http_client.c [moved from apps/netutils/webserver/http_client.c with 99% similarity]
external/webserver/http_client.h [moved from apps/netutils/webserver/http_client.h with 95% similarity]
external/webserver/http_client_tls.c [moved from apps/netutils/webserver/http_client_tls.c with 97% similarity]
external/webserver/http_keyvalue_list.c [moved from apps/netutils/webserver/http_keyvalue_list.c with 96% similarity]
external/webserver/http_log.h [moved from apps/netutils/webserver/http_log.h with 100% similarity]
external/webserver/http_query.c [moved from apps/netutils/webserver/http_query.c with 98% similarity]
external/webserver/http_query.h [moved from apps/netutils/webserver/http_query.h with 100% similarity]
external/webserver/http_server.c [moved from apps/netutils/webserver/http_server.c with 96% similarity]
external/webserver/http_server_tls.c [moved from apps/netutils/webserver/http_server_tls.c with 98% similarity]
external/webserver/http_string_util.c [moved from apps/netutils/webserver/http_string_util.c with 97% similarity]
external/webserver/http_string_util.h [moved from apps/netutils/webserver/http_string_util.h with 100% similarity]
external/websocket/Kconfig.protocol [moved from apps/netutils/websocket/Kconfig with 100% similarity]
external/websocket/Make.defs [moved from apps/netutils/websocket/Make.defs with 78% similarity]
external/websocket/Makefile [moved from apps/netutils/websocket/Makefile with 100% similarity]
external/websocket/websocket.c [moved from apps/netutils/websocket/websocket.c with 99% similarity]
external/websocket/wslay/wslay_event.c [moved from apps/netutils/websocket/wslay/wslay_event.c with 99% similarity]
external/websocket/wslay/wslay_event.h [moved from apps/netutils/websocket/wslay/wslay_event.h with 99% similarity]
external/websocket/wslay/wslay_frame.c [moved from apps/netutils/websocket/wslay/wslay_frame.c with 100% similarity]
external/websocket/wslay/wslay_frame.h [moved from apps/netutils/websocket/wslay/wslay_frame.h with 98% similarity]
external/websocket/wslay/wslay_net.c [moved from apps/netutils/websocket/wslay/wslay_net.c with 100% similarity]
external/websocket/wslay/wslay_net.h [moved from apps/netutils/websocket/wslay/wslay_net.h with 98% similarity]
external/websocket/wslay/wslay_queue.c [moved from apps/netutils/websocket/wslay/wslay_queue.c with 100% similarity]
external/websocket/wslay/wslay_queue.h [moved from apps/netutils/websocket/wslay/wslay_queue.h with 98% similarity]
external/websocket/wslay/wslay_stack.c [moved from apps/netutils/websocket/wslay/wslay_stack.c with 100% similarity]
external/websocket/wslay/wslay_stack.h [moved from apps/netutils/websocket/wslay/wslay_stack.h with 98% similarity]
external/xmlrpc/.gitignore [new file with mode: 0644]
external/xmlrpc/Kconfig.protocol [moved from apps/netutils/xmlrpc/Kconfig with 100% similarity]
external/xmlrpc/Make.defs [moved from apps/netutils/xmlrpc/Make.defs with 96% similarity]
external/xmlrpc/Makefile [moved from apps/netutils/xmlrpc/Makefile with 100% similarity]
external/xmlrpc/response.c [moved from apps/netutils/xmlrpc/response.c with 99% similarity]
external/xmlrpc/xmlparser.c [moved from apps/netutils/xmlrpc/xmlparser.c with 99% similarity]
framework/Makefile
framework/include/mqtt/mqtt_api.h [moved from apps/include/netutils/mqtt_api.h with 100% similarity, mode: 0755]
framework/src/dm/arch/sidk_s5jt200/s5j_dm_connectivity.c
framework/src/mqtt/Kconfig.protocol [moved from apps/netutils/mqtt/Kconfig with 100% similarity]
framework/src/mqtt/Make.defs [moved from apps/netutils/mqtt/Make.defs with 94% similarity]
framework/src/mqtt/Makefile [moved from apps/netutils/mqtt/Makefile with 100% similarity]
framework/src/mqtt/config.h [new file with mode: 0644]
framework/src/mqtt/config.mk [moved from apps/netutils/mqtt/config.mk with 100% similarity]
framework/src/mqtt/mqtt_api.c [moved from apps/netutils/mqtt/mqtt_api.c with 99% similarity]
os/net/Kconfig

index 9c898cd..3644e68 100644 (file)
 #include <tinyara/config.h>
 #include <apps/shell/tash.h>
 
-#include <apps/netutils/dhcpc.h>
-#include <apps/netutils/netlib.h>
-#include <apps/netutils/webclient.h>
+#include <protocols/dhcpc.h>
+#include <protocols/netlib.h>
+#include <protocols/webclient.h>
 
 #include <net/if.h>
 
 #include <dm/dm_error.h>
 #include <dm/dm_connectivity.h>
 
-#include <apps/netutils/wifi/slsi_wifi_api.h>
+#include <protocols/wifi/slsi_wifi_api.h>
 
 /****************************************************************************
  * Definitions
index 624b8a5..0247a28 100644 (file)
@@ -14,9 +14,9 @@
 #include <semaphore.h>
 #include <time.h>
 #include <sys/socket.h>
-#include <apps/netutils/webserver/http_server.h>
-#include <apps/netutils/webserver/http_keyvalue_list.h>
-#include <apps/netutils/cJSON.h>
+#include <protocols/webserver/http_server.h>
+#include <protocols/webserver/http_keyvalue_list.h>
+#include <json/cJSON.h>
 #include "wifi_api.h"
 
 /****************************************************************************
index 6e662db..2a25192 100644 (file)
@@ -63,8 +63,8 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <apps/netutils/netlib.h>
-#include <apps/netutils/ftpd.h>
+#include <protocols/netlib.h>
+#include <protocols/ftpd.h>
 
 #include "ftpd.h"
 
index 5c4464e..2eb7043 100644 (file)
@@ -68,7 +68,7 @@
 #include <net/if.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Definitions
index e3d03ec..cdd9ab3 100644 (file)
@@ -21,7 +21,7 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 
-#include <apps/netutils/libcoap/coap.h>
+#include <protocols/libcoap/coap.h>
 
 #ifdef WITH_MBEDTLS
 #define COAP_MBEDTLS_CIPHERSUIT "TLS-PSK-WITH-AES-128-CBC-SHA"
index ef59c82..9683d12 100644 (file)
@@ -23,7 +23,7 @@
 #include <errno.h>
 #include <signal.h>
 
-#include <apps/netutils/libcoap/coap.h>
+#include <protocols/libcoap/coap.h>
 
 #define COAP_RESOURCE_CHECK_TIME 2
 
index 4b0a813..6eaba95 100644 (file)
@@ -62,7 +62,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <apps/netutils/mdnsd.h>
+#include <protocols/mdnsd.h>
 
 #include <netinet/in.h>
 #include <netdb.h>
index ba24de9..e760b77 100644 (file)
@@ -34,7 +34,7 @@
 #include <tinyara/clock.h>
 #include <errno.h>
 
-#include <apps/netutils/mqtt_api.h>
+#include <mqtt/mqtt_api.h>
 
 #if defined(CONFIG_NETUTILS_MQTT_SECURITY)
 #include "tls/x509_crt.h"
index 8c4d547..1927595 100644 (file)
@@ -32,7 +32,7 @@
 #include <sys/socket.h>
 #include <errno.h>
 
-#include <apps/netutils/mqtt_api.h>
+#include <mqtt/mqtt_api.h>
 
 #if defined(CONFIG_NETUTILS_MQTT_SECURITY)
 #include "tls/x509_crt.h"
index 297745e..4a8e74d 100644 (file)
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include <sys/select.h>
 #include <sys/socket.h>
 
index 2f5c0c9..a28ff09 100644 (file)
@@ -64,7 +64,7 @@
 #include <string.h>
 #include <time.h>
 
-#include <apps/netutils/ntpclient.h>
+#include <protocols/ntpclient.h>
 
 /****************************************************************************
  * Definitions
index 45f406f..06568be 100644 (file)
@@ -36,7 +36,7 @@
 #include <net/lwip/ipv4/inet.h>
 #include <net/lwip/dhcp.h>
 #include <net/lwip/sys.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include <net/lwip/tcpip.h>
 #include <net/lwip/netif.h>
 #include <net/lwip/arch/sys_arch.h>
index 93729ca..2182b1e 100644 (file)
@@ -64,8 +64,8 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <tinyara/config.h>
-#include <apps/netutils/telnetd.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/telnetd.h>
+#include <protocols/netlib.h>
 #include "telnetd.h"
 
 /****************************************************************************
index 6d427c5..6366727 100644 (file)
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <net/if.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index f7e7c4a..db35329 100644 (file)
@@ -27,7 +27,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index 30521f5..c31e7da 100644 (file)
@@ -27,7 +27,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include <sys/socket.h>
 
 #include "tc_internal.h"
index abe9b27..4f8df69 100644 (file)
@@ -26,7 +26,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index 473e00b..3af5a11 100644 (file)
@@ -28,7 +28,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index ac1de1e..33455d0 100644 (file)
@@ -26,7 +26,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 #include <sys/ioctl.h>
index f691310..336b164 100644 (file)
@@ -27,7 +27,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index 7ec1ffe..a28c605 100644 (file)
@@ -27,7 +27,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index 587464b..aaf5ebc 100644 (file)
@@ -27,7 +27,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index c26fe76..2c12698 100644 (file)
@@ -27,7 +27,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index 797d870..577c6bf 100644 (file)
@@ -25,7 +25,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 
index b89d06e..c873a3d 100644 (file)
@@ -27,7 +27,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index 9b43c2e..9443ae9 100644 (file)
@@ -27,7 +27,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index b6c343a..7e27d29 100644 (file)
@@ -26,7 +26,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 #ifdef CONFIG_LIBC_NETDB
index c8e8a3b..3ee4f2c 100644 (file)
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <net/if.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include "tc_internal.h"
 #include <stdio.h>
 #include <stdlib.h>
index b48a51a..6750697 100644 (file)
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <net/if.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include "tc_internal.h"
 #include <stdio.h>
 #include <stdlib.h>
index f9823c9..76f2c8f 100644 (file)
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <net/if.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include "tc_internal.h"
 #include <stdio.h>
 #include <stdlib.h>
index 7c04803..5816c7d 100644 (file)
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <net/if.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include "tc_internal.h"
 #include <stdio.h>
 #include <stdlib.h>
index 3ec7c0b..a3db6fb 100644 (file)
@@ -27,7 +27,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 //#include <arch/board/board.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index 32fb09a..fdb64b5 100644 (file)
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <net/if.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include "tc_internal.h"
 #include <stdio.h>
 #include <stdlib.h>
index 6e93069..a8c19b3 100644 (file)
@@ -26,7 +26,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index 03446cf..b809523 100644 (file)
@@ -24,7 +24,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index b656af4..98c200e 100644 (file)
@@ -23,7 +23,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include <sys/socket.h>
 #include "itc_internal.h"
 #include "dm_lwm2m.h"
index a33b998..433ae9a 100644 (file)
@@ -27,9 +27,9 @@
 #include <dm/dm_error.h>
 #include <dm/dm_connectivity.h>
 
-#include <apps/netutils/dhcpc.h>
+#include <protocols/dhcpc.h>
 
-#include <apps/netutils/wifi/slsi_wifi_api.h>
+#include <protocols/wifi/slsi_wifi_api.h>
 
 #define NET_DEVNAME "wl1"
 
index 2750c20..5e02a89 100644 (file)
@@ -24,7 +24,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include <sys/socket.h>
 
index 683022e..7937665 100644 (file)
@@ -23,7 +23,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #include <sys/socket.h>
 
 #include "utc_internal.h"
index 6c68c94..dbc4281 100644 (file)
@@ -27,8 +27,8 @@
 #include <dm/dm_error.h>
 #include <dm/dm_connectivity.h>
 
-#include <apps/netutils/dhcpc.h>
-#include <apps/netutils/wifi/slsi_wifi_api.h>
+#include <protocols/dhcpc.h>
+#include <protocols/wifi/slsi_wifi_api.h>
 
 #define NET_DEVNAME "wl1"
 
index 7ab6af8..1e17d37 100644 (file)
@@ -27,9 +27,9 @@
 #include <tinyara/wqueue.h>
 #include <tinyara/clock.h>
 
-#include <apps/netutils/dhcpc.h>
+#include <protocols/dhcpc.h>
 
-#include <apps/netutils/wifi/slsi_wifi_api.h>
+#include <protocols/wifi/slsi_wifi_api.h>
 
 #define NET_DEVNAME "wl1"
 
index 9814c82..a0ce4f0 100644 (file)
@@ -72,7 +72,7 @@
 #include <unistd.h>
 #include <string.h>
 
-#include <apps/netutils/webclient.h>
+#include <protocols/webclient.h>
 
 /****************************************************************************
  * Preprocessor Definitions
index d80d09d..15a9b0a 100644 (file)
@@ -62,9 +62,9 @@
 #include <netinet/in.h>
 
 #include <tinyara/net/ethernet.h>
-#include <apps/netutils/netlib.h>
-#include <apps/netutils/webserver/http_server.h>
-#include <apps/netutils/webserver/http_keyvalue_list.h>
+#include <protocols/netlib.h>
+#include <protocols/webserver/http_server.h>
+#include <protocols/webserver/http_keyvalue_list.h>
 
 #define WEBSERVER_STACK_SIZE   (1024 * 8)
 #define WEBSERVER_SCHED_PRI    100
index ec5be8e..494ab49 100644 (file)
 #include <string.h>
 #include <errno.h>
 
-#include <apps/netutils/websocket.h>
+#include <protocols/websocket.h>
 
 #include <tls/config.h>
 #include <tls/entropy.h>
index 17317e2..13fe718 100644 (file)
@@ -62,7 +62,7 @@
  ****************************************************************************/
 
 #include <string.h>
-#include <apps/netutils/xmlrpc.h>
+#include <protocols/xmlrpc.h>
 
 /****************************************************************************
  * Private Function Prototypes
index 263ff15..8b6941e 100644 (file)
@@ -82,8 +82,8 @@
 #include <net/if.h>
 #include <netinet/in.h>
 
-#include <apps/netutils/netlib.h>
-#include <apps/netutils/xmlrpc.h>
+#include <protocols/netlib.h>
+#include <protocols/xmlrpc.h>
 
 /****************************************************************************
  * Private Data
index 33d902e..7c104d2 100644 (file)
 #include <net/lwip/dhcp.h>
 #include <net/lwip/stats.h>
 #include <tinyara/net/ip.h>
-#include <apps/netutils/dhcpc.h>
+#include <protocols/dhcpc.h>
 
 #ifdef CONFIG_NETUTILS_NETLIB
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 #endif
 
-#include <apps/netutils/netlib.h>
-#include <apps/netutils/tftp.h>
+#include <protocols/netlib.h>
+#include <protocols/tftp.h>
 
 #ifdef CONFIG_HAVE_GETHOSTBYNAME
 #include <netdb.h>
 #endif
-#include <apps/netutils/dhcpc.h>
+#include <protocols/dhcpc.h>
 #ifndef DNS_DEFAULT_PORT
 #define DNS_DEFAULT_PORT   53
 #endif
index 3a89140..6cab704 100644 (file)
@@ -64,7 +64,7 @@
 
 #include <net/if.h>
 
-#include <dhcpd.h>
+#include <protocols/dhcpd.h>
 
 /****************************************************************************
  * Preprocessor Definitions
index 73e639f..09b88a3 100644 (file)
@@ -55,7 +55,7 @@
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include "netcmd.h"
-#include <apps/netutils/tftp.h>
+#include <protocols/tftp.h>
 
 #if defined(CONFIG_NETUTILS_TFTPC)
 struct tftpc_args_s {
index 3a29ab0..51a5ecf 100644 (file)
@@ -174,4 +174,7 @@ config AWS_SDK
        ---help---
                enable AWS IoT Device SDK
 
+source "$EXTERNALDIR/json/Kconfig"
+source "$EXTERNALDIR/codecs/Kconfig"
+
 
index 9ab6feb..b131523 100644 (file)
@@ -77,8 +77,25 @@ include aws/Make.defs
 include aws/src/Make.defs
 endif
 
-#DHCPD
-include dhcpd/Make.defs
+
+include dhcpd/Make.defs #DHCPD
+include xmlrpc/Make.defs
+include ntpclient/Make.defs
+include webserver/Make.defs
+include ftpc/Make.defs
+include mdns/Make.defs
+include webclient/Make.defs
+include mosquitto/Make.defs
+include ftpd/Make.defs
+include dhcpc/Make.defs
+include websocket/Make.defs
+include libcoap/Make.defs
+include tftpc/Make.defs
+include telnetd/Make.defs
+include smtp/Make.defs
+include netlib/Make.defs
+include json/Make.defs
+
 
 AOBJS = $(ASRCS:.S=$(OBJEXT))
 COBJS = $(CSRCS:.c=$(OBJEXT))
similarity index 88%
rename from apps/netutils/ftpc/Make.defs
rename to external/codecs/Make.defs
index 93a0b79..b4e4fc4 100644 (file)
@@ -15,7 +15,7 @@
 # language governing permissions and limitations under the License.
 #
 ###########################################################################
-# apps/netutils/ftpc/Make.defs
+# apps/netutils/codecs/Make.defs
 # Adds selected applications to apps/ build
 #
 #   Copyright (C) 2016 Gregory Nutt. All rights reserved.
 #
 ############################################################################
 
-ifeq ($(CONFIG_NETUTILS_FTPC),y)
-CONFIGURED_APPS += netutils/ftpc
+ifeq ($(CONFIG_NETUTILS_CODECS),y)
+
+ifeq ($(CONFIG_CODECS_BASE64),y)
+CSRCS          += codecs/base64.c
+endif
+ifeq ($(CONFIG_CODECS_HASH_MD5),y)
+CSRCS          += codecs/md5.c
+endif
+ifeq ($(CONFIG_CODECS_URLCODE),y)
+CSRCS          += codecs/urldecode.c
+endif
+
+DEPPATH += --dep-path codecs
+VPATH += :codecs
 endif
 
similarity index 97%
rename from apps/netutils/dhcpc/Make.defs
rename to external/dhcpc/Make.defs
index d69965e..2dccb9d 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_DHCPC),y)
-CONFIGURED_APPS += netutils/dhcpc
+
+CSRCS += dhcpc/dhcpc.c
+
+DEPPATH += --dep-path dhcpc
+VPATH += :dhcpc
+
 endif
 
similarity index 99%
rename from apps/netutils/dhcpc/dhcpc.c
rename to external/dhcpc/dhcpc.c
index ed979dd..470d4d7 100644 (file)
@@ -71,8 +71,8 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 
-#include <apps/netutils/dhcpc.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/dhcpc.h>
+#include <protocols/netlib.h>
 
 #if defined(CONFIG_NETDB_DNSCLIENT) && defined(CONFIG_NETDB_DNSSERVER_BY_DHCP)
 #include <tinyara/net/dns.h>
diff --git a/external/dhcpd/Kconfig.protocol b/external/dhcpd/Kconfig.protocol
new file mode 100644 (file)
index 0000000..e0e301e
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# For a description of the syntax of this configuration file,
+# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
+#
+
+config NETUTILS_DHCPD
+       bool "DHCP server"
+       default n
+       depends on NET_IPv4
+       ---help---
+               Enable support for the DHCP server.
+
+if NETUTILS_DHCPD
+
+config NETUTILS_DHCPD_HOST
+       bool "Host-based DHCPD build"
+       default n
+       depends on EXPERIMENTAL
+       ---help---
+               DHCPD supports a host based build for testing on a PC.  It is
+               enabled by this configuration, however, ti cannot really be used
+               in the context to the TinyAra build as it currently stands.
+
+config NETUTILS_DHCPD_IGNOREBROADCAST
+       bool "Ignore client broadcast"
+       default y
+       ---help---
+               This is a hack.  I've had problems with Windows machines responding
+               to unicast.  I think this is associated with a Windows registry key in
+               HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters:
+               The IgnoreBroadcastFlag value controls this behavior:  A value of 1 will
+               cause the server to ignore the client broadcast flag and always respond
+               with multicast; the value 0 to allows clients to request unicast.
+
+config NETUTILS_DHCPD_INTERFACE
+       string "DHCPD network interface"
+       default "wl1"
+
+config NETUTILS_DHCPD_LEASETIME
+       int "Lease time (seconds)"
+       default 864000
+       ---help---
+               Default: 10 days
+
+config NETUTILS_DHCPD_MINLEASETIME
+       int "Minimum lease time (seconds)"
+       default 86400
+       ---help---
+               Default: 1 days
+
+config NETUTILS_DHCPD_MAXLEASETIME
+       int "Maximum lease time (seconds)"
+       default 2592000
+       ---help---
+               Default: 30 days
+
+config NETUTILS_DHCPD_MAXLEASES
+       int "Maximum number of leases"
+       default 6
+
+config NETUTILS_DHCPD_STARTIP
+       hex "First IP address"
+       default 0xc0a82f02
+
+config NETUTILS_DHCPD_ROUTERIP
+       hex "Router IP (0 to disable)"
+       default 0xc0a82f01
+
+config NETUTILS_DHCPD_NETMASK
+       hex "Netmask (0 to disable)"
+       default 0xffffff00
+
+config NETUTILS_DHCPD_DNSIP
+       hex "DNS (0 to disable)"
+       default 0x08080808
+
+config NETUTILS_DHCPD_OFFERTIME
+       int "Offer time (seconds)"
+       default 3600
+       ---help---
+               Default: 1 hour
+
+config NETUTILS_DHCPD_DECLINETIME
+       int "Decline time (seconds)"
+       default 3600
+       ---help---
+       Default: 1 hour
+
+endif
similarity index 94%
rename from apps/netutils/codecs/Make.defs
rename to external/dhcpd/Make.defs
index 32b6bab..78f8ada 100644 (file)
@@ -15,7 +15,7 @@
 # language governing permissions and limitations under the License.
 #
 ###########################################################################
-# apps/netutils/codecs/Make.defs
+# apps/netutils/dhcpd/Make.defs
 # Adds selected applications to apps/ build
 #
 #   Copyright (C) 2016 Gregory Nutt. All rights reserved.
 #
 ############################################################################
 
-ifeq ($(CONFIG_NETUTILS_CODECS),y)
-CONFIGURED_APPS += netutils/codecs
+ifeq ($(CONFIG_NETUTILS_DHCPD),y)
+
+CSRCS += dhcpd/dhcpd.c
+
+DEPPATH += --dep-path dhcpd
+VPATH += :dhcpd
+
 endif
 
diff --git a/external/dhcpd/dhcpd.c b/external/dhcpd/dhcpd.c
new file mode 100644 (file)
index 0000000..e6ee3c9
--- /dev/null
@@ -0,0 +1,1741 @@
+/****************************************************************************
+ * netutils/dhcpd/dhcpd.c
+ *
+ * Copyright 2016 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ ****************************************************************************/
+/****************************************************************************
+ * netutils/dhcpd/dhcpd.c
+ *
+ *   Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#ifdef CONFIG_NETUTILS_DHCPD_HOST
+#include <stdio.h>
+
+#define HTONS(a) htons(a)
+#define HTONL(a) htonl(a)
+
+#define CONFIG_CPP_HAVE_WARNING 1
+#define FAR
+
+#define ndbg(...) printf(__VA_ARGS__)
+#define nvdbg(...) printf(__VA_ARGS__)
+
+#define ERROR (-1)
+#define OK    (0)
+#else
+#include <tinyara/config.h>            /* TinyAra configuration */
+#include <debug.h>                             /* For ndbg, vdbg */
+#include <tinyara/compiler.h>  /* For CONFIG_CPP_HAVE_WARNING */
+#include <arch/irq.h>                  /* For irqstore() and friends -- REVISIT */
+#include <tinyara/net/net.h>   /* For net_lock() and friends */
+#include <protocols/dhcpd.h>   /* Advertised DHCPD APIs */
+#endif /* CONFIG_NETUTILS_DHCPD_HOST */
+
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <sys/select.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+#include <errno.h>
+
+#include <net/if.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+/****************************************************************************
+ * Global Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+#define DHCPD_SELECT             1
+
+#define DHCP_SERVER_PORT         67
+#define DHCP_CLIENT_PORT         68
+
+/* Option codes understood in this file                                     */
+/*                              Code    Data   Description                  */
+/*                                      Length                              */
+#define DHCP_OPTION_PAD           0    /*  1     Pad                          */
+#define DHCP_OPTION_SUBNET_MASK   1    /*  1     Subnet Mask                  */
+#define DHCP_OPTION_ROUTER        3    /*  4     Router                       */
+#define DHCP_OPTION_DNS_SERVER    6    /*  4N    DNS                          */
+#define DHCP_OPTION_REQ_IPADDR   50    /*  4     Requested IP Address         */
+#define DHCP_OPTION_LEASE_TIME   51    /*  4     IP address lease time        */
+#define DHCP_OPTION_OVERLOAD     52    /*  1     Option overload              */
+#define DHCP_OPTION_MSG_TYPE     53    /*  1     DHCP message type            */
+#define DHCP_OPTION_SERVER_ID    54    /*  4     Server identifier            */
+#define DHCP_OPTION_END         255    /*  0     End                          */
+
+/* Values for the dhcp msg 'op' field */
+
+#define DHCP_REQUEST              1
+#define DHCP_REPLY                2
+
+/* DHCP message types understood in this file */
+
+#define DHCPDISCOVER              1    /* Received from client only */
+#define DHCPOFFER                 2    /* Sent from server only */
+#define DHCPREQUEST               3    /* Received from client only */
+#define DHCPDECLINE               4    /* Received from client only */
+#define DHCPACK                   5    /* Sent from server only */
+#define DHCPNAK                   6    /* Sent from server only */
+#define DHCPRELEASE               7    /* Received from client only */
+#define DHCPINFORM                8    /* Not used */
+
+/* The form of an option is:
+ *   code   - 1 byte
+ *   length - 1 byte
+ *   data   - variable number of bytes
+ */
+
+#define DHCPD_OPTION_CODE         0
+#define DHCPD_OPTION_LENGTH       1
+#define DHCPD_OPTION_DATA         2
+
+/* Size of options in DHCP message */
+
+#define DHCPD_OPTIONS_SIZE        312
+
+/* Values for htype and hlen field */
+
+#define DHCP_HTYPE_ETHERNET       1
+#define DHCP_HLEN_ETHERNET        6
+
+/* Values for flags field */
+
+#define BOOTP_BROADCAST           0x8000
+
+/* Legal values for this option are:
+ *
+ *   1     the 'file' field is used to hold options
+ *   2     the 'sname' field is used to hold options
+ *   3     both fields are used to hold options
+ */
+
+#define DHCPD_OPTION_FIELD        0
+#define DHCPD_FILE_FIELD          1
+#define DHCPD_SNAME_FIELD         2
+
+#ifndef CONFIG_NETUTILS_DHCPD_LEASETIME
+#define CONFIG_NETUTILS_DHCPD_LEASETIME (60*60*24*10)  /* 10 days */
+#undef CONFIG_NETUTILS_DHCPD_MINLEASETIME
+#undef CONFIG_NETUTILS_DHCPD_MAXLEASETIME
+#endif
+
+#ifndef CONFIG_NETUTILS_DHCPD_MINLEASETIME
+#define CONFIG_NETUTILS_DHCPD_MINLEASETIME (60*60*24*1)        /* 1 days */
+#endif
+
+#ifndef CONFIG_NETUTILS_DHCPD_MAXLEASETIME
+#define CONFIG_NETUTILS_DHCPD_MAXLEASETIME (60*60*24*30)       /* 30 days */
+#endif
+
+#ifndef CONFIG_NETUTILS_DHCPD_INTERFACE
+#define CONFIG_NETUTILS_DHCPD_INTERFACE "eth0"
+#endif
+
+#ifndef CONFIG_NETUTILS_DHCPD_MAXLEASES
+#define CONFIG_NETUTILS_DHCPD_MAXLEASES 16
+#endif
+
+#ifndef CONFIG_NETUTILS_DHCPD_STARTIP
+#define CONFIG_NETUTILS_DHCPD_STARTIP (192L<<24|168L<<16|0L<<8|3L)
+#endif
+
+#undef CONFIG_NETUTILS_DHCP_OPTION_ENDIP
+#define CONFIG_NETUTILS_DHCP_OPTION_ENDIP (CONFIG_NETUTILS_DHCPD_STARTIP + CONFIG_NETUTILS_DHCPD_MAXLEASES - 1)
+
+#ifndef CONFIG_NETUTILS_DHCPD_OFFERTIME
+#define CONFIG_NETUTILS_DHCPD_OFFERTIME (60*60)        /* 1 hour */
+#endif
+
+#ifndef CONFIG_NETUTILS_DHCPD_DECLINETIME
+#define CONFIG_NETUTILS_DHCPD_DECLINETIME (60*60)      /* 1 hour */
+#endif
+
+#undef HAVE_ROUTERIP
+#if defined(CONFIG_NETUTILS_DHCPD_ROUTERIP) && CONFIG_NETUTILS_DHCPD_ROUTERIP
+#define HAVE_ROUTERIP 1
+#endif
+
+#undef HAVE_NETMASK
+#if defined(CONFIG_NETUTILS_DHCPD_NETMASK) && CONFIG_NETUTILS_DHCPD_NETMASK
+#define HAVE_NETMASK 1
+#endif
+
+#undef HAVE_DNSIP
+#if defined(CONFIG_NETUTILS_DHCPD_DNSIP) && CONFIG_NETUTILS_DHCPD_DNSIP
+#define HAVE_DNSIP 1
+#endif
+
+#undef HAVE_LEASE_TIME
+#if defined(CONFIG_NETUTILS_DHCPD_HOST) || !defined(CONFIG_DISABLE_POSIX_TIMERS)
+#define HAVE_LEASE_TIME 1
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/* This structure describes one element in the lease table.  There is one slot
+ * in the lease table for each assign-able IP address (hence, the IP address
+ * itself does not have to be in the table.
+ */
+
+struct lease_s {
+       uint8_t mac[DHCP_HLEN_ETHERNET];        /* MAC address (network order) -- could be larger! */
+       bool allocated;                         /* true: IP address is allocated */
+#ifdef HAVE_LEASE_TIME
+       time_t expiry;                          /* Lease expiration time (seconds past Epoch) */
+#endif
+};
+
+struct dhcpmsg_s {
+       uint8_t op;
+       uint8_t htype;
+       uint8_t hlen;
+       uint8_t hops;
+       uint8_t xid[4];
+       uint16_t secs;
+       uint16_t flags;
+       uint8_t ciaddr[4];
+       uint8_t yiaddr[4];
+       uint8_t siaddr[4];
+       uint8_t giaddr[4];
+       uint8_t chaddr[16];
+#ifndef CONFIG_NET_DHCP_LIGHT
+       uint8_t sname[64];
+       uint8_t file[128];
+#endif
+       uint8_t options[312];
+};
+
+struct dhcpd_state_s {
+       /* Server configuration */
+
+       in_addr_t ds_serverip;          /* The server IP address */
+
+       /* Message buffers */
+
+       struct dhcpmsg_s ds_inpacket;   /* Holds the incoming DHCP client message */
+       struct dhcpmsg_s ds_outpacket;  /* Holds the outgoing DHCP server message */
+
+       /* Parsed options from the incoming DHCP client message */
+
+       uint8_t ds_optmsgtype;          /* Incoming DHCP message type */
+       in_addr_t ds_optreqip;          /* Requested IP address (host order) */
+       in_addr_t ds_optserverip;       /* Serverip IP address (host order) */
+       time_t ds_optleasetime;         /* Requested lease time (host order) */
+
+       /* End option pointer for outgoing DHCP server message */
+
+       uint8_t *ds_optend;
+
+       /* Leases */
+
+       struct lease_s ds_leases[CONFIG_NETUTILS_DHCPD_MAXLEASES];
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static const uint8_t g_magiccookie[4] = { 99, 130, 83, 99 };
+static const uint8_t g_anyipaddr[4] = { 0, 0, 0, 0 };
+
+static struct dhcpd_state_s g_state;
+
+static int g_dhcpd_running = 0;
+static int g_dhcpd_quit = 0;
+
+static pthread_t g_tid = 0;
+
+static char DHCPD_IFNAME[IFNAMSIZ] = {0,};
+
+#if DHCPD_SELECT
+static struct timeval g_select_timeout = {10, 0};
+#endif
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: dhcpd_arpupdate
+ ****************************************************************************/
+
+#ifndef CONFIG_NETUTILS_DHCPD_HOST
+#ifndef CONFIG_NET_LWIP
+static inline void dhcpd_arpupdate(uint16_t *pipaddr, uint8_t *phwaddr)
+{
+       net_lock_t flags;
+
+       /* Disable interrupts and update the ARP table -- very non-portable hack.
+        * REVISIT -- switch to the SIOCSARP ioctl call if/when it is implemented.
+        */
+
+       flags = net_lock();
+       arp_update(pipaddr, phwaddr);
+       net_unlock(flags);
+}
+#else
+#define dhcpd_arpupdate(pipaddr, phwaddr)
+#endif /* CONFIG_NET_LWIP */
+#else
+#define dhcpd_arpupdate(pipaddr, phwaddr)
+#endif
+
+/****************************************************************************
+ * Name: dhcpd_time
+ ****************************************************************************/
+
+#ifdef CONFIG_NETUTILS_DHCPD_HOST
+#define dhcpd_time() time(0)
+#elif defined(HAVE_LEASE_TIME)
+static time_t dhcpd_time(void)
+{
+       struct timespec ts;
+       time_t ret = 0;
+
+       if (clock_gettime(CLOCK_REALTIME, &ts) == OK) {
+               ret = ts.tv_sec;
+       }
+
+       return ret;
+}
+#else
+#define dhcpd_time() (0)
+#endif
+
+/****************************************************************************
+ * Name: dhcpd_leaseexpired
+ ****************************************************************************/
+
+#ifdef HAVE_LEASE_TIME
+static inline bool dhcpd_leaseexpired(struct lease_s *lease)
+{
+       ndbg("dhcpd_leaseexpired is called!!\n");
+
+       return false;
+
+       if (lease->expiry < dhcpd_time()) {
+               return false;
+       } else {
+//      memset(lease, 0, sizeof(struct lease_s));
+               return true;
+       }
+}
+#else
+#define dhcpd_leaseexpired(lease) (false)
+#endif
+
+/****************************************************************************
+ * Name: dhcpd_setlease
+ ****************************************************************************/
+
+struct lease_s *dhcpd_setlease(const uint8_t *mac, in_addr_t ipaddr, time_t expiry)
+{
+       /* Calculate the offset from the first IP address managed by DHCPD.
+        * ipaddr must be in host order!
+        */
+
+       int ndx = ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP;
+       struct lease_s *ret = NULL;
+
+       nvdbg("ipaddr: %08x ipaddr: %08x ndx: %d MAX: %d\n", ipaddr, CONFIG_NETUTILS_DHCPD_STARTIP, ndx, CONFIG_NETUTILS_DHCPD_MAXLEASES);
+
+       /* Verify that the address offset is within the supported range */
+
+       if (ndx >= 0 && ndx < CONFIG_NETUTILS_DHCPD_MAXLEASES) {
+               ret = &g_state.ds_leases[ndx];
+               memcpy(ret->mac, mac, DHCP_HLEN_ETHERNET);
+               ret->allocated = true;
+#ifdef HAVE_LEASE_TIME
+               ret->expiry = dhcpd_time() + expiry;
+#endif
+       }
+
+       return ret;
+}
+
+/****************************************************************************
+ * Name: dhcp_leaseipaddr
+ ****************************************************************************/
+
+static inline in_addr_t dhcp_leaseipaddr(struct lease_s *lease)
+{
+       /* Return IP address in host order */
+
+       return (in_addr_t)(lease - g_state.ds_leases) + CONFIG_NETUTILS_DHCPD_STARTIP;
+}
+
+/****************************************************************************
+ * Name: dhcpd_findbymac
+ ****************************************************************************/
+
+static struct lease_s *dhcpd_findbymac(const uint8_t *mac)
+{
+       int i;
+
+       for (i = 0; i < CONFIG_NETUTILS_DHCPD_MAXLEASES; i++) {
+               if (memcmp(g_state.ds_leases[i].mac, mac, DHCP_HLEN_ETHERNET) == 0) {
+                       return &(g_state.ds_leases[i]);
+               }
+       }
+
+       return NULL;
+}
+
+/****************************************************************************
+ * Name: dhcpd_findbyipaddr
+ ****************************************************************************/
+
+static struct lease_s *dhcpd_findbyipaddr(in_addr_t ipaddr)
+{
+       if (ipaddr >= CONFIG_NETUTILS_DHCPD_STARTIP && ipaddr <= CONFIG_NETUTILS_DHCP_OPTION_ENDIP) {
+
+               struct lease_s *lease = &g_state.ds_leases[ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP];
+               ndbg("dhcpd_findbyipaddr lease index  = %d\n", ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP);
+
+               if (lease->allocated > 0) {
+                       ndbg("returen lease %d %d\n", ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP, g_state.ds_leases[ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP].allocated);
+                       return lease;
+               }
+       }
+
+       ndbg("returen null\n");
+
+       return NULL;
+}
+
+/****************************************************************************
+ * Name: dhcpd_allocipaddr
+ ****************************************************************************/
+
+static in_addr_t dhcpd_allocipaddr(void)
+{
+       struct lease_s *lease = NULL;
+       in_addr_t ipaddr;
+
+       ipaddr = CONFIG_NETUTILS_DHCPD_STARTIP;
+       for (; ipaddr <= CONFIG_NETUTILS_DHCP_OPTION_ENDIP; ipaddr++) {
+               /* Skip over address ending in 0 or 255 */
+
+               if ((ipaddr & 0xff) == 0 || (ipaddr & 0xff) == 0xff) {
+                       continue;
+               }
+
+               /* Is there already a lease on this address?  If so, has it expired? */
+
+               lease = dhcpd_findbyipaddr(ipaddr);
+               if ((lease == NULL || dhcpd_leaseexpired(lease))) {
+                       ndbg("lease pass!!\n");
+#ifdef CONFIG_CPP_HAVE_WARNING
+/**
+#warning "FIXME: Should check if anything responds to an ARP request or ping"
+#warning "       to verify that there is no other user of this IP address"
+**/
+#endif
+
+                       ndbg("leases talbe = %d %d \n", ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP, g_state.ds_leases[ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP].allocated);
+
+                       memset(g_state.ds_leases[ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP].mac, 0, DHCP_HLEN_ETHERNET);
+                       g_state.ds_leases[ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP].allocated = true;
+#ifdef HAVE_LEASE_TIME
+                       g_state.ds_leases[ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP].expiry = dhcpd_time()
+                                       + CONFIG_NETUTILS_DHCPD_OFFERTIME;
+#endif
+                       /* Return the address in host order */
+
+                       ndbg("return ipaddr\n");
+                       return ipaddr;
+               }
+       }
+       ndbg("return ipaddr = 0\n");
+       return 0;
+}
+
+/****************************************************************************
+ * Name: dhcpd_parseoptions
+ ****************************************************************************/
+
+static inline bool dhcpd_parseoptions(void)
+{
+       uint32_t tmp;
+       uint8_t *ptr;
+#ifndef CONFIG_NET_DHCP_LIGHT
+       uint8_t overloaded;
+       uint8_t currfield;
+#endif
+       int optlen = 0;
+       int remaining;
+
+       /* Verify that the option field starts with a valid magic number */
+
+       ptr = g_state.ds_inpacket.options;
+       if (memcmp(ptr, g_magiccookie, 4) != 0) {
+               /* Bad magic number... skip g_state.ds_outpacket */
+
+               ndbg("Bad magic: %d,%d,%d,%d\n", ptr[0], ptr[1], ptr[2], ptr[3]);
+               return false;
+       }
+
+       /* Set up to parse the options */
+
+       ptr += 4;
+       remaining = DHCPD_OPTIONS_SIZE - 4;
+#ifndef CONFIG_NET_DHCP_LIGHT
+       overloaded = DHCPD_OPTION_FIELD;
+       currfield = DHCPD_OPTION_FIELD;
+#endif
+
+       /* Set all options to the default value */
+
+       g_state.ds_optmsgtype = 0;      /* Incoming DHCP message type */
+       g_state.ds_optreqip = 0;        /* Requested IP address (host order) */
+       g_state.ds_optserverip = 0;     /* Serverip IP address (host order) */
+       g_state.ds_optleasetime = 0;    /* Requested lease time (host order) */
+       g_state.ds_optend = NULL;
+
+       do {
+               /* The form of an option is:
+                *   code   - 1 byte
+                *   length - 1 byte
+                *   data   - variable number of bytes
+                */
+
+               switch (ptr[DHCPD_OPTION_CODE]) {
+               /* Skip over any padding bytes */
+
+               case DHCP_OPTION_PAD:
+                       optlen = 1;
+                       break;
+
+                       /* the Overload option is used to indicate that the DHCP 'sname' or 'file'
+                        * fields are being overloaded by using them to carry DHCP options. A DHCP
+                        * server inserts this option if the returned parameters will exceed the
+                        * usual space allotted for options.
+                        *
+                        * If this option is present, the client interprets the specified additional
+                        * fields after it concludes interpretation of the standard option fields.
+                        *
+                        * Legal values for this option are:
+                        *
+                        *   1     the 'file' field is used to hold options
+                        *   2     the 'sname' field is used to hold options
+                        *   3     both fields are used to hold options
+                        */
+
+#ifndef CONFIG_NET_DHCP_LIGHT
+               case DHCP_OPTION_OVERLOAD:
+                       optlen = ptr[DHCPD_OPTION_LENGTH] + 2;
+                       if (optlen >= 1 && optlen < remaining) {
+                               overloaded = ptr[DHCPD_OPTION_DATA];
+                       }
+                       break;
+#endif
+
+               case DHCP_OPTION_END:
+#ifndef CONFIG_NET_DHCP_LIGHT
+                       if (currfield == DHCPD_OPTION_FIELD && (overloaded & DHCPD_FILE_FIELD) != 0) {
+                               ptr = g_state.ds_inpacket.file;
+                               remaining = sizeof(g_state.ds_inpacket.file);
+                               currfield = DHCPD_FILE_FIELD;
+                       } else if (currfield == DHCPD_FILE_FIELD && (overloaded & DHCPD_SNAME_FIELD) != 0) {
+                               ptr = g_state.ds_inpacket.sname;
+                               remaining = sizeof(g_state.ds_inpacket.sname);
+                               currfield = DHCPD_SNAME_FIELD;
+                       } else {
+                               return true;
+                       }
+                       break;
+#else
+                       return true;
+#endif
+
+               case DHCP_OPTION_REQ_IPADDR:    /* Requested IP Address */
+                       optlen = ptr[DHCPD_OPTION_LENGTH] + 2;
+                       if (optlen >= 4 && optlen < remaining) {
+                               memcpy(&tmp, &ptr[DHCPD_OPTION_DATA], 4);
+                               g_state.ds_optreqip = (in_addr_t)ntohl(tmp);
+                       }
+                       break;
+
+               case DHCP_OPTION_LEASE_TIME:    /* IP address lease time */
+                       optlen = ptr[DHCPD_OPTION_LENGTH] + 2;
+                       if (optlen >= 4 && optlen < remaining) {
+                               memcpy(&tmp, &ptr[DHCPD_OPTION_DATA], 4);
+                               g_state.ds_optleasetime = (time_t)ntohl(tmp);
+                       }
+                       break;
+
+               case DHCP_OPTION_MSG_TYPE:      /* DHCP message type */
+                       optlen = ptr[DHCPD_OPTION_LENGTH] + 2;
+                       if (optlen >= 1 && optlen < remaining) {
+                               g_state.ds_optmsgtype = ptr[DHCPD_OPTION_DATA];
+                       }
+                       break;
+
+               case DHCP_OPTION_SERVER_ID:     /* Server identifier */
+                       optlen = ptr[DHCPD_OPTION_LENGTH] + 2;
+                       if (optlen >= 4 && optlen < remaining) {
+                               memcpy(&tmp, &ptr[DHCPD_OPTION_DATA], 4);
+                               g_state.ds_optserverip = (in_addr_t)ntohl(tmp);
+                       }
+                       break;
+
+               default:
+                       /* Skip over unsupported options */
+
+                       optlen = ptr[DHCPD_OPTION_LENGTH] + 2;
+                       break;
+               }
+
+               /* Advance to the next option */
+
+               ptr += optlen;
+               remaining -= optlen;
+       } while (remaining > 0);
+
+       return false;
+}
+
+/****************************************************************************
+ * Name: dhcpd_verifyreqip
+ ****************************************************************************/
+
+static inline bool dhcpd_verifyreqip(void)
+{
+       struct lease_s *lease;
+
+       /* Verify that the requested IP address is within the supported lease range */
+
+       if (g_state.ds_optreqip >= CONFIG_NETUTILS_DHCPD_STARTIP && g_state.ds_optreqip <= CONFIG_NETUTILS_DHCP_OPTION_ENDIP) {
+               /* And verify that the lease has not already been taken or offered
+                * (unless the lease/offer is expired, then the address is free game).
+                */
+
+               lease = dhcpd_findbyipaddr(g_state.ds_optreqip);
+               ndbg(" lease = %d\n", lease);
+               if (!lease || dhcpd_leaseexpired(lease)) {
+                       ndbg("can use IP %08lx\n", (long)g_state.ds_optreqip);
+                       return true;
+               }
+       }
+       ndbg("can't use IP %08lx\n", (long)g_state.ds_optreqip);
+       return false;
+}
+
+/****************************************************************************
+ * Name: dhcpd_verifyreqleasetime
+ ****************************************************************************/
+
+static inline bool dhcpd_verifyreqleasetime(uint32_t *leasetime)
+{
+       uint32_t tmp = g_state.ds_optleasetime;
+
+       /* Did the client request a specific lease time? */
+
+       if (tmp != 0) {
+               /* Yes..  Verify that the requested lease time is within a valid range */
+
+               if (tmp > CONFIG_NETUTILS_DHCPD_MAXLEASETIME) {
+                       tmp = CONFIG_NETUTILS_DHCPD_MAXLEASETIME;
+               } else if (tmp < CONFIG_NETUTILS_DHCPD_MINLEASETIME) {
+                       tmp = CONFIG_NETUTILS_DHCPD_MINLEASETIME;
+               }
+
+               /* Return the clipped lease time */
+
+               *leasetime = tmp;
+               return true;
+       }
+
+       return false;
+}
+
+/****************************************************************************
+ * Name: dhcpd_addoption
+ ****************************************************************************/
+
+static int dhcpd_addoption(uint8_t *option)
+{
+       int offset;
+       int len = 4;
+
+       if (g_state.ds_optend) {
+               offset = g_state.ds_outpacket.options - g_state.ds_optend;
+               len = option[DHCPD_OPTION_LENGTH] + 2;
+
+               /* Check if the option will fit into the options array */
+
+               if (offset + len + 1 < DHCPD_OPTIONS_SIZE) {
+                       /* Copy the option into the option array */
+
+                       memcpy(g_state.ds_optend, option, len);
+                       g_state.ds_optend += len;
+                       *g_state.ds_optend = DHCP_OPTION_END;
+               }
+       }
+
+       return len;
+}
+
+/****************************************************************************
+ * Name: dhcpd_addoption8
+ ****************************************************************************/
+
+static int dhcpd_addoption8(uint8_t code, uint8_t value)
+{
+       uint8_t option[3];
+
+       /* Construct the option sequence */
+
+       option[DHCPD_OPTION_CODE] = code;
+       option[DHCPD_OPTION_LENGTH] = 1;
+       option[DHCPD_OPTION_DATA] = value;
+
+       /* Add the option sequence to the response */
+
+       return dhcpd_addoption(option);
+}
+
+/****************************************************************************
+ * Name: dhcpd_addoption32
+ ****************************************************************************/
+
+static int dhcpd_addoption32(uint8_t code, uint32_t value)
+{
+       uint8_t option[6];
+
+       /* Construct the option sequence */
+
+       option[DHCPD_OPTION_CODE] = code;
+       option[DHCPD_OPTION_LENGTH] = 4;
+       memcpy(&option[DHCPD_OPTION_DATA], &value, 4);
+
+       /* Add the option sequence to the response */
+
+       return dhcpd_addoption(option);
+}
+
+/****************************************************************************
+ * Name: dhcp_addoption32p
+ ****************************************************************************/
+
+#if HAVE_DNSIP
+static int dhcp_addoption32p(uint8_t code, FAR uint8_t *value)
+{
+       uint8_t option[6];
+
+       /* Construct the option sequence */
+
+       option[DHCPD_OPTION_CODE] = code;
+       option[DHCPD_OPTION_LENGTH] = 4;
+       memcpy(&option[DHCPD_OPTION_DATA], value, 4);
+
+       /* Add the option sequence to the response */
+
+       return dhcpd_addoption(option);
+}
+#endif
+
+/****************************************************************************
+ * Name: dhcpd_soclet
+ ****************************************************************************/
+
+static inline int dhcpd_socket(void)
+{
+       int sockfd;
+       int optval;
+       int ret;
+
+       /* Create a socket to listen for requests from DHCP clients */
+
+       sockfd = socket(PF_INET, SOCK_DGRAM, 0);
+       if (sockfd < 0) {
+               ndbg("socket failed: %d\n", errno);
+               return ERROR;
+       }
+
+       /* Configure the socket */
+       optval = 1;
+       ret = setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (void *)&optval, sizeof(int));
+       if (ret < 0) {
+               ndbg("setsockopt SO_REUSEADDR failed: %d\n", errno);
+               close(sockfd);
+               return ERROR;
+       }
+
+       optval = 1;
+       ret = setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, (void *)&optval, sizeof(int));
+       if (ret < 0) {
+               ndbg("setsockopt SO_BROADCAST failed: %d\n", errno);
+               close(sockfd);
+               return ERROR;
+       }
+
+       return sockfd;
+
+}
+
+/****************************************************************************
+ * Name: dhcpd_openresponder
+ ****************************************************************************/
+
+static inline int dhcpd_openresponder(void)
+{
+       struct sockaddr_in addr;
+       int sockfd;
+       int ret;
+
+       nvdbg("Responder: %08lx\n", ntohl(g_state.ds_serverip));
+
+       /* Create a socket to listen for requests from DHCP clients */
+
+       sockfd = dhcpd_socket();
+       if (sockfd < 0) {
+               ndbg("socket failed: %d\n", errno);
+               return ERROR;
+       }
+
+       /* Bind the socket to a local port. */
+
+       addr.sin_family = AF_INET;
+       addr.sin_port = HTONS(DHCP_SERVER_PORT);
+       addr.sin_addr.s_addr = g_state.ds_serverip;
+
+       ret = bind(sockfd, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
+       if (ret < 0) {
+               ndbg("bind failed, port=%d addr=%08lx: %d\n", addr.sin_port, (long)addr.sin_addr.s_addr, errno);
+               close(sockfd);
+               return ERROR;
+       }
+
+       return sockfd;
+}
+
+/****************************************************************************
+ * Name: dhcpd_initpacket
+ ****************************************************************************/
+
+static void dhcpd_initpacket(uint8_t mtype)
+{
+       uint32_t nulladdr = 0;
+
+       /* Set up the generic parts of the DHCP server message */
+
+       memset(&g_state.ds_outpacket, 0, sizeof(struct dhcpmsg_s));
+
+       g_state.ds_outpacket.op = DHCP_REPLY;
+       g_state.ds_outpacket.htype = g_state.ds_inpacket.htype;
+       g_state.ds_outpacket.hlen = g_state.ds_inpacket.hlen;
+
+       memcpy(&g_state.ds_outpacket.xid, &g_state.ds_inpacket.xid, 4);
+       memcpy(g_state.ds_outpacket.chaddr, g_state.ds_inpacket.chaddr, 16);
+
+       if (memcmp(g_state.ds_outpacket.giaddr, &nulladdr, 4) != 0) {
+               g_state.ds_outpacket.flags = g_state.ds_inpacket.flags;
+       } else {
+               g_state.ds_outpacket.flags = 0;
+       }
+       memset(g_state.ds_outpacket.giaddr, 0, 4);
+
+       /* Add the generic options */
+
+       memcpy(g_state.ds_outpacket.options, g_magiccookie, 4);
+       g_state.ds_optend = &g_state.ds_outpacket.options[4];
+       *g_state.ds_optend = DHCP_OPTION_END;
+       dhcpd_addoption8(DHCP_OPTION_MSG_TYPE, mtype);
+       dhcpd_addoption32(DHCP_OPTION_SERVER_ID, g_state.ds_serverip);
+}
+
+/****************************************************************************
+ * Name: dhcpd_sendpacket
+ ****************************************************************************/
+
+static int dhcpd_sendpacket(int bbroadcast)
+{
+       struct sockaddr_in addr;
+       in_addr_t ipaddr;
+       int sockfd;
+       int len;
+       int ret = ERROR;
+
+#ifdef CONFIG_NETUTILS_DHCPD_IGNOREBROADCAST
+       /* This is a hack.  I've had problems with Windows machines responding
+        * to unicast.  I think this is associated with a Windows registry key in
+        * HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters:
+        * The IgnoreBroadcastFlag value controls this behavior:  A value of 1 will
+        * cause the server to ignore the client broadcast flag and always respond
+        * with multicast; the value 0 to allows clients to request unicast.
+        */
+
+       ipaddr = INADDR_BROADCAST;
+#else
+       /* Determine which address to respond to (or if we need to broadcast the response)
+        *
+        * (1) If he caller know that it needs to multicast the response, it will set bbroadcast.
+        * (2) Otherwise, if the client already has and address (ciaddr), then use that for uni-cast
+        * (3) Broadcast if the client says it can't handle uni-cast (BOOTP_BROADCAST set)
+        * (4) Otherwise, the client claims it can handle the uni-casst response and we
+        *     will uni-cast to the offered address (yiaddr).
+        *
+        * NOTE: We really should also check the giaddr field.  If no zero, the server should
+        * send any return messages to the 'DHCP server' port on the BOOTP relay agent whose
+        * address appears in 'giaddr'.
+        */
+
+       if (bbroadcast) {
+               ipaddr = INADDR_BROADCAST;
+       } else if (memcmp(g_state.ds_outpacket.ciaddr, g_anyipaddr, 4) != 0) {
+               dhcpd_arpupdate((uint16_t *)g_state.ds_outpacket.ciaddr, g_state.ds_outpacket.chaddr);
+               memcpy(&ipaddr, g_state.ds_outpacket.ciaddr, 4);
+       } else if (g_state.ds_outpacket.flags & HTONS(BOOTP_BROADCAST)) {
+               ipaddr = INADDR_BROADCAST;
+       } else {
+               dhcpd_arpupdate((uint16_t *)g_state.ds_outpacket.yiaddr, g_state.ds_outpacket.chaddr);
+               memcpy(&ipaddr, g_state.ds_outpacket.yiaddr, 4);
+       }
+#endif
+
+       /* Create a socket to respond with a packet to the client.  We
+        * cannot re-use the listener socket because it is not bound correctly
+        */
+
+       sockfd = dhcpd_openresponder();
+       if (sockfd >= 0) {
+               /* Then send the reponse to the DHCP client port at that address */
+
+               memset(&addr, 0, sizeof(struct sockaddr_in));
+               addr.sin_family = AF_INET;
+               addr.sin_port = HTONS(DHCP_CLIENT_PORT);
+               addr.sin_addr.s_addr = ipaddr;
+
+               /* Send the minimum sized packet that includes the END option */
+
+               len = (g_state.ds_optend - (uint8_t *)&g_state.ds_outpacket) + 1;
+               nvdbg("sendto %08lx:%04x len=%d\n", (long)ntohl(addr.sin_addr.s_addr), ntohs(addr.sin_port), len);
+               ret = sendto(sockfd, &g_state.ds_outpacket, len, 0, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
+               close(sockfd);
+       } else {
+               ndbg("create socket failed : %d\n", sockfd);
+       }
+
+       return ret;
+}
+
+/****************************************************************************
+ * Name: dhcpd_send_offerpacket
+ ****************************************************************************/
+
+static int dhcpd_send_offerpacket(void)
+{
+       struct sockaddr_in addr;
+       in_addr_t ipaddr;
+       int sockfd;
+       int len;
+       int ret = ERROR;
+
+       memcpy(&ipaddr, g_state.ds_outpacket.yiaddr, 4);
+
+#if HAVE_NETMASK
+       /* A dhcp offer message should be sent as broadcast message
+        *  Some platform might discard 255.255.255.255 broadcast message, so replace it to subnet broadcast message
+        */
+       ipaddr |= (~htonl(CONFIG_NETUTILS_DHCPD_NETMASK));
+#else
+       ipaddr = htonl(IPADDR_BROADCAST);
+#endif
+
+       sockfd = dhcpd_openresponder();
+       if (sockfd >= 0) {
+               /* Then send the reponse to the DHCP client port at that address */
+
+               memset(&addr, 0, sizeof(struct sockaddr_in));
+               addr.sin_family = AF_INET;
+               addr.sin_port = HTONS(DHCP_CLIENT_PORT);
+               addr.sin_addr.s_addr = ipaddr;
+
+               /* Send the minimum sized packet that includes the END option */
+
+               len = (g_state.ds_optend - (uint8_t *)&g_state.ds_outpacket) + 1;
+               nvdbg("dhcp offer sendto %08lx:%04x len=%d\n", (long)ntohl(addr.sin_addr.s_addr), ntohs(addr.sin_port), len);
+               ret = sendto(sockfd, &g_state.ds_outpacket, len, 0, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
+               close(sockfd);
+       } else {
+               ndbg("create socket failed : %d\n", sockfd);
+       }
+
+       return ret;
+}
+
+
+/****************************************************************************
+ * Name: dhcpd_sendoffer
+ ****************************************************************************/
+
+static inline int dhcpd_sendoffer(in_addr_t ipaddr, uint32_t leasetime)
+{
+       in_addr_t netaddr;
+#if HAVE_DNSIP
+       uint32_t dnsaddr;
+       dnsaddr = htonl(CONFIG_NETUTILS_DHCPD_DNSIP);
+#endif
+       /* IP address is in host order */
+
+       nvdbg("Sending offer: %08lx\n", (long)ipaddr);
+
+       /* Initialize the outgoing packet */
+
+       dhcpd_initpacket(DHCPOFFER);
+
+       /* Add the address offered to the client (converting to network order) */
+
+       netaddr = htonl(ipaddr);
+       memcpy(g_state.ds_outpacket.yiaddr, &netaddr, 4);
+
+       /* Add the leasetime to the response options */
+
+       dhcpd_addoption32(DHCP_OPTION_LEASE_TIME, htonl(leasetime));
+#if HAVE_NETMASK
+       dhcpd_addoption32(DHCP_OPTION_SUBNET_MASK, htonl(CONFIG_NETUTILS_DHCPD_NETMASK));
+#endif
+#if HAVE_ROUTERIP
+       dhcpd_addoption32(DHCP_OPTION_ROUTER, htonl(CONFIG_NETUTILS_DHCPD_ROUTERIP));
+#endif
+#if HAVE_DNSIP
+       dhcp_addoption32p(DHCP_OPTION_DNS_SERVER, (FAR uint8_t *)&dnsaddr);
+#endif
+
+       /* Send the offer response */
+       return dhcpd_send_offerpacket();
+}
+
+/****************************************************************************
+ * Name: dhcpd_sendnak
+ ****************************************************************************/
+
+static int dhcpd_sendnak(void)
+{
+       /* Initialize and send the NAK response */
+
+       dhcpd_initpacket(DHCPNAK);
+       memcpy(g_state.ds_outpacket.ciaddr, g_state.ds_inpacket.ciaddr, 4);
+       return dhcpd_sendpacket(true);
+}
+
+/****************************************************************************
+ * Name: dhcpd_sendack
+ ****************************************************************************/
+
+int dhcpd_sendack(in_addr_t ipaddr)
+{
+       uint32_t leasetime = CONFIG_NETUTILS_DHCPD_LEASETIME;
+       in_addr_t netaddr;
+#if HAVE_DNSIP
+       uint32_t dnsaddr;
+       dnsaddr = htonl(CONFIG_NETUTILS_DHCPD_DNSIP);
+#endif
+
+       /* Initialize the ACK response */
+
+       dhcpd_initpacket(DHCPACK);
+       memcpy(g_state.ds_outpacket.ciaddr, g_state.ds_inpacket.ciaddr, 4);
+
+       /* Add the IP address assigned to the client */
+
+       netaddr = htonl(ipaddr);
+       memcpy(g_state.ds_outpacket.yiaddr, &netaddr, 4);
+
+       /* Did the client request a specific lease time? */
+
+       (void)dhcpd_verifyreqleasetime(&leasetime);
+
+       /* Add the lease time to the response */
+
+       dhcpd_addoption32(DHCP_OPTION_LEASE_TIME, htonl(leasetime));
+#if HAVE_NETMASK
+       dhcpd_addoption32(DHCP_OPTION_SUBNET_MASK, htonl(CONFIG_NETUTILS_DHCPD_NETMASK));
+#endif
+#if HAVE_ROUTERIP
+       dhcpd_addoption32(DHCP_OPTION_ROUTER, htonl(CONFIG_NETUTILS_DHCPD_ROUTERIP));
+#endif
+#if HAVE_DNSIP
+       dhcp_addoption32p(DHCP_OPTION_DNS_SERVER, (FAR uint8_t *)&dnsaddr);
+#endif
+
+       if (dhcpd_sendpacket(true) < 0) {
+               return ERROR;
+       }
+
+       dhcpd_setlease(g_state.ds_inpacket.chaddr, ipaddr, leasetime);
+       return OK;
+}
+
+/****************************************************************************
+ * Name: dhcpd_discover
+ ****************************************************************************/
+
+static inline int dhcpd_discover(void)
+{
+       struct lease_s *lease;
+       in_addr_t ipaddr;
+       uint32_t leasetime = CONFIG_NETUTILS_DHCPD_LEASETIME;
+
+       /* Check if the client is aleady in the lease table */
+
+       lease = dhcpd_findbymac(g_state.ds_inpacket.chaddr);
+       if (lease) {
+               /* Yes... get the remaining time on the lease */
+
+#ifdef HAVE_LEASE_TIME
+               if (!dhcpd_leaseexpired(lease)) {
+                       leasetime = lease->expiry - dhcpd_time();
+                       if (leasetime < CONFIG_NETUTILS_DHCPD_MINLEASETIME) {
+                               leasetime = CONFIG_NETUTILS_DHCPD_MINLEASETIME;
+                       }
+               }
+#endif
+               /* Get the IP address associated with the lease (host order) */
+
+               ipaddr = dhcp_leaseipaddr(lease);
+               ndbg("Already have lease for IP %08lx\n", (long)ipaddr);
+       }
+
+       /* Check if the client has requested a specific IP address */
+
+       else if (dhcpd_verifyreqip()) {
+               /* Use the requested IP address (host order) */
+
+               ipaddr = g_state.ds_optreqip;
+
+               ndbg("User requested IP %08lx\n", (long)ipaddr);
+       } else {
+               /* No... allocate a new IP address (host order) */
+
+               ipaddr = dhcpd_allocipaddr();
+               ndbg("Allocated IP %08lx\n", (long)ipaddr);
+       }
+
+       /* Did we get any IP address? */
+
+       if (!ipaddr) {
+               /* Nope... return failure */
+
+               ndbg("Failed to get IP address\n");
+               return ERROR;
+       }
+
+       /* Reserve the leased IP for a shorter time for the offer */
+
+       if (!dhcpd_setlease(g_state.ds_inpacket.chaddr, ipaddr, CONFIG_NETUTILS_DHCPD_OFFERTIME)) {
+               ndbg("Failed to set lease\n");
+               return ERROR;
+       }
+
+       /* Check if the client has requested a specific lease time */
+
+       (void)dhcpd_verifyreqleasetime(&leasetime);
+
+       /* Send the offer response */
+
+       return dhcpd_sendoffer(ipaddr, leasetime);
+}
+
+/****************************************************************************
+ * Name: dhcpd_request
+ ****************************************************************************/
+
+static inline int dhcpd_request(void)
+{
+       struct lease_s *lease;
+       in_addr_t ipaddr = 0;
+       uint8_t response = 0;
+
+       /* Check if this client already holds a lease.  This can happen when the client (1)
+        * the IP is reserved for the client from a previous offer, or (2) the client is
+        * re-initializing or rebooting while the lease is still valid.
+        */
+
+       lease = dhcpd_findbymac(g_state.ds_inpacket.chaddr);
+       if (lease) {
+               /* Yes.. the client already holds a lease.  Verify that the request is consistent
+                * with the existing lease (host order).
+                */
+
+               ipaddr = dhcp_leaseipaddr(lease);
+               ndbg("Lease ipaddr: %08x Server IP: %08x Requested IP: %08x\n", ipaddr, g_state.ds_optserverip, g_state.ds_optreqip);
+
+               if (g_state.ds_optserverip) {
+                       /* ACK if the serverip is correct and the requested IP address is the one
+                        * already offered to the client.
+                        */
+
+                       if (g_state.ds_optserverip == ntohl(g_state.ds_serverip) && (g_state.ds_optreqip != 0 || g_state.ds_optreqip == ipaddr)) {
+                               response = DHCPACK;
+                       } else {
+                               response = DHCPNAK;
+                       }
+               }
+
+               /* We have the lease and no server IP was requested. Was a specific IP address
+                * requested? (host order)
+                */
+
+               else if (g_state.ds_optreqip) {
+                       /* Yes..ACK if the requested IP address is the one already leased.
+                        * Both addresses are in host order.
+                        */
+
+                       if (ipaddr == g_state.ds_optreqip) {
+                               response = DHCPACK;
+                       } else {
+                               response = DHCPNAK;
+                       }
+               }
+
+               /* The client has specified neither a server IP nor requested IP address */
+
+               else {
+                       /* ACK if the IP used by the client is the one already assigned to it.
+                        * NOTE ipaddr is in host order; ciaddr is network order!
+                        */
+
+                       uint32_t tmp = htonl(ipaddr);
+                       if (memcmp(&tmp, g_state.ds_inpacket.ciaddr, 4) == 0) {
+                               response = DHCPACK;
+                       } else {
+                               response = DHCPNAK;
+                       }
+               }
+       }
+
+       /* The client does not hold a lease (referenced by its MAC address) and is
+        * requesting a specific IP address that was, apparently, never offered to
+        * to the client.  Perform some sanity checks before sending the NAK.
+        */
+
+       else if (g_state.ds_optreqip && !g_state.ds_optserverip) {
+               ndbg("Server IP: %08x Requested IP: %08x\n", g_state.ds_optserverip, g_state.ds_optreqip);
+
+               /* Is this IP address already assigned? */
+
+               lease = dhcpd_findbyipaddr(g_state.ds_optreqip);
+               if (lease) {
+                       /* Yes.. Send NAK unless the lease has expired */
+
+                       if (!dhcpd_leaseexpired(lease)) {
+                               response = DHCPNAK;
+                       }
+               }
+
+               /* No.. is the requested IP address in range? NAK if not */
+
+               else if (g_state.ds_optreqip < CONFIG_NETUTILS_DHCPD_STARTIP || g_state.ds_optreqip > CONFIG_NETUTILS_DHCP_OPTION_ENDIP) {
+                       response = DHCPNAK;
+               }
+       }
+
+       /* Otherwise, the client does not hold a lease and is not requesting any
+        * specific IP address.
+        */
+
+       /* Finally, either (1) send the ACK, (2) send a NAK, or (3) remain silent
+        * based on the checks above.
+        */
+
+       if (response == DHCPACK) {
+               ndbg("ACK IP %08lx\n", (long)ipaddr);
+
+               memset(g_state.ds_leases[ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP].mac, 0, DHCP_HLEN_ETHERNET);
+               g_state.ds_leases[ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP].allocated = true;
+#ifdef HAVE_LEASE_TIME
+               g_state.ds_leases[ipaddr - CONFIG_NETUTILS_DHCPD_STARTIP].expiry = dhcpd_time() + CONFIG_NETUTILS_DHCPD_OFFERTIME;
+#endif
+               if (dhcpd_sendack(ipaddr) == ERROR) {
+                       ndbg("Failed to send ACK\n");
+                       return ERROR;
+               }
+       } else if (response == DHCPNAK) {
+               ndbg("NAK IP %08lx\n", (long)ipaddr);
+               if (dhcpd_sendnak() == ERROR) {
+                       ndbg("Failed to send NAK\n");
+                       return ERROR;
+               }
+       } else {
+               ndbg("Remaining silent IP %08lx\n", (long)ipaddr);
+       }
+
+       return OK;
+}
+
+/****************************************************************************
+ * Name: dhcpd_decline
+ ****************************************************************************/
+
+static inline int dhcpd_decline(void)
+{
+       struct lease_s *lease;
+
+       /* Find the lease associated with this hardware address */
+
+       lease = dhcpd_findbymac(g_state.ds_inpacket.chaddr);
+       if (lease) {
+               /* Disassociate the IP from the MAC, but prevent re-used of this
+                * address for a period of time.
+                */
+
+               memset(lease->mac, 0, DHCP_HLEN_ETHERNET);
+#ifdef HAVE_LEASE_TIME
+               lease->expiry = dhcpd_time() + CONFIG_NETUTILS_DHCPD_DECLINETIME;
+#endif
+       }
+
+       return OK;
+}
+
+static inline int dhcpd_release(void)
+{
+       struct lease_s *lease;
+
+       /* Find the lease associated with this hardware address */
+
+       lease = dhcpd_findbymac(g_state.ds_inpacket.chaddr);
+       if (lease) {
+               /* Release the IP address now */
+
+               memset(lease, 0, sizeof(struct lease_s));
+       }
+
+       return OK;
+}
+
+/****************************************************************************
+ * Name: dhcpd_openlistener
+ ****************************************************************************/
+
+static inline int dhcpd_openlistener(void)
+{
+       struct sockaddr_in addr;
+       struct ifreq req;
+       int sockfd;
+       int ret;
+
+       /* Create a socket to listen for requests from DHCP clients */
+
+       sockfd = dhcpd_socket();
+       if (sockfd < 0) {
+               ndbg("socket failed: %d\n", errno);
+               return ERROR;
+       }
+
+       /* Get the IP address of the selected device */
+
+       strncpy(req.ifr_name, DHCPD_IFNAME, IFNAMSIZ);
+       ret = ioctl(sockfd, SIOCGIFADDR, (unsigned long)&req);
+       if (ret < 0) {
+               ndbg("setsockopt SIOCGIFADDR failed: %d\n", errno);
+               close(sockfd);
+               return ERROR;
+       }
+
+       g_state.ds_serverip = ((struct sockaddr_in *)&req.ifr_addr)->sin_addr.s_addr;
+       nvdbg("serverip: %08lx\n", ntohl(g_state.ds_serverip));
+
+       /* Bind the socket to a local port. We have to bind to INADDRY_ANY to
+        * receive broadcast messages.
+        */
+
+       addr.sin_family = AF_INET;
+       addr.sin_port = htons(DHCP_SERVER_PORT);
+       addr.sin_addr.s_addr = INADDR_ANY;
+
+       ret = bind(sockfd, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
+       if (ret < 0) {
+               ndbg("bind failed, port=%d addr=%08lx: %d\n", addr.sin_port, (long)addr.sin_addr.s_addr, errno);
+               close(sockfd);
+               return ERROR;
+       }
+
+       return sockfd;
+}
+
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+/****************************************************************************
+ * Name: dhcpd_netif_init
+ ****************************************************************************/
+static int dhcpd_netif_init(char *intf)
+{
+       struct in_addr server_ipaddr;
+       struct in_addr netmask_ipaddr;
+
+       server_ipaddr.s_addr = htonl(CONFIG_NETUTILS_DHCPD_ROUTERIP);
+       netmask_ipaddr.s_addr = htonl(CONFIG_NETUTILS_DHCPD_NETMASK);
+
+       if (netlib_set_ipv4addr(intf, &server_ipaddr) == ERROR) {
+               ndbg("failed to set server IP address\n");
+               return -1;
+       }
+
+       if (netlib_set_ipv4netmask(intf, &netmask_ipaddr.s_addr) == ERROR) {
+               ndbg("failed to set netmask\n");
+               return -1;
+       }
+
+       if (netlib_set_dripv4addr(intf, &server_ipaddr) == ERROR) {
+               ndbg("failed to set default gateway\n");
+               return -1;
+       }
+
+       ndbg("\n");
+
+       ndbg("Server IP address set : %u.%u.%u.%u\n",
+               (unsigned char)((htonl(server_ipaddr.s_addr) >> 24) & 0xff),
+               (unsigned char)((htonl(server_ipaddr.s_addr) >> 16) & 0xff),
+               (unsigned char)((htonl(server_ipaddr.s_addr) >> 8) & 0xff),
+               (unsigned char)((htonl(server_ipaddr.s_addr) >> 0) & 0xff));
+
+       ndbg("Server netmask address set : %u.%u.%u.%u\n",
+               (unsigned char)((htonl(netmask_ipaddr.s_addr) >> 24) & 0xff),
+               (unsigned char)((htonl(netmask_ipaddr.s_addr) >> 16) & 0xff),
+               (unsigned char)((htonl(netmask_ipaddr.s_addr) >> 8) & 0xff),
+               (unsigned char)((htonl(netmask_ipaddr.s_addr) >> 0) & 0xff));
+
+       ndbg("Server default gateway address set : %u.%u.%u.%u\n",
+               (unsigned char)((htonl(server_ipaddr.s_addr) >> 24) & 0xff),
+               (unsigned char)((htonl(server_ipaddr.s_addr) >> 16) & 0xff),
+               (unsigned char)((htonl(server_ipaddr.s_addr) >> 8) & 0xff),
+               (unsigned char)((htonl(server_ipaddr.s_addr) >> 0) & 0xff));
+
+       ndbg("\n");
+       return 0;
+}
+
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+/****************************************************************************
+ * Name: dhcpd_netif_deinit
+ ****************************************************************************/
+static int dhcpd_netif_deinit(char *intf)
+{
+       struct in_addr server_ipaddr;
+       struct in_addr netmask_ipaddr;
+
+       server_ipaddr.s_addr = IPADDR_ANY;
+       netmask_ipaddr.s_addr = IPADDR_NONE;
+
+       if (netlib_set_ipv4addr(intf, &server_ipaddr) == ERROR) {
+               ndbg("failed to set server IP address\n");
+               return -1;
+       }
+
+       if (netlib_set_ipv4netmask(intf, &netmask_ipaddr.s_addr) == ERROR) {
+               ndbg("failed to set netmask\n");
+               return -1;
+       }
+
+       if (netlib_set_dripv4addr(intf, &server_ipaddr) == ERROR) {
+               ndbg("failed to set default gateway\n");
+               return -1;
+       }
+
+       return 0;
+}
+
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+/****************************************************************************
+ * Name: dhcpd_status
+ ****************************************************************************/
+int dhcpd_status(void)
+{
+       return g_dhcpd_running;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+/****************************************************************************
+ * Name: dhcpd_stop
+ ****************************************************************************/
+void dhcpd_stop(void)
+{
+       g_dhcpd_quit = 1;
+#if DHCPD_SELECT
+       ndbg("WARN : dhcpd will be stopped after %d seconds\n", g_select_timeout.tv_sec);
+#endif
+}
+
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+/****************************************************************************
+ * Name: dhcpd_run
+ ****************************************************************************/
+
+int dhcpd_run(void *arg)
+{
+       int sockfd;
+       int nbytes;
+#if DHCPD_SELECT
+       int ret = OK;
+       fd_set sockfd_set;
+#endif
+       ndbg("Started on %s\n", DHCPD_IFNAME);
+
+       /* Initialize everything to zero */
+
+       memset(&g_state, 0, sizeof(struct dhcpd_state_s));
+
+       /* Initialize netif address (ip address, netmask, default gateway) */
+
+       if (dhcpd_netif_init(DHCPD_IFNAME) < 0) {
+               ndbg("Failed to initialize network interface %s\n", DHCPD_IFNAME);
+               ret = ERROR;
+               return ret;
+       }
+
+       /* Now loop indefinitely, reading packets from the DHCP server socket */
+
+       sockfd = -1;
+
+       g_dhcpd_quit = 0;
+       g_dhcpd_running = 1;
+
+       while (!g_dhcpd_quit) {
+               /* Create a socket to listen for requests from DHCP clients */
+
+               /* TODO : Need to add cancellation point */
+
+               if (sockfd < 0) {
+                       sockfd = dhcpd_openlistener();
+                       if (sockfd < 0) {
+                               ndbg("Failed to create socket\n");
+                               ret = ERROR;
+                               break;
+                       }
+               }
+#if DHCPD_SELECT
+               nbytes = -1;
+               FD_ZERO(&sockfd_set);
+               FD_SET(sockfd, &sockfd_set);
+
+               ret = select(sockfd+1, &sockfd_set, NULL, NULL, &g_select_timeout);
+               if ((ret > 0) && FD_ISSET(sockfd, &sockfd_set)) {
+                       /* Read the next g_state.ds_outpacket */
+                       nbytes = recv(sockfd, &g_state.ds_inpacket, sizeof(struct dhcpmsg_s), 0);
+               } else if (ret == 0) {
+                       if (!g_dhcpd_quit)
+                               continue;
+                       else {
+                               ndbg("select timeout exit\n");
+                               break;
+                       }
+               } else {
+                       /* Debugging purpose : Error case*/
+                       ndbg("ERROR, select ret %d [errno %d]\n", ret, errno);
+                       break;
+               }
+#else
+               nbytes = recv(sockfd, &g_state.ds_inpacket, sizeof(struct dhcpmsg_s), 0);
+#endif
+               if (nbytes < 0) {
+                       /* On errors (other EINTR), close the socket and try again */
+
+                       ndbg("recv failed: %d\n", errno);
+                       if (errno != EINTR) {
+                               close(sockfd);
+                               sockfd = -1;
+                       }
+                       continue;
+               }
+
+               /* Parse the incoming message options */
+
+               if (!dhcpd_parseoptions()) {
+                       /* Failed to parse the message options */
+
+                       ndbg("No msg type\n");
+
+                       continue;
+               }
+#ifdef CONFIG_NETUTILS_DHCPD_HOST
+               /* Get the poor little uC a change to get its recvfrom in place */
+
+               usleep(500 * 1000);
+#endif
+
+               /* Now process the incoming DHCP message by its message type */
+
+               switch (g_state.ds_optmsgtype) {
+               case DHCPDISCOVER:
+                       ndbg("DHCPDISCOVER\n");
+                       if (dhcpd_discover() == ERROR) {
+                               ndbg("DHCPDISCOVER : Failed to send DHCP Discover, errno %d\n", errno);
+                       }
+                       break;
+
+               case DHCPREQUEST:
+                       ndbg("DHCPREQUEST\n");
+                       dhcpd_request();
+                       break;
+
+               case DHCPDECLINE:
+                       ndbg("DHCPDECLINE\n");
+                       dhcpd_decline();
+                       break;
+
+               case DHCPRELEASE:
+                       ndbg("DHCPRELEASE\n");
+                       dhcpd_release();
+                       break;
+
+               case DHCPINFORM:                /* Not supported */
+               default:
+                       ndbg("Unsupported message type: %d\n", g_state.ds_optmsgtype);
+                       break;
+               }
+       }
+
+       if (sockfd != -1) {
+               close(sockfd);
+       }
+       g_dhcpd_running = 0;
+
+       /* de-initialize netif address (ip address, netmask, default gateway) */
+
+       if (dhcpd_netif_deinit(DHCPD_IFNAME) < 0) {
+               ndbg("Failed to deinit netif %s\n", DHCPD_IFNAME);
+       }
+
+       return ret;
+}
+
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+/****************************************************************************
+ * Name: dhcpd_start
+ ****************************************************************************/
+
+#define DHCPD_STACK_SIZE               20480
+#define DHCPD_SCHED_PRI                        100
+#define DHCPD_SCHED_POLICY             SCHED_RR
+
+int dhcpd_start(char *intf)
+{
+       pthread_attr_t attr;
+       int status;
+       struct sched_param sparam;
+
+       /* Set network interface name for DHCPD */
+       if (intf) {
+               strncpy(DHCPD_IFNAME, intf, strlen(intf));
+       } else {
+               strncpy(DHCPD_IFNAME, CONFIG_NETUTILS_DHCPD_INTERFACE, IFNAMSIZ);
+       }
+
+       status = pthread_attr_init(&attr);
+       if (status != 0) {
+               ndbg("failed to start dhcpd\n");
+               goto err_exit;
+       }
+
+       sparam.sched_priority = DHCPD_SCHED_PRI;
+       status = pthread_attr_setschedparam(&attr, &sparam);
+       if (status != 0) {
+               ndbg("failed to pthread_attr_setschedparam, ret %d, errno %d\n",
+                                               status, errno);
+               goto err_exit;
+       }
+
+       status = pthread_attr_setschedpolicy(&attr, DHCPD_SCHED_POLICY);
+       if (status != 0) {
+               ndbg("failed to pthread_attr_setchedpolicy, ret %d, errno %d\n",
+                                               status, errno);
+               goto err_exit;
+       }
+
+       status = pthread_attr_setstacksize(&attr, DHCPD_STACK_SIZE);
+       if (status != 0) {
+               ndbg("failed to pthread_attr_setstacksize, ret %d, errno %d\n",
+                                               status, errno);
+               goto err_exit;
+       }
+
+       status = pthread_create(&g_tid, &attr, (pthread_startroutine_t)dhcpd_run, NULL);
+       if (status != 0) {
+               ndbg("failed to start dhcpd\n");
+               goto err_exit;
+       }
+
+       pthread_setname_np(g_tid, "dhcpd");
+       pthread_detach(g_tid);
+
+       return 0;
+err_exit:
+       return -1;
+}
diff --git a/external/ftpc/Make.defs b/external/ftpc/Make.defs
new file mode 100644 (file)
index 0000000..4832ea5
--- /dev/null
@@ -0,0 +1,95 @@
+###########################################################################
+#
+# Copyright 2017 Samsung Electronics All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+# either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+#
+###########################################################################
+# apps/netutils/ftpc/Make.defs
+# Adds selected applications to apps/ build
+#
+#   Copyright (C) 2016 Gregory Nutt. All rights reserved.
+#   Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+#    used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+ifeq ($(CONFIG_NETUTILS_FTPC),y)
+
+# FTP connection management
+CSRCS += ftpc/ftpc_connect.c \
+         ftpc/ftpc_disconnect.c
+
+# FTP commands
+CSRCS += ftpc/ftpc_cdup.c \
+         ftpc/ftpc_chdir.c \
+         ftpc/ftpc_chmod.c \
+         ftpc/ftpc_filesize.c \
+         ftpc/ftpc_filetime.c
+CSRCS += ftpc/ftpc_help.c \
+         ftpc/ftpc_idle.c \
+         ftpc/ftpc_listdir.c \
+         ftpc/ftpc_login.c \
+         ftpc/ftpc_mkdir.c
+CSRCS += ftpc/ftpc_noop.c \
+         ftpc/ftpc_rpwd.c \
+         ftpc/ftpc_quit.c \
+         ftpc/ftpc_rename.c \
+         ftpc/ftpc_rmdir.c \
+         ftpc/ftpc_unlink.c
+CSRCS += ftpc/ftpc_cmd.c
+
+# FTP transfers
+CSRCS += ftpc/ftpc_getfile.c \
+         ftpc/ftpc_putfile.c \
+         ftpc/ftpc_transfer.c
+
+# FTP responses
+CSRCS += ftpc/ftpc_response.c \
+         ftpc/ftpc_getreply.c
+
+# FTP helpers
+CSRCS += ftpc/ftpc_utils.c \
+         ftpc/ftpc_socket.c
+
+DEPPATH += --dep-path ftpc
+VPATH += :ftpc
+
+endif
+
similarity index 96%
rename from apps/netutils/ftpd/Make.defs
rename to external/ftpd/Make.defs
index 268548b..bf5fe8d 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_FTPD),y)
-CONFIGURED_APPS += netutils/ftpd
+
+ifeq ($(CONFIG_NET_LWIP),y)
+CSRCS          += ftpd/ftpd.c
+endif
+
+DEPPATH += --dep-path ftpd
+VPATH += :ftpd
+
 endif
 
similarity index 99%
rename from apps/netutils/ftpd/ftpd.c
rename to external/ftpd/ftpd.c
index cd785d8..9935c8b 100644 (file)
@@ -79,7 +79,7 @@
 
 #include <arpa/inet.h>
 
-#include <apps/netutils/ftpd.h>
+#include <protocols/ftpd.h>
 
 #include "ftpd.h"
 
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/cJSON.h
rename to external/include/json/cJSON.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/base64.h
rename to external/include/protocols/base64.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/dhcpc.h
rename to external/include/protocols/dhcpc.h
diff --git a/external/include/protocols/dhcpd.h b/external/include/protocols/dhcpd.h
new file mode 100755 (executable)
index 0000000..fb2531f
--- /dev/null
@@ -0,0 +1,113 @@
+/****************************************************************************
+ *
+ * Copyright 2016 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ ****************************************************************************/
+/****************************************************************************
+ * apps/include/netutils/dhcpd.h
+ *
+ *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * This logic was leveraged from uIP which also has a BSD-style license:
+ *
+ *   Copyright (c) 2005, Swedish Institute of Computer Science
+ *   All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Institute nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+ /**
+  * @addtogroup DHCP
+  * @ingroup NETWORK
+  * @{
+  */
+
+/**
+ * @file netif.h
+ * @brief netif API (to be used from lwIP TCPIP thread)
+ */
+
+#ifndef __APPS_INCLUDE_NETUTILS_DHCPD_H
+#define __APPS_INCLUDE_NETUTILS_DHCPD_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
+/**
+ * @brief Starts DHCP server which is attached given network interface.
+ *
+ * @param[in] intf the name of network interface to run DHCP server
+ * @return On success, 0. On failure, returns error
+*/
+int dhcpd_run(void *arg);
+
+/**
+ * @brief Starts DHCP server as daemon which is attached given network interface.
+ *
+ * @param[in] intf the name of network interface to run DHCP server
+ * @return On success, 0. On failure, returns -1
+*/
+int dhcpd_start(char *intf);
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
+#endif                                                 /* __APPS_INCLUDE_NETUTILS_DHCPD_H */
+/** @} */
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/discover.h
rename to external/include/protocols/discover.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/ftpd.h
rename to external/include/protocols/ftpd.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/ipmsfilter.h
rename to external/include/protocols/ipmsfilter.h
similarity index 99%
rename from apps/include/netutils/libcoap/address.h
rename to external/include/protocols/libcoap/address.h
index 1e2bfc3..2326402 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef _COAP_ADDRESS_H_
 #define _COAP_ADDRESS_H_
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #ifdef HAVE_ASSERT_H
 #include <assert.h>
similarity index 98%
rename from apps/include/netutils/libcoap/async.h
rename to external/include/protocols/libcoap/async.h
index 8b4e4be..1885228 100644 (file)
@@ -31,8 +31,8 @@
 #ifndef _COAP_ASYNC_H_
 #define _COAP_ASYNC_H_
 
-#include <apps/netutils/libcoap/config.h>
-#include <apps/netutils/libcoap/net.h>
+#include <protocols/libcoap/config.h>
+#include <protocols/libcoap/net.h>
 
 #ifndef WITHOUT_ASYNC
 
similarity index 98%
rename from apps/include/netutils/libcoap/block.h
rename to external/include/protocols/libcoap/block.h
index 9d8d31f..d450b18 100644 (file)
@@ -26,9 +26,9 @@
 #ifndef _COAP_BLOCK_H_
 #define _COAP_BLOCK_H_
 
-#include <apps/netutils/libcoap/option.h>
-#include <apps/netutils/libcoap/encode.h>
-#include <apps/netutils/libcoap/pdu.h>
+#include <protocols/libcoap/option.h>
+#include <protocols/libcoap/encode.h>
+#include <protocols/libcoap/pdu.h>
 
 /**
  * @defgroup block Block Transfer
similarity index 65%
rename from apps/include/netutils/libcoap/coap.h
rename to external/include/protocols/libcoap/coap.h
index 13dc8d1..bcce1b1 100644 (file)
 extern "C" {
 #endif
 
-#include <apps/netutils/libcoap/config.h>
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/mem.h>
-#include <apps/netutils/libcoap/coap_list.h>
-#include <apps/netutils/libcoap/pdu.h>
-#include <apps/netutils/libcoap/option.h>
-#include <apps/netutils/libcoap/net.h>
-#include <apps/netutils/libcoap/encode.h>
-#include <apps/netutils/libcoap/str.h>
-#include <apps/netutils/libcoap/uri.h>
-#include <apps/netutils/libcoap/async.h>
-#include <apps/netutils/libcoap/resource.h>
-#include <apps/netutils/libcoap/subscribe.h>
-#include <apps/netutils/libcoap/block.h>
+#include <protocols/libcoap/config.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/mem.h>
+#include <protocols/libcoap/coap_list.h>
+#include <protocols/libcoap/pdu.h>
+#include <protocols/libcoap/option.h>
+#include <protocols/libcoap/net.h>
+#include <protocols/libcoap/encode.h>
+#include <protocols/libcoap/str.h>
+#include <protocols/libcoap/uri.h>
+#include <protocols/libcoap/async.h>
+#include <protocols/libcoap/resource.h>
+#include <protocols/libcoap/subscribe.h>
+#include <protocols/libcoap/block.h>
 
 #ifdef __cplusplus
 }
similarity index 98%
rename from apps/include/netutils/libcoap/coap_time.h
rename to external/include/protocols/libcoap/coap_time.h
index 891448e..e33777f 100644 (file)
@@ -38,7 +38,7 @@
 extern "C" {
 #endif
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 /**
  * @defgroup clock Clock Handling
similarity index 96%
rename from apps/include/netutils/libcoap/debug.h
rename to external/include/protocols/libcoap/debug.h
index 85c2e28..dc445a2 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef _COAP_DEBUG_H_
 #define _COAP_DEBUG_H_
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #ifndef COAP_DEBUG_FD
 #define COAP_DEBUG_FD stdout
@@ -71,7 +71,7 @@ void coap_log_impl(coap_log_t level, const char *format, ...);
 #define warn(...) coap_log(LOG_WARNING, __VA_ARGS__)
 #define debug(...) coap_log(LOG_DEBUG, __VA_ARGS__)
 
-#include <apps/netutils/libcoap/pdu.h>
+#include <protocols/libcoap/pdu.h>
 
 void coap_show_pdu2(const coap_pdu_t *, coap_protocol_t protocol);
 void coap_show_pdu(const coap_pdu_t *);
similarity index 98%
rename from apps/include/netutils/libcoap/encode.h
rename to external/include/protocols/libcoap/encode.h
index bc6eda3..b6e954a 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef _COAP_ENCODE_H_
 #define _COAP_ENCODE_H_
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #if defined (__TINYARA__)
 #include <string.h>
similarity index 98%
rename from apps/include/netutils/libcoap/hashkey.h
rename to external/include/protocols/libcoap/hashkey.h
index 367bab8..2f6f14b 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef _COAP_HASHKEY_H_
 #define _COAP_HASHKEY_H_
 
-#include <apps/netutils/libcoap/str.h>
+#include <protocols/libcoap/str.h>
 
 typedef unsigned char coap_key_t[4];
 
similarity index 98%
rename from apps/include/netutils/libcoap/net.h
rename to external/include/protocols/libcoap/net.h
index 485698a..2f7f38a 100644 (file)
@@ -30,7 +30,7 @@
 extern "C" {
 #endif
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #ifdef HAVE_ASSERT_H
 #include <assert.h>
@@ -57,11 +57,11 @@ extern "C" {
 #include <net/lwip/ipv4/ip_addr.h>
 #endif
 
-#include <apps/netutils/libcoap/option.h>
-#include <apps/netutils/libcoap/address.h>
-#include <apps/netutils/libcoap/prng.h>
-#include <apps/netutils/libcoap/pdu.h>
-#include <apps/netutils/libcoap/coap_time.h>
+#include <protocols/libcoap/option.h>
+#include <protocols/libcoap/address.h>
+#include <protocols/libcoap/prng.h>
+#include <protocols/libcoap/pdu.h>
+#include <protocols/libcoap/coap_time.h>
 
 #ifdef WITH_MBEDTLS
 #include "tls/certs.h"
similarity index 99%
rename from apps/include/netutils/libcoap/option.h
rename to external/include/protocols/libcoap/option.h
index 4abe1b2..007f98d 100644 (file)
@@ -32,8 +32,8 @@
 #ifndef _OPTION_H_
 #define _OPTION_H_
 
-#include <apps/netutils/libcoap/bits.h>
-#include <apps/netutils/libcoap/pdu.h>
+#include <protocols/libcoap/bits.h>
+#include <protocols/libcoap/pdu.h>
 
 /**
  * Use byte-oriented access methods here because sliding a complex
similarity index 99%
rename from apps/include/netutils/libcoap/pdu.h
rename to external/include/protocols/libcoap/pdu.h
index bd6a269..b54eb6c 100644 (file)
@@ -26,9 +26,9 @@
 #ifndef _PDU_H_
 #define _PDU_H_
 
-#include <apps/netutils/libcoap/config.h>
-#include <apps/netutils/libcoap/coap_list.h>
-#include <apps/netutils/libcoap/uri.h>
+#include <protocols/libcoap/config.h>
+#include <protocols/libcoap/coap_list.h>
+#include <protocols/libcoap/uri.h>
 
 #ifdef WITH_LWIP
 #include <net/lwip/pbuf.h>
similarity index 98%
rename from apps/include/netutils/libcoap/prng.h
rename to external/include/protocols/libcoap/prng.h
index 9a54911..8f20dab 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef _COAP_PRNG_H_
 #define _COAP_PRNG_H_
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 /**
  * @defgroup prng Pseudo Random Numbers
similarity index 96%
rename from apps/include/netutils/libcoap/resource.h
rename to external/include/protocols/libcoap/resource.h
index 484217f..8c0bc9c 100644 (file)
@@ -31,8 +31,8 @@
 #ifndef _COAP_RESOURCE_H_
 #define _COAP_RESOURCE_H_
 
-#include <apps/netutils/libcoap/config.h>
-#include <apps/netutils/libcoap/t_list.h>
+#include <protocols/libcoap/config.h>
+#include <protocols/libcoap/t_list.h>
 
 #if defined(HAVE_ASSERT_H) && !defined(assert)
 #include <assert.h>
 
 #ifndef WITH_CONTIKI
 #ifdef COAP_RESOURCES_NOHASH
-#include <apps/netutils/libcoap/utlist.h>
+#include <protocols/libcoap/utlist.h>
 #else
-#include <apps/netutils/libcoap/uthash.h>
+#include <protocols/libcoap/uthash.h>
 #endif
 #else                                                  /* WITH_CONTIKI */
 #endif                                                 /* WITH_CONTIKI */
-#include <apps/netutils/libcoap/hashkey.h>
-#include <apps/netutils/libcoap/async.h>
-#include <apps/netutils/libcoap/str.h>
-#include <apps/netutils/libcoap/pdu.h>
-#include <apps/netutils/libcoap/net.h>
-#include <apps/netutils/libcoap/subscribe.h>
+#include <protocols/libcoap/hashkey.h>
+#include <protocols/libcoap/async.h>
+#include <protocols/libcoap/str.h>
+#include <protocols/libcoap/pdu.h>
+#include <protocols/libcoap/net.h>
+#include <protocols/libcoap/subscribe.h>
 
 /** Definition of message handler function (@sa coap_resource_t). */
 typedef void (*coap_method_handler_t)
similarity index 98%
rename from apps/include/netutils/libcoap/subscribe.h
rename to external/include/protocols/libcoap/subscribe.h
index 6e3f9e6..826ecec 100644 (file)
@@ -27,8 +27,8 @@
 #ifndef _COAP_SUBSCRIBE_H_
 #define _COAP_SUBSCRIBE_H_
 
-#include <apps/netutils/libcoap/config.h>
-#include <apps/netutils/libcoap/address.h>
+#include <protocols/libcoap/config.h>
+#include <protocols/libcoap/address.h>
 
 /**
  * @defgroup observe Resource observation
similarity index 99%
rename from apps/include/netutils/libcoap/t_list.h
rename to external/include/protocols/libcoap/t_list.h
index 8348936..288d712 100644 (file)
@@ -157,7 +157,7 @@ static inline void *list_item_next(void *item)
 }
 
 #else                                                  /* WITH_CONTIKI */
-#include <apps/netutils/libcoap/list.h>
+#include <protocols/libcoap/list.h>
 #endif                                                 /* WITH_CONTIKI */
 
 #endif                                                 /* _DTLS_LIST_H_ */
similarity index 98%
rename from apps/include/netutils/libcoap/uri.h
rename to external/include/protocols/libcoap/uri.h
index 7da6963..005bd0b 100644 (file)
@@ -26,8 +26,8 @@
 #ifndef _COAP_URI_H_
 #define _COAP_URI_H_
 
-#include <apps/netutils/libcoap/hashkey.h>
-#include <apps/netutils/libcoap/str.h>
+#include <protocols/libcoap/hashkey.h>
+#include <protocols/libcoap/str.h>
 
 /** Representation of parsed URI. Components may be filled from a
  * string with coap_split_uri() and can be used as input for
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/liblwm2m.h
rename to external/include/protocols/liblwm2m.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/md5.h
rename to external/include/protocols/md5.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/mdnsd.h
rename to external/include/protocols/mdnsd.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/netlib.h
rename to external/include/protocols/netlib.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/ntpclient.h
rename to external/include/protocols/ntpclient.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/smtp.h
rename to external/include/protocols/smtp.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/telnetd.h
rename to external/include/protocols/telnetd.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/tftp.h
rename to external/include/protocols/tftp.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/urldecode.h
rename to external/include/protocols/urldecode.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 99%
rename from apps/include/netutils/webclient.h
rename to external/include/protocols/webclient.h
index d6c417e..89b50f6
@@ -53,7 +53,7 @@
 #include "tls/ssl_cache.h"
 #endif
 
-#include <apps/netutils/webserver/http_keyvalue_list.h>
+#include <protocols/webserver/http_keyvalue_list.h>
 
 /****************************************************************************
  * Pre-processor Definitions
@@ -33,7 +33,7 @@
  ****************************************************************************/
 
 #include <stdio.h>
-#include <apps/netutils/webserver/http_server.h>
+#include <protocols/webserver/http_server.h>
 
 #ifdef __cplusplus
 #define EXTERN extern "C"
@@ -47,7 +47,7 @@
 #include <netinet/in.h>
 
 #ifdef CONFIG_NETUTILS_WEBSOCKET
-#include <apps/netutils/websocket.h>
+#include <protocols/websocket.h>
 #endif
 
 #ifdef CONFIG_NET_SECURITY_TLS
old mode 100644 (file)
new mode 100755 (executable)
similarity index 99%
rename from apps/include/netutils/websocket.h
rename to external/include/protocols/websocket.h
index f0daf52..fdd4ce7
@@ -39,7 +39,7 @@
 
 #include <stdint.h>
 #include <netinet/in.h>
-#include <apps/netutils/wslay/wslay.h>
+#include <protocols/wslay/wslay.h>
 #include <tinyara/wqueue.h>
 
 #include "tls/config.h"
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/xmlrpc.h
rename to external/include/protocols/xmlrpc.h
index 7fa8bb2..3f0556f 100644 (file)
@@ -39,7 +39,7 @@
 #include "oic_string.h"
 #include "logger.h"
 #if defined (__TIZENRT__)
-#include <apps/netutils/cJSON.h>
+#include <json/cJSON.h>
 #else
 #include "cJSON.h"
 #endif
index 8f03b9a..29538af 100644 (file)
@@ -26,7 +26,7 @@
 #include "oic_malloc.h"
 #include "oic_string.h"
 #if defined (__TIZENRT__)
-#include <apps/netutils/cJSON.h>
+#include <json/cJSON.h>
 #else
 #include "cJSON.h"
 #endif
index 475b5c9..ce55ab5 100644 (file)
@@ -26,7 +26,7 @@
 #include "oic_malloc.h"
 #include "oic_string.h"
 #if defined (__TIZENRT__)
-#include <apps/netutils/cJSON.h>
+#include <json/cJSON.h>
 #else
 #include "cJSON.h"
 #endif
index 5482ace..a440cac 100644 (file)
@@ -22,7 +22,7 @@
 #include <string.h>
 #include "utlist.h"
 #if defined (__TIZENRT__)
-#include <apps/netutils/cJSON.h>
+#include <json/cJSON.h>
 #else
 #include "cJSON.h"
 #endif
index 5114f41..8d53c4e 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "oicgroup.h"
 #if defined (__TIZENRT__)
-#include <apps/netutils/cJSON.h>
+#include <json/cJSON.h>
 #else
 #include "cJSON.h"
 #endif
index 6912e5d..0125fb8 100644 (file)
@@ -33,7 +33,7 @@ extern "C"
 
 #include "CoapHttpParser.h"
 #if defined (__TIZENRT__)
-#include <apps/netutils/cJSON.h>
+#include <json/cJSON.h>
 #else
 #include "cJSON.h"
 #endif
index 8d7eb64..1bd9681 100644 (file)
@@ -28,7 +28,7 @@
 #include "CoapHttpParser.h"
 #include "CoapHttpMap.h"
 #if defined (__TIZENRT__)
-#include <apps/netutils/cJSON.h>
+#include <json/cJSON.h>
 #else
 #include "cJSON.h"
 #endif
index da90c64..5013b0e 100644 (file)
@@ -30,7 +30,7 @@
 #include <fstream>\r
 #include <algorithm>\r
 #if defined (__TIZENRT__)\r
-#include <apps/netutils/cJSON.h>\r
+#include <json/cJSON.h>\r
 #else\r
 #include "cJSON.h"\r
 #endif\r
index 482919b..7481565 100644 (file)
@@ -50,7 +50,7 @@
 #include "RamlExceptions.h"\r
 #include "RamlUtils.h"\r
 #if defined (__TIZENRT__)\r
-#include <apps/netutils/cJSON.h>\r
+#include <json/cJSON.h>\r
 #else\r
 #include "cJSON.h"\r
 #endif\r
similarity index 97%
rename from apps/netutils/json/Make.defs
rename to external/json/Make.defs
index c845a4c..fead411 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_JSON),y)
-CONFIGURED_APPS += netutils/json
+
+CSRCS += json/cJSON.c
+
+DEPPATH += --dep-path json
+VPATH += :json
+
 endif
 
similarity index 99%
rename from apps/netutils/json/cJSON.c
rename to external/json/cJSON.c
index 0067c72..dd426b3 100644 (file)
@@ -60,7 +60,7 @@
 #include <ctype.h>
 #include <unistd.h>
 
-#include <apps/netutils/cJSON.h>
+#include <json/cJSON.h>
 
 /****************************************************************************
  * Pre-processor Definitions
similarity index 86%
rename from apps/netutils/libcoap/Make.defs
rename to external/libcoap/Make.defs
index 0eb52c3..61d6805 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_LIBCOAP),y)
-CONFIGURED_APPS += netutils/libcoap
+
+CSRCS += libcoap/async.c
+CSRCS += libcoap/block.c
+CSRCS += libcoap/coap_list.c
+CSRCS += libcoap/debug.c
+CSRCS += libcoap/encode.c
+CSRCS += libcoap/hashkey.c
+CSRCS += libcoap/net.c
+CSRCS += libcoap/option.c
+CSRCS += libcoap/pdu.c
+CSRCS += libcoap/resource.c
+CSRCS += libcoap/str.c
+CSRCS += libcoap/subscribe.c
+CSRCS += libcoap/uri.c
+
+DEPPATH += --dep-path libcoap
+VPATH += :libcoap
+
 endif
 
+
similarity index 94%
rename from apps/netutils/libcoap/async.c
rename to external/libcoap/async.c
index 2988647..a699ca4 100644 (file)
 
 #ifndef WITHOUT_ASYNC
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
-#include <apps/netutils/libcoap/utlist.h>
+#include <protocols/libcoap/utlist.h>
 
-#include <apps/netutils/libcoap/mem.h>
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/async.h>
+#include <protocols/libcoap/mem.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/async.h>
 
 coap_async_state_t *coap_register_async(coap_context_t *context, coap_address_t *peer, coap_pdu_t *request, unsigned char flags, void *data)
 {
similarity index 97%
rename from apps/netutils/libcoap/block.c
rename to external/libcoap/block.c
index d79cdce..e295daf 100644 (file)
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #if defined(HAVE_ASSERT_H) && !defined(assert)
 #include <assert.h>
 #endif
 
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/block.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/block.h>
 
 #define min(a,b) ((a) < (b) ? (a) : (b))
 
similarity index 93%
rename from apps/netutils/libcoap/coap_list.c
rename to external/libcoap/coap_list.c
index 06c2fa9..564dddc 100644 (file)
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #include <stdio.h>
 #include <string.h>
 
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/mem.h>
-#include <apps/netutils/libcoap/coap_list.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/mem.h>
+#include <protocols/libcoap/coap_list.h>
 
 int coap_insert(coap_list_t **queue, coap_list_t *node, int (*order)(void *, void *node))
 {
similarity index 98%
rename from apps/netutils/libcoap/debug.c
rename to external/libcoap/debug.c
index 9473953..afb48bc 100644 (file)
@@ -23,7 +23,7 @@
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #if defined(HAVE_ASSERT_H) && !defined(assert)
 #include <assert.h>
@@ -42,8 +42,8 @@
 #include <time.h>
 #endif
 
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/net.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/net.h>
 
 #ifdef WITH_CONTIKI
 #ifndef DEBUG
similarity index 96%
rename from apps/netutils/libcoap/encode.c
rename to external/libcoap/encode.c
index e7cb70d..a62f804 100644 (file)
@@ -27,8 +27,8 @@
 #include <stdio.h>
 #endif
 
-#include <apps/netutils/libcoap/config.h>
-#include <apps/netutils/libcoap/encode.h>
+#include <protocols/libcoap/config.h>
+#include <protocols/libcoap/encode.h>
 
 /* Carsten suggested this when fls() is not available: */
 int coap_fls(unsigned int i)
similarity index 96%
rename from apps/netutils/libcoap/hashkey.c
rename to external/libcoap/hashkey.c
index 05e0df7..9ee9430 100644 (file)
@@ -23,7 +23,7 @@
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/hashkey.h>
+#include <protocols/libcoap/hashkey.h>
 
 /* Caution: When changing this, update COAP_DEFAULT_WKC_HASHKEY
  * accordingly (see int coap_hash_path());
similarity index 99%
rename from apps/netutils/libcoap/net.c
rename to external/libcoap/net.c
index cb31c5f..cca5375 100644 (file)
@@ -23,7 +23,7 @@
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #include <ctype.h>
 #include <stdio.h>
 #include <net/lwip/timers.h>
 #endif
 
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/mem.h>
-#include <apps/netutils/libcoap/str.h>
-#include <apps/netutils/libcoap/async.h>
-#include <apps/netutils/libcoap/resource.h>
-#include <apps/netutils/libcoap/option.h>
-#include <apps/netutils/libcoap/encode.h>
-#include <apps/netutils/libcoap/block.h>
-#include <apps/netutils/libcoap/net.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/mem.h>
+#include <protocols/libcoap/str.h>
+#include <protocols/libcoap/async.h>
+#include <protocols/libcoap/resource.h>
+#include <protocols/libcoap/option.h>
+#include <protocols/libcoap/encode.h>
+#include <protocols/libcoap/block.h>
+#include <protocols/libcoap/net.h>
 
 #if defined(WITH_POSIX)
 
similarity index 98%
rename from apps/netutils/libcoap/option.c
rename to external/libcoap/option.c
index 4088fa4..e539824 100644 (file)
@@ -24,7 +24,7 @@
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #if defined(HAVE_ASSERT_H) && !defined(assert)
 #include <assert.h>
@@ -33,8 +33,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <apps/netutils/libcoap/option.h>
-#include <apps/netutils/libcoap/debug.h>
+#include <protocols/libcoap/option.h>
+#include <protocols/libcoap/debug.h>
 
 coap_opt_t *options_start(coap_pdu_t *pdu, coap_transport_t transport)
 {
similarity index 99%
rename from apps/netutils/libcoap/pdu.c
rename to external/libcoap/pdu.c
index e376aac..5c0d0d4 100644 (file)
@@ -23,7 +23,7 @@
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #if defined(HAVE_ASSERT_H) && !defined(assert)
 #include <assert.h>
 #include <arpa/inet.h>
 #endif
 
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/pdu.h>
-#include <apps/netutils/libcoap/option.h>
-#include <apps/netutils/libcoap/encode.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/pdu.h>
+#include <protocols/libcoap/option.h>
+#include <protocols/libcoap/encode.h>
 
 #ifdef WITH_CONTIKI
 #include "memb.h"
@@ -55,7 +55,7 @@ void coap_pdu_resources_init()
        memb_init(&pdu_storage);
 }
 #else                                                  /* WITH_CONTIKI */
-#include <apps/netutils/libcoap/mem.h>
+#include <protocols/libcoap/mem.h>
 #endif                                                 /* WITH_CONTIKI */
 
 void coap_pdu_clear(coap_pdu_t *pdu, size_t size)
similarity index 98%
rename from apps/netutils/libcoap/resource.c
rename to external/libcoap/resource.c
index d0be6ac..16bfb34 100644 (file)
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
-#include <apps/netutils/libcoap/net.h>
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/resource.h>
-#include <apps/netutils/libcoap/subscribe.h>
+#include <protocols/libcoap/config.h>
+#include <protocols/libcoap/net.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/resource.h>
+#include <protocols/libcoap/subscribe.h>
 
 #ifdef WITH_LWIP
 #include "utlist.h"
@@ -45,8 +45,8 @@
 
 #endif
 #ifdef WITH_POSIX
-#include <apps/netutils/libcoap/utlist.h>
-#include <apps/netutils/libcoap/mem.h>
+#include <protocols/libcoap/utlist.h>
+#include <protocols/libcoap/mem.h>
 
 #define COAP_MALLOC_TYPE(Type) \
   ((coap_##Type##_t *)coap_malloc(sizeof(coap_##Type##_t)))
similarity index 89%
rename from apps/netutils/libcoap/str.c
rename to external/libcoap/str.c
index e18ec48..2f819b6 100644 (file)
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #include <stdio.h>
 
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/mem.h>
-#include <apps/netutils/libcoap/str.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/mem.h>
+#include <protocols/libcoap/str.h>
 
 str *coap_new_string(size_t size)
 {
similarity index 97%
rename from apps/netutils/libcoap/subscribe.c
rename to external/libcoap/subscribe.c
index 8ec658f..0b8f158 100644 (file)
@@ -24,7 +24,7 @@
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #if defined(HAVE_ASSERT_H) && !defined(assert)
 #include <assert.h>
 
 /* #include "resource.h" */
 
-#include <apps/netutils/libcoap/mem.h>
-#include <apps/netutils/libcoap/encode.h>
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/subscribe.h>
+#include <protocols/libcoap/mem.h>
+#include <protocols/libcoap/encode.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/subscribe.h>
 
 void coap_subscription_init(coap_subscription_t *s)
 {
similarity index 98%
rename from apps/netutils/libcoap/uri.c
rename to external/libcoap/uri.c
index edcfe25..749f609 100644 (file)
@@ -23,7 +23,7 @@
  * README for terms of use.
  */
 
-#include <apps/netutils/libcoap/config.h>
+#include <protocols/libcoap/config.h>
 
 #if defined(HAVE_ASSERT_H) && !defined(assert)
 #include <assert.h>
 #include <string.h>
 #include <ctype.h>
 
-#include <apps/netutils/libcoap/mem.h>
-#include <apps/netutils/libcoap/debug.h>
-#include <apps/netutils/libcoap/pdu.h>
-#include <apps/netutils/libcoap/option.h>
-#include <apps/netutils/libcoap/uri.h>
+#include <protocols/libcoap/mem.h>
+#include <protocols/libcoap/debug.h>
+#include <protocols/libcoap/pdu.h>
+#include <protocols/libcoap/option.h>
+#include <protocols/libcoap/uri.h>
 
 /**
  * A length-safe version of strchr(). This function returns a pointer
similarity index 90%
rename from apps/netutils/mdns/Make.defs
rename to external/mdns/Make.defs
index 538dfdb..610b52b 100644 (file)
 ###########################################################################
 
 ifeq ($(CONFIG_NETUTILS_MDNS),y)
-CONFIGURED_APPS += netutils/mdns
+
+CSRCS += mdns/mdns.c mdns/mdnsd.c
+
+DEPPATH += --dep-path mdns
+VPATH += :mdns
+
 endif
similarity index 99%
rename from apps/netutils/mdns/mdnsd.c
rename to external/mdns/mdnsd.c
index a6e98c7..2d92f50 100644 (file)
@@ -90,7 +90,7 @@
 #endif
 
 #include "mdns.h"
-#include <apps/netutils/mdnsd.h>
+#include <protocols/mdnsd.h>
 
 #if (MDNS_DEBUG_PRINTF == 1) && (MDNS_RR_DEBUG == 1)
 #define MDNSD_RR_DEBUG
diff --git a/external/mosquitto/Make.defs b/external/mosquitto/Make.defs
new file mode 100644 (file)
index 0000000..7ed2ffd
--- /dev/null
@@ -0,0 +1,81 @@
+###########################################################################
+#
+# Copyright 2017 Samsung Electronics All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+# either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+#
+###########################################################################
+# apps/netutils/dhcpd/Make.defs
+# Adds selected applications to apps/ build
+#
+#   Copyright (C) 2016 Gregory Nutt. All rights reserved.
+#   Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+#    used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+ifeq ($(CONFIG_NETUTILS_MQTT),y)
+
+include mosquitto/config.mk
+
+CSRCS += mosquitto/tls_mosq.c
+CSRCS += mosquitto/net_mosq.c
+CSRCS += mosquitto/send_client_mosq.c
+CSRCS += mosquitto/messages_mosq.c
+CSRCS += mosquitto/util_mosq.c
+CSRCS += mosquitto/socks_mosq.c
+CSRCS += mosquitto/will_mosq.c
+CSRCS += mosquitto/mosquitto.c
+CSRCS += mosquitto/logging_mosq.c
+CSRCS += mosquitto/send_mosq.c
+CSRCS += mosquitto/read_handle_shared.c
+CSRCS += mosquitto/srv_mosq.c
+CSRCS += mosquitto/thread_mosq.c
+CSRCS += mosquitto/read_handle_client.c
+CSRCS += mosquitto/read_handle.c
+CSRCS += mosquitto/time_mosq.c
+CSRCS += mosquitto/memory_mosq.c
+
+#CFLAGS += -Imosquitto
+
+DEPPATH += --dep-path mosquitto
+VPATH += :mosquitto
+
+endif
+
diff --git a/external/mosquitto/config.mk b/external/mosquitto/config.mk
new file mode 100644 (file)
index 0000000..7fb9518
--- /dev/null
@@ -0,0 +1,115 @@
+###########################################################################
+#
+# Copyright 2016 Samsung Electronics All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+# either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+#
+###########################################################################
+# =============================================================================
+# User configuration section.
+#
+# These options control compilation on all systems apart from Windows and Mac
+# OS X. Use CMake to compile on Windows and Mac.
+#
+# Largely, these are options that are designed to make mosquitto run more
+# easily in restrictive environments by removing features.
+#
+# Modify the variable below to enable/disable features.
+#
+# Can also be overriden at the command line, e.g.:
+#
+# make WITH_TLS=no
+# =============================================================================
+
+# Uncomment to compile the broker with tcpd/libwrap support.
+#WITH_WRAP:=yes
+
+# Comment out to disable SSL/TLS support in the broker and client.
+# Disabling this will also mean that passwords must be stored in plain text. It
+# is strongly recommended that you only disable WITH_TLS if you are not using
+# password authentication at all.
+WITH_TLS:=no
+
+# Comment out to disable TLS/PSK support in the broker and client. Requires
+# WITH_TLS=yes.
+# This must be disabled if using openssl < 1.0.
+WITH_TLS_PSK:=no
+
+# Comment out to disable client client threading support.
+WITH_THREADING:=yes
+
+# Comment out to remove bridge support from the broker. This allow the broker
+# to connect to other brokers and subscribe/publish to topics. You probably
+# want to leave this included unless you want to save a very small amount of
+# memory size and CPU time.
+WITH_BRIDGE:=no
+
+# Comment out to remove persistent database support from the broker. This
+# allows the broker to store retained messages and durable subscriptions to a
+# file periodically and on shutdown. This is usually desirable (and is
+# suggested by the MQTT spec), but it can be disabled if required.
+WITH_PERSISTENCE:=no
+
+# Comment out to remove memory tracking support from the broker. If disabled,
+# mosquitto won't track heap memory usage nor export '$SYS/broker/heap/current
+# size', but will use slightly less memory and CPU time.
+WITH_MEMORY_TRACKING:=no
+
+# Compile with database upgrading support? If disabled, mosquitto won't
+# automatically upgrade old database versions.
+# Not currently supported.
+#WITH_DB_UPGRADE:=yes
+
+# Comment out to remove publishing of the $SYS topic hierarchy containing
+# information about the broker state.
+WITH_SYS_TREE:=no
+
+# Build with SRV lookup support.
+WITH_SRV:=no
+
+# Build using libuuid for clientid generation (Linux only - please report if
+# supported on your platform).
+WITH_UUID:=no
+
+# Build with websockets support on the broker.
+WITH_WEBSOCKETS:=no
+
+# Use elliptic keys in broker
+WITH_EC:=no
+
+# Build man page documentation by default.
+WITH_DOCS:=no
+
+# Build with client support for SOCK5 proxy.
+WITH_SOCKS:=no
+
+# =============================================================================
+# End of user configuration
+# =============================================================================
+-include $(TOPDIR)/.config
+
+#MQTT_TOP=$(EXTDIR)/mosquitto
+MQTT_TOP=mosquitto
+VERSION=1.4.10
+
+ifeq ($(WITH_THREADING),yes)
+       LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_THREADING
+endif
+
+ifeq ($(CONFIG_NETUTILS_MQTT_SECURITY),y)
+       LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_MBEDTLS
+endif
+
+MQTT_LIB_CFLAGS := $(LIB_CFLAGS) -D__TINYARA__ -DVERSION="\"${VERSION}\""
+MQTT_LIB_CFLAGS += -I$(MQTT_TOP)
+CFLAGS += $(MQTT_LIB_CFLAGS)
similarity index 72%
rename from apps/netutils/netlib/Make.defs
rename to external/netlib/Make.defs
index 8cff814..7184c4a 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_NETLIB),y)
-CONFIGURED_APPS += netutils/netlib
+
+CSRCS += netlib/netlib.c
+CSRCS += netlib/netlib_parsehttpurl.c
+CSRCS += netlib/netlib_setifstatus.c \
+       netlib/netlib_getifstatus.c
+
+
+ifeq ($(CONFIG_NET_IPv4),y)
+CSRCS += netlib/netlib_setipv4addr.c \
+       netlib/netlib_getipv4addr.c \
+       netlib/netlib_getdripv4addr.c \
+       netlib/netlib_setdripv4addr.c \
+       netlib/netlib_setipv4netmask.c
+endif
+
+ifeq ($(CONFIG_NET_IPv6),y)
+CSRCS += netlib/netlib_setipv6addr.c \
+       netlib/netlib_getipv6addr.c \
+       netlib/netlib_getdripv6addr.c \
+       netlib/netlib_setdripv6addr.c \
+       netlib/netlib_setipv6netmask.c \
+       netlib/netlib_prefix2ipv6netmask.c \
+       netlib/netlib_ipv6netmask2prefix.c
+endif
+
+
+# No MAC address support for SLIP (Ethernet only)
+
+ifeq ($(CONFIG_NET_ETHERNET),y)
+CSRCS += netlib/netlib_setmacaddr.c \
+       netlib/netlib_getmacaddr.c
+endif
+
+# IGMP support
+
+ifeq ($(CONFIG_NET_IGMP),y)
+ifeq ($(CONFIG_NET_IPv4),y) # Not yet available for IPv6
+CSRCS += netlib/netlib_ipmsfilter.c
+endif
+endif
+
+DEPPATH += --dep-path netlib
+VPATH += :netlib
+
+
 endif
 
similarity index 99%
rename from apps/netutils/netlib/netlib.c
rename to external/netlib/netlib.c
index 4e0a340..16d7a0f 100644 (file)
@@ -65,7 +65,7 @@
 #include <string.h>
 #include <debug.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_getdripv4addr.c
rename to external/netlib/netlib_getdripv4addr.c
index 1c2676a..0314c33 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_getdripv6addr.c
rename to external/netlib/netlib_getdripv6addr.c
index ddfc8bf..4d9963d 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_getifstatus.c
rename to external/netlib/netlib_getifstatus.c
index c54e365..dca16dc 100644 (file)
@@ -69,7 +69,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Pre-processor Definitions
similarity index 99%
rename from apps/netutils/netlib/netlib_getipv4addr.c
rename to external/netlib/netlib_getipv4addr.c
index 329b149..0622fe8 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Pre-processor Definitions
similarity index 99%
rename from apps/netutils/netlib/netlib_getipv6addr.c
rename to external/netlib/netlib_getipv6addr.c
index e405a27..6626d54 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Pre-processor Definitions
similarity index 99%
rename from apps/netutils/netlib/netlib_getmacaddr.c
rename to external/netlib/netlib_getmacaddr.c
index c7b8eca..312acf9 100644 (file)
@@ -68,7 +68,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Pre-processor Definitions
similarity index 98%
rename from apps/netutils/netlib/netlib_ipmsfilter.c
rename to external/netlib/netlib_ipmsfilter.c
index 54ec22d..bd866d1 100644 (file)
@@ -68,8 +68,8 @@
 #include <netinet/in.h>
 #include <sys/sockio.h>
 
-#include <apps/netutils/netlib.h>
-#include <apps/netutils/ipmsfilter.h>
+#include <protocols/netlib.h>
+#include <protocols/ipmsfilter.h>
 
 #ifdef CONFIG_NET_IGMP
 
@@ -59,7 +59,7 @@
 #include <stdint.h>
 #include <arpa/inet.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #ifdef CONFIG_NET_IPv6
 
similarity index 99%
rename from apps/netutils/netlib/netlib_listenon.c
rename to external/netlib/netlib_listenon.c
index e622c06..ef7e549 100644 (file)
@@ -68,7 +68,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_parsehttpurl.c
rename to external/netlib/netlib_parsehttpurl.c
index a8bb078..6b74a47 100644 (file)
@@ -60,7 +60,7 @@
 #include <string.h>
 #include <errno.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Private Data
@@ -59,7 +59,7 @@
 #include <stdint.h>
 #include <netinet/ip.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #ifdef CONFIG_NET_IPv6
 
similarity index 99%
rename from apps/netutils/netlib/netlib_server.c
rename to external/netlib/netlib_server.c
index 48d81c0..4cdd134 100644 (file)
@@ -68,7 +68,7 @@
 
 #include <netinet/in.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_setdripv4addr.c
rename to external/netlib/netlib_setdripv4addr.c
index 5472a31..3088371 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_setdripv6addr.c
rename to external/netlib/netlib_setdripv6addr.c
index 89e77f6..7ef29d0 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_setifstatus.c
rename to external/netlib/netlib_setifstatus.c
index f8d67e6..979c083 100644 (file)
@@ -68,7 +68,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Pre-processor Definitions
similarity index 99%
rename from apps/netutils/netlib/netlib_setipv4addr.c
rename to external/netlib/netlib_setipv4addr.c
index 4c63380..d58f986 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_setipv4netmask.c
rename to external/netlib/netlib_setipv4netmask.c
index ab123d8..900392b 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_setipv6addr.c
rename to external/netlib/netlib_setipv6addr.c
index 22de6d8..b668c09 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_setipv6netmask.c
rename to external/netlib/netlib_setipv6netmask.c
index d183f32..075e0a3 100644 (file)
@@ -67,7 +67,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Public Functions
similarity index 99%
rename from apps/netutils/netlib/netlib_setmacaddr.c
rename to external/netlib/netlib_setmacaddr.c
index 20c3204..665535d 100644 (file)
@@ -70,7 +70,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Pre-processor Definitions
similarity index 96%
rename from apps/netutils/ntpclient/Make.defs
rename to external/ntpclient/Make.defs
index 4119e0f..f8921de 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_NTPCLIENT),y)
-CONFIGURED_APPS += netutils/ntpclient
+
+CSRCS += ntpclient/ntpclient.c
+
+DEPPATH += --dep-path ntpclient
+VPATH += :ntpclient
+
 endif
 
similarity index 99%
rename from apps/netutils/ntpclient/ntpclient.c
rename to external/ntpclient/ntpclient.c
index 931d5ee..eee7957 100644 (file)
@@ -72,7 +72,7 @@
 #include <errno.h>
 #include <debug.h>
 #include <netinet/in.h>
-#include <apps/netutils/ntpclient.h>
+#include <protocols/ntpclient.h>
 #include <netdb.h>
 #include "ntpv3.h"
 
similarity index 97%
rename from apps/netutils/smtp/Make.defs
rename to external/smtp/Make.defs
index a5b3359..646d88d 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_SMTP),y)
-CONFIGURED_APPS += netutils/smtp
+
+CSRCS  += smtp/smtp.c
+
+DEPPATH += --dep-path smtp
+VPATH += :smtp
+
 endif
 
similarity index 99%
rename from apps/netutils/smtp/smtp.c
rename to external/smtp/smtp.c
index de8e697..17aba18 100644 (file)
@@ -77,7 +77,7 @@
 #include <arpa/inet.h>
 
 #include <tinyara/net/ip.h>
-#include <apps/netutils/smtp.h>
+#include <protocols/smtp.h>
 
 /****************************************************************************
  * Pre-processor Definitions
similarity index 96%
rename from apps/netutils/telnetd/Make.defs
rename to external/telnetd/Make.defs
index 043f25f..bee0365 100644 (file)
 
 ifeq ($(CONFIG_NETUTILS_TELNETD),y)
 CONFIGURED_APPS += netutils/telnetd
+
+CSRCS          += telnetd/telnetd_daemon.c
+
+DEPPATH += --dep-path telnetd
+VPATH += :telnetd
+
 endif
 
similarity index 99%
rename from apps/netutils/telnetd/telnetd_daemon.c
rename to external/telnetd/telnetd_daemon.c
index f45df7f..0e19709 100644 (file)
@@ -76,8 +76,8 @@
 
 #include <tinyara/net/telnet.h>
 
-#include <apps/netutils/telnetd.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/telnetd.h>
+#include <protocols/netlib.h>
 
 /****************************************************************************
  * Private Types
similarity index 95%
rename from apps/netutils/tftpc/Make.defs
rename to external/tftpc/Make.defs
index 6c82737..5619ca8 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_TFTPC),y)
-CONFIGURED_APPS += netutils/tftpc
+
+CSRCS += tftpc/tftpc_get.c tftpc/tftpc_put.c tftpc/tftpc_packets.c
+
+DEPPATH += --dep-path tftpc
+VPATH += :tftpc
+
 endif
 
similarity index 99%
rename from apps/netutils/tftpc/tftpc_get.c
rename to external/tftpc/tftpc_get.c
index a76cfd8..18b3370 100644 (file)
@@ -68,7 +68,7 @@
 
 #include <arpa/inet.h>
 
-#include <apps/netutils/tftp.h>
+#include <protocols/tftp.h>
 
 #include "tftpc_internal.h"
 
similarity index 99%
rename from apps/netutils/tftpc/tftpc_packets.c
rename to external/tftpc/tftpc_packets.c
index a03e225..c052748 100644 (file)
@@ -69,7 +69,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <apps/netutils/tftp.h>
+#include <protocols/tftp.h>
 
 #include "tftpc_internal.h"
 
similarity index 99%
rename from apps/netutils/tftpc/tftpc_put.c
rename to external/tftpc/tftpc_put.c
index 6afb029..c3a675d 100644 (file)
@@ -66,7 +66,7 @@
 #include <errno.h>
 #include <debug.h>
 
-#include <apps/netutils/tftp.h>
+#include <protocols/tftp.h>
 
 #include "tftpc_internal.h"
 
similarity index 95%
rename from apps/netutils/webclient/Make.defs
rename to external/webclient/Make.defs
index 1fa5ab9..39880f9 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_WEBCLIENT),y)
-CONFIGURED_APPS += netutils/webclient
+
+ifeq ($(CONFIG_NETUTILS_WEBCLIENT),y)
+CSRCS  += webclient/webclient.c
+endif
+
+DEPPATH += --dep-path webclient
+VPATH += :webclient
+
 endif
 
similarity index 99%
rename from apps/netutils/webclient/webclient.c
rename to external/webclient/webclient.c
index 0cf8cef..45b2d20 100644 (file)
 #include <netinet/in.h>
 
 #include <tinyara/version.h>
-#include <apps/netutils/netlib.h>
+#include <protocols/netlib.h>
 
 #include "../webserver/http_string_util.h"
 #include "../webserver/http_client.h"
-#include <apps/netutils/webclient.h>
+#include <protocols/webclient.h>
 #if defined(CONFIG_NETUTILS_CODECS)
 #  if defined(CONFIG_CODECS_URLCODE)
 #    define WGET_USE_URLENCODE 1
-#    include <apps/netutils/urldecode.h>
+#    include <protocols/urldecode.h>
 #  endif
 #  if defined(CONFIG_CODECS_BASE64)
-#    include <apps/netutils/base64.h>
+#    include <protocols/base64.h>
 #  endif
 #else
 #  undef CONFIG_CODECS_URLCODE
similarity index 85%
rename from apps/netutils/webserver/Make.defs
rename to external/webserver/Make.defs
index b9cbaf4..6ce4e51 100644 (file)
 
 ifeq ($(CONFIG_NETUTILS_WEBSERVER),y)
 CONFIGURED_APPS += netutils/webserver
+
+ifeq ($(CONFIG_NETUTILS_WEBSERVER),y)
+CSRCS  += webserver/http.c
+CSRCS   += webserver/http_server.c
+CSRCS   += webserver/http_client.c
+ifeq ($(CONFIG_NET_SECURITY_TLS),y)
+CSRCS   += webserver/http_client_tls.c
+CSRCS   += webserver/http_server_tls.c
+endif
+CSRCS   += webserver/http_string_util.c
+CSRCS   += webserver/http_keyvalue_list.c
+CSRCS   += webserver/http_query.c
+endif
+
+DEPPATH += --dep-path webserver
+VPATH += :webserver
+
 endif
 
similarity index 98%
rename from apps/netutils/webserver/http.c
rename to external/webserver/http.c
index 1124175..0311a49 100644 (file)
@@ -16,9 +16,9 @@
  *
  ****************************************************************************/
 
-#include <apps/netutils/webserver/http_err.h>
-#include <apps/netutils/webserver/http_server.h>
-#include <apps/netutils/webserver/http_keyvalue_list.h>
+#include <protocols/webserver/http_err.h>
+#include <protocols/webserver/http_server.h>
+#include <protocols/webserver/http_keyvalue_list.h>
 #include <fcntl.h>
 
 #include "http.h"
similarity index 99%
rename from apps/netutils/webserver/http_client.c
rename to external/webserver/http_client.c
index d7e329f..482aba6 100644 (file)
  ****************************************************************************/
 
 #include <fcntl.h>
-#include <apps/netutils/webserver/http_err.h>
-#include <apps/netutils/webserver/http_keyvalue_list.h>
-#include <apps/netutils/webclient.h>
-#include <apps/netutils/websocket.h>
+#include <protocols/webserver/http_err.h>
+#include <protocols/webserver/http_keyvalue_list.h>
+#include <protocols/webclient.h>
+#include <protocols/websocket.h>
 #include <tinyara/fs/fs.h>
 #include <tinyara/fs/dirent.h>
 
similarity index 95%
rename from apps/netutils/webserver/http_client.h
rename to external/webserver/http_client.h
index e415fa1..0456a1b 100644 (file)
@@ -19,9 +19,9 @@
 #ifndef __http_client_h__
 #define __http_client_h__
 
-#include <apps/netutils/webserver/http_server.h>
-#include <apps/netutils/webclient.h>
-#include <apps/netutils/websocket.h>
+#include <protocols/webserver/http_server.h>
+#include <protocols/webclient.h>
+#include <protocols/websocket.h>
 
 #ifdef CONFIG_NET_SECURITY_TLS
 #include "tls/config.h"
similarity index 97%
rename from apps/netutils/webserver/http_client_tls.c
rename to external/webserver/http_client_tls.c
index 762e240..9c3f1d1 100644 (file)
@@ -16,7 +16,7 @@
  *
  ****************************************************************************/
 
-#include <apps/netutils/webserver/http_err.h>
+#include <protocols/webserver/http_err.h>
 
 #include "http.h"
 #include "http_client.h"
similarity index 96%
rename from apps/netutils/webserver/http_keyvalue_list.c
rename to external/webserver/http_keyvalue_list.c
index 564b4ba..a99e030 100644 (file)
@@ -20,8 +20,8 @@
 #include <tinyara/progmem.h>
 #include <sys/stat.h>
 
-#include <apps/netutils/webserver/http_err.h>
-#include <apps/netutils/webserver/http_keyvalue_list.h>
+#include <protocols/webserver/http_err.h>
+#include <protocols/webserver/http_keyvalue_list.h>
 
 #include "http.h"
 #include "http_arch.h"
similarity index 98%
rename from apps/netutils/webserver/http_query.c
rename to external/webserver/http_query.c
index abb651b..848a59f 100644 (file)
@@ -20,8 +20,8 @@
 #include <tinyara/progmem.h>
 #include <sys/stat.h>
 
-#include <apps/netutils/webserver/http_err.h>
-#include <apps/netutils/webserver/http_keyvalue_list.h>
+#include <protocols/webserver/http_err.h>
+#include <protocols/webserver/http_keyvalue_list.h>
 
 #include "http.h"
 #include "http_client.h"
similarity index 96%
rename from apps/netutils/webserver/http_server.c
rename to external/webserver/http_server.c
index 3419369..e4eed0b 100644 (file)
@@ -17,8 +17,8 @@
  ****************************************************************************/
 
 #include <stdlib.h>
-#include <apps/netutils/webserver/http_err.h>
-#include <apps/netutils/webserver/http_server.h>
+#include <protocols/webserver/http_err.h>
+#include <protocols/webserver/http_server.h>
 
 #include "http_client.h"
 #include "http_arch.h"
similarity index 98%
rename from apps/netutils/webserver/http_server_tls.c
rename to external/webserver/http_server_tls.c
index 8cf238e..1fdae5f 100644 (file)
@@ -16,8 +16,8 @@
  *
  ****************************************************************************/
 
-#include <apps/netutils/webserver/http_err.h>
-#include <apps/netutils/webserver/http_server.h>
+#include <protocols/webserver/http_err.h>
+#include <protocols/webserver/http_server.h>
 
 #include "http_client.h"
 #include "http_arch.h"
similarity index 97%
rename from apps/netutils/webserver/http_string_util.c
rename to external/webserver/http_string_util.c
index c5c98b3..44e76e4 100644 (file)
@@ -22,8 +22,8 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include <apps/netutils/webserver/http_err.h>
-#include <apps/netutils/webserver/http_server.h>
+#include <protocols/webserver/http_err.h>
+#include <protocols/webserver/http_server.h>
 
 #include "http.h"
 #include "http_string_util.h"
similarity index 78%
rename from apps/netutils/websocket/Make.defs
rename to external/websocket/Make.defs
index fbb59f0..c6c7aa8 100644 (file)
 
 ifeq ($(CONFIG_NETUTILS_WEBSOCKET),y)
 CONFIGURED_APPS += netutils/websocket
+
+CSRCS += websocket/websocket.c
+CSRCS += websocket/wslay/wslay_net.c \
+         websocket/wslay/wslay_queue.c \
+         websocket/wslay/wslay_frame.c \
+         websocket/wslay/wslay_event.c
+
+DEPPATH += --dep-path websocket
+VPATH += :websocket
+
 endif
 
similarity index 99%
rename from apps/netutils/websocket/websocket.c
rename to external/websocket/websocket.c
index 8176f6c..3f97f54 100644 (file)
@@ -40,9 +40,9 @@
 #include <sys/time.h>
 #include <tls/sha1.h>
 #include <tls/base64.h>
-#include <apps/netutils/netlib.h>
-#include <apps/netutils/websocket.h>
-#include <apps/netutils/wslay/wslay.h>
+#include <protocols/netlib.h>
+#include <protocols/websocket.h>
+#include <protocols/wslay/wslay.h>
 
 /****************************************************************************
  * Definitions
similarity index 99%
rename from apps/netutils/websocket/wslay/wslay_event.c
rename to external/websocket/wslay/wslay_event.c
index afb94b0..a46e51f 100644 (file)
@@ -76,7 +76,7 @@
 #include "wslay_frame.h"
 #include "wslay_net.h"
 
-#include <apps/netutils/websocket.h>
+#include <protocols/websocket.h>
 #define UTF8_ACCEPT 0
 #define UTF8_REJECT 12
 
similarity index 99%
rename from apps/netutils/websocket/wslay/wslay_event.h
rename to external/websocket/wslay/wslay_event.h
index 7f3fee6..b555c82 100644 (file)
@@ -43,7 +43,7 @@
 #define WSLAY_EVENT_H
 
 #include <tinyara/config.h>
-#include <apps/netutils/wslay/wslay.h>
+#include <protocols/wslay/wslay.h>
 
 struct wslay_stack;
 struct wslay_queue;
similarity index 98%
rename from apps/netutils/websocket/wslay/wslay_frame.h
rename to external/websocket/wslay/wslay_frame.h
index 149dd85..6d45a55 100644 (file)
@@ -43,7 +43,7 @@
 #define WSLAY_FRAME_H
 
 #include <tinyara/config.h>
-#include <apps/netutils/wslay/wslay.h>
+#include <protocols/wslay/wslay.h>
 
 enum wslay_frame_state {
        PREP_HEADER,
similarity index 98%
rename from apps/netutils/websocket/wslay/wslay_net.h
rename to external/websocket/wslay/wslay_net.h
index 21d1ae3..6ee5ad1 100644 (file)
@@ -45,7 +45,7 @@
 #include <tinyara/config.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <apps/netutils/wslay/wslay.h>
+#include <protocols/wslay/wslay.h>
 
 #ifdef WORDS_BIGENDIAN
 #define ntoh64(x) (x)
similarity index 98%
rename from apps/netutils/websocket/wslay/wslay_queue.h
rename to external/websocket/wslay/wslay_queue.h
index c932cda..f6961c2 100644 (file)
@@ -43,7 +43,7 @@
 #define WSLAY_QUEUE_H
 
 #include <tinyara/config.h>
-#include <apps/netutils/wslay/wslay.h>
+#include <protocols/wslay/wslay.h>
 
 struct wslay_queue_cell {
        void *data;
similarity index 98%
rename from apps/netutils/websocket/wslay/wslay_stack.h
rename to external/websocket/wslay/wslay_stack.h
index 89731c3..87ab441 100644 (file)
@@ -43,7 +43,7 @@
 #define WSLAY_STACK_H
 
 #include "tinyara/config.h"
-#include <apps/netutils/wslay/wslay.h>
+#include <protocols/wslay/wslay.h>
 
 struct wslay_stack_cell {
        void *data;
diff --git a/external/xmlrpc/.gitignore b/external/xmlrpc/.gitignore
new file mode 100644 (file)
index 0000000..f21c854
--- /dev/null
@@ -0,0 +1,6 @@
+/.built
+/.depend
+/Make.dep
+/*.src
+/*.obj
+/*.lst
similarity index 96%
rename from apps/netutils/xmlrpc/Make.defs
rename to external/xmlrpc/Make.defs
index 7132b5f..c110fd0 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_XMLRPC),y)
-CONFIGURED_APPS += netutils/xmlrpc
+
+CSRCS += xmlrpc/xmlparser.c \
+         xmlrpc/response.c
+
+DEPPATH += --dep-path xmlrpc
+VPATH += :xmlrpc
+
 endif
 
similarity index 99%
rename from apps/netutils/xmlrpc/response.c
rename to external/xmlrpc/response.c
index 664e6ac..94d283a 100644 (file)
@@ -72,7 +72,7 @@
 #include <stdarg.h>
 #include <string.h>
 #include <stdio.h>
-#include <apps/netutils/xmlrpc.h>
+#include <protocols/xmlrpc.h>
 
 /****************************************************************************
  * Private Functions
similarity index 99%
rename from apps/netutils/xmlrpc/xmlparser.c
rename to external/xmlrpc/xmlparser.c
index 89ab002..c7443d3 100644 (file)
@@ -73,7 +73,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <apps/netutils/xmlrpc.h>
+#include <protocols/xmlrpc.h>
 
 /****************************************************************************
  * Pre-processor Definitions
index 5cc210c..47f11cc 100644 (file)
@@ -38,6 +38,10 @@ ifeq ($(CONFIG_ARASTORAGE), y)
 include src$(DELIM)arastorage$(DELIM)Make.defs
 endif
 
+ifeq ($(CONFIG_NETUTILS_MQTT), y)
+include src$(DELIM)mqtt$(DELIM)Make.defs
+endif
+
 AOBJS = $(ASRCS:.S=$(OBJEXT))
 COBJS = $(CSRCS:.c=$(OBJEXT))
 
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from apps/include/netutils/mqtt_api.h
rename to framework/include/mqtt/mqtt_api.h
index 583d9f0..9f4084f 100644 (file)
@@ -40,7 +40,7 @@
 #include <dm/dm_error.h>
 #include <dm/dm_connectivity.h>
 
-#include <apps/netutils/dhcpc.h>
+#include <protocols/dhcpc.h>
 #include <apps/netutils/wifi/slsi_wifi_api.h>
 #include <apps/netutils/wifi/slsi_wifi_utils.h>
 #include <arpa/inet.h>
similarity index 94%
rename from apps/netutils/mqtt/Make.defs
rename to framework/src/mqtt/Make.defs
index d3c107d..5e1263a 100644 (file)
 ############################################################################
 
 ifeq ($(CONFIG_NETUTILS_MQTT),y)
-CONFIGURED_APPS += netutils/mqtt
+
+include ../external/mosquitto/config.mk
+
+CSRCS += mqtt_api.c
+
+CFLAGS += -I../external/mosquitto
+
+DEPPATH += --dep-path src/mqtt
+VPATH += :src/mqtt
+
 endif
 
diff --git a/framework/src/mqtt/config.h b/framework/src/mqtt/config.h
new file mode 100644 (file)
index 0000000..2e1bf72
--- /dev/null
@@ -0,0 +1,59 @@
+/****************************************************************************
+ *
+ * Copyright 2016 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ ****************************************************************************/
+
+/* ============================================================
+ * Control compile time options.
+ * ============================================================
+ *
+ * Compile time options have moved to config.mk.
+ */
+
+/* ============================================================
+ * Compatibility defines
+ *
+ * Generally for Windows native support.
+ * ============================================================ */
+
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#      define snprintf sprintf_s
+#endif
+
+#ifdef WIN32
+#      ifndef strcasecmp
+#              define strcasecmp strcmpi
+#      endif
+#define strtok_r strtok_s
+#define strerror_r(e, b, l) strerror_s(b, l, e)
+#endif
+
+#define uthash_malloc(sz) _mosquitto_malloc(sz)
+#define uthash_free(ptr,sz) _mosquitto_free(ptr)
+
+#ifndef EPROTO
+#      define EPROTO ECONNABORTED
+#endif
+
+#ifdef WITH_MBEDTLS
+#include "tls/ssl.h"
+#include "tls/net.h"
+#include "tls/x509_crt.h"
+#include "tls/pk.h"
+#include "tls/ctr_drbg.h"
+#include "tls/ssl_cache.h"
+#include "tls/entropy.h"
+#endif
similarity index 99%
rename from apps/netutils/mqtt/mqtt_api.c
rename to framework/src/mqtt/mqtt_api.c
index 3f0d2f1..de92404 100644 (file)
@@ -34,7 +34,7 @@
 #include "mosquitto_internal.h"
 #include "memory_mosq.h"
 
-#include <apps/netutils/mqtt_api.h>
+#include <mqtt/mqtt_api.h>
 
 /****************************************************************************
  * Pre-processor Definitions
index 9ed8095..79511d6 100644 (file)
@@ -111,7 +111,25 @@ source net/netdev/Kconfig
 source net/route/Kconfig
 
 menu "Protocols"
-source ../external/dhcpd/Kconfig.protocol
+
+source "$EXTERNALDIR/dhcpd/Kconfig.protocol"
+source "$EXTERNALDIR/xmlrpc/Kconfig.protocol"
+source "$EXTERNALDIR/ntpclient/Kconfig.protocol"
+source "$EXTERNALDIR/webserver/Kconfig.protocol"
+source "$EXTERNALDIR/ftpc/Kconfig.protocol"
+source "$EXTERNALDIR/mdns/Kconfig.protocol"
+source "$EXTERNALDIR/webclient/Kconfig.protocol"
+source "$EXTERNALDIR/ftpd/Kconfig.protocol"
+source "$EXTERNALDIR/dhcpc/Kconfig.protocol"
+source "$EXTERNALDIR/websocket/Kconfig.protocol"
+source "$EXTERNALDIR/libcoap/Kconfig.protocol"
+source "$EXTERNALDIR/tftpc/Kconfig.protocol"
+source "$EXTERNALDIR/telnetd/Kconfig.protocol"
+source "$EXTERNALDIR/smtp/Kconfig.protocol"
+source "$EXTERNALDIR/netlib/Kconfig.protocl"
+
+source "../framework/src/mqtt/Kconfig.protocol"
+
 endmenu #Protocols