Permalink
Browse files

Initial release of LibNyoci

  • Loading branch information...
darconeous committed Mar 19, 2017
1 parent 016765d commit c800caaf2699d906746a082b37d2ded0a20b79a2
Showing with 25,311 additions and 0 deletions.
  1. +1 −0 .default-version
  2. +8 −0 .gitattributes
  3. +47 −0 .gitignore
  4. +43 −0 .travis.yml
  5. +58 −0 .travis/after_success.sh
  6. +16 −0 .travis/before_install.sh
  7. +18 −0 .travis/before_script.sh
  8. +2 −0 .travis/deploy.prv.enc
  9. +1 −0 .travis/deploy.pub
  10. +23 −0 .travis/script.sh
  11. +150 −0 .uncrustify.cfg
  12. 0 CHANGELOG
  13. +73 −0 CONTRIBUTING.md
  14. +7 −0 HACKING.md
  15. +34 −0 LICENSE
  16. +30 −0 Makefile.am
  17. +10 −0 NEWS.md
  18. +186 −0 README.md
  19. +15 −0 bootstrap.sh
  20. +406 −0 configure.ac
  21. +57 −0 contiki-src/Makefile.nyoci
  22. +17 −0 contiki-src/examples/nyoci-complex/.gitignore
  23. +32 −0 contiki-src/examples/nyoci-complex/Makefile
  24. +506 −0 contiki-src/examples/nyoci-complex/nyoci-complex.c
  25. +17 −0 contiki-src/examples/nyoci-plugtest/.gitignore
  26. +39 −0 contiki-src/examples/nyoci-plugtest/Makefile
  27. +4 −0 contiki-src/examples/nyoci-plugtest/nyoci-plugtest.avr-raven.gdb
  28. +64 −0 contiki-src/examples/nyoci-plugtest/nyoci-plugtest.c
  29. +17 −0 contiki-src/examples/nyoci-simple/.gitignore
  30. +30 −0 contiki-src/examples/nyoci-simple/Makefile
  31. +100 −0 contiki-src/examples/nyoci-simple/nyoci-simple.c
  32. +86 −0 contiki-src/led-node.c
  33. +45 −0 contiki-src/led-node.h
  34. +38 −0 contiki-src/nyoci-contiki-config.h
  35. +111 −0 contiki-src/nyoci-task.c
  36. +40 −0 contiki-src/nyoci-task.h
  37. +72 −0 contiki-src/sensor-node.c
  38. +44 −0 contiki-src/sensor-node.h
  39. +5 −0 doc/Makefile.am
  40. +134 −0 doc/nyocictl.1
  41. +251 −0 doc/oss-plan.md
  42. +1,808 −0 doxygen.cfg.in
  43. +16 −0 etc/Dockerfile
  44. +38 −0 etc/build-in-docker.sh
  45. +32 −0 etc/libnyoci.rb
  46. +165 −0 etc/run-in-docker.sh
  47. +2 −0 src/.gitignore
  48. +43 −0 src/Makefile.am
  49. +5 −0 src/examples/.gitignore
  50. +30 −0 src/examples/Makefile.am
  51. +91 −0 src/examples/example-1.c
  52. +101 −0 src/examples/example-2.c
  53. +109 −0 src/examples/example-3.c
  54. +138 −0 src/examples/example-4.c
  55. +170 −0 src/examples/example-multicast-request.c
  56. +88 −0 src/libnyoci/Makefile.am
  57. +147 −0 src/libnyoci/assert-macros.h
  58. +824 −0 src/libnyoci/btree.c
  59. +131 −0 src/libnyoci/btree.h
  60. +899 −0 src/libnyoci/coap.c
  61. +416 −0 src/libnyoci/coap.h
  62. +84 −0 src/libnyoci/fasthash.c
  63. +51 −0 src/libnyoci/fasthash.h
  64. +534 −0 src/libnyoci/libnyoci.h
  65. +11 −0 src/libnyoci/libnyoci.pc.in
  66. +244 −0 src/libnyoci/ll.h
  67. +167 −0 src/libnyoci/nyoci-async.c
  68. +83 −0 src/libnyoci/nyoci-async.h
  69. +124 −0 src/libnyoci/nyoci-config.h.in
  70. +336 −0 src/libnyoci/nyoci-defaults.h
  71. +79 −0 src/libnyoci/nyoci-dupe.c
  72. +52 −0 src/libnyoci/nyoci-dupe.h
  73. +92 −0 src/libnyoci/nyoci-helpers.h
  74. +540 −0 src/libnyoci/nyoci-inbound.c
  75. +181 −0 src/libnyoci/nyoci-internal.h
  76. +74 −0 src/libnyoci/nyoci-logging.h
  77. +78 −0 src/libnyoci/nyoci-missing.c
  78. +141 −0 src/libnyoci/nyoci-missing.h
  79. +460 −0 src/libnyoci/nyoci-observable.c
  80. +141 −0 src/libnyoci/nyoci-observable.h
  81. +46 −0 src/libnyoci/nyoci-opts.h
  82. +794 −0 src/libnyoci/nyoci-outbound.c
  83. +215 −0 src/libnyoci/nyoci-plat-net-func.h
  84. +92 −0 src/libnyoci/nyoci-plat-tls-func.h
  85. +88 −0 src/libnyoci/nyoci-session.c
  86. +66 −0 src/libnyoci/nyoci-session.h
  87. +90 −0 src/libnyoci/nyoci-status.h
  88. +242 −0 src/libnyoci/nyoci-timer.c
  89. +120 −0 src/libnyoci/nyoci-timer.h
  90. +996 −0 src/libnyoci/nyoci-transaction.c
  91. +195 −0 src/libnyoci/nyoci-transaction.h
  92. +366 −0 src/libnyoci/nyoci.c
  93. +105 −0 src/libnyoci/string-utils.c
  94. +54 −0 src/libnyoci/string-utils.h
  95. +952 −0 src/libnyoci/url-helpers.c
  96. +140 −0 src/libnyoci/url-helpers.h
  97. +29 −0 src/libnyociextra/Makefile.am
  98. +41 −0 src/libnyociextra/libnyociextra.h
  99. +12 −0 src/libnyociextra/libnyociextra.pc.in
  100. +212 −0 src/libnyociextra/nyoci-list.c
  101. +488 −0 src/libnyociextra/nyoci-node-router.c
  102. +179 −0 src/libnyociextra/nyoci-node-router.h
  103. +364 −0 src/libnyociextra/nyoci-var-handler.c
  104. +79 −0 src/libnyociextra/nyoci-var-handler.h
  105. +3 −0 src/missing/Makefile.am
  106. +65 −0 src/missing/fgetln.h
  107. +100 −0 src/missing/getline.c
  108. +54 −0 src/missing/strlcat/Makefile.am
  109. +41 −0 src/missing/strlcat/strlcat.c
  110. +54 −0 src/missing/strlcat/strlcat.h
  111. +61 −0 src/missing/strlcat/strlcat_test.c
  112. +42 −0 src/missing/strlcpy/Makefile.am
  113. +52 −0 src/missing/strlcpy/strlcpy.c
  114. +54 −0 src/missing/strlcpy/strlcpy.h
  115. +61 −0 src/missing/strlcpy/strlcpy_test.c
  116. +14 −0 src/nyocictl/Makefile.am
  117. +196 −0 src/nyocictl/cmd_delete.c
  118. +2 −0 src/nyocictl/cmd_delete.h
  119. +378 −0 src/nyocictl/cmd_get.c
  120. +11 −0 src/nyocictl/cmd_get.h
  121. +522 −0 src/nyocictl/cmd_list.c
  122. +11 −0 src/nyocictl/cmd_list.h
  123. +281 −0 src/nyocictl/cmd_post.c
  124. +2 −0 src/nyocictl/cmd_post.h
  125. +131 −0 src/nyocictl/cmd_repeat.c
  126. +11 −0 src/nyocictl/cmd_repeat.h
  127. +14 −0 src/nyocictl/help.c
  128. +123 −0 src/nyocictl/help.h
  129. +885 −0 src/nyocictl/main.c
  130. +42 −0 src/nyocictl/nyocictl.h
  131. +22 −0 src/plat-net/posix/Makefile.am
  132. +127 −0 src/plat-net/posix/nyoci-plat-net-internal.h
  133. +1,058 −0 src/plat-net/posix/nyoci-plat-net.c
  134. +98 −0 src/plat-net/posix/nyoci-plat-net.h
  135. +22 −0 src/plat-net/uip/Makefile.am
  136. +79 −0 src/plat-net/uip/nyoci-plat-net-internal.h
  137. +444 −0 src/plat-net/uip/nyoci-plat-net.c
  138. +57 −0 src/plat-net/uip/nyoci-plat-net.h
  139. +21 −0 src/plat-tls/openssl/Makefile.am
  140. +866 −0 src/plat-tls/openssl/nyoci-plat-tls.c
  141. +70 −0 src/plat-tls/openssl/nyoci-plat-tls.h
  142. +20 −0 src/plugtest/Makefile.am
  143. +6 −0 src/plugtest/README.md
  144. +748 −0 src/plugtest/main-client.c
  145. +154 −0 src/plugtest/main-server.c
  146. +431 −0 src/plugtest/plugtest-server.c
  147. +48 −0 src/plugtest/plugtest-server.h
  148. +11 −0 src/plugtest/selftest.sh
  149. +16 −0 src/tests/Makefile.am
  150. +238 −0 src/tests/test-concurrency.c
  151. +7 −0 src/version.c.in
  152. +31 −0 src/version.h
