GNUNET_snprintf (ret, sizeof (ret), "%s Mac-Address %X:%X:%X:%X:%X:%X",
PROTOCOL_PREFIX, mac->mac[0], mac->mac[1], mac->mac[2],
mac->mac[3], mac->mac[4], mac->mac[5]);
-#if DEBUG_wlan
- GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME,
- "Func wlan_plugin_address_to_string made string: %s\n",
- ret);
-#endif
+
return ret;
}
(GNUNET_TIME_absolute_add
(queue->content->last_activity, SESSION_TIMEOUT)).rel_value == 0)
{
+ GNUNET_STATISTICS_update (queue->content->mac->plugin->env->stats, _("# wlan session timeouts"), 1, GNUNET_NO);
free_session (queue->content->mac->plugin, queue, GNUNET_YES);
}
else
const struct GNUNET_PeerIdentity *peer)
{
GNUNET_assert (endpoint != NULL);
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan session created"), 1, GNUNET_NO);
struct Sessionqueue *queue =
GNUNET_malloc (sizeof (struct Sessionqueue) + sizeof (struct Session));
struct GNUNET_MessageHeader *msgheader2;
const struct GNUNET_MessageHeader *hello;
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan hello beacons send"), 1, GNUNET_NO);
+
hello = plugin->env->get_our_hello ();
hallo_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello);
GNUNET_assert (sizeof (struct WlanHeader) + hallo_size <= WLAN_MTU);
ntohs (ack->hdr->size) - sizeof (struct Radiotap_Send));
#endif
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan acks send"), 1, GNUNET_NO);
+
getRadiotapHeader (plugin, ack->endpoint, ack->radioHeader);
getWlanHeader (ack->ieeewlanheader, &ack->endpoint->addr, plugin,
ntohs (ack->hdr->size));
if (plugin->sending_messages_head != NULL)
{
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan fragments send"), 1, GNUNET_NO);
+
fmq = plugin->sending_messages_head;
fm = fmq->content;
GNUNET_CONTAINER_DLL_remove (plugin->sending_messages_head,
}
}
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan messages queued"), 1, GNUNET_NO);
+
//queue message:
//queue message in session
return;
}
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan whole messages received"), 1, GNUNET_NO);
wlanheader = (struct WlanHeader *) hdr;
session = search_session (plugin, endpoint, &wlanheader->source);
((const struct GNUNET_HELLO_Message *) hdr,
&tmpsource) == GNUNET_OK)
{
- session_light->session = create_session (plugin, session_light->macendpoint, &tmpsource);
+ session_light->session = search_session (plugin, session_light->macendpoint, &tmpsource);
+ if (session_light->session == NULL)
+ {
+ session_light->session = create_session (plugin, session_light->macendpoint, &tmpsource);
+ }
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan hallo messages received"), 1, GNUNET_NO);
plugin->env->receive(plugin->env->cls,&session_light->session->target,hdr, NULL, 0, session_light->session,
(const char *) &session_light->session->mac->addr,
sizeof (session_light->session->mac->addr));
session_light->addr.mac,
6));
#endif
-
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan fragments received"), 1, GNUNET_NO);
int ret =
GNUNET_DEFRAGMENT_process_fragment (session_light->macendpoint->defrag,
hdr);
while (fm != NULL)
{
fm2 = fm->next;
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan acks received"), 1, GNUNET_NO);
int ret = GNUNET_FRAGMENT_process_ack (fm->fragcontext, hdr);
if (ret == GNUNET_OK)
(GNUNET_TIME_absolute_add
(endpoint->last_activity, MACENDPOINT_TIMEOUT)).rel_value == 0)
{
+ GNUNET_STATISTICS_update (endpoint->plugin->env->stats, _("# wlan mac endpoints timeouts"), 1, GNUNET_NO);
free_macendpoint (endpoint->plugin, endpoint);
}
else
{
struct MacEndpoint *newend = GNUNET_malloc (sizeof (struct MacEndpoint));
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan mac endpoints created"), 1, GNUNET_NO);
newend->addr = *addr;
newend->plugin = plugin;
newend->addr = *addr;
case GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA:
#if DEBUG_wlan
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME,
- "Func wlan_process_helper got GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA size: %u\n",
+ "Func wlan_process_helper got GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA size: %u\n",
ntohs (hdr->size));
#endif
-
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan WLAN_HELPER_DATA received"), 1, GNUNET_NO);
//call wlan_process_helper with the message inside, later with wlan: analyze signal
if (ntohs (hdr->size) <
sizeof (struct ieee80211_frame) + 2*sizeof (struct GNUNET_MessageHeader) +
memcpy (&session_light->addr, &(wlanIeeeHeader->i_addr2),
sizeof (struct MacAddress));
//session_light->session = search_session(plugin,session_light->addr);
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan messaged for this client received"), 1, GNUNET_NO);
pos = 0;
while (pos < datasize)
temp_hdr = (struct GNUNET_MessageHeader *) &wlanIeeeHeader[1] + pos;
if (ntohs(temp_hdr->size) <= datasize + pos)
{
- wlan_data_helper (plugin, session_light, temp_hdr, rxinfo);
+ GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan messaged in WLAN_HELPER_DATA received"), 1, GNUNET_NO);
+ wlan_data_helper (plugin, session_light, temp_hdr, rxinfo);
}
else
{