Changeset 1941928beef9f0cad9a9bf2b4b341523aa01bfa5
- Timestamp:
- 01/17/07 17:48:37
(4 years ago)
- Author:
- hansp <hansp>
- git-committer:
- hansp <hansp> 1169074117 +0000
- git-parent:
[453d0bc5fd6d8bd133e170e04983aa7ed8ecd2e8]
- git-author:
- hansp <hansp> 1169074117 +0000
- Message:
Adapt to FlowIPService changes.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rf74aea3 |
r1941928 |
|
| 55 | 55 | |
|---|
| 56 | 56 | static void |
|---|
| 57 | | resolved (FlowIPResolver *ip_resolver, GList *addr_list, GList *name_list) |
|---|
| | 57 | resolved (GList *addr_list, GList *name_list, FlowIPResolver *ip_resolver) |
|---|
| 58 | 58 | { |
|---|
| 59 | 59 | GList *l; |
|---|
| … | … | |
| 114 | 114 | ip_resolver = flow_ip_resolver_new (); |
|---|
| 115 | 115 | |
|---|
| 116 | | g_signal_connect (ip_resolver, "resolved", (GCallback) resolved, NULL); |
|---|
| 117 | | |
|---|
| 118 | 116 | for (i = 0; resolve_names [i]; i++) |
|---|
| 119 | 117 | { |
|---|
| 120 | | flow_ip_resolver_resolve_name (ip_resolver, resolve_names [i]); |
|---|
| | 118 | flow_ip_resolver_resolve_name (ip_resolver, resolve_names [i], |
|---|
| | 119 | (FlowIPLookupFunc *) resolved, ip_resolver); |
|---|
| 121 | 120 | } |
|---|
| 122 | 121 | |
|---|
| … | … | |
| 131 | 130 | test_end (TEST_RESULT_FAILED, "IP address parser failed"); |
|---|
| 132 | 131 | |
|---|
| 133 | | flow_ip_resolver_resolve_ip_addr (ip_resolver, ip_addr); |
|---|
| | 132 | flow_ip_resolver_resolve_ip_addr (ip_resolver, ip_addr, |
|---|
| | 133 | (FlowIPLookupFunc *) resolved, ip_resolver); |
|---|
| 134 | 134 | |
|---|
| 135 | 135 | g_object_unref (ip_addr); |
|---|
| r9dad0bb |
r1941928 |
|
| 181 | 181 | else if (FLOW_IS_IP_SERVICE (object)) |
|---|
| 182 | 182 | { |
|---|
| 183 | | gchar *string; |
|---|
| 184 | | |
|---|
| 185 | | string = flow_ip_addr_get_string (FLOW_IP_ADDR (object)); |
|---|
| | 183 | FlowIPAddr *ip_addr; |
|---|
| | 184 | gchar *string; |
|---|
| | 185 | |
|---|
| | 186 | ip_addr = flow_ip_service_find_address (FLOW_IP_SERVICE (object), FLOW_IP_ADDR_ANY_FAMILY); |
|---|
| | 187 | if (!ip_addr) |
|---|
| | 188 | test_end (TEST_RESULT_FAILED, "no suitable address passed for remote end"); |
|---|
| | 189 | |
|---|
| | 190 | string = flow_ip_addr_get_string (ip_addr); |
|---|
| 186 | 191 | test_print ("Read: Got remote IP service %s:%d.\n", string, flow_ip_service_get_port (FLOW_IP_SERVICE (object))); |
|---|
| | 192 | |
|---|
| | 193 | g_object_unref (ip_addr); |
|---|
| 187 | 194 | } |
|---|
| 188 | 195 | else if (!FLOW_IS_EVENT (object)) |
|---|
| … | … | |
| 380 | 387 | { |
|---|
| 381 | 388 | FlowIPService *loopback_service; |
|---|
| | 389 | FlowIPAddr *ip_addr; |
|---|
| 382 | 390 | gint i; |
|---|
| 383 | 391 | |
|---|
| … | … | |
| 414 | 422 | |
|---|
| 415 | 423 | loopback_service = flow_ip_service_new (); |
|---|
| 416 | | flow_ip_addr_set_string (FLOW_IP_ADDR (loopback_service), "127.0.0.1"); |
|---|
| | 424 | ip_addr = flow_ip_addr_new (); |
|---|
| | 425 | |
|---|
| | 426 | flow_ip_addr_set_string (ip_addr, "127.0.0.1"); |
|---|
| 417 | 427 | flow_ip_service_set_port (loopback_service, 2533); |
|---|
| | 428 | flow_ip_service_add_address (loopback_service, ip_addr); |
|---|
| | 429 | |
|---|
| | 430 | g_object_unref (ip_addr); |
|---|
| 418 | 431 | |
|---|
| 419 | 432 | listener_shunt = flow_open_tcp_listener (loopback_service); |
|---|
| rf74aea3 |
r1941928 |
|
| 186 | 186 | { |
|---|
| 187 | 187 | FlowIPService *ip_service = FLOW_IP_SERVICE (object); |
|---|
| | 188 | FlowIPAddr *ip_addr; |
|---|
| 188 | 189 | gchar *addr_str; |
|---|
| 189 | 190 | |
|---|
| 190 | | addr_str = flow_ip_addr_get_string (FLOW_IP_ADDR (ip_service)); |
|---|
| | 191 | ip_addr = flow_ip_service_find_address (ip_service, FLOW_IP_ADDR_ANY_FAMILY); |
|---|
| | 192 | if (!ip_addr) |
|---|
| | 193 | test_end (TEST_RESULT_FAILED, "no suitable address passed for remote end"); |
|---|
| | 194 | |
|---|
| | 195 | addr_str = flow_ip_addr_get_string (ip_addr); |
|---|
| 191 | 196 | test_print ("Read: Got source address %s:%d\n", addr_str, flow_ip_service_get_port (ip_service)); |
|---|
| 192 | 197 | g_free (addr_str); |
|---|
| | 198 | |
|---|
| | 199 | g_object_unref (ip_addr); |
|---|
| 193 | 200 | } |
|---|
| 194 | 201 | else if (!FLOW_IS_EVENT (object)) |
|---|
| … | … | |
| 322 | 329 | test_run (void) |
|---|
| 323 | 330 | { |
|---|
| 324 | | gint i; |
|---|
| | 331 | FlowIPAddr *ip_addr; |
|---|
| | 332 | gint i; |
|---|
| 325 | 333 | |
|---|
| 326 | 334 | g_random_set_seed (time (NULL)); |
|---|
| … | … | |
| 356 | 364 | |
|---|
| 357 | 365 | sender_service = flow_ip_service_new (); |
|---|
| 358 | | flow_ip_addr_set_string (FLOW_IP_ADDR (sender_service), "127.0.0.1"); |
|---|
| | 366 | ip_addr = flow_ip_addr_new (); |
|---|
| | 367 | flow_ip_addr_set_string (ip_addr, "127.0.0.1"); |
|---|
| 359 | 368 | flow_ip_service_set_port (sender_service, 2533); |
|---|
| | 369 | flow_ip_service_add_address (sender_service, ip_addr); |
|---|
| | 370 | g_object_unref (ip_addr); |
|---|
| 360 | 371 | |
|---|
| 361 | 372 | recipient_service = flow_ip_service_new (); |
|---|
| 362 | | flow_ip_addr_set_string (FLOW_IP_ADDR (recipient_service), "127.0.0.1"); |
|---|
| | 373 | ip_addr = flow_ip_addr_new (); |
|---|
| | 374 | flow_ip_addr_set_string (ip_addr, "127.0.0.1"); |
|---|
| 363 | 375 | flow_ip_service_set_port (recipient_service, 2534); |
|---|
| | 376 | flow_ip_service_add_address (recipient_service, ip_addr); |
|---|
| | 377 | g_object_unref (ip_addr); |
|---|
| 364 | 378 | |
|---|
| 365 | 379 | sender_shunt = flow_open_udp_port (sender_service); |
|---|
| r70e5c4e |
r1941928 |
|
| 332 | 332 | test_run (void) |
|---|
| 333 | 333 | { |
|---|
| 334 | | gint i; |
|---|
| | 334 | FlowIPAddr *ip_addr; |
|---|
| | 335 | gint i; |
|---|
| 335 | 336 | |
|---|
| 336 | 337 | g_random_set_seed (time (NULL)); |
|---|
| … | … | |
| 360 | 361 | |
|---|
| 361 | 362 | loopback_service = flow_ip_service_new (); |
|---|
| 362 | | flow_ip_addr_set_string (FLOW_IP_ADDR (loopback_service), "127.0.0.1"); |
|---|
| | 363 | ip_addr = flow_ip_addr_new (); |
|---|
| | 364 | flow_ip_addr_set_string (ip_addr, "127.0.0.1"); |
|---|
| 363 | 365 | flow_ip_service_set_port (loopback_service, 2533); |
|---|
| | 366 | flow_ip_service_add_address (loopback_service, ip_addr); |
|---|
| | 367 | g_object_unref (ip_addr); |
|---|
| 364 | 368 | |
|---|
| 365 | 369 | bad_loopback_service = flow_ip_service_new (); |
|---|
| 366 | | flow_ip_addr_set_string (FLOW_IP_ADDR (bad_loopback_service), "127.0.0.1"); |
|---|
| | 370 | ip_addr = flow_ip_addr_new (); |
|---|
| | 371 | flow_ip_addr_set_string (ip_addr, "127.0.0.1"); |
|---|
| 367 | 372 | flow_ip_service_set_port (bad_loopback_service, 12505); |
|---|
| | 373 | flow_ip_service_add_address (bad_loopback_service, ip_addr); |
|---|
| | 374 | g_object_unref (ip_addr); |
|---|
| 368 | 375 | |
|---|
| 369 | 376 | tcp_listener = flow_tcp_io_listener_new (); |
|---|
| r9dbaa8f |
r1941928 |
|
| 390 | 390 | test_run (void) |
|---|
| 391 | 391 | { |
|---|
| 392 | | gint i; |
|---|
| | 392 | FlowIPAddr *ip_addr; |
|---|
| | 393 | gint i; |
|---|
| 393 | 394 | |
|---|
| 394 | 395 | g_random_set_seed (time (NULL)); |
|---|
| … | … | |
| 418 | 419 | |
|---|
| 419 | 420 | loopback_service = flow_ip_service_new (); |
|---|
| 420 | | flow_ip_addr_set_string (FLOW_IP_ADDR (loopback_service), "127.0.0.1"); |
|---|
| | 421 | ip_addr = flow_ip_addr_new (); |
|---|
| | 422 | flow_ip_addr_set_string (ip_addr, "127.0.0.1"); |
|---|
| 421 | 423 | flow_ip_service_set_port (loopback_service, 2533); |
|---|
| | 424 | flow_ip_service_add_address (loopback_service, ip_addr); |
|---|
| | 425 | g_object_unref (ip_addr); |
|---|
| 422 | 426 | |
|---|
| 423 | 427 | bad_loopback_service = flow_ip_service_new (); |
|---|
| 424 | | flow_ip_addr_set_string (FLOW_IP_ADDR (bad_loopback_service), "127.0.0.1"); |
|---|
| | 428 | ip_addr = flow_ip_addr_new (); |
|---|
| | 429 | flow_ip_addr_set_string (ip_addr, "127.0.0.1"); |
|---|
| 425 | 430 | flow_ip_service_set_port (bad_loopback_service, 12505); |
|---|
| | 431 | flow_ip_service_add_address (bad_loopback_service, ip_addr); |
|---|
| | 432 | g_object_unref (ip_addr); |
|---|
| 426 | 433 | |
|---|
| 427 | 434 | tls_tcp_listener = flow_tls_tcp_io_listener_new (); |
|---|