aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/Makefile.am1
-rw-r--r--src/transport/transport-testing.h62
2 files changed, 62 insertions, 1 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index c571364ab..24984a957 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -73,6 +73,7 @@ libgnunettransporttesting_la_LIBADD = \
73 $(top_builddir)/src/transport/libgnunettransport.la \ 73 $(top_builddir)/src/transport/libgnunettransport.la \
74 $(top_builddir)/src/hello/libgnunethello.la \ 74 $(top_builddir)/src/hello/libgnunethello.la \
75 $(top_builddir)/src/util/libgnunetutil.la \ 75 $(top_builddir)/src/util/libgnunetutil.la \
76 $(top_builddir)/src/testing/libgnunettesting.la \
76 $(GN_LIBINTL) 77 $(GN_LIBINTL)
77libgnunettransporttesting_la_DEPENDENCIES = \ 78libgnunettransporttesting_la_DEPENDENCIES = \
78 libgnunettransport.la 79 libgnunettransport.la
diff --git a/src/transport/transport-testing.h b/src/transport/transport-testing.h
index 20e802dfa..639eff018 100644
--- a/src/transport/transport-testing.h
+++ b/src/transport/transport-testing.h
@@ -33,6 +33,7 @@
33#include "gnunet_program_lib.h" 33#include "gnunet_program_lib.h"
34#include "gnunet_container_lib.h" 34#include "gnunet_container_lib.h"
35#include "gnunet_transport_service.h" 35#include "gnunet_transport_service.h"
36#include "gnunet_testing_lib-new.h"
36 37
37 38
38#define GNUNET_TRANSPORT_TESTING_ConnectRequest void * 39#define GNUNET_TRANSPORT_TESTING_ConnectRequest void *
@@ -59,7 +60,9 @@ typedef void (*GNUNET_TRANSPORT_TESTING_connect_cb) (struct PeerContext * p1,
59 void *cls); 60 void *cls);
60 61
61 62
62 63/**
64 * Definition for a transport testing handle
65 */
63struct GNUNET_TRANSPORT_TESTING_handle; 66struct GNUNET_TRANSPORT_TESTING_handle;
64 67
65/** 68/**
@@ -67,37 +70,94 @@ struct GNUNET_TRANSPORT_TESTING_handle;
67 */ 70 */
68struct PeerContext 71struct PeerContext
69{ 72{
73 /**
74 * Next element in the DLL
75 */
70 struct PeerContext *next; 76 struct PeerContext *next;
77
78 /**
79 * Previous element in the DLL
80 */
71 struct PeerContext *prev; 81 struct PeerContext *prev;
72 82
83 /**
84 * Transport testing handle this peer belongs to
85 */
73 struct GNUNET_TRANSPORT_TESTING_handle *tth; 86 struct GNUNET_TRANSPORT_TESTING_handle *tth;
74 87
88 /**
89 * Peer's configuration
90 */
75 struct GNUNET_CONFIGURATION_Handle *cfg; 91 struct GNUNET_CONFIGURATION_Handle *cfg;
76 92
93 /**
94 * Peer's transport service handle
95 */
77 struct GNUNET_TRANSPORT_Handle *th; 96 struct GNUNET_TRANSPORT_Handle *th;
78 97
98 /**
99 * Peer's transport get hello handle to retrieve peer's HELLO message
100 */
79 struct GNUNET_TRANSPORT_GetHelloHandle *ghh; 101 struct GNUNET_TRANSPORT_GetHelloHandle *ghh;
80 102
103 /**
104 * Peer's testing handle
105 */
106 struct GNUNET_TESTING_Peer *peer;
107
108 /**
109 * Peer identity
110 */
81 struct GNUNET_PeerIdentity id; 111 struct GNUNET_PeerIdentity id;
82 112
113 /**
114 * Handle for the peer's ARM process
115 */
83 struct GNUNET_OS_Process *arm_proc; 116 struct GNUNET_OS_Process *arm_proc;
84 117
118 /**
119 * Receive callback
120 */
85 GNUNET_TRANSPORT_ReceiveCallback rec; 121 GNUNET_TRANSPORT_ReceiveCallback rec;
86 122
123 /**
124 * Notify connect callback
125 */
87 GNUNET_TRANSPORT_NotifyConnect nc; 126 GNUNET_TRANSPORT_NotifyConnect nc;
88 127
128 /**
129 * Notify disconnect callback
130 */
89 GNUNET_TRANSPORT_NotifyDisconnect nd; 131 GNUNET_TRANSPORT_NotifyDisconnect nd;
90 132
133 /**
134 * Startup completed callback
135 */
91 GNUNET_TRANSPORT_TESTING_start_cb start_cb; 136 GNUNET_TRANSPORT_TESTING_start_cb start_cb;
92 137
138 /**
139 * Peers HELLO Message
140 */
93 struct GNUNET_HELLO_Message *hello; 141 struct GNUNET_HELLO_Message *hello;
94 142
143 /**
144 * Closure for the callbacks
145 */
95 void *cb_cls; 146 void *cb_cls;
96 147
148 /**
149 * Peer's service home directory
150 */
97 char *servicehome; 151 char *servicehome;
98 152
153 /**
154 * Hostkey file
155 */
99 char *hostkeyfile; 156 char *hostkeyfile;
100 157
158 /**
159 * An unique number to identify the peer
160 */
101 unsigned int no; 161 unsigned int no;
102}; 162};
103 163