Browse Source

make: Global change: Move all public headers to include folder. Change source to including public headers using #include <ndn-cpp/*>. Split some header files to minimize exposing C .h files.

pull/1/head
Jeff Thompson 12 years ago
parent
commit
25b4e61ced
  1. 129
      Makefile.am
  2. 166
      Makefile.in
  3. 53
      include/Makefile.am
  4. 65
      include/Makefile.in
  5. 3
      include/ndn-cpp/c/common.h
  6. 27
      include/ndn-cpp/c/data-types.h
  7. 39
      include/ndn-cpp/c/encoding/element-listener.h
  8. 0
      include/ndn-cpp/c/forwarding-flags.h
  9. 25
      include/ndn-cpp/c/interest-types.h
  10. 31
      include/ndn-cpp/c/key-types.h
  11. 3
      include/ndn-cpp/common.hpp
  12. 8
      include/ndn-cpp/data.hpp
  13. 1
      include/ndn-cpp/encoding/binary-xml-wire-format.hpp
  14. 7
      include/ndn-cpp/encoding/element-listener.hpp
  15. 1
      include/ndn-cpp/encoding/wire-format.hpp
  16. 1
      include/ndn-cpp/face.hpp
  17. 5
      include/ndn-cpp/forwarding-entry.hpp
  18. 0
      include/ndn-cpp/forwarding-flags.hpp
  19. 15
      include/ndn-cpp/interest.hpp
  20. 5
      include/ndn-cpp/key.hpp
  21. 18
      include/ndn-cpp/name.hpp
  22. 9
      include/ndn-cpp/node.hpp
  23. 15
      include/ndn-cpp/publisher-public-key-digest.hpp
  24. 0
      include/ndn-cpp/security/certificate/certificate.hpp
  25. 0
      include/ndn-cpp/security/certificate/oid.hpp
  26. 0
      include/ndn-cpp/security/certificate/public-key.hpp
  27. 0
      include/ndn-cpp/security/encryption/encryption-manager.hpp
  28. 0
      include/ndn-cpp/security/identity/basic-identity-storage.hpp
  29. 1
      include/ndn-cpp/security/identity/identity-manager.hpp
  30. 0
      include/ndn-cpp/security/identity/identity-storage.hpp
  31. 0
      include/ndn-cpp/security/identity/memory-identity-storage.hpp
  32. 0
      include/ndn-cpp/security/identity/memory-private-key-storage.hpp
  33. 0
      include/ndn-cpp/security/identity/osx-private-key-storage.hpp
  34. 1
      include/ndn-cpp/security/identity/private-key-storage.hpp
  35. 1
      include/ndn-cpp/security/key-chain.hpp
  36. 0
      include/ndn-cpp/security/policy/no-verify-policy-manager.hpp
  37. 0
      include/ndn-cpp/security/policy/policy-manager.hpp
  38. 0
      include/ndn-cpp/security/security-common.hpp
  39. 0
      include/ndn-cpp/security/security-exception.hpp
  40. 1
      include/ndn-cpp/sha256-with-rsa-signature.hpp
  41. 18
      include/ndn-cpp/transport/tcp-transport.hpp
  42. 1
      include/ndn-cpp/transport/transport.hpp
  43. 18
      include/ndn-cpp/transport/udp-transport.hpp
  44. 18
      include/ndn-cpp/util/blob.hpp
  45. 1
      include/ndn-cpp/util/signed-blob.hpp
  46. 10
      ndn-cpp/c/data.h
  47. 2
      ndn-cpp/c/encoding/binary-xml-decoder.h
  48. 24
      ndn-cpp/c/encoding/binary-xml-element-reader.h
  49. 2
      ndn-cpp/c/encoding/binary-xml-key.h
  50. 2
      ndn-cpp/c/encoding/binary-xml-structure-decoder.h
  51. 4
      ndn-cpp/c/forwarding-entry.h
  52. 1
      ndn-cpp/c/forwarding-flags.c
  53. 6
      ndn-cpp/c/interest.h
  54. 14
      ndn-cpp/c/key.h
  55. 1
      ndn-cpp/c/name.h
  56. 2
      ndn-cpp/c/publisher-public-key-digest.h
  57. 2
      ndn-cpp/c/transport/socket-transport.h
  58. 2
      ndn-cpp/c/util/blob.h
  59. 2
      ndn-cpp/c/util/crypto.h
  60. 2
      ndn-cpp/c/util/ndn_memory.h
  61. 3
      ndn-cpp/common.cpp
  62. 8
      ndn-cpp/data.cpp
  63. 1
      ndn-cpp/encoding/binary-xml-decoder.hpp
  64. 3
      ndn-cpp/encoding/binary-xml-encoder.hpp
  65. 1
      ndn-cpp/encoding/binary-xml-structure-decoder.hpp
  66. 9
      ndn-cpp/encoding/binary-xml-wire-format.cpp
  67. 3
      ndn-cpp/encoding/element-listener.cpp
  68. 3
      ndn-cpp/encoding/wire-format.cpp
  69. 3
      ndn-cpp/face.cpp
  70. 6
      ndn-cpp/forwarding-entry.cpp
  71. 14
      ndn-cpp/interest.cpp
  72. 8
      ndn-cpp/key.cpp
  73. 18
      ndn-cpp/name.cpp
  74. 20
      ndn-cpp/node.cpp
  75. 27
      ndn-cpp/publisher-public-key-digest.cpp
  76. 2
      ndn-cpp/security/certificate/oid.cpp
  77. 4
      ndn-cpp/security/certificate/public-key.cpp
  78. 4
      ndn-cpp/security/identity/basic-identity-storage.cpp
  79. 7
      ndn-cpp/security/identity/identity-manager.cpp
  80. 4
      ndn-cpp/security/identity/memory-identity-storage.cpp
  81. 4
      ndn-cpp/security/identity/memory-private-key-storage.cpp
  82. 4
      ndn-cpp/security/identity/osx-private-key-storage.cpp
  83. 9
      ndn-cpp/security/key-chain.cpp
  84. 2
      ndn-cpp/security/policy/no-verify-policy-manager.cpp
  85. 2
      ndn-cpp/security/security-exception.cpp
  86. 4
      ndn-cpp/sha256-with-rsa-signature.cpp
  87. 32
      ndn-cpp/transport/tcp-transport.cpp
  88. 3
      ndn-cpp/transport/transport.cpp
  89. 32
      ndn-cpp/transport/udp-transport.cpp
  90. 30
      ndn-cpp/util/blob.cpp
  91. 1
      ndn-cpp/util/changed-event.cpp
  92. 3
      ndn-cpp/util/changed-event.hpp
  93. 1
      ndn-cpp/util/dynamic-uint8-vector.cpp
  94. 3
      ndn-cpp/util/dynamic-uint8-vector.hpp
  95. 2
      ndn-cpp/util/logging.hpp
  96. 12
      tests/test-encode-decode-data.cpp
  97. 8
      tests/test-encode-decode-forwarding-entry.cpp
  98. 2
      tests/test-encode-decode-interest.cpp
  99. 2
      tests/test-get-async.cpp
  100. 10
      tests/test-publish-async.cpp

129
Makefile.am

