diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_nat_lib.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index 123d106e9..79031f9a9 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h | |||
@@ -455,6 +455,41 @@ GNUNET_NAT_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
455 | void | 455 | void |
456 | GNUNET_NAT_autoconfig_cancel (struct GNUNET_NAT_AutoHandle *ah); | 456 | GNUNET_NAT_autoconfig_cancel (struct GNUNET_NAT_AutoHandle *ah); |
457 | 457 | ||
458 | |||
459 | struct GNUNET_NAT_StunRequestHandle; | ||
460 | |||
461 | /** | ||
462 | * Make Generic STUN request and | ||
463 | * Send a generic stun request to the server specified using the specified socket. | ||
464 | * possibly waiting for a reply and filling the 'reply' field with | ||
465 | * the externally visible address. | ||
466 | *c | ||
467 | * @param server, the address of the stun server | ||
468 | * @param port, port of the stun server | ||
469 | * @param sock the socket used to send the request | ||
470 | * @return GNUNET_NAT_StunRequestHandle on success, NULL on error. | ||
471 | */ | ||
472 | struct GNUNET_NAT_StunRequestHandle * | ||
473 | GNUNET_NAT_stun_make_request(char * server, int port, struct GNUNET_NETWORK_Handle * sock); | ||
474 | |||
475 | |||
476 | /** | ||
477 | * Handle an incoming STUN message, Do some basic sanity checks on packet size and content, | ||
478 | * try to extract a bit of information, and possibly reply. | ||
479 | * At the moment this only processes BIND requests, and returns | ||
480 | * the externally visible address of the request. | ||
481 | * If a callback is specified, invoke it with the attribute. | ||
482 | * | ||
483 | * @param data, pointer where we will set the type | ||
484 | * @param len, pointer where we will set the type | ||
485 | * @param st, pointer where we will set the type | ||
486 | * | ||
487 | * @return, 0 on IGNORE, -1 if the packet is invalid ( not a stun packet) | ||
488 | */ | ||
489 | int | ||
490 | GNUNET_NAT_stun_handle_packet(const uint8_t *data, size_t len,struct sockaddr_in *arg); | ||
491 | |||
492 | |||
458 | #endif | 493 | #endif |
459 | 494 | ||
460 | /* end of gnunet_nat_lib.h */ | 495 | /* end of gnunet_nat_lib.h */ |