Permalink
Browse files

* Compile fixes

* Remove executable permissions from text and source files
* Add checks for PCL and glib in configure
  • Loading branch information...
Erik Nordström
Erik Nordström committed Jun 4, 2011
1 parent cbb38c0 commit 62025113e3b00899bc7f22d10b067a6ad207818d
Showing with 1,768 additions and 1,433 deletions.
  1. 0 AUTHORS
  2. 0 Android.mk
  3. 0 COPYING
  4. 0 ChangeLog
  5. 0 INSTALL
  6. 0 Makefile.am
  7. 0 NEWS
  8. 0 README
  9. 0 android/ServalChat/.classpath
  10. 0 android/ServalChat/.project
  11. 0 android/ServalChat/AndroidManifest.xml
  12. 0 android/ServalChat/default.properties
  13. 0 android/ServalChat/proguard.cfg
  14. BIN android/ServalChat/res/drawable-hdpi/icon.png
  15. BIN android/ServalChat/res/drawable-ldpi/icon.png
  16. BIN android/ServalChat/res/drawable-mdpi/icon.png
  17. 0 android/ServalChat/res/layout/main.xml
  18. 0 android/ServalChat/res/layout/message.xml
  19. 0 android/ServalChat/res/values/strings.xml
  20. 0 android/ServalChat/src/edu/princeton/cs/sns/ServalChat/ChatActivity.java
  21. +10 −0 configure.ac
  22. 0 include/libserval/serval.h
  23. 0 include/libstack/callback.h
  24. 0 include/libstack/ctrlmsg.h
  25. 0 include/libstack/resolver_protocol.h
  26. 0 include/libstack/stack.h
  27. 0 include/netinet/serval.h
  28. 0 include/serval/atomic.h
  29. 0 include/serval/bitops.h
  30. 0 include/serval/debug.h
  31. 0 include/serval/dst.h
  32. 0 include/serval/hash.h
  33. 0 include/serval/inet_sock.h
  34. 0 include/serval/list.h
  35. 0 include/serval/lock.h
  36. 0 include/serval/net.h
  37. 0 include/serval/netdevice.h
  38. +2 −0 include/serval/platform.h
  39. 0 include/serval/platform_tcpip.h
  40. 0 include/serval/skbuff.h
  41. 0 include/serval/sock.h
  42. 0 include/serval/timer.h
  43. +4 −2 include/serval/wait.h
  44. 0 src/Makefile.am
  45. 0 src/javasock/Makefile.am
  46. 0 src/javasock/Manifest.txt
  47. 0 src/javasock/README
  48. 0 src/javasock/java/Makefile.am
  49. 0 src/javasock/java/serval/net/ServalDatagramPacket.java
  50. 0 src/javasock/java/serval/net/ServalDatagramSocket.java
  51. 0 src/javasock/java/serval/net/ServalDatagramSocketImpl.java
  52. 0 src/javasock/java/serval/net/ServalDatagramSocketImplFactory.java
  53. 0 src/javasock/java/serval/net/ServalServerDatagramSocket.java
  54. 0 src/javasock/java/serval/net/ServalSocket.java
  55. 0 src/javasock/java/serval/net/ServalSocketAddress.java
  56. 0 src/javasock/java/serval/net/ServiceID.java
  57. 0 src/javasock/java/serval/platform/ServalNetworkStack.java
  58. 0 src/javasock/java/serval/test/UDPClient.java
  59. 0 src/javasock/java/serval/test/UDPServer.java
  60. 0 src/javasock/jni/Android.mk
  61. 0 src/javasock/jni/JNIHelp.c
  62. 0 src/javasock/jni/JNIHelp.h
  63. 0 src/javasock/jni/Makefile.am
  64. 0 src/javasock/jni/serval_platform_ServalNetworkStack.c
  65. 0 src/javasock/jni/serval_platform_ServalNetworkStack.h
  66. 0 src/libserval/Android.mk
  67. 0 src/libserval/Makefile.am
  68. 0 src/libserval/accept.cc
  69. 0 src/libserval/accept.hh
  70. 0 src/libserval/bind.cc
  71. 0 src/libserval/bind.hh
  72. 0 src/libserval/cli.cc
  73. 0 src/libserval/cli.hh
  74. 0 src/libserval/close.cc
  75. 0 src/libserval/close.hh
  76. 0 src/libserval/connect.cc
  77. 0 src/libserval/connect.hh
  78. 0 src/libserval/listen.cc
  79. 0 src/libserval/listen.hh
  80. 0 src/libserval/log.cc
  81. 0 src/libserval/log.hh
  82. 0 src/libserval/message.cc
  83. 0 src/libserval/message.hh
  84. 0 src/libserval/migrate.cc
  85. 0 src/libserval/migrate.hh
  86. 0 src/libserval/recv.cc
  87. 0 src/libserval/recv.hh
  88. 0 src/libserval/select.cc
  89. 0 src/libserval/select.hh
  90. 0 src/libserval/send.cc
  91. 0 src/libserval/send.hh
  92. 0 src/libserval/sf.cc
  93. 0 src/libserval/socket.cc
  94. 0 src/libserval/socket.hh
  95. 0 src/libserval/sockio.cc
  96. 0 src/libserval/sockio.hh
  97. 0 src/libserval/state.cc
  98. 0 src/libserval/state.hh
  99. 0 src/libserval/types.h
  100. 0 src/libstack/Android.mk
  101. 0 src/libstack/Makefile.am
  102. 0 src/libstack/ctrlmsg.c
  103. 0 src/libstack/debug.h
  104. 0 src/libstack/event.c
  105. 0 src/libstack/event.h
  106. 0 src/libstack/init.h
  107. 0 src/libstack/libstack.c
  108. 0 src/libstack/netlink.c
  109. 0 src/libstack/unix.c
  110. 0 src/servd/Android.mk
  111. +88 −33 src/servd/Makefile.am
  112. 0 src/servd/client_resolver.c
  113. 0 src/servd/cmwc.c
  114. 0 src/servd/cmwc.h
  115. 0 src/servd/debug.h
  116. 0 src/servd/ifa.c
  117. 0 src/servd/ifa.h
  118. +7 −4 src/servd/local_resolver.c
  119. 0 src/servd/message_channel.h
  120. +2 −2 src/servd/message_channel_base.c
  121. 0 src/servd/message_channel_base.h
  122. +2 −2 src/servd/messaging_test.c
  123. +4 −3 src/servd/netlink_message_channel.c
  124. 0 src/servd/poll_reactor.c
  125. 0 src/servd/poll_reactor.h
  126. +23 −19 src/servd/prefixtrie.c
  127. 0 src/servd/prefixtrie.h
  128. +2 −0 src/servd/prefixtrie_test.c
  129. +9 −7 src/servd/resolution_path.c
  130. 0 src/servd/resolution_path.h
  131. 0 src/servd/resolver.h
  132. +2 −0 src/servd/resolver_base.c
  133. 0 src/servd/resolver_base.h
  134. +3 −2 src/servd/resolver_messaging.c
  135. 0 src/servd/resolver_messaging.h
  136. 0 src/servd/rtnl.c
  137. 0 src/servd/rtnl.h
  138. 0 src/servd/servd.c
  139. 0 src/servd/server_resolver.c
  140. 0 src/servd/server_resolver.h
  141. +19 −16 src/servd/service_router.c
  142. 0 src/servd/service_table.c
  143. 0 src/servd/service_table.h
  144. +1 −1 src/servd/service_table_test.c
  145. 0 src/servd/service_types.c
  146. 0 src/servd/service_types.h
  147. 0 src/servd/service_util.c
  148. 0 src/servd/service_util.h
  149. +13 −10 src/servd/task.c
  150. +1 −0 src/servd/task.h
  151. +1 −1 src/servd/task_test.c
  152. 0 src/servd/time_util.c
  153. 0 src/servd/time_util.h
  154. 0 src/servd/timer.c
  155. 0 src/servd/timer.h
  156. +5 −5 src/servd/udp_message_channel.c
  157. +2 −2 src/servd/unix_message_channel.c
  158. +6 −6 src/servd/util_test.c
  159. 0 src/stack/Android.mk
  160. 0 src/stack/Kbuild.in
  161. 0 src/stack/Makefile.am
  162. 0 src/stack/af_serval.c
  163. 0 src/stack/af_serval.h
  164. 0 src/stack/bst.c
  165. 0 src/stack/bst.h
  166. 0 src/stack/ctrl.h
  167. +172 −141 src/stack/ctrl_handler.c
  168. 0 src/stack/debug.c
  169. 0 src/stack/input.c
  170. 0 src/stack/input.h
  171. 0 src/stack/linux/ctrl.c
  172. 0 src/stack/linux/log.c
  173. 0 src/stack/linux/log.h
  174. 0 src/stack/linux/module.c
  175. 0 src/stack/linux/packet.c
  176. 0 src/stack/linux/proc.c
  177. 0 src/stack/linux/splice.c
  178. 0 src/stack/neighbor.c
  179. 0 src/stack/neighbor.h
  180. 0 src/stack/output.c
  181. 0 src/stack/output.h
  182. 0 src/stack/platform.c
  183. 0 src/stack/serval_ipv4.c
  184. 0 src/stack/serval_ipv4.h
  185. 0 src/stack/serval_request_sock.h
  186. 0 src/stack/serval_sock.c
  187. 0 src/stack/serval_sock.h
  188. +346 −307 src/stack/serval_srv.c
  189. 0 src/stack/serval_srv.h
  190. 0 src/stack/serval_tcp.c
  191. 0 src/stack/serval_tcp_sock.h
  192. 0 src/stack/serval_udp.c
  193. 0 src/stack/serval_udp_sock.h
  194. +995 −821 src/stack/service.c
  195. 0 src/stack/service.h
  196. 0 src/stack/userlevel/client.c
  197. 0 src/stack/userlevel/client.h
  198. 0 src/stack/userlevel/client_msg.c
  199. 0 src/stack/userlevel/client_msg.h
  200. 0 src/stack/userlevel/ctrl.c
  201. 0 src/stack/userlevel/dev.c
  202. 0 src/stack/userlevel/dst.c
  203. 0 src/stack/userlevel/packet.h
  204. 0 src/stack/userlevel/packet_bpf.c
  205. 0 src/stack/userlevel/packet_linux.c
  206. 0 src/stack/userlevel/serval.c
  207. 0 src/stack/userlevel/skbuff.c
  208. +2 −1 src/stack/userlevel/sock.c
  209. 0 src/stack/userlevel/socket.c
  210. 0 src/stack/userlevel/telnet.c
  211. 0 src/stack/userlevel/timer.c
  212. +47 −48 src/stack/userlevel/wait.c
  213. 0 src/test/Android.mk
  214. 0 src/test/Makefile.am
  215. 0 src/test/addservice.c
  216. 0 src/test/bindtest.c
  217. 0 src/test/listentest.c
  218. 0 src/test/nltest.c
  219. 0 src/test/recv_udp_packet.c
  220. 0 src/test/send_udp_packet.c
  221. 0 src/test/tcp_inet_client.c
  222. 0 src/test/translator.c
  223. 0 src/test/udp_client.c
  224. 0 src/test/udp_server.c