@ -17,16 +17,60 @@ lib_LTLIBRARIES = libndn-c.la libndn-cpp.la
bin_PROGRAMS = bin/test-encode-decode-forwarding-entry bin/test-encode-decode-interest bin/test-encode-decode-data \
bin/test-get-async bin/test-publish-async
# Public C headers.
ndn_cpp_c_headers = \
include/ndn-cpp/ndn-cpp-config.h \
include/ndn-cpp/c/common.h \
include/ndn-cpp/c/data-types.h \
include/ndn-cpp/c/forwarding-flags.h \
include/ndn-cpp/c/interest-types.h \
include/ndn-cpp/c/key-types.h \
include/ndn-cpp/c/encoding/element-listener.h
# Public C++ headers.
ndn_cpp_cpp_headers = \
include/ndn-cpp/common.hpp \
include/ndn-cpp/data.hpp \
include/ndn-cpp/face.hpp \
include/ndn-cpp/forwarding-entry.hpp \
include/ndn-cpp/forwarding-flags.hpp \
include/ndn-cpp/interest.hpp \
include/ndn-cpp/key.hpp \
include/ndn-cpp/name.hpp \
include/ndn-cpp/node.hpp \
include/ndn-cpp/publisher-public-key-digest.hpp \
include/ndn-cpp/sha256-with-rsa-signature.hpp \
include/ndn-cpp/encoding/element-listener.hpp \
include/ndn-cpp/encoding/binary-xml-wire-format.hpp \
include/ndn-cpp/encoding/wire-format.hpp \
include/ndn-cpp/security/security-common.hpp \
include/ndn-cpp/security/key-chain.hpp \
include/ndn-cpp/security/security-exception.hpp \
include/ndn-cpp/security/certificate/oid.hpp \
include/ndn-cpp/security/certificate/public-key.hpp \
include/ndn-cpp/security/encryption/encryption-manager.hpp \
include/ndn-cpp/security/identity/basic-identity-storage.hpp \
include/ndn-cpp/security/identity/identity-manager.hpp \
include/ndn-cpp/security/identity/identity-storage.hpp \
include/ndn-cpp/security/identity/memory-identity-storage.hpp \
include/ndn-cpp/security/identity/memory-private-key-storage.hpp \
include/ndn-cpp/security/identity/osx-private-key-storage.hpp \
include/ndn-cpp/security/identity/private-key-storage.hpp \
include/ndn-cpp/security/policy/no-verify-policy-manager.hpp \
include/ndn-cpp/security/policy/policy-manager.hpp \
include/ndn-cpp/transport/tcp-transport.hpp \
include/ndn-cpp/transport/transport.hpp \
include/ndn-cpp/transport/udp-transport.hpp \
include/ndn-cpp/util/blob.hpp \
include/ndn-cpp/util/signed-blob.hpp
# Just the C code.
libndn_c_la_SOURCES = \
ndn-cpp/ndn-cpp-config.h \
ndn-cpp/c/common.h \
libndn_c_la_SOURCES = $(ndn_cpp_c_headers) \
ndn-cpp/c/data.h \
ndn-cpp/c/errors.c ndn-cpp/c/errors.h \
ndn-cpp/c/forwarding-entry.h \
ndn-cpp/c/forwarding-flags.c ndn-cpp/c/forwarding-flags.h \
ndn-cpp/c/forwarding-flags.c \
ndn-cpp/c/interest.c ndn-cpp/c/interest.h \
ndn-cpp/c/key.h \
ndn-cpp/c/name.c ndn-cpp/c/name.h \
ndn-cpp/c/publisher-public-key-digest.h \
ndn-cpp/c/encoding/binary-xml.h \
@ -50,51 +94,40 @@ libndn_c_la_SOURCES = \
ndn-cpp/c/util/ndn_realloc.c ndn-cpp/c/util/ndn_realloc.h
# C++ code and also the C code.
libndn_cpp_la_SOURCES = \
$(libndn_c_la_SOURCES) \
ndn-cpp/ndn-cpp-config.h \
ndn-cpp/c/common.h \
ndn-cpp/common.hpp ndn-cpp/common.cpp \
ndn-cpp/data.cpp ndn-cpp/c/data.h ndn-cpp/data.hpp \
ndn-cpp/face.cpp ndn-cpp/face.hpp \
ndn-cpp/forwarding-entry.cpp ndn-cpp/c/forwarding-entry.h ndn-cpp/forwarding-entry.hpp \
ndn-cpp/c/forwarding-entry.h ndn-cpp/forwarding-entry.hpp \
ndn-cpp/interest.cpp ndn-cpp/c/interest.h ndn-cpp/interest.hpp \
ndn-cpp/key.cpp ndn-cpp/c/key.h ndn-cpp/key.hpp \
ndn-cpp/name.cpp ndn-cpp/c/name.h ndn-cpp/name.hpp \
ndn-cpp/node.cpp ndn-cpp/node.hpp \
ndn-cpp/publisher-public-key-digest.hpp \
ndn-cpp/sha256-with-rsa-signature.cpp ndn-cpp/sha256-with-rsa-signature.hpp \
ndn-cpp/c/encoding/binary-xml.h \
ndn-cpp/c/encoding/binary-xml-decoder.h ndn-cpp/encoding/binary-xml-decoder.hpp \
ndn-cpp/c/encoding/binary-xml-element-reader.h ndn-cpp/encoding/binary-xml-element-reader.cpp ndn-cpp/encoding/binary-xml-element-reader.hpp \
ndn-cpp/c/encoding/binary-xml-encoder.h ndn-cpp/encoding/binary-xml-encoder.hpp ndn-cpp/c/util/dynamic-uint8-array.h \
ndn-cpp/c/encoding/binary-xml-structure-decoder.h ndn-cpp/encoding/binary-xml-structure-decoder.hpp \
ndn-cpp/encoding/binary-xml-wire-format.cpp ndn-cpp/c/encoding/binary-xml-name.h ndn-cpp/encoding/binary-xml-wire-format.hpp \
ndn-cpp/encoding/wire-format.cpp ndn-cpp/encoding/wire-format.hpp \
ndn-cpp/security/security-common.hpp \
ndn-cpp/security/key-chain.cpp ndn-cpp/security/key-chain.hpp \
ndn-cpp/security/security-exception.cpp ndn-cpp/security/security-exception.hpp \
ndn-cpp/security/certificate/oid.cpp ndn-cpp/security/certificate/oid.hpp \
ndn-cpp/security/certificate/public-key.cpp ndn-cpp/security/certificate/public-key.hpp \
ndn-cpp/security/encryption/encryption-manager.hpp \
ndn-cpp/security/identity/basic-identity-storage.cpp ndn-cpp/security/identity/basic-identity-storage.hpp \
ndn-cpp/security/identity/identity-manager.cpp ndn-cpp/security/identity/identity-manager.hpp \
ndn-cpp/security/identity/identity-storage.hpp \
ndn-cpp/security/identity/memory-identity-storage.cpp ndn-cpp/security/identity/memory-identity-storage.hpp \
ndn-cpp/security/identity/memory-private-key-storage.cpp ndn-cpp/security/identity/memory-private-key-storage.hpp \
ndn-cpp/security/identity/osx-private-key-storage.cpp ndn-cpp/security/identity/osx-private-key-storage.hpp \
ndn-cpp/security/identity/private-key-storage.hpp \
ndn-cpp/security/policy/no-verify-policy-manager.cpp ndn-cpp/security/policy/no-verify-policy-manager.hpp \
ndn-cpp/security/policy/policy-manager.hpp \
ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/tcp-transport.h ndn-cpp/transport/tcp-transport.cpp ndn-cpp/transport/tcp-transport.hpp \
ndn-cpp/transport/transport.cpp ndn-cpp/transport/transport.hpp \
ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/udp-transport.h ndn-cpp/transport/udp-transport.cpp ndn-cpp/transport/udp-transport.hpp \
ndn-cpp/util/blob.hpp \
libndn_cpp_la_SOURCES = $(libndn_c_la_SOURCES) $(ndn_cpp_cpp_headers) \
ndn-cpp/common.cpp \
ndn-cpp/data.cpp \
ndn-cpp/face.cpp \
ndn-cpp/forwarding-entry.cpp \
ndn-cpp/interest.cpp \
ndn-cpp/key.cpp \
ndn-cpp/name.cpp \
ndn-cpp/node.cpp \
ndn-cpp/publisher-public-key-digest.cpp \
ndn-cpp/sha256-with-rsa-signature.cpp \
ndn-cpp/encoding/binary-xml-decoder.hpp \
ndn-cpp/encoding/binary-xml-encoder.hpp \
ndn-cpp/encoding/binary-xml-structure-decoder.hpp \
ndn-cpp/encoding/binary-xml-wire-format.cpp \
ndn-cpp/encoding/element-listener.cpp \
ndn-cpp/encoding/wire-format.cpp \
ndn-cpp/security/key-chain.cpp \
ndn-cpp/security/security-exception.cpp \
ndn-cpp/security/certificate/oid.cpp \
ndn-cpp/security/certificate/public-key.cpp \
ndn-cpp/security/identity/basic-identity-storage.cpp \
ndn-cpp/security/identity/identity-manager.cpp \
ndn-cpp/security/identity/memory-identity-storage.cpp \
ndn-cpp/security/identity/memory-private-key-storage.cpp \
ndn-cpp/security/identity/osx-private-key-storage.cpp \
ndn-cpp/security/policy/no-verify-policy-manager.cpp \
ndn-cpp/transport/tcp-transport.cpp \
ndn-cpp/transport/transport.cpp \
ndn-cpp/transport/udp-transport.cpp \
ndn-cpp/util/blob.cpp \
ndn-cpp/util/changed-event.cpp ndn-cpp/util/changed-event.hpp \
ndn-cpp/util/dynamic-uint8-vector.cpp ndn-cpp/util/dynamic-uint8-vector.hpp \
ndn-cpp/util/logging.cpp ndn-cpp/util/logging.hpp \
ndn-cpp/util/signed-blob.hpp
ndn-cpp/util/logging.cpp ndn-cpp/util/logging.hpp
bin_test_encode_decode_forwarding_entry_SOURCES = tests/test-encode-decode-forwarding-entry.cpp
bin_test_encode_decode_forwarding_entry_LDADD = libndn-cpp.la

166
Makefile.in

