diff options
Diffstat (limited to 'src/include/gnunet_testing_lib.h')
-rw-r--r-- | src/include/gnunet_testing_lib.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index d96743615..d4c5b5b37 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -67,6 +67,29 @@ struct GNUNET_TESTING_Peer; | |||
67 | 67 | ||
68 | 68 | ||
69 | /** | 69 | /** |
70 | * Specification of a service that is to be shared among peers | ||
71 | */ | ||
72 | struct GNUNET_TESTING_SharedService | ||
73 | { | ||
74 | /** | ||
75 | * The name of the service. | ||
76 | */ | ||
77 | const char *service; | ||
78 | |||
79 | /** | ||
80 | * The configuration template for the service. Cannot be NULL | ||
81 | */ | ||
82 | const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
83 | |||
84 | /** | ||
85 | * The number of peers which share an instance of the service. 0 for sharing | ||
86 | * among all peers | ||
87 | */ | ||
88 | unsigned int share; | ||
89 | }; | ||
90 | |||
91 | |||
92 | /** | ||
70 | * Create a system handle. There must only be one system handle per operating | 93 | * Create a system handle. There must only be one system handle per operating |
71 | * system. Uses a default range for allowed ports. Ports are still tested for | 94 | * system. Uses a default range for allowed ports. Ports are still tested for |
72 | * availability. | 95 | * availability. |
@@ -80,12 +103,16 @@ struct GNUNET_TESTING_Peer; | |||
80 | * in CIDR notation. | 103 | * in CIDR notation. |
81 | * @param hostname the hostname of the system we are using for testing; NULL for | 104 | * @param hostname the hostname of the system we are using for testing; NULL for |
82 | * localhost | 105 | * localhost |
106 | * @param shared_services NULL terminated array describing services that are to | ||
107 | * be shared among peers | ||
83 | * @return handle to this system, NULL on error | 108 | * @return handle to this system, NULL on error |
84 | */ | 109 | */ |
85 | struct GNUNET_TESTING_System * | 110 | struct GNUNET_TESTING_System * |
86 | GNUNET_TESTING_system_create (const char *testdir, | 111 | GNUNET_TESTING_system_create (const char *testdir, |
87 | const char *trusted_ip, | 112 | const char *trusted_ip, |
88 | const char *hostname); | 113 | const char *hostname, |
114 | const struct GNUNET_TESTING_SharedService ** | ||
115 | shared_services); | ||
89 | 116 | ||
90 | 117 | ||
91 | /** | 118 | /** |
@@ -104,6 +131,8 @@ GNUNET_TESTING_system_create (const char *testdir, | |||
104 | * in CIDR notation. | 131 | * in CIDR notation. |
105 | * @param hostname the hostname of the system we are using for testing; NULL for | 132 | * @param hostname the hostname of the system we are using for testing; NULL for |
106 | * localhost | 133 | * localhost |
134 | * @param shared_services NULL terminated array describing services that are to | ||
135 | * be shared among peers | ||
107 | * @param lowport lowest port number this system is allowed to allocate (inclusive) | 136 | * @param lowport lowest port number this system is allowed to allocate (inclusive) |
108 | * @param highport highest port number this system is allowed to allocate (exclusive) | 137 | * @param highport highest port number this system is allowed to allocate (exclusive) |
109 | * @return handle to this system, NULL on error | 138 | * @return handle to this system, NULL on error |
@@ -112,6 +141,9 @@ struct GNUNET_TESTING_System * | |||
112 | GNUNET_TESTING_system_create_with_portrange (const char *testdir, | 141 | GNUNET_TESTING_system_create_with_portrange (const char *testdir, |
113 | const char *trusted_ip, | 142 | const char *trusted_ip, |
114 | const char *hostname, | 143 | const char *hostname, |
144 | const struct | ||
145 | GNUNET_TESTING_SharedService ** | ||
146 | shared_services, | ||
115 | uint16_t lowport, | 147 | uint16_t lowport, |
116 | uint16_t highport); | 148 | uint16_t highport); |
117 | 149 | ||