- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "send_pkt_to_peer_notify_callback: buf = %x; size = %u;\n", buf,
- size);
- GNUNET_assert (size >= ntohs (hdr->size));
- memcpy (buf, hdr, ntohs (hdr->size));
- size = ntohs (hdr->size);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sent!\n");
- }
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "send_pkt_to_peer_notify_callback: buf = %x; size = %u;\n", buf,
+ size);
+ GNUNET_assert (size >= ntohs (hdr->size));
+ memcpy (buf, hdr, ntohs (hdr->size));
+ size = ntohs (hdr->size);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sent!\n");
+ }
- struct tunnel_notify_queue *element = GNUNET_MESH_tunnel_get_head (*tunnel);
- struct tunnel_notify_queue *head = GNUNET_MESH_tunnel_get_head (*tunnel);
- struct tunnel_notify_queue *tail = GNUNET_MESH_tunnel_get_tail (*tunnel);
-
- GNUNET_CONTAINER_DLL_remove (head, tail, element);
+ struct tunnel_notify_queue *element = ts->head;
- GNUNET_MESH_tunnel_set_head (*tunnel, head);
- GNUNET_MESH_tunnel_set_tail (*tunnel, tail);
+ GNUNET_CONTAINER_DLL_remove (ts->head, ts->tail, element);
- struct GNUNET_MESH_TransmitHandle *th =
- GNUNET_MESH_notify_transmit_ready (*tunnel,
- GNUNET_NO,
- 42,
+ ts->th =
+ GNUNET_MESH_notify_transmit_ready (*tunnel, GNUNET_NO, 42,
GNUNET_TIME_relative_divide
(GNUNET_CONSTANTS_MAX_CORK_DELAY, 2),
(const struct GNUNET_PeerIdentity *)
GNUNET_TIME_relative_divide
(GNUNET_CONSTANTS_MAX_CORK_DELAY, 2),
(const struct GNUNET_PeerIdentity *)
- struct GNUNET_MESH_TransmitHandle *th =
- GNUNET_MESH_notify_transmit_ready (*tunnel,
- GNUNET_NO,
- 42,
+ ts->th =
+ GNUNET_MESH_notify_transmit_ready (*tunnel, GNUNET_NO, 42,
GNUNET_TIME_relative_divide
(GNUNET_CONSTANTS_MAX_CORK_DELAY, 2),
(const struct GNUNET_PeerIdentity *)
GNUNET_TIME_relative_divide
(GNUNET_CONSTANTS_MAX_CORK_DELAY, 2),
(const struct GNUNET_PeerIdentity *)
struct tunnel_notify_queue *element = GNUNET_malloc (sizeof *element);
element->cls = cls;
element->len = ntohs (hdr->size);
struct tunnel_notify_queue *element = GNUNET_malloc (sizeof *element);
element->cls = cls;
element->len = ntohs (hdr->size);
- GNUNET_CONTAINER_DLL_insert_tail (head, tail, element);
-
- GNUNET_MESH_tunnel_set_head (*tunnel, head);
- GNUNET_MESH_tunnel_set_tail (*tunnel, tail);
+ GNUNET_CONTAINER_DLL_insert_tail (ts->head, ts->tail, element);
memcpy (&list->pkt, pkt, htons (pkt->hdr.size));
}
else if (pkt->subtype == GNUNET_DNS_ANSWER_TYPE_REMOTE_AAAA)
memcpy (&list->pkt, pkt, htons (pkt->hdr.size));
}
else if (pkt->subtype == GNUNET_DNS_ANSWER_TYPE_REMOTE_AAAA)
static int
receive_udp_back (void *cls
__attribute__ ((unused)), struct GNUNET_MESH_Tunnel *tunnel,
static int
receive_udp_back (void *cls
__attribute__ ((unused)), struct GNUNET_MESH_Tunnel *tunnel,
- void **tunnel_ctx
- __attribute__ ((unused)),
- const struct GNUNET_PeerIdentity *sender
- __attribute__ ((unused)),
+ void **tunnel_ctx, const struct GNUNET_PeerIdentity *sender,
__attribute__ ((unused)))
{
GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
struct remote_addr *s = (struct remote_addr *) desc;
struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1);
__attribute__ ((unused)))
{
GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
struct remote_addr *s = (struct remote_addr *) desc;
struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1);
static int
receive_tcp_back (void *cls
__attribute__ ((unused)), struct GNUNET_MESH_Tunnel *tunnel,
static int
receive_tcp_back (void *cls
__attribute__ ((unused)), struct GNUNET_MESH_Tunnel *tunnel,
__attribute__ ((unused)),
const struct GNUNET_MessageHeader *message,
__attribute__ ((unused)),
const struct GNUNET_MessageHeader *message,
__attribute__ ((unused)))
{
GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
struct remote_addr *s = (struct remote_addr *) desc;
struct tcp_pkt *pkt = (struct tcp_pkt *) (desc + 1);
__attribute__ ((unused)))
{
GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
struct remote_addr *s = (struct remote_addr *) desc;
struct tcp_pkt *pkt = (struct tcp_pkt *) (desc + 1);
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet back, addrlen = %d\n", s->addrlen);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received TCP-Packet back, addrlen = %d\n", s->addrlen);
+static void *
+new_tunnel (void *cls, struct GNUNET_MESH_Tunnel *tunnel,
+ const struct GNUNET_PeerIdentity *initiator,
+ const struct GNUNET_ATS_Information *atsi)
+{
+ /* Why should anyone open an inbound tunnel to vpn? */
+ GNUNET_break (0);
+ return NULL;
+}
+
+static void
+cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel, void *tunnel_ctx)
+{
+ /* Why should anyone open an inbound tunnel to vpn? */
+ GNUNET_break (0);
+}
+
- mesh_handle = GNUNET_MESH_connect (cfg_, NULL, NULL, handlers, types);
+ mesh_handle =
+ GNUNET_MESH_connect (cfg_, 42, NULL, new_tunnel, cleaner, handlers,
+ types);