@ -135,8 +135,9 @@ am__uninstall_files_from_dir = { \
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libndn_c_la_LIBADD =
am__objects_1 =
am__dirstamp = $(am__leading_dot)dirstamp
am_libndn_c_la_OBJECTS = ndn-cpp/c/errors.lo \
am_libndn_c_la_OBJECTS = $(am__objects_1) ndn-cpp/c/errors.lo \
ndn-cpp/c/forwarding-flags.lo ndn-cpp/c/interest.lo \
ndn-cpp/c/name.lo ndn-cpp/c/encoding/binary-xml-data.lo \
ndn-cpp/c/encoding/binary-xml-decoder.lo \
@ -157,9 +158,9 @@ am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libndn_cpp_la_LIBADD =
am__objects_1 = ndn-cpp/c/errors.lo ndn-cpp/c/forwarding-flags.lo \
ndn-cpp/c/interest.lo ndn-cpp/c/name.lo \
ndn-cpp/c/encoding/binary-xml-data.lo \
am__objects_2 = $(am__objects_1) ndn-cpp/c/errors.lo \
ndn-cpp/c/forwarding-flags.lo ndn-cpp/c/interest.lo \
ndn-cpp/c/name.lo ndn-cpp/c/encoding/binary-xml-data.lo \
ndn-cpp/c/encoding/binary-xml-decoder.lo \
ndn-cpp/c/encoding/binary-xml-element-reader.lo \
ndn-cpp/c/encoding/binary-xml-encoder.lo \
@ -172,12 +173,14 @@ am__objects_1 = ndn-cpp/c/errors.lo ndn-cpp/c/forwarding-flags.lo \
ndn-cpp/c/transport/socket-transport.lo \
ndn-cpp/c/util/crypto.lo ndn-cpp/c/util/dynamic-uint8-array.lo \
ndn-cpp/c/util/ndn_memory.lo ndn-cpp/c/util/ndn_realloc.lo
am_libndn_cpp_la_OBJECTS = $(am__objects_1) ndn-cpp/common.lo \
ndn-cpp/data.lo ndn-cpp/face.lo ndn-cpp/forwarding-entry.lo \
ndn-cpp/interest.lo ndn-cpp/key.lo ndn-cpp/name.lo \
ndn-cpp/node.lo ndn-cpp/sha256-with-rsa-signature.lo \
ndn-cpp/encoding/binary-xml-element-reader.lo \
am_libndn_cpp_la_OBJECTS = $(am__objects_2) $(am__objects_1) \
ndn-cpp/common.lo ndn-cpp/data.lo ndn-cpp/face.lo \
ndn-cpp/forwarding-entry.lo ndn-cpp/interest.lo ndn-cpp/key.lo \
ndn-cpp/name.lo ndn-cpp/node.lo \
ndn-cpp/publisher-public-key-digest.lo \
ndn-cpp/sha256-with-rsa-signature.lo \
ndn-cpp/encoding/binary-xml-wire-format.lo \
ndn-cpp/encoding/element-listener.lo \
ndn-cpp/encoding/wire-format.lo ndn-cpp/security/key-chain.lo \
ndn-cpp/security/security-exception.lo \
ndn-cpp/security/certificate/oid.lo \
@ -190,7 +193,7 @@ am_libndn_cpp_la_OBJECTS = $(am__objects_1) ndn-cpp/common.lo \
ndn-cpp/security/policy/no-verify-policy-manager.lo \
ndn-cpp/transport/tcp-transport.lo \
ndn-cpp/transport/transport.lo \
ndn-cpp/transport/udp-transport.lo \
ndn-cpp/transport/udp-transport.lo ndn-cpp/util/blob.lo \
ndn-cpp/util/changed-event.lo \
ndn-cpp/util/dynamic-uint8-vector.lo ndn-cpp/util/logging.lo
libndn_cpp_la_OBJECTS = $(am_libndn_cpp_la_OBJECTS)
@ -549,16 +552,62 @@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
SUBDIRS = include
lib_LTLIBRARIES = libndn-c.la libndn-cpp.la
# Public C headers.
ndn_cpp_c_headers = \
include/ndn-cpp/ndn-cpp-config.h \
include/ndn-cpp/c/common.h \
include/ndn-cpp/c/data-types.h \
include/ndn-cpp/c/forwarding-flags.h \
include/ndn-cpp/c/interest-types.h \
include/ndn-cpp/c/key-types.h \
include/ndn-cpp/c/encoding/element-listener.h
# Public C++ headers.
ndn_cpp_cpp_headers = \
include/ndn-cpp/common.hpp \
include/ndn-cpp/data.hpp \
include/ndn-cpp/face.hpp \
include/ndn-cpp/forwarding-entry.hpp \
include/ndn-cpp/forwarding-flags.hpp \
include/ndn-cpp/interest.hpp \
include/ndn-cpp/key.hpp \
include/ndn-cpp/name.hpp \
include/ndn-cpp/node.hpp \
include/ndn-cpp/publisher-public-key-digest.hpp \
include/ndn-cpp/sha256-with-rsa-signature.hpp \
include/ndn-cpp/encoding/element-listener.hpp \
include/ndn-cpp/encoding/binary-xml-wire-format.hpp \
include/ndn-cpp/encoding/wire-format.hpp \
include/ndn-cpp/security/security-common.hpp \
include/ndn-cpp/security/key-chain.hpp \
include/ndn-cpp/security/security-exception.hpp \
include/ndn-cpp/security/certificate/oid.hpp \
include/ndn-cpp/security/certificate/public-key.hpp \
include/ndn-cpp/security/encryption/encryption-manager.hpp \
include/ndn-cpp/security/identity/basic-identity-storage.hpp \
include/ndn-cpp/security/identity/identity-manager.hpp \
include/ndn-cpp/security/identity/identity-storage.hpp \
include/ndn-cpp/security/identity/memory-identity-storage.hpp \
include/ndn-cpp/security/identity/memory-private-key-storage.hpp \
include/ndn-cpp/security/identity/osx-private-key-storage.hpp \
include/ndn-cpp/security/identity/private-key-storage.hpp \
include/ndn-cpp/security/policy/no-verify-policy-manager.hpp \
include/ndn-cpp/security/policy/policy-manager.hpp \
include/ndn-cpp/transport/tcp-transport.hpp \
include/ndn-cpp/transport/transport.hpp \
include/ndn-cpp/transport/udp-transport.hpp \
include/ndn-cpp/util/blob.hpp \
include/ndn-cpp/util/signed-blob.hpp
# Just the C code.
libndn_c_la_SOURCES = \
ndn-cpp/ndn-cpp-config.h \
ndn-cpp/c/common.h \
libndn_c_la_SOURCES = $(ndn_cpp_c_headers) \
ndn-cpp/c/data.h \
ndn-cpp/c/errors.c ndn-cpp/c/errors.h \
ndn-cpp/c/forwarding-entry.h \
ndn-cpp/c/forwarding-flags.c ndn-cpp/c/forwarding-flags.h \
ndn-cpp/c/forwarding-flags.c \
ndn-cpp/c/interest.c ndn-cpp/c/interest.h \
ndn-cpp/c/key.h \
ndn-cpp/c/name.c ndn-cpp/c/name.h \
ndn-cpp/c/publisher-public-key-digest.h \
ndn-cpp/c/encoding/binary-xml.h \
@ -583,51 +632,40 @@ libndn_c_la_SOURCES = \
# C++ code and also the C code.
libndn_cpp_la_SOURCES = \
$(libndn_c_la_SOURCES) \
ndn-cpp/ndn-cpp-config.h \
ndn-cpp/c/common.h \
ndn-cpp/common.hpp ndn-cpp/common.cpp \
ndn-cpp/data.cpp ndn-cpp/c/data.h ndn-cpp/data.hpp \
ndn-cpp/face.cpp ndn-cpp/face.hpp \
ndn-cpp/forwarding-entry.cpp ndn-cpp/c/forwarding-entry.h ndn-cpp/forwarding-entry.hpp \
ndn-cpp/c/forwarding-entry.h ndn-cpp/forwarding-entry.hpp \
ndn-cpp/interest.cpp ndn-cpp/c/interest.h ndn-cpp/interest.hpp \
ndn-cpp/key.cpp ndn-cpp/c/key.h ndn-cpp/key.hpp \
ndn-cpp/name.cpp ndn-cpp/c/name.h ndn-cpp/name.hpp \
ndn-cpp/node.cpp ndn-cpp/node.hpp \
ndn-cpp/publisher-public-key-digest.hpp \
ndn-cpp/sha256-with-rsa-signature.cpp ndn-cpp/sha256-with-rsa-signature.hpp \
ndn-cpp/c/encoding/binary-xml.h \
ndn-cpp/c/encoding/binary-xml-decoder.h ndn-cpp/encoding/binary-xml-decoder.hpp \
ndn-cpp/c/encoding/binary-xml-element-reader.h ndn-cpp/encoding/binary-xml-element-reader.cpp ndn-cpp/encoding/binary-xml-element-reader.hpp \
ndn-cpp/c/encoding/binary-xml-encoder.h ndn-cpp/encoding/binary-xml-encoder.hpp ndn-cpp/c/util/dynamic-uint8-array.h \
ndn-cpp/c/encoding/binary-xml-structure-decoder.h ndn-cpp/encoding/binary-xml-structure-decoder.hpp \
ndn-cpp/encoding/binary-xml-wire-format.cpp ndn-cpp/c/encoding/binary-xml-name.h ndn-cpp/encoding/binary-xml-wire-format.hpp \
ndn-cpp/encoding/wire-format.cpp ndn-cpp/encoding/wire-format.hpp \
ndn-cpp/security/security-common.hpp \
ndn-cpp/security/key-chain.cpp ndn-cpp/security/key-chain.hpp \
ndn-cpp/security/security-exception.cpp ndn-cpp/security/security-exception.hpp \
ndn-cpp/security/certificate/oid.cpp ndn-cpp/security/certificate/oid.hpp \
ndn-cpp/security/certificate/public-key.cpp ndn-cpp/security/certificate/public-key.hpp \
ndn-cpp/security/encryption/encryption-manager.hpp \
ndn-cpp/security/identity/basic-identity-storage.cpp ndn-cpp/security/identity/basic-identity-storage.hpp \
ndn-cpp/security/identity/identity-manager.cpp ndn-cpp/security/identity/identity-manager.hpp \
ndn-cpp/security/identity/identity-storage.hpp \
ndn-cpp/security/identity/memory-identity-storage.cpp ndn-cpp/security/identity/memory-identity-storage.hpp \
ndn-cpp/security/identity/memory-private-key-storage.cpp ndn-cpp/security/identity/memory-private-key-storage.hpp \
ndn-cpp/security/identity/osx-private-key-storage.cpp ndn-cpp/security/identity/osx-private-key-storage.hpp \
ndn-cpp/security/identity/private-key-storage.hpp \
ndn-cpp/security/policy/no-verify-policy-manager.cpp ndn-cpp/security/policy/no-verify-policy-manager.hpp \
ndn-cpp/security/policy/policy-manager.hpp \
ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/tcp-transport.h ndn-cpp/transport/tcp-transport.cpp ndn-cpp/transport/tcp-transport.hpp \
ndn-cpp/transport/transport.cpp ndn-cpp/transport/transport.hpp \
ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/udp-transport.h ndn-cpp/transport/udp-transport.cpp ndn-cpp/transport/udp-transport.hpp \
ndn-cpp/util/blob.hpp \
libndn_cpp_la_SOURCES = $(libndn_c_la_SOURCES) $(ndn_cpp_cpp_headers) \
ndn-cpp/common.cpp \
ndn-cpp/data.cpp \
ndn-cpp/face.cpp \
ndn-cpp/forwarding-entry.cpp \
ndn-cpp/interest.cpp \
ndn-cpp/key.cpp \
ndn-cpp/name.cpp \
ndn-cpp/node.cpp \
ndn-cpp/publisher-public-key-digest.cpp \
ndn-cpp/sha256-with-rsa-signature.cpp \
ndn-cpp/encoding/binary-xml-decoder.hpp \
ndn-cpp/encoding/binary-xml-encoder.hpp \
ndn-cpp/encoding/binary-xml-structure-decoder.hpp \
ndn-cpp/encoding/binary-xml-wire-format.cpp \
ndn-cpp/encoding/element-listener.cpp \
ndn-cpp/encoding/wire-format.cpp \
ndn-cpp/security/key-chain.cpp \
ndn-cpp/security/security-exception.cpp \
ndn-cpp/security/certificate/oid.cpp \
ndn-cpp/security/certificate/public-key.cpp \
ndn-cpp/security/identity/basic-identity-storage.cpp \
ndn-cpp/security/identity/identity-manager.cpp \
ndn-cpp/security/identity/memory-identity-storage.cpp \
ndn-cpp/security/identity/memory-private-key-storage.cpp \
ndn-cpp/security/identity/osx-private-key-storage.cpp \
ndn-cpp/security/policy/no-verify-policy-manager.cpp \
ndn-cpp/transport/tcp-transport.cpp \
ndn-cpp/transport/transport.cpp \
ndn-cpp/transport/udp-transport.cpp \
ndn-cpp/util/blob.cpp \
ndn-cpp/util/changed-event.cpp ndn-cpp/util/changed-event.hpp \
ndn-cpp/util/dynamic-uint8-vector.cpp ndn-cpp/util/dynamic-uint8-vector.hpp \
ndn-cpp/util/logging.cpp ndn-cpp/util/logging.hpp \
ndn-cpp/util/signed-blob.hpp
ndn-cpp/util/logging.cpp ndn-cpp/util/logging.hpp
bin_test_encode_decode_forwarding_entry_SOURCES = tests/test-encode-decode-forwarding-entry.cpp
bin_test_encode_decode_forwarding_entry_LDADD = libndn-cpp.la
@ -812,6 +850,8 @@ ndn-cpp/name.lo: ndn-cpp/$(am__dirstamp) \
ndn-cpp/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/node.lo: ndn-cpp/$(am__dirstamp) \
ndn-cpp/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/publisher-public-key-digest.lo: ndn-cpp/$(am__dirstamp) \
ndn-cpp/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/sha256-with-rsa-signature.lo: ndn-cpp/$(am__dirstamp) \
ndn-cpp/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/encoding/$(am__dirstamp):
@ -820,10 +860,10 @@ ndn-cpp/encoding/$(am__dirstamp):
ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) ndn-cpp/encoding/$(DEPDIR)
@: > ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/encoding/binary-xml-element-reader.lo: \
ndn-cpp/encoding/binary-xml-wire-format.lo: \
ndn-cpp/encoding/$(am__dirstamp) \
ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/encoding/binary-xml-wire-format.lo: \
ndn-cpp/encoding/element-listener.lo: \
ndn-cpp/encoding/$(am__dirstamp) \
ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/encoding/wire-format.lo: ndn-cpp/encoding/$(am__dirstamp) \
@ -899,6 +939,8 @@ ndn-cpp/util/$(am__dirstamp):
ndn-cpp/util/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) ndn-cpp/util/$(DEPDIR)
@: > ndn-cpp/util/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/util/blob.lo: ndn-cpp/util/$(am__dirstamp) \
ndn-cpp/util/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/util/changed-event.lo: ndn-cpp/util/$(am__dirstamp) \
ndn-cpp/util/$(DEPDIR)/$(am__dirstamp)
ndn-cpp/util/dynamic-uint8-vector.lo: ndn-cpp/util/$(am__dirstamp) \
@ -1036,6 +1078,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/$(DEPDIR)/key.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/$(DEPDIR)/name.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/$(DEPDIR)/node.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/$(DEPDIR)/publisher-public-key-digest.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/$(DEPDIR)/sha256-with-rsa-signature.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/$(DEPDIR)/errors.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/$(DEPDIR)/forwarding-flags.Plo@am__quote@
@ -1056,8 +1099,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/util/$(DEPDIR)/dynamic-uint8-array.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/util/$(DEPDIR)/ndn_memory.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/util/$(DEPDIR)/ndn_realloc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/binary-xml-element-reader.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/binary-xml-wire-format.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/element-listener.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/wire-format.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/security/$(DEPDIR)/key-chain.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/security/$(DEPDIR)/security-exception.Plo@am__quote@
@ -1072,6 +1115,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/transport/$(DEPDIR)/tcp-transport.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/transport/$(DEPDIR)/transport.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/transport/$(DEPDIR)/udp-transport.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/util/$(DEPDIR)/blob.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/util/$(DEPDIR)/changed-event.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/util/$(DEPDIR)/dynamic-uint8-vector.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/util/$(DEPDIR)/logging.Plo@am__quote@