View
@@ -0,0 +1 @@
0.07.00rc1
View
@@ -0,0 +1,8 @@
* text=auto
*.[ch] text whitespace=trailing-space,space-before-tab,indent-with-non-tab,-tab-in-indent,tabwidth=4
*.rb text whitespace=trailing-space,space-before-tab,-indent-with-non-tab,tab-in-indent,tabwidth=2
*.yml text whitespace=trailing-space,space-before-tab,-indent-with-non-tab,tab-in-indent,tabwidth=4
*.md text whitespace=-trailing-space,space-before-tab,-indent-with-non-tab,-tab-in-indent
Makefile.* text whitespace=trailing-space,space-before-tab,indent-with-non-tab,-tab-in-indent,tabwidth=4
Makefile text whitespace=trailing-space,space-before-tab,indent-with-non-tab,-tab-in-indent,tabwidth=4
*.bat text eol=crlf
View
@@ -0,0 +1,47 @@
.DS_Store
*.swp
*.o
*.lo
.deps
*.orig
Makefile.in
*~
*.xcuserdatad
xcuserdata
*.a
*.la
*.gz
*.log
*.trs
*.dylib
*.lai
.libs
*.gcno
*.gcda
doxygen.cfg
/doc/html
/doc/latex
/build
/DerivedData
/autom4te.cache
/aclocal.m4
/config.h.in
/config.log
/config.status
/configure
/libtool
/Makefile
/doc/Makefile
/src/config.h
/src/nyocictl/nyocictl
/src/libnyoci/libnyoci.pc
/src/libnyoci/nyoci-config.h
/src/libnyoci/stamp-h2
/src/libnyociextra/libnyociextra.pc
/m4
/src/stamp-h1
/src/config.h.in
/src/plugtest/nyoci-plugtest-client
/src/plugtest/nyoci-plugtest-server
/src/libnyoci/btreetest
/src/tests/test-concurrency
View
@@ -0,0 +1,43 @@
language: c
os:
- linux
- osx
compiler:
- clang
- gcc
before_install:
- .travis/before_install.sh
before_script:
- .travis/before_script.sh
script:
- .travis/script.sh
after_success:
- ssh-agent .travis/after_success.sh
env:
- BUILD_MAKEARGS='distcheck' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'
- BUILD_MAKEARGS='check' BUILD_CONFIGFLAGS='--enable-embedded NYOCI_CONF_TRANS_ENABLE_BLOCK2=1 NYOCI_CONF_TRANS_ENABLE_OBSERVING=1' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'
- BUILD_MAKEARGS='check' BUILD_CONFIGFLAGS='--enable-dtls' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'
matrix:
exclude:
- os: osx
compiler: gcc
- os: osx
env: BUILD_MAKEARGS='check' BUILD_CONFIGFLAGS='--enable-dtls' BUILD_PLATFORM='unix' BUILD_MAKEPATH='build'
include:
- os: linux
compiler: gcc
env: BUILD_PLATFORM='contiki' BUILD_MAKEPATH='contiki-src/examples/nyoci-plugtest' BUILD_MAKEARGS='TARGET=minimal-net CONTIKI=../../../contiki'
- os: linux
compiler: gcc
env: BUILD_PLATFORM='contiki' BUILD_MAKEPATH='contiki-src/examples/nyoci-complex' BUILD_MAKEARGS='TARGET=native CONTIKI=../../../contiki'
- os: linux
compiler: gcc
env: BUILD_PLATFORM='contiki' BUILD_MAKEPATH='contiki-src/examples/nyoci-simple' BUILD_MAKEARGS='TARGET=minimal-net CONTIKI=../../../contiki'
View
@@ -0,0 +1,58 @@
#!/bin/sh
PREV_PATH="`pwd`"
die() {
echo " *** ERROR: " $*
exit 1
}
set -x
prep_ssh_key() {
openssl aes-256-cbc -K "${encrypted_0f1462f1026b_key}" -iv "${encrypted_0f1462f1026b_iv}" -in .travis/deploy.prv.enc -out .travis/deploy.prv -d &&
chmod 600 .travis/deploy.prv &&
ssh-add .travis/deploy.prv &&
git config --global user.name "Travis CI" &&
git config --global user.email "noreply@travis-ci.com"
}
AUTOCONF_BRANCH="autoconf/$TRAVIS_BRANCH"
if [ $TRAVIS_REPO_SLUG = "darconeous/libnyoci" ] \
&& [ $TRAVIS_BRANCH = "master" ] \
&& [ $TRAVIS_OS_NAME = "linux" ] \
&& [ $TRAVIS_PULL_REQUEST = "false" ] \
&& [ $BUILD_MAKEPATH = "build" ] \
&& [ $BUILD_MAKEARGS = "distcheck" ] \
&& prep_ssh_key #
then
git fetch --unshallow origin || die
git fetch origin scripts:scripts ${AUTOCONF_BRANCH}:${AUTOCONF_BRANCH} ${TRAVIS_BRANCH}:${TRAVIS_BRANCH} || die
PREVREV="`git rev-parse ${AUTOCONF_BRANCH}`"
echo "Checking for update to '${AUTOCONF_BRANCH}'..."
git checkout scripts || die
NO_PUSH=1 ./update-autoconf-master ${TRAVIS_BRANCH} || die
CHANGED_LINES=`git diff "${PREVREV}".."${AUTOCONF_BRANCH}" | grep '^[-+]' | grep -v '^[-+]SOURCE_VERSION=' | wc -l`
if [ "$CHANGED_LINES" -gt "2" ]
then
echo "Branch '${AUTOCONF_BRANCH}' is OUT OF DATE."
git checkout "${TRAVIS_BRANCH}" || die
git push git@github.com:${TRAVIS_REPO_SLUG}.git ${AUTOCONF_BRANCH}:${AUTOCONF_BRANCH} || die
else
echo "Branch '${AUTOCONF_BRANCH}' is still up-to-date."
fi
else
echo "Skipping update of '${AUTOCONF_BRANCH}'."
fi
exit 0
View
@@ -0,0 +1,16 @@
#!/bin/sh
die() {
echo " *** ERROR: " $*
exit 1
}
set -x
[ $TRAVIS_OS_NAME != linux ] || {
sudo apt-get -y update || die
sudo apt-get -y install bsdtar autoconf-archive automake autoconf || die
}
[ $TRAVIS_OS_NAME != osx ] || {
brew install autoconf-archive || die
}
View
@@ -0,0 +1,18 @@
#!/bin/sh
die() {
echo " *** ERROR: " $*
exit 1
}
set -x
if [ $BUILD_PLATFORM = contiki ]
then
git clone git://github.com/contiki-os/contiki.git || die
cd contiki || die
git checkout 1d69099 || die
cd .. || die
fi
exit 0
View
@@ -0,0 +1,2 @@
FVȕU���I�j]�x2��OP/c�g��9�E�����[N�@�\TTQ�c��Tд��s#��~}�Үr�4�U//���:z7F�e��~u������47�U��=g�(C<� �}��a�%�H'g�o~��9.?�
�o���zt��m��݌�e)�C�,��/��S�w`�63b��1�2)F��G��� F QƆ�.�)L���?i�;E����~74��VF���Zm?ګ'
View
@@ -0,0 +1 @@
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJklIcnzvTSSq98mJ6PZGMPMtfXsXwH3m796tLRvl4bA9KCWkf6DlA0/mSVk7ZC+g9aEQcoTcjcs22RoISjXxOs= rquattle@rquattle-macpro.roam.corp.google.com
View
@@ -0,0 +1,23 @@
#!/bin/sh
PREV_PATH="`pwd`"
die() {
echo " *** ERROR: " $*
exit 1
}
if [ $BUILD_PLATFORM = unix ]
then
[ -e configure ] || ./bootstrap.sh || die
mkdir -p "${BUILD_MAKEPATH}" || die
cd "${BUILD_MAKEPATH}" || die
../configure ${BUILD_CONFIGFLAGS} || die
cd "${PREV_PATH}" || die
fi
make -C "${BUILD_MAKEPATH}" ${BUILD_MAKEARGS} || die
View
@@ -0,0 +1,150 @@
indent_with_tabs = 1 # 1=indent to level only, 2=indent with tabs
input_tab_size = 4 # original tab size
output_tab_size = 4 # new tab size
indent_columns = output_tab_size
indent_label = 1 # pos: absolute col, neg: relative column
nl_max = 3
#
# inter-symbol newlines
#
nl_enum_brace = remove # "enum {" vs "enum \n {"
nl_union_brace = remove # "union {" vs "union \n {"
nl_struct_brace = remove # "struct {" vs "struct \n {"
nl_do_brace = remove # "do {" vs "do \n {"
nl_if_brace = remove # "if () {" vs "if () \n {"
nl_for_brace = remove # "for () {" vs "for () \n {"
nl_else_brace = remove # "else {" vs "else \n {"
nl_while_brace = remove # "while () {" vs "while () \n {"
nl_switch_brace = remove # "switch () {" vs "switch () \n {"
nl_brace_while = remove # "} while" vs "} \n while" - cuddle while
nl_brace_else = remove # "} else" vs "} \n else" - cuddle else
sp_brace_else = force
sp_else_brace = force
nl_func_var_def_blk = 1
nl_fcall_brace = remove # "list_for_each() {" vs "list_for_each()\n{"
nl_fdef_brace = remove # "int foo() {" vs "int foo()\n{"
# nl_after_return = TRUE;
# nl_before_case = 1
code_width = 75
nl_func_leave_one_liners = true
ls_func_split_full = true
ls_for_split_full = true
nl_func_def_start = force
nl_func_def_start_single = remove
nl_func_decl_start = force
nl_func_decl_start_single = remove
nl_func_def_end = force
nl_func_def_end_single = remove
nl_after_func_proto = 1
nl_after_func_proto_group = 1
#
# Source code modifications
#
mod_paren_on_return = remove # "return 1;" vs "return (1);"
#mod_full_brace_if = remove # "if (a) a--;" vs "if (a) { a--; }"
mod_full_brace_if_chain = true
mod_full_brace_for = ignore # "for () a--;" vs "for () { a--; }"
mod_full_brace_do = ignore # "do a--; while ();" vs "do { a--; } while ();"
mod_full_brace_while = ignore # "while (a) a--;" vs "while (a) { a--; }"
mod_full_brace_nl = 3 # don't remove if more than 3 newlines
#
# inter-character spacing options
#
sp_return_paren = force # "return (1);" vs "return(1);"
sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
sp_before_sparen = remove # "if (" vs "if("
sp_after_sparen = force # "if () {" vs "if (){"
sp_after_cast = remove # "(int) a" vs "(int)a"
sp_inside_braces = force # "{ 1 }" vs "{1}"
sp_inside_braces_struct = force # "{ 1 }" vs "{1}"
sp_inside_braces_enum = force # "{ 1 }" vs "{1}"
sp_assign = force
sp_arith = force
sp_bool = force
sp_compare = force
sp_assign = force
sp_after_comma = force
sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
sp_func_call_paren = remove # "foo (" vs "foo("
sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
sp_before_ptr_star = ignore
sp_after_ptr_star = ignore
#
# Aligning stuff
#
align_with_tabs = TRUE # use tabs to align
align_on_tabstop = TRUE # align on tabstops
# align_keep_tabs = true
align_enum_equ_span = 4 # '=' in enum definition
# align_nl_cont = TRUE
# align_var_def_span = 2
# align_var_def_inline = TRUE
# align_var_def_star = FALSE
# align_var_def_colon = TRUE
# align_assign_span = 1
align_struct_init_span = 3 # align stuff in a structure init '= { }'
align_right_cmt_span = 3
# align_pp_define_span = 8;
# align_pp_define_gap = 4;
cmt_star_cont = false
# indent_brace = 0
nl_func_paren = remove
#nl_func_decl_start = ignore
#nl_func_decl_empty = remove
#nl_func_decl_args = remove
#nl_func_decl_end = remove
sp_inside_paren = remove
sp_inside_square = remove
sp_inside_paren_cast = remove
sp_inside_fparen = remove
sp_inside_sparen = remove
sp_paren_paren = remove
sp_between_ptr_star = remove
align_func_params = true
align_var_struct_span = 6
eat_blanks_after_open_brace = true
eat_blanks_before_close_brace = true
pp_indent = ignore
indent_continue = 4
nl_start_of_file = remove
nl_end_of_file = force
nl_end_of_file_min = 1
nl_comment_func_def = 1
align_var_def_star_style = 0
nl_define_macro = true
indent_func_call_param = true
indent_func_def_param = true
indent_func_proto_param = true
indent_var_def_cont = true
indent_paren_close = 2
sp_fparen_brace = force
#align_nl_cont = true
nl_multi_line_define = true
View
No changes.
Oops, something went wrong.

0 comments on commit c800caa

Please sign in to comment.