View
0 AUTHORS 100755 → 100644
No changes.
View
0 Android.mk 100755 → 100644
No changes.
View
0 COPYING 100755 → 100644
No changes.
View
0 ChangeLog 100755 → 100644
No changes.
View
0 INSTALL 100755 → 100644
No changes.
View
0 Makefile.am 100755 → 100644
No changes.
View
0 NEWS 100755 → 100644
No changes.
View
0 README 100755 → 100644
No changes.
View
0 android/ServalChat/.classpath 100755 → 100644
No changes.
View
0 android/ServalChat/.project 100755 → 100644
No changes.
View
No changes.
View
No changes.
View
0 android/ServalChat/proguard.cfg 100755 → 100644
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
10 configure.ac 100755 → 100644
@@ -231,6 +231,16 @@ esac],[kernel=yes])
AM_CONDITIONAL([LINUX_KERNEL], [test x$kernel = xyes && test x$serval_os_linux = xyes])
+
+dnl Check for PCL library
+AC_CHECK_LIB(pcl,co_thread_init, [AC_CHECK_HEADERS([pcl.h],have_pcl=yes,AC_MSG_ERROR(You have libpcl but not the development headers))],AC_MSG_ERROR(PCL library not found...),)
+
+AC_MSG_CHECKING([for Portable Coroutine Library (PCL)])
+AC_MSG_RESULT([$have_pcl])
+
+dnl Check for glib
+PKG_CHECK_MODULES([GLIB], [glib-2.0])
+
dnl Check for OpenSSL and development headers
#AC_CHECK_LIB(crypto,DSA_sign,
# [AC_CHECK_HEADERS([openssl/rsa.h],,AC_MSG_ERROR(You have openssl but not the development headers))],AC_MSG_ERROR(openssl library is not found...),)
View
0 include/libserval/serval.h 100755 → 100644
No changes.
View
0 include/libstack/callback.h 100755 → 100644
No changes.
View
0 include/libstack/ctrlmsg.h 100755 → 100644
No changes.
View
No changes.
View
0 include/libstack/stack.h 100755 → 100644
No changes.
View
0 include/netinet/serval.h 100755 → 100644
No changes.
View
0 include/serval/atomic.h 100755 → 100644
No changes.
View
0 include/serval/bitops.h 100755 → 100644
No changes.
View
0 include/serval/debug.h 100755 → 100644
No changes.
View
0 include/serval/dst.h 100755 → 100644
No changes.
View
0 include/serval/hash.h 100755 → 100644
No changes.
View
0 include/serval/inet_sock.h 100755 → 100644
No changes.
View
0 include/serval/list.h 100755 → 100644
No changes.
View
0 include/serval/lock.h 100755 → 100644
No changes.
View
0 include/serval/net.h 100755 → 100644
No changes.
View
0 include/serval/netdevice.h 100755 → 100644
No changes.
View
2 include/serval/platform.h 100755 → 100644
@@ -35,6 +35,8 @@
#define HAVE_LIBIO 1
#define HAVE_PPOLL 1
#define HAVE_PSELECT 1
+#define HAVE_OFFSETOF 1
+#include <stddef.h>
#endif
#if defined(OS_ANDROID)
View
0 include/serval/platform_tcpip.h 100755 → 100644
No changes.
View
0 include/serval/skbuff.h 100755 → 100644
No changes.
View
0 include/serval/sock.h 100755 → 100644
No changes.
View
0 include/serval/timer.h 100755 → 100644
No changes.
View
6 include/serval/wait.h 100755 → 100644
@@ -16,8 +16,10 @@
#include <limits.h>
typedef struct __wait_queue wait_queue_t;
-typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
-int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key);
+typedef int (*wait_queue_func_t)(wait_queue_t *wait,
+ unsigned mode, int flags, void *key);
+int default_wake_function(wait_queue_t *wait, unsigned mode,
+ int flags, void *key);
struct __wait_queue {
unsigned int flags;
View
0 src/Makefile.am 100755 → 100644
No changes.
View
0 src/javasock/Makefile.am 100755 → 100644
No changes.
View
0 src/javasock/Manifest.txt 100755 → 100644
No changes.
View
0 src/javasock/README 100755 → 100644
No changes.
View
0 src/javasock/java/Makefile.am 100755 → 100644
No changes.
No changes.
No changes.
No changes.
No changes.
No changes.
View
No changes.
No changes.
View
No changes.
No changes.
View
No changes.
View
No changes.
View
0 src/javasock/jni/Android.mk 100755 → 100644
No changes.
View
0 src/javasock/jni/JNIHelp.c 100755 → 100644
No changes.
View
0 src/javasock/jni/JNIHelp.h 100755 → 100644
No changes.
View
0 src/javasock/jni/Makefile.am 100755 → 100644
No changes.
No changes.
No changes.
View
0 src/libserval/Android.mk 100755 → 100644
No changes.
View
0 src/libserval/Makefile.am 100755 → 100644
No changes.
View
0 src/libserval/accept.cc 100755 → 100644
No changes.
View
0 src/libserval/accept.hh 100755 → 100644
No changes.
View
0 src/libserval/bind.cc 100755 → 100644
No changes.
View
0 src/libserval/bind.hh 100755 → 100644
No changes.
View
0 src/libserval/cli.cc 100755 → 100644
No changes.
View
0 src/libserval/cli.hh 100755 → 100644
No changes.
View
0 src/libserval/close.cc 100755 → 100644
No changes.
View
0 src/libserval/close.hh 100755 → 100644
No changes.
View
0 src/libserval/connect.cc 100755 → 100644
No changes.
View
0 src/libserval/connect.hh 100755 → 100644
No changes.
View
0 src/libserval/listen.cc 100755 → 100644
No changes.
View
0 src/libserval/listen.hh 100755 → 100644
No changes.
View
0 src/libserval/log.cc 100755 → 100644
No changes.
View
0 src/libserval/log.hh 100755 → 100644
No changes.
View
0 src/libserval/message.cc 100755 → 100644
No changes.
View
0 src/libserval/message.hh 100755 → 100644
No changes.
View
0 src/libserval/migrate.cc 100755 → 100644
No changes.
View
0 src/libserval/migrate.hh 100755 → 100644
No changes.
View
0 src/libserval/recv.cc 100755 → 100644
No changes.
View
0 src/libserval/recv.hh 100755 → 100644
No changes.
View
0 src/libserval/select.cc 100755 → 100644
No changes.
View
0 src/libserval/select.hh 100755 → 100644
No changes.
View
0 src/libserval/send.cc 100755 → 100644
No changes.
View
0 src/libserval/send.hh 100755 → 100644
No changes.
View
0 src/libserval/sf.cc 100755 → 100644
No changes.
View
0 src/libserval/socket.cc 100755 → 100644
No changes.
View
0 src/libserval/socket.hh 100755 → 100644
No changes.
View
0 src/libserval/sockio.cc 100755 → 100644
No changes.
View
0 src/libserval/sockio.hh 100755 → 100644
No changes.
View
0 src/libserval/state.cc 100755 → 100644
No changes.
View
0 src/libserval/state.hh 100755 → 100644
No changes.
View
0 src/libserval/types.h 100755 → 100644
No changes.
View
0 src/libstack/Android.mk 100755 → 100644
No changes.
View
0 src/libstack/Makefile.am 100755 → 100644
No changes.
View
0 src/libstack/ctrlmsg.c 100755 → 100644
No changes.
View
0 src/libstack/debug.h 100755 → 100644
No changes.
View
0 src/libstack/event.c 100755 → 100644
No changes.
View
0 src/libstack/event.h 100755 → 100644
No changes.
View
0 src/libstack/init.h 100755 → 100644
No changes.
View
0 src/libstack/libstack.c 100755 → 100644
No changes.
View
0 src/libstack/netlink.c 100755 → 100644
No changes.
View
0 src/libstack/unix.c 100755 → 100644
No changes.
View
0 src/servd/Android.mk 100755 → 100644
No changes.
View
121 src/servd/Makefile.am 100755 → 100644
@@ -18,12 +18,20 @@ utiltest_SOURCES = \
task.c \
poll_reactor.c
-utiltest_CPPFLAGS =-I$(top_srcdir)/include -I$(top_srcdir)/src/servd/ -I$(top_srcdir)/src/libstack -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/local/include/glib-2.0
-
-utiltest_LDFLAGS =-L$(top_srcdir)/src/libstack \
+utiltest_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/servd/ \
+ -I$(top_srcdir)/src/libstack \
+ $(GLIB_CFLAGS)
+
+utiltest_LDFLAGS = \
+ -L$(top_srcdir)/src/libstack \
-L$(top_srcdir)/src/libserval \
-L$(top_srcdir)/src/servd \
- -lglib-2.0 -lpthread -lrt -lpcl
+ $(GLIB_LIBS) \
+ -lpthread \
+ -lrt \
+ -lpcl
messagetest_SOURCES = \
messaging_test.c \
@@ -40,16 +48,24 @@ messagetest_SOURCES = \
resolution_path.c \
resolver_base.c \
time_util.c
-
-
-messagetest_CPPFLAGS =-I$(top_srcdir)/include -I$(top_srcdir)/src/servd/ -I$(top_srcdir)/src/libstack -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/local/include/glib-2.0
-messagetest_LDFLAGS =-L$(top_srcdir)/src/libstack \
- -L$(top_srcdir)/src/libserval -lserval \
+
+messagetest_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/servd \
+ -I$(top_srcdir)/src/libstack \
+ $(GLIB_CFLAGS)
+
+messagetest_LDFLAGS = \
+ -L$(top_srcdir)/src/libstack \
+ -L$(top_srcdir)/src/libserval \
-L$(top_srcdir)/src/servd \
- -lrt -lpcl \
- -lglib-2.0 -lpthread
-
+ -lserval \
+ -lrt \
+ -lpcl \
+ $(GLIB_LIBS) \
+ -lpthread
+
trietest_SOURCES = \
service_util.c \
time_util.c \
@@ -61,19 +77,35 @@ trietest_SOURCES = \
prefixtrie.c \
prefixtrie_test.c
-trietest_CPPFLAGS =-I$(top_srcdir)/include -I$(top_srcdir)/src/servd/ -I$(top_srcdir)/src/libstack -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/local/include/glib-2.0
+trietest_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/servd \
+ -I$(top_srcdir)/src/libstack \
+ $(GLIB_CFLAGS)
-trietest_LDFLAGS =-L$(top_srcdir)/src/libstack \
+trietest_LDFLAGS = \
+ -L$(top_srcdir)/src/libstack \
-L$(top_srcdir)/src/libserval \
-L$(top_srcdir)/src/servd \
- -lglib-2.0 -lpthread -lrt -lpcl
-
-stabletest_CPPFLAGS =-I$(top_srcdir)/include -I$(top_srcdir)/src/servd/ -I$(top_srcdir)/src/libstack -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/local/include/glib-2.0
-
-stabletest_LDFLAGS =-L$(top_srcdir)/src/libstack \
+ $(GLIB_LIBS) \
+ -lpthread \
+ -lrt \
+ -lpcl
+
+stabletest_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/servd \
+ -I$(top_srcdir)/src/libstack \
+ $(GLIB_CFLAGS)
+
+stabletest_LDFLAGS = \
+ -L$(top_srcdir)/src/libstack \
-L$(top_srcdir)/src/libserval \
-L$(top_srcdir)/src/servd \
- -lglib-2.0 -lpthread -lrt -lpcl
+ $(GLIB_LIBS) \
+ -lpthread \
+ -lrt \
+ -lpcl
stabletest_SOURCES = \
service_util.c \
@@ -96,13 +128,21 @@ tasktest_SOURCES = \
task.c \
poll_reactor.c \
task_test.c
-
-tasktest_CPPFLAGS =-I$(top_srcdir)/include -I$(top_srcdir)/src/servd/ -I$(top_srcdir)/src/libstack -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/local/include/glib-2.0 -pthread
-tasktest_LDFLAGS =-L$(top_srcdir)/src/libstack \
+tasktest_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/servd \
+ -I$(top_srcdir)/src/libstack \
+ $(GLIB_CFLAGS)
+
+tasktest_LDFLAGS = \
+ -L$(top_srcdir)/src/libstack \
-L$(top_srcdir)/src/libserval \
-L$(top_srcdir)/src/servd \
- -lglib-2.0 -lpthread -lrt -lpcl
+ $(GLIB_LIBS) \
+ -lpthread \
+ -lrt \
+ -lpcl
servr_SOURCES = \
time_util.c \
@@ -125,11 +165,21 @@ servr_SOURCES = \
local_resolver.c \
service_router.c
-servr_CPPFLAGS =-I$(top_srcdir)/include -I$(top_srcdir)/src/libstack -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/local/include/glib-2.0
-servr_LDFLAGS =-L$(top_srcdir)/src/libstack -lstack \
- -L$(top_srcdir)/src/libserval -lserval \
- -lpcl -lrt \
- -lglib-2.0 -pthread
+servr_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/libstack \
+ $(GLIB_CFLAGS)
+
+servr_LDFLAGS = \
+ -L$(top_srcdir)/src/libstack \
+ -L$(top_srcdir)/src/libserval \
+ -L/usr/local/lib \
+ -lstack \
+ -lserval \
+ -lpcl \
+ -lrt \
+ -lpthread \
+ $(GLIB_LIBS)
servd_SOURCES = \
timer.c \
@@ -151,11 +201,16 @@ noinst_HEADERS = \
ifa.h \
rtnl.h
+servd_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/libstack
-servd_CPPFLAGS =-I$(top_srcdir)/include -I$(top_srcdir)/src/libstack -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-servd_LDFLAGS =-L$(top_srcdir)/src/libstack -lstack \
- -L$(top_srcdir)/src/libserval -lserval \
- -pthread
+servd_LDFLAGS = \
+ -L$(top_srcdir)/src/libstack \
+ -L$(top_srcdir)/src/libserval \
+ -lstack \
+ -lserval \
+ -lpthread
clean-local:
rm -f *~
View
0 src/servd/client_resolver.c 100755 → 100644
No changes.
View
0 src/servd/cmwc.c 100755 → 100644
No changes.
View
0 src/servd/cmwc.h 100755 → 100644
No changes.
View
0 src/servd/debug.h 100755 → 100644
No changes.
View
0 src/servd/ifa.c 100755 → 100644
No changes.
View
0 src/servd/ifa.h 100755 → 100644
No changes.
View
11 src/servd/local_resolver.c 100755 → 100644
@@ -837,12 +837,14 @@ static int local_register_services(service_resolver* resolver, service_resolver*
if(address == NULL) {
/* it's a local registration*/
- printf("Resolver address count: %i\n", resolver_get_address_count(resolver));
+ printf("Resolver address count: %i\n",
+ resolver_get_address_count(resolver));
address = resolver_get_address(resolver, 0);
assert(address);
}
- LOG_DBG("Locally registering %i services @ %s with ttl %i\n", num_svc, inet_ntoa(address->net_un.un_ip), ttl);
+ LOG_DBG("Locally registering %zu services @ %s with ttl %u\n",
+ num_svc, inet_ntoa(address->net_un.un_ip), ttl);
int count = 0;
int rcount = 0;
@@ -979,7 +981,8 @@ static int local_unregister_services(service_resolver* resolver, service_resolve
assert(address);
}
- LOG_DBG("Locally unregistering %i services @ %s\n", num_svc, inet_ntoa(address->net_un.un_ip));
+ LOG_DBG("Locally unregistering %zu services @ %s\n",
+ num_svc, inet_ntoa(address->net_un.un_ip));
int count = 0;
int rcount = 0;
@@ -1067,7 +1070,7 @@ static int local_query_services(service_resolver* resolver, service_resolver* pe
assert(resolver);
struct sv_local_resolver* lres = (struct sv_local_resolver*) resolver;
- LOG_DBG("Locally querying %i services\n", num_svc);
+ LOG_DBG("Locally querying %zu services\n", num_svc);
size_t count = 0;
int rcount = 0;
View
0 src/servd/message_channel.h 100755 → 100644
No changes.
View
4 src/servd/message_channel_base.c 100755 → 100644
@@ -12,8 +12,8 @@
#include <unistd.h>
#include <pthread.h>
-#include "serval/platform.h"
-#include "serval/atomic.h"
+#include <serval/platform.h>
+#include <serval/atomic.h>
#include "debug.h"
#include "service_util.h"
#include "task.h"
View
0 src/servd/message_channel_base.h 100755 → 100644
No changes.
View
4 src/servd/messaging_test.c 100755 → 100644
@@ -89,15 +89,15 @@ static int test_recv_message(message_channel_callback* cb, const void* message,
if(cb->target == &test_cb1) {
LOG_DBG(
- "Receiving message for channel 1: %s of size %i\n",
+ "Receiving message for channel 1: %s of size %zu\n",
service_id_to_str(
&((const struct sockaddr_sv*) channel1->interface->
get_local_address(channel1, &addrlen))->sv_srvid),
length);
channel1_recv++;
} else if(cb->target == &test_cb2) {
LOG_DBG(
- "Receiving message for channel 2: %s of size %i\n",
+ "Receiving message for channel 2: %s of size %zu\n",
service_id_to_str(
&((const struct sockaddr_sv*) channel2->interface->
get_local_address(channel2, &addrlen))->sv_srvid),
View
@@ -351,7 +351,7 @@ static int netlink_send_iov(message_channel* channel, struct iovec* iov, size_t
}
struct sv_netlink_message_channel* nchannel = (struct sv_netlink_message_channel *) channel;
- LOG_DBG("Sending NETLINK %i byte message to the local stack\n", datalen);
+ LOG_DBG("Sending NETLINK %zu byte message to the local stack\n", datalen);
struct iovec* vec = (struct iovec*) malloc((veclen + 1) * sizeof(*vec));
struct nlmsghdr nh;
@@ -425,7 +425,7 @@ static int netlink_send(message_channel* channel, void *message, size_t datalen)
assert(channel);
struct sv_netlink_message_channel* nchannel = (struct sv_netlink_message_channel *) channel;
- LOG_DBG("Sending NETLINK %i byte message to the local stack\n", datalen);
+ LOG_DBG("Sending NETLINK %zu byte message to the local stack\n", datalen);
struct nlmsghdr nh;
struct iovec iov[2] = { { (void *) &nh, sizeof(nh) }, { (void *) message, datalen } };
@@ -450,7 +450,8 @@ static int netlink_recv(message_channel* channel, const void *message, size_t da
struct sv_netlink_message_channel* nchannel = (struct sv_netlink_message_channel *) channel;
struct nlmsghdr* nlm;
int num_msgs = 0;
- LOG_DBG("Received NETLINK %i byte message from the local stack\n", datalen);
+ LOG_DBG("Received NETLINK %zu byte message from the local stack\n",
+ datalen);
for (nlm = (struct nlmsghdr *) message; NLMSG_OK(nlm, (unsigned int) datalen); nlm
= NLMSG_NEXT(nlm, datalen)) {
struct nlmsgerr *nlmerr = NULL;
View
0 src/servd/poll_reactor.c 100755 → 100644
No changes.
View
0 src/servd/poll_reactor.h 100755 → 100644
No changes.
View
42 src/servd/prefixtrie.c 100755 → 100644
@@ -2035,11 +2035,14 @@ int prefix_trie_has_key(struct prefix_trie_struct* trie, uint8_t* key, uint16_t
void print_trie(struct prefix_trie_struct* trie) {
assert(trie);
- printf(
- "Trie: key_len=%u count=%u node_count=%u def_value=%u fill_factor=%f branch_fill=%u shortest=%u max_depth=%u\n",
- (uint32_t) trie->key_len, (uint32_t) trie->count, (uint32_t) trie->node_count,
- (uintptr_t) trie->def_value, trie->fill_factor, trie->branch_fill, trie->shortest,
- (uint32_t) trie->max_depth);
+ printf("Trie: key_len=%zu count=%zu node_count=%zu def_value=%p fill_factor=%f branch_fill=%u shortest=%u max_depth=%zu\n",
+ trie->key_len, trie->count,
+ trie->node_count,
+ trie->def_value,
+ trie->fill_factor,
+ trie->branch_fill,
+ trie->shortest,
+ trie->max_depth);
struct prefix_trie_iter iter;
_prefix_trie_iter_init(&iter, trie, TRUE);
@@ -2066,8 +2069,9 @@ char* print_trie_data(struct prefix_trie_data* dnode) {
int bytes = dnode->len / 8 + (dnode->len % 8 > 0 ? 1 : 0);
__hexdump(dnode->key, bytes, keybuf, 128);
- snprintf(outbuf, 128, "%s:%u:%u:%i:%u:%u", keybuf, dnode->len, dnode->shortest,
- dnode->ref_count, (uintptr_t) dnode->data, (uintptr_t) dnode->prefix);
+ snprintf(outbuf, 128, "%s:%d:%d:%i:%p:%p",
+ keybuf, dnode->len, dnode->shortest,
+ dnode->ref_count, dnode->data, dnode->prefix);
return outbuf;
}
@@ -2081,9 +2085,10 @@ char* print_trie_node(struct prefix_trie_node* node, uint8_t offset) {
int bytes = (offset + node->skip) / 8 + ((offset + node->skip) % 8 > 0 ? 1 : 0);
__hexdump(node->key, bytes, keybuf, 128);
- snprintf(outbuf, 128, "%s:%u(%u):%u:%u:%u:%u:%u", keybuf, offset + node->skip, node->skip,
- node->shortest, get_branch_bits(node), get_branch_fill(node), get_branch_full(node),
- (uintptr_t) node->prefix);
+ snprintf(outbuf, 128, "%s:%u(%u):%u:%u:%u:%d:%p",
+ keybuf, offset + node->skip, node->skip,
+ node->shortest, get_branch_bits(node),
+ get_branch_fill(node), get_branch_full(node), node->prefix);
return outbuf;
}
@@ -2113,13 +2118,13 @@ static void _prefix_trie_iter_init(struct prefix_trie_iter* iter, struct prefix_
char buffer[128];
while(fnode == NULL) {
int i = 0;
- for(; i < inode->limit; i++) {
+ for (; i < inode->limit; i++) {
if(inode->branches[i]) {
inode->branch = i;
dnode = inode->branches[i];
- if(trie_get_type(dnode) == PREFIX_TRIE_TYPE_DATA) {
+ if (trie_get_type(dnode) == PREFIX_TRIE_TYPE_DATA) {
fnode = dnode;
} else {
node = (struct prefix_trie_node*) dnode;
@@ -2128,18 +2133,17 @@ static void _prefix_trie_iter_init(struct prefix_trie_iter* iter, struct prefix_
}
}
- if(fnode == NULL && node == NULL) {
+ if (fnode == NULL && node == NULL)
break;
- }
- if(node) {
+ if (node) {
total_len += level_bits + node->skip;
level_bits = get_branch_bits(node);
+
+ nnode = create_iter_node(total_len,
+ (struct prefix_trie_data**) (((uint8_t*) node) + sizeof(*node)), 0, inode->level + 1, node, inode);
- nnode = create_iter_node(total_len, (struct prefix_trie_data**) (((uint8_t*) node)
- + sizeof(*node)), 0, inode->level + 1, node, inode);
-
- if(print_out) {
+ if (print_out) {
memset(buffer, ' ', inode->level);
buffer[inode->level] = 0;
printf("%snode(%u): %s\n", buffer, inode->branch, print_trie_node(node, nnode->len
View
0 src/servd/prefixtrie.h 100755 → 100644
No changes.
Oops, something went wrong.

0 comments on commit 6202511

Please sign in to comment.