53
include/Makefile.am

@ -3,7 +3,55 @@
# These files are included by the application with, for example
# #include <ndn-cpp/namp.hpp>
# Internal include headers are not put in this public install directory.
ndnboost_files = \
# Public C headers.
ndn_cpp_c_headers = \
ndn-cpp/ndn-cpp-config.h \
ndn-cpp/c/common.h \
ndn-cpp/c/data-types.h \
ndn-cpp/c/forwarding-flags.h \
ndn-cpp/c/interest-types.h \
ndn-cpp/c/key-types.h \
ndn-cpp/c/encoding/element-listener.h
# Public C++ headers.
ndn_cpp_cpp_headers = \
ndn-cpp/common.hpp \
ndn-cpp/data.hpp \
ndn-cpp/face.hpp \
ndn-cpp/forwarding-entry.hpp \
ndn-cpp/forwarding-flags.hpp \
ndn-cpp/interest.hpp \
ndn-cpp/key.hpp \
ndn-cpp/name.hpp \
ndn-cpp/node.hpp \
ndn-cpp/publisher-public-key-digest.hpp \
ndn-cpp/sha256-with-rsa-signature.hpp \
ndn-cpp/encoding/element-listener.hpp \
ndn-cpp/encoding/binary-xml-wire-format.hpp \
ndn-cpp/encoding/wire-format.hpp \
ndn-cpp/security/security-common.hpp \
ndn-cpp/security/key-chain.hpp \
ndn-cpp/security/security-exception.hpp \
ndn-cpp/security/certificate/oid.hpp \
ndn-cpp/security/certificate/public-key.hpp \
ndn-cpp/security/encryption/encryption-manager.hpp \
ndn-cpp/security/identity/basic-identity-storage.hpp \
ndn-cpp/security/identity/identity-manager.hpp \
ndn-cpp/security/identity/identity-storage.hpp \
ndn-cpp/security/identity/memory-identity-storage.hpp \
ndn-cpp/security/identity/memory-private-key-storage.hpp \
ndn-cpp/security/identity/osx-private-key-storage.hpp \
ndn-cpp/security/identity/private-key-storage.hpp \
ndn-cpp/security/policy/no-verify-policy-manager.hpp \
ndn-cpp/security/policy/policy-manager.hpp \
ndn-cpp/transport/tcp-transport.hpp \
ndn-cpp/transport/transport.hpp \
ndn-cpp/transport/udp-transport.hpp \
ndn-cpp/util/blob.hpp \
ndn-cpp/util/signed-blob.hpp
ndnboost_headers = \
ndnboost/algorithm/string/compare.hpp \
ndnboost/algorithm/string/concept.hpp \
ndnboost/algorithm/string/config.hpp \
@ -1757,5 +1805,4 @@ ndnboost_files = \
ndnboost/visit_each.hpp \
ndnboost/weak_ptr.hpp
nobase_include_HEADERS = $(ndnboost_files) \
ndn-cpp/ndn-cpp-config.h
nobase_include_HEADERS = $(ndn_cpp_c_headers) $(ndn_cpp_cpp_headers) $(ndnboost_headers)

65
include/Makefile.in

@ -14,6 +14,12 @@
@SET_MAKE@
# "make install" will install these in the install include directory, for example
# /usr/local/include/ndn-cpp/name.hpp.
# These files are included by the application with, for example
# #include <ndn-cpp/namp.hpp>
# Internal include headers are not put in this public install directory.
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
@ -314,12 +320,55 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# "make install" will install these in the install include directory, for example
# /usr/local/include/ndn-cpp/name.hpp.
# These files are included by the application with, for example
# #include <ndn-cpp/namp.hpp>
# Internal include headers are not put in this public install directory.
ndnboost_files = \
# Public C headers.
ndn_cpp_c_headers = \
ndn-cpp/ndn-cpp-config.h \
ndn-cpp/c/common.h \
ndn-cpp/c/data-types.h \
ndn-cpp/c/forwarding-flags.h \
ndn-cpp/c/interest-types.h \
ndn-cpp/c/key-types.h \
ndn-cpp/c/encoding/element-listener.h
# Public C++ headers.
ndn_cpp_cpp_headers = \
ndn-cpp/common.hpp \
ndn-cpp/data.hpp \
ndn-cpp/face.hpp \
ndn-cpp/forwarding-entry.hpp \
ndn-cpp/forwarding-flags.hpp \
ndn-cpp/interest.hpp \
ndn-cpp/key.hpp \
ndn-cpp/name.hpp \
ndn-cpp/node.hpp \
ndn-cpp/publisher-public-key-digest.hpp \
ndn-cpp/sha256-with-rsa-signature.hpp \
ndn-cpp/encoding/element-listener.hpp \
ndn-cpp/encoding/binary-xml-wire-format.hpp \
ndn-cpp/encoding/wire-format.hpp \
ndn-cpp/security/security-common.hpp \
ndn-cpp/security/key-chain.hpp \
ndn-cpp/security/security-exception.hpp \
ndn-cpp/security/certificate/oid.hpp \
ndn-cpp/security/certificate/public-key.hpp \
ndn-cpp/security/encryption/encryption-manager.hpp \
ndn-cpp/security/identity/basic-identity-storage.hpp \
ndn-cpp/security/identity/identity-manager.hpp \
ndn-cpp/security/identity/identity-storage.hpp \
ndn-cpp/security/identity/memory-identity-storage.hpp \
ndn-cpp/security/identity/memory-private-key-storage.hpp \
ndn-cpp/security/identity/osx-private-key-storage.hpp \
ndn-cpp/security/identity/private-key-storage.hpp \
ndn-cpp/security/policy/no-verify-policy-manager.hpp \
ndn-cpp/security/policy/policy-manager.hpp \
ndn-cpp/transport/tcp-transport.hpp \
ndn-cpp/transport/transport.hpp \
ndn-cpp/transport/udp-transport.hpp \
ndn-cpp/util/blob.hpp \
ndn-cpp/util/signed-blob.hpp
ndnboost_headers = \
ndnboost/algorithm/string/compare.hpp \
ndnboost/algorithm/string/concept.hpp \
ndnboost/algorithm/string/config.hpp \
@ -2073,9 +2122,7 @@ ndnboost_files = \
ndnboost/visit_each.hpp \
ndnboost/weak_ptr.hpp
nobase_include_HEADERS = $(ndnboost_files) \
ndn-cpp/ndn-cpp-config.h
nobase_include_HEADERS = $(ndn_cpp_c_headers) $(ndn_cpp_cpp_headers) $(ndnboost_headers)
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am

3
ndn-cpp/c/common.h → include/ndn-cpp/c/common.h

@ -7,8 +7,9 @@
#ifndef NDN_COMMON_H
#define NDN_COMMON_H
#include <ndn-cpp/ndn-cpp-config.h>
#include "../ndn-cpp-config.h"
#include <stdint.h>
// TODO: Is stddef.h portable?
#include <stddef.h>
#endif

27
include/ndn-cpp/c/data-types.h

@ -0,0 +1,27 @@
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#ifndef NDN_DATA_TYPES_H
#define NDN_DATA_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
ndn_ContentType_DATA = 0,
ndn_ContentType_ENCR = 1,
ndn_ContentType_GONE = 2,
ndn_ContentType_KEY = 3,
ndn_ContentType_LINK = 4,
ndn_ContentType_NACK = 5
} ndn_ContentType;
#ifdef __cplusplus
}
#endif
#endif

39
include/ndn-cpp/c/encoding/element-listener.h

@ -0,0 +1,39 @@
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#ifndef NDN_ELEMENT_LISTENER_H
#define NDN_ELEMENT_LISTENER_H
#include "../common.h"
#ifdef __cplusplus
extern "C" {
#endif
/** An ndn_ElementListener struct holds a function pointer onReceivedElement. You can extend this struct with data that
* will be passed to onReceivedElement.
*/
struct ndn_ElementListener {
void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength); /**< see ndn_ElementListener_initialize */
};
/**
* Initialize an ndn_ElementListener struct to use the onReceivedElement function pointer.
* @param self pointer to the ndn_ElementListener struct
* @param onReceivedElement pointer to a function which is called when an entire binary XML element is received.
* self is the pointer to this ndn_ElementListener struct. See ndn_BinaryXmlElementReader_onReceivedData.
*/
static inline void ndn_ElementListener_initialize
(struct ndn_ElementListener *self, void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength))
{
self->onReceivedElement = onReceivedElement;
}
#ifdef __cplusplus
}
#endif
#endif

0
ndn-cpp/c/forwarding-flags.h → include/ndn-cpp/c/forwarding-flags.h

25
include/ndn-cpp/c/interest-types.h

@ -0,0 +1,25 @@
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#ifndef NDN_INTEREST_TYPES_H
#define NDN_INTEREST_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
ndn_Exclude_COMPONENT = 0,
ndn_Exclude_ANY = 1
} ndn_ExcludeType;
#ifdef __cplusplus
}
#endif
#endif

31
include/ndn-cpp/c/key-types.h

@ -0,0 +1,31 @@
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#ifndef NDN_KEY_TYPES_H
#define NDN_KEY_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
ndn_KeyLocatorType_KEY = 1,
ndn_KeyLocatorType_CERTIFICATE = 2,
ndn_KeyLocatorType_KEYNAME = 3
} ndn_KeyLocatorType;
typedef enum {
ndn_KeyNameType_PUBLISHER_PUBLIC_KEY_DIGEST = 1,
ndn_KeyNameType_PUBLISHER_CERTIFICATE_DIGEST = 2,
ndn_KeyNameType_PUBLISHER_ISSUER_KEY_DIGEST = 3,
ndn_KeyNameType_PUBLISHER_ISSUER_CERTIFICATE_DIGEST = 4
} ndn_KeyNameType;
#ifdef __cplusplus
}
#endif
#endif

3
ndn-cpp/common.hpp → include/ndn-cpp/common.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -8,7 +9,7 @@
#define NDN_COMMON_HPP
#include <vector>
// common.h includes ndn-cpp-config.h.
// common.h include ndn-cpp-config.h.
#include "c/common.h"
// Depending on where ./configure found shared_ptr, define the ptr_lib namespace.

