Typedefs | |
typedef void(* | GNUNET_VPN_AllocationCallback) (void *cls, int af, const void *address) |
Callback invoked from the VPN service once a redirection is available. More... | |
Functions | |
void | GNUNET_VPN_cancel_request (struct GNUNET_VPN_RedirectionRequest *rr) |
Cancel redirection request with the service. More... | |
struct GNUNET_VPN_RedirectionRequest * | GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh, int result_af, uint8_t protocol, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HashCode *serv, struct GNUNET_TIME_Absolute expiration_time, GNUNET_VPN_AllocationCallback cb, void *cb_cls) |
Tell the VPN that a forwarding to a particular peer offering a particular service is requested. More... | |
struct GNUNET_VPN_RedirectionRequest * | GNUNET_VPN_redirect_to_ip (struct GNUNET_VPN_Handle *vh, int result_af, int addr_af, const void *addr, struct GNUNET_TIME_Absolute expiration_time, GNUNET_VPN_AllocationCallback cb, void *cb_cls) |
Tell the VPN that forwarding to the Internet via some exit node is requested. More... | |
struct GNUNET_VPN_Handle * | GNUNET_VPN_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Connect to the VPN service. More... | |
void | GNUNET_VPN_disconnect (struct GNUNET_VPN_Handle *vh) |
Disconnect from the VPN service. More... | |
typedef void(* GNUNET_VPN_AllocationCallback) (void *cls, int af, const void *address) |
Callback invoked from the VPN service once a redirection is available.
Provides the IP address that can now be used to reach the requested destination.
cls | closure |
af | address family, AF_INET or AF_INET6; AF_UNSPEC on error; will match 'result_af' from the request |
address | IP address (struct in_addr or struct in_addr6, depending on 'af') that the VPN allocated for the redirection; traffic to this IP will now be redirected to the specified target peer; NULL on error |
Definition at line 65 of file gnunet_vpn_service.h.
void GNUNET_VPN_cancel_request | ( | struct GNUNET_VPN_RedirectionRequest * | rr | ) |
Cancel redirection request with the service.
rr | request to cancel |
Definition at line 375 of file vpn_api.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_VPN_Handle::rr_head, GNUNET_VPN_Handle::rr_tail, and GNUNET_VPN_RedirectionRequest::vh.
Referenced by do_disconnect(), and do_timeout().
struct GNUNET_VPN_RedirectionRequest * GNUNET_VPN_redirect_to_peer | ( | struct GNUNET_VPN_Handle * | vh, |
int | result_af, | ||
uint8_t | protocol, | ||
const struct GNUNET_PeerIdentity * | peer, | ||
const struct GNUNET_HashCode * | serv, | ||
struct GNUNET_TIME_Absolute | expiration_time, | ||
GNUNET_VPN_AllocationCallback | cb, | ||
void * | cb_cls | ||
) |
Tell the VPN that a forwarding to a particular peer offering a particular service is requested.
The VPN is to reserve a particular IP for the redirection and return it. The VPN will begin the redirection as soon as possible and maintain it as long as it is actively used and keeping it is feasible. Given resource limitations, the longest inactive mappings will be destroyed.
vh | VPN handle |
result_af | desired address family for the returned allocation can also be AF_UNSPEC |
protocol | protocol, IPPROTO_UDP or IPPROTO_TCP |
peer | target peer for the redirection |
serv | service descriptor to give to the peer |
expiration_time | at what time should the redirection expire? (this should not impact connections that are active at that time) |
cb | function to call with the IP |
cb_cls | closure for cb |
Definition at line 388 of file vpn_api.c.
References GNUNET_VPN_RedirectionRequest::cb, GNUNET_VPN_RedirectionRequest::cb_cls, GNUNET_VPN_RedirectionRequest::expiration_time, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_new, GNUNET_VPN_RedirectionRequest::peer, GNUNET_VPN_RedirectionRequest::protocol, GNUNET_VPN_RedirectionRequest::result_af, GNUNET_VPN_Handle::rr_head, GNUNET_VPN_Handle::rr_tail, send_request(), GNUNET_VPN_RedirectionRequest::serv, and GNUNET_VPN_RedirectionRequest::vh.
Referenced by result_processor(), and run().
struct GNUNET_VPN_RedirectionRequest * GNUNET_VPN_redirect_to_ip | ( | struct GNUNET_VPN_Handle * | vh, |
int | result_af, | ||
int | addr_af, | ||
const void * | addr, | ||
struct GNUNET_TIME_Absolute | expiration_time, | ||
GNUNET_VPN_AllocationCallback | cb, | ||
void * | cb_cls | ||
) |
Tell the VPN that forwarding to the Internet via some exit node is requested.
Note that both UDP and TCP traffic will be forwarded, but possibly to different exit nodes. The VPN is to reserve a particular IP for the redirection and return it. The VPN will begin the redirection as soon as possible and maintain it as long as it is actively used and keeping it is feasible. Given resource limitations, the longest inactive mappings will be destroyed.
vh | VPN handle |
result_af | desired address family for the returned allocation, can also be AF_UNSPEC |
addr_af | address family for 'addr', AF_INET or AF_INET6 |
addr | destination IP address on the Internet; destination port is to be taken from the VPN packet itself |
expiration_time | at what time should the redirection expire? (this should not impact connections that are active at that time) |
cb | function to call with the IP |
cb_cls | closure for cb |
Note that both UDP and TCP traffic will be forwarded, but possibly to different exit nodes. The VPN is to reserve a particular IP for the redirection and return it. The VPN will begin the redirection as soon as possible and maintain it as long as it is actively used and keeping it is feasible. Given resource limitations, the longest inactive mappings will be destroyed.
vh | VPN handle |
result_af | desired address family for the returned allocation |
addr_af | address family for addr, AF_INET or AF_INET6 |
addr | destination IP address on the Internet; destination port is to be taken from the VPN packet itself |
expiration_time | at what time should the redirection expire? (this should not impact connections that are active at that time) |
cb | function to call with the IP |
cb_cls | closure for cb |
Definition at line 439 of file vpn_api.c.
References GNUNET_VPN_RedirectionRequest::addr, GNUNET_VPN_RedirectionRequest::addr_af, GNUNET_VPN_RedirectionRequest::cb, GNUNET_VPN_RedirectionRequest::cb_cls, GNUNET_VPN_RedirectionRequest::expiration_time, GNUNET_break, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_malloc, GNUNET_memcpy, GNUNET_VPN_RedirectionRequest::result_af, GNUNET_VPN_Handle::rr_head, GNUNET_VPN_Handle::rr_tail, send_request(), and GNUNET_VPN_RedirectionRequest::vh.
Referenced by modify_address(), and run().
struct GNUNET_VPN_Handle * GNUNET_VPN_connect | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Connect to the VPN service.
cfg | configuration to use |
Definition at line 490 of file vpn_api.c.
References cfg, GNUNET_VPN_Handle::cfg, connect_task(), GNUNET_free, GNUNET_new, and GNUNET_VPN_Handle::mq.
Referenced by run().
void GNUNET_VPN_disconnect | ( | struct GNUNET_VPN_Handle * | vh | ) |
Disconnect from the VPN service.
vh | VPN handle |
Definition at line 512 of file vpn_api.c.
References GNUNET_assert, GNUNET_free, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_cancel(), GNUNET_VPN_Handle::mq, GNUNET_VPN_Handle::rr_head, and GNUNET_VPN_Handle::rt.
Referenced by cleanup(), do_disconnect(), do_shutdown(), and run().