Procházet zdrojové kódy

rearrange source flow such that 'flow' does not depend on 'system'

ambrop7 před 14 roky
rodič
revize
cb1485dcd3
100 změnil soubory, kde provedl 179 přidání a 168 odebrání
  1. 2 0
      CMakeLists.txt
  2. 1 1
      base/BLog.c
  3. 2 2
      base/BLog.h
  4. 2 1
      base/BPending.c
  5. 3 3
      base/BPending.h
  6. 5 0
      base/CMakeLists.txt
  7. 1 1
      base/DebugObject.c
  8. 2 2
      base/DebugObject.h
  9. 6 1
      client/CMakeLists.txt
  10. 1 1
      client/DPReceive.c
  11. 1 1
      client/DPReceive.h
  12. 1 1
      client/DPRelay.c
  13. 1 1
      client/DPRelay.h
  14. 1 1
      client/DataProto.c
  15. 3 3
      client/DataProto.h
  16. 1 1
      client/DataProtoKeepaliveSource.c
  17. 3 3
      client/DataProtoKeepaliveSource.h
  18. 1 1
      client/DatagramPeerIO.c
  19. 7 7
      client/DatagramPeerIO.h
  20. 3 2
      client/FragmentProtoAssembler.c
  21. 3 3
      client/FragmentProtoAssembler.h
  22. 1 1
      client/FragmentProtoDisassembler.c
  23. 3 3
      client/FragmentProtoDisassembler.h
  24. 1 1
      client/FrameDecider.c
  25. 1 1
      client/FrameDecider.h
  26. 1 1
      client/PasswordListener.c
  27. 1 1
      client/PasswordListener.h
  28. 2 2
      client/PasswordSender.h
  29. 2 2
      client/SPProtoDecoder.c
  30. 3 3
      client/SPProtoDecoder.h
  31. 1 1
      client/SPProtoEncoder.c
  32. 3 3
      client/SPProtoEncoder.h
  33. 1 1
      client/StreamPeerIO.c
  34. 3 3
      client/StreamPeerIO.h
  35. 2 2
      client/client.c
  36. 1 1
      dhcpclient/BDHCPClient.c
  37. 3 3
      dhcpclient/BDHCPClient.h
  38. 1 1
      dhcpclient/BDHCPClientCore.c
  39. 1 1
      dhcpclient/BDHCPClientCore.h
  40. 1 1
      dhcpclient/CMakeLists.txt
  41. 1 1
      dhcpclient/DHCPIpUdpDecoder.h
  42. 1 1
      dhcpclient/DHCPIpUdpEncoder.h
  43. 1 1
      examples/CMakeLists.txt
  44. 1 1
      examples/FastPacketSource.h
  45. 1 1
      examples/RandomPacketSink.h
  46. 1 1
      examples/bencryption_bench.c
  47. 2 2
      examples/bprocess_example.c
  48. 1 1
      examples/btimer_example.c
  49. 2 2
      examples/dhcpclient_test.c
  50. 1 1
      examples/fairqueue_test.c
  51. 1 1
      examples/fairqueue_test2.c
  52. 1 1
      examples/ncdudevmanager_test.c
  53. 1 1
      examples/ncdudevmonitor_test.c
  54. 1 1
      examples/predicate_test.c
  55. 2 2
      examples/stdin_input.c
  56. 1 1
      flooder/flooder.c
  57. 1 1
      flow/BufferWriter.h
  58. 1 13
      flow/CMakeLists.txt
  59. 1 1
      flow/LineBuffer.c
  60. 1 1
      flow/LineBuffer.h
  61. 1 1
      flow/PacketBuffer.h
  62. 1 1
      flow/PacketPassConnector.h
  63. 2 2
      flow/PacketPassFairQueue.h
  64. 2 2
      flow/PacketPassInterface.h
  65. 1 1
      flow/PacketPassNotifier.h
  66. 2 2
      flow/PacketPassPriorityQueue.h
  67. 1 1
      flow/PacketProtoDecoder.c
  68. 1 1
      flow/PacketProtoDecoder.h
  69. 1 1
      flow/PacketProtoEncoder.h
  70. 1 1
      flow/PacketProtoFlow.h
  71. 1 1
      flow/PacketRecvBlocker.h
  72. 1 1
      flow/PacketRecvConnector.h
  73. 2 2
      flow/PacketRecvInterface.h
  74. 2 2
      flow/PacketRouter.h
  75. 1 1
      flow/PacketStreamSender.h
  76. 1 1
      flow/RouteBuffer.h
  77. 1 1
      flow/SinglePacketBuffer.h
  78. 1 1
      flow/SinglePacketSender.h
  79. 2 2
      flow/StreamPassInterface.h
  80. 1 1
      flow/StreamRecvConnector.h
  81. 2 2
      flow/StreamRecvInterface.h
  82. 9 0
      flowextra/CMakeLists.txt
  83. 2 2
      flowextra/DatagramSocketSink.c
  84. 3 3
      flowextra/DatagramSocketSink.h
  85. 2 2
      flowextra/DatagramSocketSource.c
  86. 4 4
      flowextra/DatagramSocketSource.h
  87. 1 1
      flowextra/KeepaliveIO.c
  88. 4 4
      flowextra/KeepaliveIO.h
  89. 1 1
      flowextra/PacketPassInactivityMonitor.c
  90. 3 3
      flowextra/PacketPassInactivityMonitor.h
  91. 2 2
      flowextra/StreamSocketSink.c
  92. 3 3
      flowextra/StreamSocketSink.h
  93. 2 2
      flowextra/StreamSocketSource.c
  94. 3 3
      flowextra/StreamSocketSource.h
  95. 1 1
      inputprocess/BInputProcess.c
  96. 2 2
      inputprocess/BInputProcess.h
  97. 1 1
      inputprocess/CMakeLists.txt
  98. 1 1
      lwip/custom/arch/cc.h
  99. 1 1
      misc/debugerror.h
  100. 1 1
      misc/loglevel.h

+ 2 - 0
CMakeLists.txt

@@ -130,8 +130,10 @@ install(
 )
 )
 
 
 # internal libraries
 # internal libraries
+add_subdirectory(base)
 add_subdirectory(system)
 add_subdirectory(system)
 add_subdirectory(flow)
 add_subdirectory(flow)
+add_subdirectory(flowextra)
 add_subdirectory(tuntap)
 add_subdirectory(tuntap)
 add_subdirectory(predicate)
 add_subdirectory(predicate)
 add_subdirectory(nspr_support)
 add_subdirectory(nspr_support)

+ 1 - 1
system/BLog.c → base/BLog.c

@@ -22,7 +22,7 @@
 
 
 #include <stdio.h>
 #include <stdio.h>
 
 