8
ndn-cpp/data.hpp → include/ndn-cpp/data.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -10,7 +11,12 @@
#include "common.hpp"
#include "name.hpp"
#include "util/signed-blob.hpp"
#include "c/data.h"
#include "c/data-types.h"
#include "encoding/wire-format.hpp"
struct ndn_MetaInfo;
struct ndn_Signature;
struct ndn_Data;
namespace ndn {

1
ndn-cpp/encoding/binary-xml-wire-format.hpp → include/ndn-cpp/encoding/binary-xml-wire-format.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

7
ndn-cpp/encoding/binary-xml-element-reader.hpp → include/ndn-cpp/encoding/element-listener.hpp

@ -1,13 +1,14 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#ifndef NDN_BINARYXMLELEMENTREADER_HPP
#define NDN_BINARYXMLELEMENTREADER_HPP
#ifndef NDN_ELEMENT_LISTENER_HPP
#define NDN_ELEMENT_LISTENER_HPP
#include "../c/encoding/binary-xml-element-reader.h"
#include "../c/encoding/element-listener.h"
namespace ndn {

1
ndn-cpp/encoding/wire-format.hpp → include/ndn-cpp/encoding/wire-format.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

1
ndn-cpp/face.hpp → include/ndn-cpp/face.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

5
ndn-cpp/forwarding-entry.hpp → include/ndn-cpp/forwarding-entry.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -11,7 +12,9 @@
#include "name.hpp"
#include "publisher-public-key-digest.hpp"
#include "forwarding-flags.hpp"
#include "c/forwarding-entry.h"
#include "encoding/wire-format.hpp"
struct ndn_ForwardingEntry;
namespace ndn {

0
ndn-cpp/forwarding-flags.hpp → include/ndn-cpp/forwarding-flags.hpp

15
ndn-cpp/interest.hpp → include/ndn-cpp/interest.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -9,7 +10,12 @@
#include "name.hpp"
#include "publisher-public-key-digest.hpp"
#include "c/interest.h"
#include "c/interest-types.h"
#include "encoding/wire-format.hpp"
struct ndn_ExcludeEntry;
struct ndn_Exclude;
struct ndn_Interest;
namespace ndn {
@ -40,12 +46,7 @@ public:
* @param excludeEntryStruct the C ndn_NameComponent struct to receive the pointer
*/
void
get(struct ndn_ExcludeEntry& excludeEntryStruct) const
{
excludeEntryStruct.type = type_;
if (type_ == ndn_Exclude_COMPONENT)
component_.get(excludeEntryStruct.component);
}
get(struct ndn_ExcludeEntry& excludeEntryStruct) const;
ndn_ExcludeType getType() const { return type_; }

5
ndn-cpp/key.hpp → include/ndn-cpp/key.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -8,9 +9,11 @@
#define NDN_KEY_HPP
#include <vector>
#include "c/key.h"
#include "c/key-types.h"
#include "name.hpp"
struct ndn_KeyLocator;
namespace ndn {
class KeyLocator {

18
ndn-cpp/name.hpp → include/ndn-cpp/name.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -12,10 +13,11 @@
#include <vector>
#include <string>
#include <sstream>
#include "c/name.h"
#include "encoding/binary-xml-wire-format.hpp"
#include "util/blob.hpp"
struct ndn_NameComponent;
struct ndn_Name;
namespace ndn {
class Name {
@ -66,10 +68,7 @@ public:
* @param componentStruct The C ndn_NameComponent struct to receive the pointer.
*/
void
get(struct ndn_NameComponent& componentStruct) const
{
value_.get(componentStruct.value);
}
get(struct ndn_NameComponent& componentStruct) const;
const Blob&
getValue() const { return value_; }
@ -102,12 +101,7 @@ public:
* @return The integer number.
*/
uint64_t
toNumber() const
{
struct ndn_NameComponent componentStruct;
get(componentStruct);
return ndn_NameComponent_toNumber(&componentStruct);
}
toNumber() const;
/**
* Interpret this name component as a network-ordered number with a marker and return an integer.

9
ndn-cpp/node.hpp → include/ndn-cpp/node.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -11,8 +12,10 @@
#include "interest.hpp"
#include "data.hpp"
#include "transport/tcp-transport.hpp"
#include "encoding/binary-xml-element-reader.hpp"
#include "forwarding-flags.hpp"
#include "encoding/element-listener.hpp"
struct ndn_Interest;
namespace ndn {
@ -163,7 +166,7 @@ private:
const struct ndn_Interest&
getInterestStruct()
{
return interestStruct_;
return *interestStruct_;
}
/**
@ -179,7 +182,7 @@ private:
ptr_lib::shared_ptr<const Interest> interest_;
std::vector<struct ndn_NameComponent> nameComponents_;
std::vector<struct ndn_ExcludeEntry> excludeEntries_;
struct ndn_Interest interestStruct_;
ptr_lib::shared_ptr<struct ndn_Interest> interestStruct_;
static uint64_t lastPendingInterestId_; /**< A class variable used to get the next unique ID. */
uint64_t pendingInterestId_; /**< A unique identifier for this entry so it can be deleted */

15
ndn-cpp/publisher-public-key-digest.hpp → include/ndn-cpp/publisher-public-key-digest.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -9,7 +10,9 @@
#include <vector>
#include "common.hpp"
#include "c/publisher-public-key-digest.h"
#include "util/blob.hpp"
struct ndn_PublisherPublicKeyDigest;
namespace ndn {
@ -28,20 +31,14 @@ public:
* @param publisherPublicKeyDigestStruct a C ndn_PublisherPublicKeyDigest struct to receive the pointer
*/
void
get(struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) const
{
publisherPublicKeyDigest_.get(publisherPublicKeyDigestStruct.publisherPublicKeyDigest);
}
get(struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) const;
/**
* Clear this PublisherPublicKeyDigest, and copy from the ndn_PublisherPublicKeyDigest struct.
* @param excludeStruct a C ndn_Exclude struct
*/
void
set(const struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct)
{
publisherPublicKeyDigest_ = Blob(publisherPublicKeyDigestStruct.publisherPublicKeyDigest);
}
set(const struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct);
const Blob&
getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }

0
ndn-cpp/security/certificate/certificate.hpp → include/ndn-cpp/security/certificate/certificate.hpp

0
ndn-cpp/security/certificate/oid.hpp → include/ndn-cpp/security/certificate/oid.hpp

0
ndn-cpp/security/certificate/public-key.hpp → include/ndn-cpp/security/certificate/public-key.hpp

0
ndn-cpp/security/encryption/encryption-manager.hpp → include/ndn-cpp/security/encryption/encryption-manager.hpp

0
ndn-cpp/security/identity/basic-identity-storage.hpp → include/ndn-cpp/security/identity/basic-identity-storage.hpp

1
ndn-cpp/security/identity/identity-manager.hpp → include/ndn-cpp/security/identity/identity-manager.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Yingdi Yu <yingdi@cs.ucla.edu>

0
ndn-cpp/security/identity/identity-storage.hpp → include/ndn-cpp/security/identity/identity-storage.hpp

0
ndn-cpp/security/identity/memory-identity-storage.hpp → include/ndn-cpp/security/identity/memory-identity-storage.hpp

0
ndn-cpp/security/identity/memory-private-key-storage.hpp → include/ndn-cpp/security/identity/memory-private-key-storage.hpp

0
ndn-cpp/security/identity/osx-private-key-storage.hpp → include/ndn-cpp/security/identity/osx-private-key-storage.hpp

1
ndn-cpp/security/identity/private-key-storage.hpp → include/ndn-cpp/security/identity/private-key-storage.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Yingdi Yu <yingdi@cs.ucla.edu>

1
ndn-cpp/security/key-chain.hpp → include/ndn-cpp/security/key-chain.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

0
ndn-cpp/security/policy/no-verify-policy-manager.hpp → include/ndn-cpp/security/policy/no-verify-policy-manager.hpp

0
ndn-cpp/security/policy/policy-manager.hpp → include/ndn-cpp/security/policy/policy-manager.hpp

0
ndn-cpp/security/security-common.hpp → include/ndn-cpp/security/security-common.hpp

0
ndn-cpp/security/security-exception.hpp → include/ndn-cpp/security/security-exception.hpp

1
ndn-cpp/sha256-with-rsa-signature.hpp → include/ndn-cpp/sha256-with-rsa-signature.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

18
ndn-cpp/transport/tcp-transport.hpp → include/ndn-cpp/transport/tcp-transport.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -8,10 +9,12 @@
#define NDN_TCPTRANSPORT_HPP
#include <string>
#include "../c/transport/tcp-transport.h"
#include "../c/encoding/binary-xml-element-reader.h"
#include "../common.hpp"
#include "transport.hpp"
struct ndn_TcpTransport;
struct ndn_BinaryXmlElementReader;
namespace ndn {
class TcpTransport : public Transport {
@ -53,12 +56,7 @@ public:
unsigned short port_;
};
TcpTransport()
: elementListener_(0), isConnected_(false)
{
ndn_TcpTransport_initialize(&transport_);
elementReader_.partialData.array = 0;
}
TcpTransport();
/**
* Connect according to the info in ConnectionInfo, and processEvents() will use elementListener.
@ -93,11 +91,11 @@ public:
~TcpTransport();
private:
struct ndn_TcpTransport transport_;
ptr_lib::shared_ptr<struct ndn_TcpTransport> transport_;
bool isConnected_;
ElementListener *elementListener_;
// TODO: This belongs in the socket listener.
ndn_BinaryXmlElementReader elementReader_;
ptr_lib::shared_ptr<struct ndn_BinaryXmlElementReader> elementReader_;
};
}

1
ndn-cpp/transport/transport.hpp → include/ndn-cpp/transport/transport.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

18
ndn-cpp/transport/udp-transport.hpp → include/ndn-cpp/transport/udp-transport.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -8,10 +9,12 @@
#define NDN_UDPTRANSPORT_HPP
#include <string>
#include "../c/transport/udp-transport.h"
#include "../c/encoding/binary-xml-element-reader.h"
#include "../common.hpp"
#include "transport.hpp"
struct ndn_UdpTransport;
struct ndn_BinaryXmlElementReader;
namespace ndn {
class UdpTransport : public Transport {
@ -53,12 +56,7 @@ public:
unsigned short port_;
};
UdpTransport()
: elementListener_(0), isConnected_(false)
{
ndn_UdpTransport_initialize(&transport_);
elementReader_.partialData.array = 0;
}
UdpTransport();
/**
* Connect according to the info in ConnectionInfo, and processEvents() will use elementListener.
@ -98,11 +96,11 @@ public:
~UdpTransport();
private:
struct ndn_UdpTransport transport_;
ptr_lib::shared_ptr<struct ndn_UdpTransport> transport_;
bool isConnected_;
ElementListener *elementListener_;
// TODO: This belongs in the socket listener.
ndn_BinaryXmlElementReader elementReader_;
ptr_lib::shared_ptr<struct ndn_BinaryXmlElementReader> elementReader_;
};
}

18
ndn-cpp/util/blob.hpp → include/ndn-cpp/util/blob.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -8,7 +9,8 @@
#define NDN_BLOB_HPP
#include "../common.hpp"
#include "../c/util/blob.h"
struct ndn_Blob;
namespace ndn {
@ -56,10 +58,7 @@ public:
* Create a new Blob with an immutable copy of the array in the given Blob struct.
* @param blobStruct The C ndn_Blob struct to receive the pointer.
*/
Blob(const struct ndn_Blob& blobStruct)
: ptr_lib::shared_ptr<const std::vector<uint8_t> >(new std::vector<uint8_t>(blobStruct.value, blobStruct.value + blobStruct.length))
{
}
Blob(const struct ndn_Blob& blobStruct);
/**
* Create a new Blob to point to an existing byte array. IMPORTANT: After calling this constructor,
@ -105,14 +104,7 @@ public:
* @param blobStruct The C ndn_Blob struct to receive the pointer.
*/
void
get(struct ndn_Blob& blobStruct) const
{
blobStruct.length = size();
if (size() > 0)
blobStruct.value = (uint8_t*)buf();
else
blobStruct.value = 0;
}
get(struct ndn_Blob& blobStruct) const;
};
}

1
ndn-cpp/util/signed-blob.hpp → include/ndn-cpp/util/signed-blob.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Zhenkai Zhu <zhenkai@cs.ucla.edu>

10
ndn-cpp/c/data.h

@ -7,6 +7,7 @@
#ifndef NDN_DATA_H
#define NDN_DATA_H
#include <ndn-cpp/c/data-types.h>
#include "name.h"
#include "publisher-public-key-digest.h"
#include "key.h"
@ -41,15 +42,6 @@ static inline void ndn_Signature_initialize(struct ndn_Signature *self, struct n
ndn_KeyLocator_initialize(&self->keyLocator, keyNameComponents, maxKeyNameComponents);
}
typedef enum {
ndn_ContentType_DATA = 0,
ndn_ContentType_ENCR = 1,
ndn_ContentType_GONE = 2,
ndn_ContentType_KEY = 3,
ndn_ContentType_LINK = 4,
ndn_ContentType_NACK = 5
} ndn_ContentType;
/**
* An ndn_MetaInfo struct holds the meta info which is signed inside the data packet.
*/

2
ndn-cpp/c/encoding/binary-xml-decoder.h

@ -7,7 +7,7 @@
#ifndef NDN_BINARYXMLDECODER_H
#define NDN_BINARYXMLDECODER_H
#include "../common.h"
#include <ndn-cpp/c/common.h>
#include "../errors.h"
#include "../util/blob.h"

24
ndn-cpp/c/encoding/binary-xml-element-reader.h

@ -4,9 +4,10 @@
* See COPYING for copyright and distribution information.
*/
#ifndef NDN_BINARYXMLELEMENTREADER_H
#define NDN_BINARYXMLELEMENTREADER_H
#ifndef NDN_BINARY_XML_ELEMENT_READER_H
#define NDN_BINARY_XML_ELEMENT_READER_H
#include <ndn-cpp/c/encoding/element-listener.h>
#include "../errors.h"
#include "binary-xml-structure-decoder.h"
#include "../util/dynamic-uint8-array.h"
@ -14,25 +15,6 @@
#ifdef __cplusplus
extern "C" {
#endif
/** An ndn_ElementListener struct holds a function pointer onReceivedElement. You can extend this struct with data that
* will be passed to onReceivedElement.
*/
struct ndn_ElementListener {
void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength); /**< see ndn_ElementListener_initialize */
};
/**
* Initialize an ndn_ElementListener struct to use the onReceivedElement function pointer.
* @param self pointer to the ndn_ElementListener struct
* @param onReceivedElement pointer to a function which is called when an entire binary XML element is received.
* self is the pointer to this ndn_ElementListener struct. See ndn_BinaryXmlElementReader_onReceivedData.
*/
static inline void ndn_ElementListener_initialize
(struct ndn_ElementListener *self, void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength))
{
self->onReceivedElement = onReceivedElement;
}
/**
* A BinaryXmlElementReader lets you call ndn_BinaryXmlElementReader_onReceivedData multiple times which uses an

2
ndn-cpp/c/encoding/binary-xml-key.h

@ -7,8 +7,8 @@
#ifndef NDN_BINARYXMLKEY_H
#define NDN_BINARYXMLKEY_H
#include "../errors.h"
#include "../key.h"
#include "../errors.h"
#include "binary-xml-encoder.h"
#include "binary-xml-decoder.h"

2
ndn-cpp/c/encoding/binary-xml-structure-decoder.h

@ -7,7 +7,7 @@
#ifndef NDN_BINARYXMLSTRUCTUREDECODER_H
#define NDN_BINARYXMLSTRUCTUREDECODER_H
#include "../common.h"
#include <ndn-cpp/c/common.h>
#include "../errors.h"
#ifdef __cplusplus

4
ndn-cpp/c/forwarding-entry.h

@ -7,10 +7,10 @@
#ifndef NDN_FORWARDING_ENTRY_H
#define NDN_FORWARDING_ENTRY_H
#include "common.h"
#include <ndn-cpp/c/common.h>
#include <ndn-cpp/c/forwarding-flags.h>
#include "name.h"
#include "publisher-public-key-digest.h"
#include "forwarding-flags.h"
#ifdef __cplusplus
extern "C" {

1
ndn-cpp/c/forwarding-flags.c

@ -5,7 +5,6 @@
*/
#include "forwarding-entry.h"
#include "forwarding-flags.h"
void ndn_ForwardingFlags_initialize(struct ndn_ForwardingFlags *self)
{

6
ndn-cpp/c/interest.h

@ -7,6 +7,7 @@
#ifndef NDN_INTEREST_H
#define NDN_INTEREST_H
#include <ndn-cpp/c/interest-types.h>
#include "name.h"
#include "publisher-public-key-digest.h"
@ -14,11 +15,6 @@
extern "C" {
#endif
typedef enum {
ndn_Exclude_COMPONENT = 0,
ndn_Exclude_ANY = 1
} ndn_ExcludeType;
/**
* An ndn_ExcludeEntry holds an ndn_ExcludeType, and if it is a COMPONENT, it holds a pointer to the component value.
*/

14
ndn-cpp/c/key.h

@ -7,25 +7,13 @@
#ifndef NDN_KEY_H
#define NDN_KEY_H
#include <ndn-cpp/c/key-types.h>
#include "name.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
ndn_KeyLocatorType_KEY = 1,
ndn_KeyLocatorType_CERTIFICATE = 2,
ndn_KeyLocatorType_KEYNAME = 3
} ndn_KeyLocatorType;
typedef enum {
ndn_KeyNameType_PUBLISHER_PUBLIC_KEY_DIGEST = 1,
ndn_KeyNameType_PUBLISHER_CERTIFICATE_DIGEST = 2,
ndn_KeyNameType_PUBLISHER_ISSUER_KEY_DIGEST = 3,
ndn_KeyNameType_PUBLISHER_ISSUER_CERTIFICATE_DIGEST = 4
} ndn_KeyNameType;
/**
* An ndn_KeyLocator holds the type of key locator and related data.
*/

1
ndn-cpp/c/name.h

@ -7,6 +7,7 @@
#ifndef NDN_NAME_H
#define NDN_NAME_H
#include <ndn-cpp/c/common.h>
#include "errors.h"
#include "util/blob.h"

2
ndn-cpp/c/publisher-public-key-digest.h

@ -7,7 +7,7 @@
#ifndef NDN_PUBLISHERPUBLICKEYDIGEST_H
#define NDN_PUBLISHERPUBLICKEYDIGEST_H
#include "common.h"
#include <ndn-cpp/c/common.h>
#include "util/blob.h"
#ifdef __cplusplus

2
ndn-cpp/c/transport/socket-transport.h

@ -8,7 +8,7 @@
#define NDN_SOCKETTRANSPORT_H
#include <sys/socket.h>
#include "../common.h"
#include <ndn-cpp/c/common.h>
#include "../errors.h"
#ifdef __cplusplus

2
ndn-cpp/c/util/blob.h

@ -7,6 +7,8 @@
#ifndef NDN_BLOB_H
#define NDN_BLOB_H
#include <ndn-cpp/c/common.h>
#ifdef __cplusplus
extern "C" {
#endif

2
ndn-cpp/c/util/crypto.h

@ -9,7 +9,7 @@
#include <openssl/ssl.h>
#include <openssl/rsa.h>
#include "../common.h"
#include <ndn-cpp/c/common.h>
#ifdef __cplusplus
extern "C" {

2
ndn-cpp/c/util/ndn_memory.h

@ -11,7 +11,7 @@
#ifndef NDN_MEMORY_H
#define NDN_MEMORY_H
#include "../common.h"
#include <ndn-cpp/c/common.h>
#ifdef __cplusplus
extern "C" {

3
ndn-cpp/common.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -5,7 +6,7 @@
*/
#include <sstream>
#include "common.hpp"
#include <ndn-cpp/common.hpp>
using namespace std;

8
ndn-cpp/data.cpp

@ -1,12 +1,14 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#include "common.hpp"
#include "data.hpp"
#include "sha256-with-rsa-signature.hpp"
#include <ndn-cpp/common.hpp>
#include <ndn-cpp/data.hpp>
#include <ndn-cpp/sha256-with-rsa-signature.hpp>
#include "c/data.h"
using namespace std;

1
ndn-cpp/encoding/binary-xml-decoder.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

3
ndn-cpp/encoding/binary-xml-encoder.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -8,7 +9,7 @@
#define NDN_BINARYXMLENCODER_HPP
#include <vector>
#include "../common.hpp"
#include <ndn-cpp/common.hpp>
#include "../util/dynamic-uint8-vector.hpp"
#include "../c/encoding/binary-xml-encoder.h"

1
ndn-cpp/encoding/binary-xml-structure-decoder.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

9
ndn-cpp/encoding/binary-xml-wire-format.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -5,15 +6,15 @@
*/
#include <stdexcept>
#include <ndn-cpp/interest.hpp>
#include <ndn-cpp/data.hpp>
#include <ndn-cpp/forwarding-entry.hpp>
#include <ndn-cpp/encoding/binary-xml-wire-format.hpp>
#include "../c/encoding/binary-xml-interest.h"
#include "../c/encoding/binary-xml-data.h"
#include "../c/encoding/binary-xml-forwarding-entry.h"
#include "../interest.hpp"
#include "../data.hpp"
#include "../forwarding-entry.hpp"
#include "binary-xml-encoder.hpp"
#include "binary-xml-decoder.hpp"
#include "binary-xml-wire-format.hpp"
using namespace std;

3
ndn-cpp/encoding/binary-xml-element-reader.cpp → ndn-cpp/encoding/element-listener.cpp

@ -1,10 +1,11 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#include "binary-xml-element-reader.hpp"
#include <ndn-cpp/encoding/element-listener.hpp>
namespace ndn {

3
ndn-cpp/encoding/wire-format.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -5,7 +6,7 @@
*/
#include <stdexcept>
#include "wire-format.hpp"
#include <ndn-cpp/encoding/wire-format.hpp>
using namespace std;

3
ndn-cpp/face.cpp

@ -1,10 +1,11 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#include "face.hpp"
#include <ndn-cpp/face.hpp>
using namespace std;

6
ndn-cpp/forwarding-entry.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -5,8 +6,9 @@
*/
#include <stdexcept>
#include "common.hpp"
#include "forwarding-entry.hpp"
#include <ndn-cpp/common.hpp>
#include <ndn-cpp/forwarding-entry.hpp>
#include "c/forwarding-entry.h"
using namespace std;

14
ndn-cpp/interest.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -5,13 +6,22 @@
*/
#include <stdexcept>
#include "common.hpp"
#include "interest.hpp"
#include <ndn-cpp/common.hpp>
#include <ndn-cpp/interest.hpp>
#include "c/interest.h"
using namespace std;
namespace ndn {
void
ExcludeEntry::get(struct ndn_ExcludeEntry& excludeEntryStruct) const
{
excludeEntryStruct.type = type_;
if (type_ == ndn_Exclude_COMPONENT)
component_.get(excludeEntryStruct.component);
}
void
Exclude::get(struct ndn_Exclude& excludeStruct) const
{

8
ndn-cpp/key.cpp

@ -1,16 +1,18 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#include "common.hpp"
#include "key.hpp"
#include <ndn-cpp/common.hpp>
#include <ndn-cpp/key.hpp>
#include "c/key.h"
using namespace std;
namespace ndn {
void
KeyLocator::get(struct ndn_KeyLocator& keyLocatorStruct) const
{

18
ndn-cpp/name.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -6,7 +7,8 @@
#include <stdexcept>
#include <algorithm>
#include "name.hpp"
#include <ndn-cpp/name.hpp>
#include "c/name.h"
using namespace std;
using namespace ndn::ptr_lib;
@ -161,6 +163,20 @@ Name::Component::makeSegment(unsigned long segment)
return Blob(value);
}
void
Name::Component::get(struct ndn_NameComponent& componentStruct) const
{
value_.get(componentStruct.value);
}
uint64_t
Name::Component::toNumber() const
{
struct ndn_NameComponent componentStruct;
get(componentStruct);
return ndn_NameComponent_toNumber(&componentStruct);
}
void
Name::set(const char *uri_cstr)
{

20
ndn-cpp/node.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -6,13 +7,15 @@
#include <sys/time.h>
#include <stdexcept>
#include "c/name.h"
#include "c/interest.h"
#include "c/util/crypto.h"
#include "encoding/binary-xml-decoder.hpp"
#include "c/encoding/binary-xml.h"
#include "forwarding-entry.hpp"
#include "security/key-chain.hpp"
#include "sha256-with-rsa-signature.hpp"
#include "node.hpp"
#include "encoding/binary-xml-decoder.hpp"
#include <ndn-cpp/forwarding-entry.hpp>
#include <ndn-cpp/security/key-chain.hpp>
#include <ndn-cpp/sha256-with-rsa-signature.hpp>
#include <ndn-cpp/node.hpp>
using namespace std;
using namespace ndn::ptr_lib;
@ -338,7 +341,8 @@ Node::getEntryForRegisteredPrefix(const Name& name)
Node::PendingInterest::PendingInterest
(uint64_t pendingInterestId, const shared_ptr<const Interest>& interest, const OnData& onData, const OnTimeout& onTimeout)
: pendingInterestId_(pendingInterestId), interest_(interest), onData_(onData), onTimeout_(onTimeout)
: pendingInterestId_(pendingInterestId), interest_(interest), onData_(onData), onTimeout_(onTimeout),
interestStruct_(new struct ndn_Interest)
{
// Set up timeoutTime_.
if (interest_->getInterestLifetimeMilliseconds() >= 0.0)
@ -352,8 +356,8 @@ Node::PendingInterest::PendingInterest
nameComponents_.reserve(interest_->getName().getComponentCount());
excludeEntries_.reserve(interest_->getExclude().getEntryCount());
ndn_Interest_initialize
(&interestStruct_, &nameComponents_[0], nameComponents_.capacity(), &excludeEntries_[0], excludeEntries_.capacity());
interest_->get(interestStruct_);
(interestStruct_.get(), &nameComponents_[0], nameComponents_.capacity(), &excludeEntries_[0], excludeEntries_.capacity());
interest_->get(*interestStruct_);
}
bool

27
ndn-cpp/publisher-public-key-digest.cpp

@ -0,0 +1,27 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#include "c/publisher-public-key-digest.h"
#include <ndn-cpp/publisher-public-key-digest.hpp>
using namespace std;
namespace ndn {
void
PublisherPublicKeyDigest::get(struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) const
{
publisherPublicKeyDigest_.get(publisherPublicKeyDigestStruct.publisherPublicKeyDigest);
}
void
PublisherPublicKeyDigest::set(const struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct)
{
publisherPublicKeyDigest_ = Blob(publisherPublicKeyDigestStruct.publisherPublicKeyDigest);
}
}

2
ndn-cpp/security/certificate/oid.cpp

@ -8,7 +8,7 @@
#include <stdlib.h>
#include <sstream>
#include "oid.hpp"
#include <ndn-cpp/security/certificate/oid.hpp>
using namespace std;

4
ndn-cpp/security/certificate/public-key.cpp

@ -6,9 +6,9 @@
* See COPYING for copyright and distribution information.
*/
#include "../security-exception.hpp"
#include <ndn-cpp/security//security-exception.hpp>
#include "../../c/util/crypto.h"
#include "public-key.hpp"
#include <ndn-cpp/security/certificate/public-key.hpp>
using namespace std;
using namespace ndn::ptr_lib;

4
ndn-cpp/security/identity/basic-identity-storage.cpp

@ -15,9 +15,9 @@
#include <stdlib.h>
#include <sstream>
#include <fstream>
#include "basic-identity-storage.hpp"
#include <ndn-cpp/security/identity/basic-identity-storage.hpp>
#include "../../util/logging.hpp"
#include "../security-exception.hpp"
#include <ndn-cpp/security//security-exception.hpp>
#include "ndn-cpp/data.hpp"
#if 0

7
ndn-cpp/security/identity/identity-manager.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Yingdi Yu <yingdi@cs.ucla.edu>
@ -9,9 +10,9 @@
#include <stdexcept>
#endif
#include "../../util/logging.hpp"
#include "../../sha256-with-rsa-signature.hpp"
#include "../security-exception.hpp"
#include "identity-manager.hpp"
#include <ndn-cpp/sha256-with-rsa-signature.hpp>
#include <ndn-cpp/security/security-exception.hpp>
#include <ndn-cpp/security/identity/identity-manager.hpp>
using namespace std;
using namespace ndn::ptr_lib;

4
ndn-cpp/security/identity/memory-identity-storage.cpp

@ -9,8 +9,8 @@
#include <stdexcept>
#endif
#include <algorithm>
#include "../security-exception.hpp"
#include "memory-identity-storage.hpp"
#include <ndn-cpp/security/security-exception.hpp>
#include <ndn-cpp/security/identity/memory-identity-storage.hpp>
using namespace std;
using namespace ndn::ptr_lib;

4
ndn-cpp/security/identity/memory-private-key-storage.cpp

@ -9,8 +9,8 @@
#include <stdexcept>
#endif
#include "../../c/util/crypto.h"
#include "../security-exception.hpp"
#include "memory-private-key-storage.hpp"
#include <ndn-cpp/security/security-exception.hpp>
#include <ndn-cpp/security/identity/memory-private-key-storage.hpp>
using namespace std;
using namespace ndn::ptr_lib;

4
ndn-cpp/security/identity/osx-private-key-storage.cpp

@ -14,8 +14,8 @@
#include <CoreFoundation/CoreFoundation.h>
#include "../../util/logging.hpp"
#include "osx-private-key-storage.hpp"
#include "../security-exception.hpp"
#include <ndn-cpp/security/identity/osx-private-key-storage.hpp>
#include <ndn-cpp/security/security-exception.hpp>
using namespace std;
using namespace ndn::ptr_lib;

9
ndn-cpp/security/key-chain.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -7,11 +8,11 @@
#include "../c/util/crypto.h"
#include "../c/encoding/binary-xml-data.h"
#include "../encoding/binary-xml-encoder.hpp"
#include "../sha256-with-rsa-signature.hpp"
#include <ndn-cpp/sha256-with-rsa-signature.hpp>
#include "../util/logging.hpp"
#include "policy/policy-manager.hpp"
#include "security-exception.hpp"
#include "key-chain.hpp"
#include <ndn-cpp/security/security-exception.hpp>
#include <ndn-cpp/security/policy/policy-manager.hpp>
#include <ndn-cpp/security/key-chain.hpp>
using namespace std;
using namespace ndn::ptr_lib;

2
ndn-cpp/security/policy/no-verify-policy-manager.cpp

@ -6,7 +6,7 @@
* See COPYING for copyright and distribution information.
*/
#include "no-verify-policy-manager.hpp"
#include <ndn-cpp/security/policy/no-verify-policy-manager.hpp>
using namespace std;
using namespace ndn::ptr_lib;

2
ndn-cpp/security/security-exception.cpp

@ -6,7 +6,7 @@
* See COPYING for copyright and distribution information.
*/
#include "security-exception.hpp"
#include <ndn-cpp/security/security-exception.hpp>
using namespace std;
namespace ndn {

4
ndn-cpp/sha256-with-rsa-signature.cpp

@ -1,10 +1,12 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#include "sha256-with-rsa-signature.hpp"
#include "c/data.h"
#include <ndn-cpp/sha256-with-rsa-signature.hpp>
using namespace std;
using namespace ndn::ptr_lib;

32
ndn-cpp/transport/tcp-transport.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -5,9 +6,11 @@
*/
#include <stdexcept>
#include "../node.hpp"
#include <ndn-cpp/node.hpp>
#include "../c/transport/tcp-transport.h"
#include "../c/encoding/binary-xml-element-reader.h"
#include "../c/util/ndn_realloc.h"
#include "tcp-transport.hpp"
#include <ndn-cpp/transport/tcp-transport.hpp>
using namespace std;
@ -17,20 +20,27 @@ TcpTransport::ConnectionInfo::~ConnectionInfo()
{
}
TcpTransport::TcpTransport()
: elementListener_(0), isConnected_(false), transport_(new struct ndn_TcpTransport), elementReader_(new struct ndn_BinaryXmlElementReader)
{
ndn_TcpTransport_initialize(transport_.get());
elementReader_->partialData.array = 0;
}
void
TcpTransport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener)
{
const TcpTransport::ConnectionInfo& tcpConnectionInfo = dynamic_cast<const TcpTransport::ConnectionInfo&>(connectionInfo);
ndn_Error error;
if ((error = ndn_TcpTransport_connect(&transport_, (char *)tcpConnectionInfo.getHost().c_str(), tcpConnectionInfo.getPort())))
if ((error = ndn_TcpTransport_connect(transport_.get(), (char *)tcpConnectionInfo.getHost().c_str(), tcpConnectionInfo.getPort())))
throw std::runtime_error(ndn_getErrorString(error));
// TODO: This belongs in the socket listener.
const size_t initialLength = 1000;
// Automatically cast elementReader_ to (struct ndn_ElementListener *)
ndn_BinaryXmlElementReader_initialize
(&elementReader_, &elementListener, (uint8_t *)malloc(initialLength), initialLength, ndn_realloc);
(elementReader_.get(), &elementListener, (uint8_t *)malloc(initialLength), initialLength, ndn_realloc);
isConnected_ = true;
elementListener_ = &elementListener;
@ -40,7 +50,7 @@ void
TcpTransport::send(const uint8_t *data, size_t dataLength)
{
ndn_Error error;
if ((error = ndn_TcpTransport_send(&transport_, (uint8_t *)data, dataLength)))
if ((error = ndn_TcpTransport_send(transport_.get(), (uint8_t *)data, dataLength)))
throw std::runtime_error(ndn_getErrorString(error));
}
@ -49,17 +59,17 @@ TcpTransport::processEvents()
{
int receiveIsReady;
ndn_Error error;
if ((error = ndn_TcpTransport_receiveIsReady(&transport_, &receiveIsReady)))
if ((error = ndn_TcpTransport_receiveIsReady(transport_.get(), &receiveIsReady)))
throw std::runtime_error(ndn_getErrorString(error));
if (!receiveIsReady)
return;
uint8_t buffer[8000];
size_t nBytes;
if ((error = ndn_TcpTransport_receive(&transport_, buffer, sizeof(buffer), &nBytes)))
if ((error = ndn_TcpTransport_receive(transport_.get(), buffer, sizeof(buffer), &nBytes)))
throw std::runtime_error(ndn_getErrorString(error));
ndn_BinaryXmlElementReader_onReceivedData(&elementReader_, buffer, nBytes);
ndn_BinaryXmlElementReader_onReceivedData(elementReader_.get(), buffer, nBytes);
}
bool
@ -72,15 +82,15 @@ void
TcpTransport::close()
{
ndn_Error error;
if ((error = ndn_TcpTransport_close(&transport_)))
if ((error = ndn_TcpTransport_close(transport_.get())))
throw std::runtime_error(ndn_getErrorString(error));
}
TcpTransport::~TcpTransport()
{
if (elementReader_.partialData.array)
if (elementReader_->partialData.array)
// Free the memory allocated in connect.
free(elementReader_.partialData.array);
free(elementReader_->partialData.array);
}
}

3
ndn-cpp/transport/transport.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -5,7 +6,7 @@
*/
#include <stdexcept>
#include "transport.hpp"
#include <ndn-cpp/transport/transport.hpp>
using namespace std;

32
ndn-cpp/transport/udp-transport.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -5,9 +6,11 @@
*/
#include <stdexcept>
#include "../face.hpp"
#include <ndn-cpp/face.hpp>
#include "../c/transport/udp-transport.h"
#include "../c/encoding/binary-xml-element-reader.h"
#include "../c/util/ndn_realloc.h"
#include "udp-transport.hpp"
#include <ndn-cpp/transport/udp-transport.hpp>
using namespace std;
@ -17,20 +20,27 @@ UdpTransport::ConnectionInfo::~ConnectionInfo()
{
}
UdpTransport::UdpTransport()
: elementListener_(0), isConnected_(false), transport_(new struct ndn_UdpTransport), elementReader_(new struct ndn_BinaryXmlElementReader)
{
ndn_UdpTransport_initialize(transport_.get());
elementReader_->partialData.array = 0;
}
void
UdpTransport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener)
{
const UdpTransport::ConnectionInfo& udpConnectionInfo = dynamic_cast<const UdpTransport::ConnectionInfo&>(connectionInfo);
ndn_Error error;
if ((error = ndn_UdpTransport_connect(&transport_, (char *)udpConnectionInfo.getHost().c_str(), udpConnectionInfo.getPort())))
if ((error = ndn_UdpTransport_connect(transport_.get(), (char *)udpConnectionInfo.getHost().c_str(), udpConnectionInfo.getPort())))
throw std::runtime_error(ndn_getErrorString(error));
// TODO: This belongs in the socket listener.
const size_t initialLength = 1000;
// Automatically cast elementReader_ to (struct ndn_ElementListener *)
ndn_BinaryXmlElementReader_initialize
(&elementReader_, &elementListener, (uint8_t *)malloc(initialLength), initialLength, ndn_realloc);
(elementReader_.get(), &elementListener, (uint8_t *)malloc(initialLength), initialLength, ndn_realloc);
isConnected_ = true;
elementListener_ = &elementListener;
@ -40,7 +50,7 @@ void
UdpTransport::send(const uint8_t *data, size_t dataLength)
{
ndn_Error error;
if ((error = ndn_UdpTransport_send(&transport_, (uint8_t *)data, dataLength)))
if ((error = ndn_UdpTransport_send(transport_.get(), (uint8_t *)data, dataLength)))
throw std::runtime_error(ndn_getErrorString(error));
}
@ -49,17 +59,17 @@ UdpTransport::processEvents()
{
int receiveIsReady;
ndn_Error error;
if ((error = ndn_UdpTransport_receiveIsReady(&transport_, &receiveIsReady)))
if ((error = ndn_UdpTransport_receiveIsReady(transport_.get(), &receiveIsReady)))
throw std::runtime_error(ndn_getErrorString(error));
if (!receiveIsReady)
return;
uint8_t buffer[8000];
size_t nBytes;
if ((error = ndn_UdpTransport_receive(&transport_, buffer, sizeof(buffer), &nBytes)))
if ((error = ndn_UdpTransport_receive(transport_.get(), buffer, sizeof(buffer), &nBytes)))
throw std::runtime_error(ndn_getErrorString(error));
ndn_BinaryXmlElementReader_onReceivedData(&elementReader_, buffer, nBytes);
ndn_BinaryXmlElementReader_onReceivedData(elementReader_.get(), buffer, nBytes);
}
bool
@ -72,15 +82,15 @@ void
UdpTransport::close()
{
ndn_Error error;
if ((error = ndn_UdpTransport_close(&transport_)))
if ((error = ndn_UdpTransport_close(transport_.get())))
throw std::runtime_error(ndn_getErrorString(error));
}
UdpTransport::~UdpTransport()
{
if (elementReader_.partialData.array)
if (elementReader_->partialData.array)
// Free the memory allocated in connect.
free(elementReader_.partialData.array);
free(elementReader_->partialData.array);
}
}

30
ndn-cpp/util/blob.cpp

@ -0,0 +1,30 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#include "../c/util/blob.h"
#include <ndn-cpp/util/blob.hpp>
using namespace std;
namespace ndn {
Blob::Blob(const struct ndn_Blob& blobStruct)
: ptr_lib::shared_ptr<const std::vector<uint8_t> >(new std::vector<uint8_t>(blobStruct.value, blobStruct.value + blobStruct.length))
{
}
void
Blob::get(struct ndn_Blob& blobStruct) const
{
blobStruct.length = size();
if (size() > 0)
blobStruct.value = (uint8_t*)buf();
else
blobStruct.value = 0;
}
}

1
ndn-cpp/util/changed-event.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

3
ndn-cpp/util/changed-event.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -8,7 +9,7 @@
#define NDN_CHANGED_EVENT_HPP
#include <vector>
#include "../common.hpp"
#include <ndn-cpp/common.hpp>
namespace ndn {

1
ndn-cpp/util/dynamic-uint8-vector.cpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>

3
ndn-cpp/util/dynamic-uint8-vector.hpp

@ -1,3 +1,4 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Jeff Thompson <jefft0@remap.ucla.edu>
@ -8,7 +9,7 @@
#define NDN_DYNAMIC_UCHAR_VECTOR_HPP
#include <vector>
#include "../common.hpp"
#include <ndn-cpp/common.hpp>
#include "../c/util/dynamic-uint8-array.h"
namespace ndn {

2
ndn-cpp/util/logging.hpp

@ -9,7 +9,7 @@
#ifndef NDN_LOGGING_HPP
#define NDN_LOGGING_HPP
#include "../common.hpp"
#include <ndn-cpp//common.hpp>
#ifdef NDN_CPP_HAVE_LOG4CXX

12
tests/test-encode-decode-data.cpp

@ -9,12 +9,12 @@
#include <iostream>
#include <time.h>
#include <stdint.h>
#include "../ndn-cpp/data.hpp"
#include "../ndn-cpp/security/identity/memory-identity-storage.hpp"
#include "../ndn-cpp/security/identity/memory-private-key-storage.hpp"
#include "../ndn-cpp/security/policy/no-verify-policy-manager.hpp"
#include "../ndn-cpp/security/key-chain.hpp"
#include "../ndn-cpp/sha256-with-rsa-signature.hpp"
#include <ndn-cpp/data.hpp>
#include <ndn-cpp/security/identity/memory-identity-storage.hpp>
#include <ndn-cpp/security/identity/memory-private-key-storage.hpp>
#include <ndn-cpp/security/policy/no-verify-policy-manager.hpp>
#include <ndn-cpp/security/key-chain.hpp>
#include <ndn-cpp/sha256-with-rsa-signature.hpp>
using namespace std;
using namespace ndn;

8
tests/test-encode-decode-forwarding-entry.cpp

@ -7,10 +7,10 @@
#include <cstdlib>
#include <sstream>
#include <iostream>
#include "../ndn-cpp/interest.hpp"
#include "../ndn-cpp/data.hpp"
#include "../ndn-cpp/forwarding-entry.hpp"
#include "../ndn-cpp/security/key-chain.hpp"
#include <ndn-cpp/interest.hpp>
#include <ndn-cpp/data.hpp>
#include <ndn-cpp/forwarding-entry.hpp>
#include <ndn-cpp/security/key-chain.hpp>
using namespace std;
using namespace ndn;

2
tests/test-encode-decode-interest.cpp

@ -7,7 +7,7 @@
#include <cstdlib>
#include <sstream>
#include <iostream>
#include "../ndn-cpp/interest.hpp"
#include <ndn-cpp/interest.hpp>
using namespace std;
using namespace ndn;

2
tests/test-get-async.cpp

@ -7,7 +7,7 @@
#include <cstdlib>
#include <sstream>
#include <iostream>
#include "../ndn-cpp/face.hpp"
#include <ndn-cpp/face.hpp>
using namespace std;
using namespace ndn;

10
tests/test-publish-async.cpp

@ -8,11 +8,11 @@
#include <sstream>
#include <iostream>
#include <time.h>
#include "../ndn-cpp/face.hpp"
#include "../ndn-cpp/security/identity/memory-identity-storage.hpp"
#include "../ndn-cpp/security/identity/memory-private-key-storage.hpp"
#include "../ndn-cpp/security/policy/no-verify-policy-manager.hpp"
#include "../ndn-cpp/security/key-chain.hpp"
#include <ndn-cpp/face.hpp>
#include <ndn-cpp/security/identity/memory-identity-storage.hpp>
#include <ndn-cpp/security/identity/memory-private-key-storage.hpp>
#include <ndn-cpp/security/policy/no-verify-policy-manager.hpp>
#include <ndn-cpp/security/key-chain.hpp>
using namespace std;
using namespace ndn;

Loading…
Cancel
Save