diff options
Diffstat (limited to 'src/vpn/vpn_api.c')
-rw-r--r-- | src/vpn/vpn_api.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c index e4da5fae0..8539a6a37 100644 --- a/src/vpn/vpn_api.c +++ b/src/vpn/vpn_api.c | |||
@@ -143,12 +143,6 @@ struct GNUNET_VPN_RedirectionRequest | |||
143 | int addr_af; | 143 | int addr_af; |
144 | 144 | ||
145 | /** | 145 | /** |
146 | * GNUNET_YES if we are to call the callback only after successful | ||
147 | * mesh tunnel creation. | ||
148 | */ | ||
149 | int nac; | ||
150 | |||
151 | /** | ||
152 | * For service redirection, IPPROT_UDP or IPPROTO_TCP. | 146 | * For service redirection, IPPROT_UDP or IPPROTO_TCP. |
153 | */ | 147 | */ |
154 | uint8_t protocol; | 148 | uint8_t protocol; |
@@ -285,7 +279,7 @@ transmit_request (void *cls, | |||
285 | GNUNET_assert (ret <= size); | 279 | GNUNET_assert (ret <= size); |
286 | rs.header.size = htons ((uint16_t) ret); | 280 | rs.header.size = htons ((uint16_t) ret); |
287 | rs.header.type = htons (GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_SERVICE); | 281 | rs.header.type = htons (GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_SERVICE); |
288 | rs.nac = htonl (rr->nac); | 282 | rs.reserved = htonl (0); |
289 | rs.expiration_time = GNUNET_TIME_absolute_hton (rr->expiration_time); | 283 | rs.expiration_time = GNUNET_TIME_absolute_hton (rr->expiration_time); |
290 | rs.protocol = htonl (rr->protocol); | 284 | rs.protocol = htonl (rr->protocol); |
291 | rs.result_af = htonl (rr->result_af); | 285 | rs.result_af = htonl (rr->result_af); |
@@ -312,7 +306,7 @@ transmit_request (void *cls, | |||
312 | GNUNET_assert (ret <= size); | 306 | GNUNET_assert (ret <= size); |
313 | rip.header.size = htons ((uint16_t) ret); | 307 | rip.header.size = htons ((uint16_t) ret); |
314 | rip.header.type = htons (GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_IP); | 308 | rip.header.type = htons (GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_IP); |
315 | rip.nac = htonl (rr->nac); | 309 | rip.reserved = htonl (0); |
316 | rip.expiration_time = GNUNET_TIME_absolute_hton (rr->expiration_time); | 310 | rip.expiration_time = GNUNET_TIME_absolute_hton (rr->expiration_time); |
317 | rip.result_af = htonl (rr->result_af); | 311 | rip.result_af = htonl (rr->result_af); |
318 | rip.addr_af = htonl (rr->addr_af); | 312 | rip.addr_af = htonl (rr->addr_af); |
@@ -448,9 +442,6 @@ GNUNET_VPN_cancel_request (struct GNUNET_VPN_RedirectionRequest *rr) | |||
448 | * @param protocol protocol, IPPROTO_UDP or IPPROTO_TCP | 442 | * @param protocol protocol, IPPROTO_UDP or IPPROTO_TCP |
449 | * @param peer target peer for the redirection | 443 | * @param peer target peer for the redirection |
450 | * @param serv service descriptor to give to the peer | 444 | * @param serv service descriptor to give to the peer |
451 | * @param nac GNUNET_YES to notify via callback only after completion of | ||
452 | * the MESH-level connection, | ||
453 | * GNUNET_NO to notify as soon as the IP has been reserved | ||
454 | * @param expiration_time at what time should the redirection expire? | 445 | * @param expiration_time at what time should the redirection expire? |
455 | * (this should not impact connections that are active at that time) | 446 | * (this should not impact connections that are active at that time) |
456 | * @param cb function to call with the IP | 447 | * @param cb function to call with the IP |
@@ -465,14 +456,13 @@ GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh, | |||
465 | uint8_t protocol, | 456 | uint8_t protocol, |
466 | const struct GNUNET_PeerIdentity *peer, | 457 | const struct GNUNET_PeerIdentity *peer, |
467 | const struct GNUNET_HashCode *serv, | 458 | const struct GNUNET_HashCode *serv, |
468 | int nac, | ||
469 | struct GNUNET_TIME_Absolute expiration_time, | 459 | struct GNUNET_TIME_Absolute expiration_time, |
470 | GNUNET_VPN_AllocationCallback cb, | 460 | GNUNET_VPN_AllocationCallback cb, |
471 | void *cb_cls) | 461 | void *cb_cls) |
472 | { | 462 | { |
473 | struct GNUNET_VPN_RedirectionRequest *rr; | 463 | struct GNUNET_VPN_RedirectionRequest *rr; |
474 | 464 | ||
475 | rr = GNUNET_malloc (sizeof (struct GNUNET_VPN_RedirectionRequest)); | 465 | rr = GNUNET_new (struct GNUNET_VPN_RedirectionRequest); |
476 | rr->vh = vh; | 466 | rr->vh = vh; |
477 | rr->cb = cb; | 467 | rr->cb = cb; |
478 | rr->cb_cls = cb_cls; | 468 | rr->cb_cls = cb_cls; |
@@ -480,7 +470,6 @@ GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh, | |||
480 | rr->serv = *serv; | 470 | rr->serv = *serv; |
481 | rr->expiration_time = expiration_time; | 471 | rr->expiration_time = expiration_time; |
482 | rr->result_af = result_af; | 472 | rr->result_af = result_af; |
483 | rr->nac = nac; | ||
484 | rr->protocol = protocol; | 473 | rr->protocol = protocol; |
485 | queue_request (rr); | 474 | queue_request (rr); |
486 | return rr; | 475 | return rr; |
@@ -501,9 +490,6 @@ GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh, | |||
501 | * @param addr_af address family for 'addr', AF_INET or AF_INET6 | 490 | * @param addr_af address family for 'addr', AF_INET or AF_INET6 |
502 | * @param addr destination IP address on the Internet; destination | 491 | * @param addr destination IP address on the Internet; destination |
503 | * port is to be taken from the VPN packet itself | 492 | * port is to be taken from the VPN packet itself |
504 | * @param nac GNUNET_YES to notify via callback only after completion of | ||
505 | * the MESH-level connection, | ||
506 | * GNUNET_NO to notify as soon as the IP has been reserved | ||
507 | * @param expiration_time at what time should the redirection expire? | 493 | * @param expiration_time at what time should the redirection expire? |
508 | * (this should not impact connections that are active at that time) | 494 | * (this should not impact connections that are active at that time) |
509 | * @param cb function to call with the IP | 495 | * @param cb function to call with the IP |
@@ -517,7 +503,6 @@ GNUNET_VPN_redirect_to_ip (struct GNUNET_VPN_Handle *vh, | |||
517 | int result_af, | 503 | int result_af, |
518 | int addr_af, | 504 | int addr_af, |
519 | const void *addr, | 505 | const void *addr, |
520 | int nac, | ||
521 | struct GNUNET_TIME_Absolute expiration_time, | 506 | struct GNUNET_TIME_Absolute expiration_time, |
522 | GNUNET_VPN_AllocationCallback cb, | 507 | GNUNET_VPN_AllocationCallback cb, |
523 | void *cb_cls) | 508 | void *cb_cls) |
@@ -545,7 +530,6 @@ GNUNET_VPN_redirect_to_ip (struct GNUNET_VPN_Handle *vh, | |||
545 | rr->expiration_time = expiration_time; | 530 | rr->expiration_time = expiration_time; |
546 | rr->result_af = result_af; | 531 | rr->result_af = result_af; |
547 | rr->addr_af = addr_af; | 532 | rr->addr_af = addr_af; |
548 | rr->nac = nac; | ||
549 | memcpy (&rr[1], addr, alen); | 533 | memcpy (&rr[1], addr, alen); |
550 | queue_request (rr); | 534 | queue_request (rr); |
551 | return rr; | 535 | return rr; |
@@ -563,7 +547,7 @@ GNUNET_VPN_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
563 | { | 547 | { |
564 | struct GNUNET_VPN_Handle *vh; | 548 | struct GNUNET_VPN_Handle *vh; |
565 | 549 | ||
566 | vh = GNUNET_malloc (sizeof (struct GNUNET_VPN_Handle)); | 550 | vh = GNUNET_new (struct GNUNET_VPN_Handle); |
567 | vh->cfg = cfg; | 551 | vh->cfg = cfg; |
568 | vh->client = GNUNET_CLIENT_connect ("vpn", cfg); | 552 | vh->client = GNUNET_CLIENT_connect ("vpn", cfg); |
569 | if (NULL == vh->client) | 553 | if (NULL == vh->client) |