-#include <system/BLog.h>
+#include "BLog.h"
 
 
 struct _BLog_channel blog_channel_list[] = {
 struct _BLog_channel blog_channel_list[] = {
 #include <generated/blog_channels_list.h>
 #include <generated/blog_channels_list.h>

+ 2 - 2
system/BLog.h → base/BLog.h

@@ -24,8 +24,8 @@
  * A global object for logging.
  * A global object for logging.
  */
  */
 
 
-#ifndef BADVPN_SYSTEM_BLOG_H
-#define BADVPN_SYSTEM_BLOG_H
+#ifndef BADVPN_BLOG_H
+#define BADVPN_BLOG_H
 
 
 #include <stdarg.h>
 #include <stdarg.h>
 #include <string.h>
 #include <string.h>

+ 2 - 1
system/BPending.c → base/BPending.c

@@ -24,7 +24,8 @@
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <misc/offset.h>
 #include <misc/offset.h>
-#include <system/BPending.h>
+
+#include "BPending.h"
 
 
 void BPendingGroup_Init (BPendingGroup *g)
 void BPendingGroup_Init (BPendingGroup *g)
 {
 {

+ 3 - 3
system/BPending.h → base/BPending.h

@@ -24,12 +24,12 @@
  * Module for managing a queue of jobs pending execution.
  * Module for managing a queue of jobs pending execution.
  */
  */
 
 
-#ifndef BADVPN_SYSTEM_BPENDING_H
-#define BADVPN_SYSTEM_BPENDING_H
+#ifndef BADVPN_BPENDING_H
+#define BADVPN_BPENDING_H
 
 
 #include <misc/debugcounter.h>
 #include <misc/debugcounter.h>
 #include <structure/LinkedList1.h>
 #include <structure/LinkedList1.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 
 
 /**
 /**
  * Job execution handler.
  * Job execution handler.

+ 5 - 0
base/CMakeLists.txt

@@ -0,0 +1,5 @@
+add_library(base
+    DebugObject.c
+    BLog.c
+    BPending.c
+)

+ 1 - 1
system/DebugObject.c → base/DebugObject.c

@@ -20,7 +20,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
  */
 
 
-#include <system/DebugObject.h>
+#include "DebugObject.h"
 
 
 #ifndef NDEBUG
 #ifndef NDEBUG
 DebugCounter debugobject_counter = DEBUGCOUNTER_STATIC;
 DebugCounter debugobject_counter = DEBUGCOUNTER_STATIC;

+ 2 - 2
system/DebugObject.h → base/DebugObject.h

@@ -24,8 +24,8 @@
  * Object used for detecting leaks.
  * Object used for detecting leaks.
  */
  */
 
 
-#ifndef BADVPN_SYSTEM_DEBUGOBJECT_H
-#define BADVPN_SYSTEM_DEBUGOBJECT_H
+#ifndef BADVPN_DEBUGOBJECT_H
+#define BADVPN_DEBUGOBJECT_H
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 

+ 6 - 1
client/CMakeLists.txt

@@ -8,8 +8,13 @@ add_executable(badvpn-client
     FrameDecider.c
     FrameDecider.c
     DPRelay.c
     DPRelay.c
     DPReceive.c
     DPReceive.c
+    FragmentProtoDisassembler.c
+    FragmentProtoAssembler.c
+    SPProtoEncoder.c
+    SPProtoDecoder.c
+    DataProtoKeepaliveSource.c
 )
 )
-target_link_libraries(badvpn-client system flow tuntap server_conection security ${NSPR_LIBRARIES} ${NSS_LIBRARIES})
+target_link_libraries(badvpn-client system flow flowextra tuntap server_conection security ${NSPR_LIBRARIES} ${NSS_LIBRARIES})
 
 
 install(
 install(
     TARGETS badvpn-client
     TARGETS badvpn-client

+ 1 - 1
client/DPReceive.c

@@ -26,7 +26,7 @@
 #include <protocol/dataproto.h>
 #include <protocol/dataproto.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
 #include <misc/offset.h>
 #include <misc/offset.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <client/DPReceive.h>
 #include <client/DPReceive.h>
 
 

+ 1 - 1
client/DPReceive.h

@@ -31,7 +31,7 @@
 #include <misc/debugcounter.h>
 #include <misc/debugcounter.h>
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <structure/LinkedList2.h>
 #include <structure/LinkedList2.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassFairQueue.h>
 #include <flow/PacketPassFairQueue.h>
 #include <client/DataProto.h>
 #include <client/DataProto.h>
 #include <client/DPRelay.h>
 #include <client/DPRelay.h>

+ 1 - 1
client/DPRelay.c

@@ -24,7 +24,7 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <misc/offset.h>
 #include <misc/offset.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <client/DPRelay.h>
 #include <client/DPRelay.h>
 
 

+ 1 - 1
client/DPRelay.h

@@ -30,7 +30,7 @@
 #include <protocol/dataproto.h>
 #include <protocol/dataproto.h>
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <structure/LinkedList1.h>
 #include <structure/LinkedList1.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/BufferWriter.h>
 #include <flow/BufferWriter.h>
 #include <client/DataProto.h>
 #include <client/DataProto.h>
 
 

+ 1 - 1
client/DataProto.c

@@ -27,7 +27,7 @@
 #include <protocol/dataproto.h>
 #include <protocol/dataproto.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <client/DataProto.h>
 #include <client/DataProto.h>
 
 

+ 3 - 3
client/DataProto.h

@@ -31,16 +31,16 @@
 
 
 #include <misc/debugcounter.h>
 #include <misc/debugcounter.h>
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <flow/PacketPassFairQueue.h>
 #include <flow/PacketPassFairQueue.h>
-#include <flow/PacketPassInactivityMonitor.h>
 #include <flow/PacketPassNotifier.h>
 #include <flow/PacketPassNotifier.h>
-#include <flow/DataProtoKeepaliveSource.h>
 #include <flow/PacketRecvBlocker.h>
 #include <flow/PacketRecvBlocker.h>
 #include <flow/SinglePacketBuffer.h>
 #include <flow/SinglePacketBuffer.h>
 #include <flow/PacketPassConnector.h>
 #include <flow/PacketPassConnector.h>
 #include <flow/PacketRouter.h>
 #include <flow/PacketRouter.h>
+#include <flowextra/PacketPassInactivityMonitor.h>
+#include <client/DataProtoKeepaliveSource.h>
 
 
 typedef void (*DataProtoSink_handler) (void *user, int up);
 typedef void (*DataProtoSink_handler) (void *user, int up);
 typedef void (*DataProtoSource_handler) (void *user, const uint8_t *frame, int frame_len);
 typedef void (*DataProtoSource_handler) (void *user, const uint8_t *frame, int frame_len);

+ 1 - 1
flow/DataProtoKeepaliveSource.c → client/DataProtoKeepaliveSource.c

@@ -23,7 +23,7 @@
 #include <protocol/dataproto.h>
 #include <protocol/dataproto.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
 
 
-#include <flow/DataProtoKeepaliveSource.h>
+#include "DataProtoKeepaliveSource.h"
 
 
 static void output_handler_recv (DataProtoKeepaliveSource *o, uint8_t *data)
 static void output_handler_recv (DataProtoKeepaliveSource *o, uint8_t *data)
 {
 {

+ 3 - 3
flow/DataProtoKeepaliveSource.h → client/DataProtoKeepaliveSource.h

@@ -24,10 +24,10 @@
  * A {@link PacketRecvInterface} source which provides DataProto keepalive packets.
  * A {@link PacketRecvInterface} source which provides DataProto keepalive packets.
  */
  */
 
 
-#ifndef BADVPN_FLOW_DATAPROTOKEEPALIVESOURCE_H
-#define BADVPN_FLOW_DATAPROTOKEEPALIVESOURCE_H
+#ifndef BADVPN_DATAPROTOKEEPALIVESOURCE_H
+#define BADVPN_DATAPROTOKEEPALIVESOURCE_H
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 
 
 /**
 /**

+ 1 - 1
client/DatagramPeerIO.c

@@ -23,7 +23,7 @@
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <client/DatagramPeerIO.h>
 #include <client/DatagramPeerIO.h>
 
 

+ 7 - 7
client/DatagramPeerIO.h

@@ -32,22 +32,22 @@
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <protocol/spproto.h>
 #include <protocol/spproto.h>
 #include <protocol/fragmentproto.h>
 #include <protocol/fragmentproto.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <system/BAddr.h>
 #include <system/BAddr.h>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
 #include <system/BTime.h>
 #include <system/BTime.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
-#include <flow/DatagramSocketSink.h>
 #include <flow/PacketPassConnector.h>
 #include <flow/PacketPassConnector.h>
 #include <flow/SinglePacketBuffer.h>
 #include <flow/SinglePacketBuffer.h>
-#include <flow/SPProtoEncoder.h>
-#include <flow/FragmentProtoDisassembler.h>
-#include <flow/DatagramSocketSource.h>
 #include <flow/PacketRecvConnector.h>
 #include <flow/PacketRecvConnector.h>
-#include <flow/SPProtoDecoder.h>
-#include <flow/FragmentProtoAssembler.h>
 #include <flow/PacketPassNotifier.h>
 #include <flow/PacketPassNotifier.h>
+#include <flowextra/DatagramSocketSource.h>
+#include <flowextra/DatagramSocketSink.h>
+#include <client/FragmentProtoDisassembler.h>
+#include <client/FragmentProtoAssembler.h>
+#include <client/SPProtoEncoder.h>
+#include <client/SPProtoDecoder.h>
 
 
 /**
 /**
  * Handler function invoked when the number of used OTPs has reached
  * Handler function invoked when the number of used OTPs has reached

+ 3 - 2
flow/FragmentProtoAssembler.c → client/FragmentProtoAssembler.c

@@ -27,8 +27,9 @@
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
 #include <misc/balloc.h>
 #include <misc/balloc.h>
-#include <system/BLog.h>
-#include <flow/FragmentProtoAssembler.h>
+#include <base/BLog.h>
+
+#include "FragmentProtoAssembler.h"
 
 
 #include <generated/blog_channel_FragmentProtoAssembler.h>
 #include <generated/blog_channel_FragmentProtoAssembler.h>
 
 

+ 3 - 3
flow/FragmentProtoAssembler.h → client/FragmentProtoAssembler.h

@@ -24,14 +24,14 @@
  * Object which decodes packets according to FragmentProto.
  * Object which decodes packets according to FragmentProto.
  */
  */
 
 
-#ifndef BADVPN_FLOW_FRAGMENTPROTOASSEMBLER_H
-#define BADVPN_FLOW_FRAGMENTPROTOASSEMBLER_H
+#ifndef BADVPN_CLIENT_FRAGMENTPROTOASSEMBLER_H
+#define BADVPN_CLIENT_FRAGMENTPROTOASSEMBLER_H
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <protocol/fragmentproto.h>
 #include <protocol/fragmentproto.h>
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <structure/LinkedList2.h>
 #include <structure/LinkedList2.h>
 #include <structure/BAVL.h>
 #include <structure/BAVL.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>

+ 1 - 1
flow/FragmentProtoDisassembler.c → client/FragmentProtoDisassembler.c

@@ -28,7 +28,7 @@
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
 #include <misc/minmax.h>
 #include <misc/minmax.h>
 
 
-#include <flow/FragmentProtoDisassembler.h>
+#include "client/FragmentProtoDisassembler.h"
 
 
 static void write_chunks (FragmentProtoDisassembler *o)
 static void write_chunks (FragmentProtoDisassembler *o)
 {
 {

+ 3 - 3
flow/FragmentProtoDisassembler.h → client/FragmentProtoDisassembler.h

@@ -25,13 +25,13 @@
  * according to FragmentProto.
  * according to FragmentProto.
  */
  */
 
 
-#ifndef BADVPN_FLOW_CCPROTODISASSEMBLER_H
-#define BADVPN_FLOW_CCPROTODISASSEMBLER_H
+#ifndef BADVPN_CLIENT_CCPROTODISASSEMBLER_H
+#define BADVPN_CLIENT_CCPROTODISASSEMBLER_H
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <protocol/fragmentproto.h>
 #include <protocol/fragmentproto.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <system/BTime.h>
 #include <system/BTime.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>

+ 1 - 1
client/FrameDecider.c

@@ -31,7 +31,7 @@
 #include <misc/ipv4_proto.h>
 #include <misc/ipv4_proto.h>
 #include <misc/igmp_proto.h>
 #include <misc/igmp_proto.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <client/FrameDecider.h>
 #include <client/FrameDecider.h>
 
 

+ 1 - 1
client/FrameDecider.h

@@ -33,7 +33,7 @@
 #include <structure/BAVL.h>
 #include <structure/BAVL.h>
 #include <structure/LinkedList2.h>
 #include <structure/LinkedList2.h>
 #include <structure/LinkedList3.h>
 #include <structure/LinkedList3.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 
 
 struct _FrameDeciderPeer;
 struct _FrameDeciderPeer;

+ 1 - 1
client/PasswordListener.c

@@ -31,7 +31,7 @@
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <misc/offset.h>
 #include <misc/offset.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 #include <nspr_support/DummyPRFileDesc.h>
 #include <nspr_support/DummyPRFileDesc.h>
 #include <nspr_support/BSocketPRFileDesc.h>
 #include <nspr_support/BSocketPRFileDesc.h>
 
 

+ 1 - 1
client/PasswordListener.h

@@ -36,7 +36,7 @@
 #include <keyhi.h>
 #include <keyhi.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/Listener.h>
 #include <system/Listener.h>
 #include <misc/sslsocket.h>
 #include <misc/sslsocket.h>
 #include <structure/LinkedList2.h>
 #include <structure/LinkedList2.h>

+ 2 - 2
client/PasswordSender.h

@@ -31,10 +31,10 @@
 
 
 #include <misc/debugerror.h>
 #include <misc/debugerror.h>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/SinglePacketSender.h>
 #include <flow/SinglePacketSender.h>
 #include <flow/PacketStreamSender.h>
 #include <flow/PacketStreamSender.h>
-#include <flow/StreamSocketSink.h>
+#include <flowextra/StreamSocketSink.h>
 #include <nspr_support/BPRFileDesc.h>
 #include <nspr_support/BPRFileDesc.h>
 #include <nspr_support/PRStreamSink.h>
 #include <nspr_support/PRStreamSink.h>
 
 

+ 2 - 2
flow/SPProtoDecoder.c → client/SPProtoDecoder.c

@@ -26,9 +26,9 @@
 #include <misc/balign.h>
 #include <misc/balign.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
 #include <security/BHash.h>
 #include <security/BHash.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
-#include <flow/SPProtoDecoder.h>
+#include "SPProtoDecoder.h"
 
 
 #include <generated/blog_channel_SPProtoDecoder.h>
 #include <generated/blog_channel_SPProtoDecoder.h>
 
 

+ 3 - 3
flow/SPProtoDecoder.h → client/SPProtoDecoder.h

@@ -24,13 +24,13 @@
  * Object which decodes packets according to SPProto.
  * Object which decodes packets according to SPProto.
  */
  */
 
 
-#ifndef BADVPN_FLOW_SPPROTODECODER_H
-#define BADVPN_FLOW_SPPROTODECODER_H
+#ifndef BADVPN_CLIENT_SPPROTODECODER_H
+#define BADVPN_CLIENT_SPPROTODECODER_H
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <protocol/spproto.h>
 #include <protocol/spproto.h>
 #include <security/BEncryption.h>
 #include <security/BEncryption.h>
 #include <security/OTPChecker.h>
 #include <security/OTPChecker.h>

+ 1 - 1
flow/SPProtoEncoder.c → client/SPProtoEncoder.c

@@ -30,7 +30,7 @@
 #include <security/BRandom.h>
 #include <security/BRandom.h>
 #include <security/BHash.h>
 #include <security/BHash.h>
 
 
-#include <flow/SPProtoEncoder.h>
+#include "SPProtoEncoder.h"
 
 
 static int can_encode (SPProtoEncoder *o);
 static int can_encode (SPProtoEncoder *o);
 static void encode_packet (SPProtoEncoder *o);
 static void encode_packet (SPProtoEncoder *o);

+ 3 - 3
flow/SPProtoEncoder.h → client/SPProtoEncoder.h

@@ -24,14 +24,14 @@
  * Object which encodes packets according to SPProto.
  * Object which encodes packets according to SPProto.
  */
  */
 
 
-#ifndef BADVPN_FLOW_SPPROTOENCODER_H
-#define BADVPN_FLOW_SPPROTOENCODER_H
+#ifndef BADVPN_CLIENT_SPPROTOENCODER_H
+#define BADVPN_CLIENT_SPPROTOENCODER_H
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <protocol/spproto.h>
 #include <protocol/spproto.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <security/BEncryption.h>
 #include <security/BEncryption.h>
 #include <security/OTPGenerator.h>
 #include <security/OTPGenerator.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>

+ 1 - 1
client/StreamPeerIO.c

@@ -28,7 +28,7 @@
 #include <misc/offset.h>
 #include <misc/offset.h>
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <client/StreamPeerIO.h>
 #include <client/StreamPeerIO.h>
 
 

+ 3 - 3
client/StreamPeerIO.h

@@ -33,19 +33,19 @@
 #include <keyhi.h>
 #include <keyhi.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
 #include <structure/LinkedList2.h>
 #include <structure/LinkedList2.h>
-#include <flow/StreamSocketSource.h>
 #include <flow/PacketProtoDecoder.h>
 #include <flow/PacketProtoDecoder.h>
-#include <flow/StreamSocketSink.h>
 #include <flow/PacketStreamSender.h>
 #include <flow/PacketStreamSender.h>
 #include <flow/SinglePacketBuffer.h>
 #include <flow/SinglePacketBuffer.h>
 #include <flow/PacketProtoEncoder.h>
 #include <flow/PacketProtoEncoder.h>
 #include <flow/PacketCopier.h>
 #include <flow/PacketCopier.h>
 #include <flow/PacketPassConnector.h>
 #include <flow/PacketPassConnector.h>
 #include <flow/StreamRecvConnector.h>
 #include <flow/StreamRecvConnector.h>
+#include <flowextra/StreamSocketSource.h>
+#include <flowextra/StreamSocketSink.h>
 #include <nspr_support/PRStreamSink.h>
 #include <nspr_support/PRStreamSink.h>
 #include <nspr_support/PRStreamSource.h>
 #include <nspr_support/PRStreamSource.h>
 #include <client/PasswordListener.h>
 #include <client/PasswordListener.h>

+ 2 - 2
client/client.c

@@ -53,10 +53,10 @@
 #include <security/BRandom.h>
 #include <security/BRandom.h>
 #include <nspr_support/DummyPRFileDesc.h>
 #include <nspr_support/DummyPRFileDesc.h>
 #include <nspr_support/BSocketPRFileDesc.h>
 #include <nspr_support/BSocketPRFileDesc.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 #include <system/BSignal.h>
 #include <system/BSignal.h>
 #include <system/BTime.h>
 #include <system/BTime.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <server_connection/ServerConnection.h>
 #include <server_connection/ServerConnection.h>
 #include <tuntap/BTap.h>
 #include <tuntap/BTap.h>
 
 

+ 1 - 1
dhcpclient/BDHCPClient.c

@@ -34,7 +34,7 @@
 #include <misc/ethernet_proto.h>
 #include <misc/ethernet_proto.h>
 #include <misc/ipv4_proto.h>
 #include <misc/ipv4_proto.h>
 #include <misc/udp_proto.h>
 #include <misc/udp_proto.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <dhcpclient/BDHCPClient.h>
 #include <dhcpclient/BDHCPClient.h>
 
 

+ 3 - 3
dhcpclient/BDHCPClient.h

@@ -27,15 +27,15 @@
 #ifndef BADVPN_DHCPCLIENT_BDHCPCLIENT_H
 #ifndef BADVPN_DHCPCLIENT_BDHCPCLIENT_H
 #define BADVPN_DHCPCLIENT_BDHCPCLIENT_H
 #define BADVPN_DHCPCLIENT_BDHCPCLIENT_H
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
 #include <flow/PacketCopier.h>
 #include <flow/PacketCopier.h>
 #include <flow/SinglePacketBuffer.h>
 #include <flow/SinglePacketBuffer.h>
-#include <flow/DatagramSocketSink.h>
-#include <flow/DatagramSocketSource.h>
 #include <dhcpclient/BDHCPClientCore.h>
 #include <dhcpclient/BDHCPClientCore.h>
 #include <dhcpclient/DHCPIpUdpDecoder.h>
 #include <dhcpclient/DHCPIpUdpDecoder.h>
 #include <dhcpclient/DHCPIpUdpEncoder.h>
 #include <dhcpclient/DHCPIpUdpEncoder.h>
+#include <flowextra/DatagramSocketSink.h>
+#include <flowextra/DatagramSocketSource.h>
 
 
 #define BDHCPCLIENT_EVENT_UP 1
 #define BDHCPCLIENT_EVENT_UP 1
 #define BDHCPCLIENT_EVENT_DOWN 2
 #define BDHCPCLIENT_EVENT_DOWN 2

+ 1 - 1
dhcpclient/BDHCPClientCore.c

@@ -26,7 +26,7 @@
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
 #include <misc/minmax.h>
 #include <misc/minmax.h>
 #include <security/BRandom.h>
 #include <security/BRandom.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <dhcpclient/BDHCPClientCore.h>
 #include <dhcpclient/BDHCPClientCore.h>
 
 

+ 1 - 1
dhcpclient/BDHCPClientCore.h

@@ -32,7 +32,7 @@
 
 
 #include <misc/dhcp_proto.h>
 #include <misc/dhcp_proto.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 
 

+ 1 - 1
dhcpclient/CMakeLists.txt

@@ -1,7 +1,7 @@
 add_library(dhcpclientcore
 add_library(dhcpclientcore
     BDHCPClientCore.c
     BDHCPClientCore.c
 )
 )
-target_link_libraries(dhcpclientcore system flow security)
+target_link_libraries(dhcpclientcore system flow flowextra security)
 
 
 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
     add_library(dhcpclient
     add_library(dhcpclient

+ 1 - 1
dhcpclient/DHCPIpUdpDecoder.h

@@ -25,7 +25,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 
 typedef struct {
 typedef struct {

+ 1 - 1
dhcpclient/DHCPIpUdpEncoder.h

@@ -25,7 +25,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 
 
 typedef struct {
 typedef struct {

+ 1 - 1
examples/CMakeLists.txt

@@ -38,7 +38,7 @@ if (NOT WIN32)
     target_link_libraries(ncdudevmanager_test udevmonitor)
     target_link_libraries(ncdudevmanager_test udevmonitor)
 
 
     add_executable(stdin_input stdin_input.c)
     add_executable(stdin_input stdin_input.c)
-    target_link_libraries(stdin_input system flow)
+    target_link_libraries(stdin_input system flow flowextra)
 endif ()
 endif ()
 
 
 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")

+ 1 - 1
examples/FastPacketSource.h

@@ -27,7 +27,7 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 
 typedef struct {
 typedef struct {

+ 1 - 1
examples/RandomPacketSink.h

@@ -27,7 +27,7 @@
 
 
 #include <security/BRandom.h>
 #include <security/BRandom.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 
 typedef struct {
 typedef struct {

+ 1 - 1
examples/bencryption_bench.c

@@ -28,7 +28,7 @@
 
 
 #include <security/BRandom.h>
 #include <security/BRandom.h>
 #include <security/BEncryption.h>
 #include <security/BEncryption.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 
 
 static void usage (char *name)
 static void usage (char *name)
 {
 {

+ 2 - 2
examples/bprocess_example.c

@@ -24,8 +24,8 @@
 #include <unistd.h>
 #include <unistd.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
-#include <system/BLog.h>
+#include <base/DebugObject.h>
+#include <base/BLog.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <system/BSignal.h>
 #include <system/BSignal.h>
 #include <system/BTime.h>
 #include <system/BTime.h>

+ 1 - 1
examples/btimer_example.c

@@ -25,7 +25,7 @@
 #include <time.h>
 #include <time.h>
 
 
 #include <system/BReactor.h>
 #include <system/BReactor.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 #include <system/BTime.h>
 #include <system/BTime.h>
 
 
 // gives average firing rate 100kHz
 // gives average firing rate 100kHz

+ 2 - 2
examples/dhcpclient_test.c

@@ -23,8 +23,8 @@
 #include <stddef.h>
 #include <stddef.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
-#include <system/BLog.h>
+#include <base/DebugObject.h>
+#include <base/BLog.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <system/BSignal.h>
 #include <system/BSignal.h>
 #include <system/BTime.h>
 #include <system/BTime.h>

+ 1 - 1
examples/fairqueue_test.c

@@ -26,7 +26,7 @@
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 #include <system/BTime.h>
 #include <system/BTime.h>
 #include <flow/PacketPassFairQueue.h>
 #include <flow/PacketPassFairQueue.h>
 #include <examples/FastPacketSource.h>
 #include <examples/FastPacketSource.h>

+ 1 - 1
examples/fairqueue_test2.c

@@ -24,7 +24,7 @@
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 #include <system/BTime.h>
 #include <system/BTime.h>
 #include <flow/PacketPassFairQueue.h>
 #include <flow/PacketPassFairQueue.h>
 #include <examples/FastPacketSource.h>
 #include <examples/FastPacketSource.h>

+ 1 - 1
examples/ncdudevmanager_test.c

@@ -24,7 +24,7 @@
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <system/BTime.h>
 #include <system/BTime.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <system/BUnixSignal.h>
 #include <system/BUnixSignal.h>
 #include <process/BProcess.h>
 #include <process/BProcess.h>

+ 1 - 1
examples/ncdudevmonitor_test.c

@@ -23,7 +23,7 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <system/BTime.h>
 #include <system/BTime.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <system/BSignal.h>
 #include <system/BSignal.h>
 #include <process/BProcess.h>
 #include <process/BProcess.h>

+ 1 - 1
examples/predicate_test.c

@@ -24,7 +24,7 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <predicate/BPredicate.h>
 #include <predicate/BPredicate.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 static int func_hello (void *user, void **args)
 static int func_hello (void *user, void **args)
 {
 {

+ 2 - 2
examples/stdin_input.c

@@ -30,8 +30,8 @@
 #include <system/BReactor.c>
 #include <system/BReactor.c>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
 #include <system/BUnixSignal.h>
 #include <system/BUnixSignal.h>
-#include <system/DebugObject.h>
-#include <flow/StreamSocketSource.h>
+#include <base/DebugObject.h>
+#include <flowextra/StreamSocketSource.h>
 
 
 #define BUF_SIZE 64
 #define BUF_SIZE 64
 
 

+ 1 - 1
flooder/flooder.c

@@ -32,7 +32,7 @@
 #include <misc/nsskey.h>
 #include <misc/nsskey.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
 #include <misc/loggers_string.h>
 #include <misc/loggers_string.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <system/BSignal.h>
 #include <system/BSignal.h>
 #include <flow/SinglePacketBuffer.h>
 #include <flow/SinglePacketBuffer.h>

+ 1 - 1
flow/BufferWriter.h

@@ -31,7 +31,7 @@
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 
 
 /**
 /**

+ 1 - 13
flow/CMakeLists.txt

@@ -1,7 +1,6 @@
 add_library(flow
 add_library(flow
     PacketPassFairQueue.c
     PacketPassFairQueue.c
     PacketPassPriorityQueue.c
     PacketPassPriorityQueue.c
-    PacketPassInactivityMonitor.c
     PacketPassConnector.c
     PacketPassConnector.c
     PacketRecvConnector.c
     PacketRecvConnector.c
     StreamRecvConnector.c
     StreamRecvConnector.c
@@ -11,19 +10,8 @@ add_library(flow
     SinglePacketBuffer.c
     SinglePacketBuffer.c
     PacketCopier.c
     PacketCopier.c
     PacketStreamSender.c
     PacketStreamSender.c
-    KeepaliveIO.c
-    SCKeepaliveSource.c
-    StreamSocketSource.c
-    StreamSocketSink.c
-    DatagramSocketSource.c
-    DatagramSocketSink.c
     PacketProtoEncoder.c
     PacketProtoEncoder.c
     PacketProtoDecoder.c
     PacketProtoDecoder.c
-    FragmentProtoDisassembler.c
-    SPProtoEncoder.c
-    SPProtoDecoder.c
-    FragmentProtoAssembler.c
-    DataProtoKeepaliveSource.c
     PacketProtoFlow.c
     PacketProtoFlow.c
     SinglePacketSender.c
     SinglePacketSender.c
     BufferWriter.c
     BufferWriter.c
@@ -36,4 +24,4 @@ add_library(flow
     PacketRouter.c
     PacketRouter.c
     LineBuffer.c
     LineBuffer.c
 )
 )
-target_link_libraries(flow system security)
+target_link_libraries(flow base)

+ 1 - 1
flow/LineBuffer.c

@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>
 
 
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <flow/LineBuffer.h>
 #include <flow/LineBuffer.h>
 
 

+ 1 - 1
flow/LineBuffer.h

@@ -26,7 +26,7 @@
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/StreamRecvInterface.h>
 #include <flow/StreamRecvInterface.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 

+ 1 - 1
flow/PacketBuffer.h

@@ -30,7 +30,7 @@
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <structure/ChunkBuffer2.h>
 #include <structure/ChunkBuffer2.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>

+ 1 - 1
flow/PacketPassConnector.h

@@ -30,7 +30,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 
 /**
 /**

+ 2 - 2
flow/PacketPassFairQueue.h

@@ -32,8 +32,8 @@
 #include <misc/debugcounter.h>
 #include <misc/debugcounter.h>
 #include <structure/BHeap.h>
 #include <structure/BHeap.h>
 #include <structure/LinkedList2.h>
 #include <structure/LinkedList2.h>
-#include <system/DebugObject.h>
-#include <system/BPending.h>
+#include <base/DebugObject.h>
+#include <base/BPending.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 
 // reduce this to test time overflow handling
 // reduce this to test time overflow handling

+ 2 - 2
flow/PacketPassInterface.h

@@ -31,8 +31,8 @@
 #include <stddef.h>
 #include <stddef.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
-#include <system/BPending.h>
+#include <base/DebugObject.h>
+#include <base/BPending.h>
 
 
 #define PPI_STATE_NONE 1
 #define PPI_STATE_NONE 1
 #define PPI_STATE_OPERATION_PENDING 2
 #define PPI_STATE_OPERATION_PENDING 2

+ 1 - 1
flow/PacketPassNotifier.h

@@ -30,7 +30,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 
 /**
 /**

+ 2 - 2
flow/PacketPassPriorityQueue.h

@@ -31,8 +31,8 @@
 
 
 #include <misc/debugcounter.h>
 #include <misc/debugcounter.h>
 #include <structure/BHeap.h>
 #include <structure/BHeap.h>
-#include <system/DebugObject.h>
-#include <system/BPending.h>
+#include <base/DebugObject.h>
+#include <base/BPending.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 
 typedef void (*PacketPassPriorityQueue_handler_busy) (void *user);
 typedef void (*PacketPassPriorityQueue_handler_busy) (void *user);

+ 1 - 1
flow/PacketProtoDecoder.c

@@ -26,7 +26,7 @@
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
 #include <misc/minmax.h>
 #include <misc/minmax.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <flow/PacketProtoDecoder.h>
 #include <flow/PacketProtoDecoder.h>
 
 

+ 1 - 1
flow/PacketProtoDecoder.h

@@ -32,7 +32,7 @@
 #include <protocol/packetproto.h>
 #include <protocol/packetproto.h>
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <misc/balign.h>
 #include <misc/balign.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/StreamRecvInterface.h>
 #include <flow/StreamRecvInterface.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/FlowError.h>
 #include <flow/FlowError.h>

+ 1 - 1
flow/PacketProtoEncoder.h

@@ -29,7 +29,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 
 
 /**
 /**

+ 1 - 1
flow/PacketProtoFlow.h

@@ -30,7 +30,7 @@
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/BufferWriter.h>
 #include <flow/BufferWriter.h>
 #include <flow/PacketProtoEncoder.h>
 #include <flow/PacketProtoEncoder.h>
 #include <flow/PacketBuffer.h>
 #include <flow/PacketBuffer.h>

+ 1 - 1
flow/PacketRecvBlocker.h

@@ -30,7 +30,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 
 
 /**
 /**

+ 1 - 1
flow/PacketRecvConnector.h

@@ -30,7 +30,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 
 
 /**
 /**

+ 2 - 2
flow/PacketRecvInterface.h

@@ -31,8 +31,8 @@
 #include <stddef.h>
 #include <stddef.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
-#include <system/BPending.h>
+#include <base/DebugObject.h>
+#include <base/BPending.h>
 
 
 #define PRI_STATE_NONE 1
 #define PRI_STATE_NONE 1
 #define PRI_STATE_OPERATION_PENDING 2
 #define PRI_STATE_OPERATION_PENDING 2

+ 2 - 2
flow/PacketRouter.h

@@ -28,8 +28,8 @@
 #ifndef BADVPN_FLOW_PACKETROUTER_H
 #ifndef BADVPN_FLOW_PACKETROUTER_H
 #define BADVPN_FLOW_PACKETROUTER_H
 #define BADVPN_FLOW_PACKETROUTER_H
 
 
-#include <system/DebugObject.h>
-#include <system/BPending.h>
+#include <base/DebugObject.h>
+#include <base/BPending.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/RouteBuffer.h>
 #include <flow/RouteBuffer.h>
 
 

+ 1 - 1
flow/PacketStreamSender.h

@@ -30,7 +30,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/StreamPassInterface.h>
 #include <flow/StreamPassInterface.h>
 
 

+ 1 - 1
flow/RouteBuffer.h

@@ -29,7 +29,7 @@
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <structure/LinkedList1.h>
 #include <structure/LinkedList1.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 
 struct RouteBuffer_packet {
 struct RouteBuffer_packet {

+ 1 - 1
flow/SinglePacketBuffer.h

@@ -31,7 +31,7 @@
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 

+ 1 - 1
flow/SinglePacketSender.h

@@ -30,7 +30,7 @@
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debugerror.h>
 #include <misc/debugerror.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 
 /**
 /**

+ 2 - 2
flow/StreamPassInterface.h

@@ -36,8 +36,8 @@
 #include <stddef.h>
 #include <stddef.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
-#include <system/BPending.h>
+#include <base/DebugObject.h>
+#include <base/BPending.h>
 
 
 #define SPI_STATE_NONE 1
 #define SPI_STATE_NONE 1
 #define SPI_STATE_OPERATION_PENDING 2
 #define SPI_STATE_OPERATION_PENDING 2

+ 1 - 1
flow/StreamRecvConnector.h

@@ -30,7 +30,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <flow/StreamRecvInterface.h>
 #include <flow/StreamRecvInterface.h>
 
 
 /**
 /**

+ 2 - 2
flow/StreamRecvInterface.h

@@ -36,8 +36,8 @@
 #include <stddef.h>
 #include <stddef.h>
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
-#include <system/BPending.h>
+#include <base/DebugObject.h>
+#include <base/BPending.h>
 
 
 #define SRI_STATE_NONE 1
 #define SRI_STATE_NONE 1
 #define SRI_STATE_OPERATION_PENDING 2
 #define SRI_STATE_OPERATION_PENDING 2

+ 9 - 0
flowextra/CMakeLists.txt

@@ -0,0 +1,9 @@
+add_library(flowextra
+    DatagramSocketSource.c
+    DatagramSocketSink.c
+    StreamSocketSource.c
+    StreamSocketSink.c
+    PacketPassInactivityMonitor.c
+    KeepaliveIO.c
+)
+target_link_libraries(flowextra flow system security)

+ 2 - 2
flow/DatagramSocketSink.c → flowextra/DatagramSocketSink.c

@@ -21,9 +21,9 @@
  */
  */
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
-#include <flow/DatagramSocketSink.h>
+#include "DatagramSocketSink.h"
 
 
 #include <generated/blog_channel_DatagramSocketSink.h>
 #include <generated/blog_channel_DatagramSocketSink.h>
 
 

+ 3 - 3
flow/DatagramSocketSink.h → flowextra/DatagramSocketSink.h

@@ -24,12 +24,12 @@
  * A {@link PacketPassInterface} sink which sends packets to a datagram socket.
  * A {@link PacketPassInterface} sink which sends packets to a datagram socket.
  */
  */
 
 
-#ifndef BADVPN_FLOW_DATAGRAMSOCKETSINK_H
-#define BADVPN_FLOW_DATAGRAMSOCKETSINK_H
+#ifndef BADVPN_DATAGRAMSOCKETSINK_H
+#define BADVPN_DATAGRAMSOCKETSINK_H
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/FlowError.h>
 #include <flow/FlowError.h>

+ 2 - 2
flow/DatagramSocketSource.c → flowextra/DatagramSocketSource.c

@@ -21,9 +21,9 @@
  */
  */
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
-#include <flow/DatagramSocketSource.h>
+#include "DatagramSocketSource.h"
 
 
 #include <generated/blog_channel_DatagramSocketSource.h>
 #include <generated/blog_channel_DatagramSocketSource.h>
 
 

+ 4 - 4
flow/DatagramSocketSource.h → flowextra/DatagramSocketSource.h

@@ -24,14 +24,14 @@
  * A {@link PacketRecvInterface} source which receives packets from a datagram socket.
  * A {@link PacketRecvInterface} source which receives packets from a datagram socket.
  */
  */
 
 
-#ifndef BADVPN_FLOW_DATAGRAMSOCKETSOURCE_H
-#define BADVPN_FLOW_DATAGRAMSOCKETSOURCE_H
+#ifndef BADVPN_DATAGRAMSOCKETSOURCE_H
+#define BADVPN_DATAGRAMSOCKETSOURCE_H
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
-#include <system/BPending.h>
+#include <base/BPending.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/FlowError.h>
 #include <flow/FlowError.h>
 
 

+ 1 - 1
flow/KeepaliveIO.c → flowextra/KeepaliveIO.c

@@ -22,7 +22,7 @@
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
 
 
-#include <flow/KeepaliveIO.h>
+#include "KeepaliveIO.h"
 
 
 static void keepalive_handler (KeepaliveIO *o)
 static void keepalive_handler (KeepaliveIO *o)
 {
 {

+ 4 - 4
flow/KeepaliveIO.h → flowextra/KeepaliveIO.h

@@ -24,18 +24,18 @@
  * A {@link PacketPassInterface} layer for sending keep-alive packets.
  * A {@link PacketPassInterface} layer for sending keep-alive packets.
  */
  */
 
 
-#ifndef BADVPN_FLOW_KEEPALIVEIO
-#define BADVPN_FLOW_KEEPALIVEIO
+#ifndef BADVPN_KEEPALIVEIO
+#define BADVPN_KEEPALIVEIO
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketRecvInterface.h>
 #include <flow/PacketPassPriorityQueue.h>
 #include <flow/PacketPassPriorityQueue.h>
 #include <flow/SinglePacketBuffer.h>
 #include <flow/SinglePacketBuffer.h>
 #include <flow/PacketRecvBlocker.h>
 #include <flow/PacketRecvBlocker.h>
-#include <flow/PacketPassInactivityMonitor.h>
+#include <flowextra/PacketPassInactivityMonitor.h>
 
 
 /**
 /**
  * A {@link PacketPassInterface} layer for sending keep-alive packets.
  * A {@link PacketPassInterface} layer for sending keep-alive packets.

+ 1 - 1
flow/PacketPassInactivityMonitor.c → flowextra/PacketPassInactivityMonitor.c

@@ -20,7 +20,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
  */
 
 
-#include <flow/PacketPassInactivityMonitor.h>
+#include "PacketPassInactivityMonitor.h"
 
 
 static void input_handler_send (PacketPassInactivityMonitor *o, uint8_t *data, int data_len)
 static void input_handler_send (PacketPassInactivityMonitor *o, uint8_t *data, int data_len)
 {
 {

+ 3 - 3
flow/PacketPassInactivityMonitor.h → flowextra/PacketPassInactivityMonitor.h

@@ -24,10 +24,10 @@
  * A {@link PacketPassInterface} layer for detecting inactivity.
  * A {@link PacketPassInterface} layer for detecting inactivity.
  */
  */
 
 
-#ifndef BADVPN_FLOW_PACKETPASSINACTIVITYMONITOR_H
-#define BADVPN_FLOW_PACKETPASSINACTIVITYMONITOR_H
+#ifndef BADVPN_PACKETPASSINACTIVITYMONITOR_H
+#define BADVPN_PACKETPASSINACTIVITYMONITOR_H
 
 
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BReactor.h>
 #include <system/BReactor.h>
 #include <flow/PacketPassInterface.h>
 #include <flow/PacketPassInterface.h>
 
 

+ 2 - 2
flow/StreamSocketSink.c → flowextra/StreamSocketSink.c

@@ -21,9 +21,9 @@
  */
  */
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
-#include <flow/StreamSocketSink.h>
+#include "StreamSocketSink.h"
 
 
 #include <generated/blog_channel_StreamSocketSink.h>
 #include <generated/blog_channel_StreamSocketSink.h>
 
 

+ 3 - 3
flow/StreamSocketSink.h → flowextra/StreamSocketSink.h

@@ -24,13 +24,13 @@
  * A {@link StreamPassInterface} sink which sends data to a stream socket.
  * A {@link StreamPassInterface} sink which sends data to a stream socket.
  */
  */
 
 
-#ifndef BADVPN_FLOW_STREAMSOCKETSINK_H
-#define BADVPN_FLOW_STREAMSOCKETSINK_H
+#ifndef BADVPN_STREAMSOCKETSINK_H
+#define BADVPN_STREAMSOCKETSINK_H
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debugerror.h>
 #include <misc/debugerror.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
 #include <flow/StreamPassInterface.h>
 #include <flow/StreamPassInterface.h>
 #include <flow/FlowError.h>
 #include <flow/FlowError.h>

+ 2 - 2
flow/StreamSocketSource.c → flowextra/StreamSocketSource.c

@@ -21,9 +21,9 @@
  */
  */
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
-#include <flow/StreamSocketSource.h>
+#include "StreamSocketSource.h"
 
 
 #include <generated/blog_channel_StreamSocketSource.h>
 #include <generated/blog_channel_StreamSocketSource.h>
 
 

+ 3 - 3
flow/StreamSocketSource.h → flowextra/StreamSocketSource.h

@@ -24,13 +24,13 @@
  * A {@link StreamRecvInterface} source which receives data from a stream socket.
  * A {@link StreamRecvInterface} source which receives data from a stream socket.
  */
  */
 
 
-#ifndef BADVPN_FLOW_STREAMSOCKETSOURCE_H
-#define BADVPN_FLOW_STREAMSOCKETSOURCE_H
+#ifndef BADVPN_STREAMSOCKETSOURCE_H
+#define BADVPN_STREAMSOCKETSOURCE_H
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include <misc/debugerror.h>
 #include <misc/debugerror.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
 #include <flow/StreamRecvInterface.h>
 #include <flow/StreamRecvInterface.h>
 #include <flow/FlowError.h>
 #include <flow/FlowError.h>

+ 1 - 1
inputprocess/BInputProcess.c

@@ -22,7 +22,7 @@
 
 
 #include <unistd.h>
 #include <unistd.h>
 
 
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #include <inputprocess/BInputProcess.h>
 #include <inputprocess/BInputProcess.h>
 
 

+ 2 - 2
inputprocess/BInputProcess.h

@@ -24,10 +24,10 @@
 #define BADVPN_INPUTPROCESS_BINPUTPROCESS_H
 #define BADVPN_INPUTPROCESS_BINPUTPROCESS_H
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/DebugObject.h>
+#include <base/DebugObject.h>
 #include <system/BSocket.h>
 #include <system/BSocket.h>
 #include <process/BProcess.h>
 #include <process/BProcess.h>
-#include <flow/StreamSocketSource.h>
+#include <flowextra/StreamSocketSource.h>
 
 
 typedef void (*BInputProcess_handler_terminated) (void *user, int normally, uint8_t normally_exit_status);
 typedef void (*BInputProcess_handler_terminated) (void *user, int normally, uint8_t normally_exit_status);
 typedef void (*BInputProcess_handler_closed) (void *user, int is_error);
 typedef void (*BInputProcess_handler_closed) (void *user, int is_error);

+ 1 - 1
inputprocess/CMakeLists.txt

@@ -1,4 +1,4 @@
 add_library(inputprocess
 add_library(inputprocess
     BInputProcess.c
     BInputProcess.c
 )
 )
-target_link_libraries(inputprocess system flow process)
+target_link_libraries(inputprocess system flow flowextra process)

+ 1 - 1
lwip/custom/arch/cc.h

@@ -30,7 +30,7 @@
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
 #include <misc/byteorder.h>
 #include <misc/byteorder.h>
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 #define u8_t uint8_t
 #define u8_t uint8_t
 #define s8_t int8_t
 #define s8_t int8_t

+ 1 - 1
misc/debugerror.h

@@ -29,7 +29,7 @@
 #define BADVPN_MISC_DEBUGERROR_H
 #define BADVPN_MISC_DEBUGERROR_H
 
 
 #include <misc/debug.h>
 #include <misc/debug.h>
-#include <system/BPending.h>
+#include <base/BPending.h>
 
 
 #ifndef NDEBUG
 #ifndef NDEBUG
     #define DEBUGERROR(de, call) \
     #define DEBUGERROR(de, call) \

+ 1 - 1
misc/loglevel.h

@@ -29,7 +29,7 @@
 
 
 #include <string.h>
 #include <string.h>
 
 
-#include <system/BLog.h>
+#include <base/BLog.h>
 
 
 /**
 /**
  * Parses the log level string.
  * Parses the log level string.

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů