Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

gnet_stats.c File Reference


Detailed Description

Needs brief description here.

Author:
Richard Eckart
Date:
2001-2003

#include "common.h"
#include "gnet_stats.h"
#include "gmsg.h"
#include "if/gnet_property_priv.h"
#include "lib/event.h"
#include "lib/endian.h"
#include "lib/override.h"

Defines

#define DROP_STATS(gs, t, s)

Functions

 RCSID ("$Id:gnet_stats.c, v 1.15 2005/11/12 11:13:42 cbiere Exp $")
void gnet_stats_init (void)
void gnet_stats_count_received_header (gnutella_node_t *n)
 Called when Gnutella header has been read.

void gnet_stats_count_received_payload (const gnutella_node_t *n)
 Called when Gnutella payload has been read.

void gnet_stats_count_queued (const gnutella_node_t *n, guint8 type, guint8 hops, guint32 size)
void gnet_stats_count_sent (const gnutella_node_t *n, guint8 type, guint8 hops, guint32 size)
void gnet_stats_count_expired (const gnutella_node_t *n)
void gnet_stats_count_dropped (gnutella_node_t *n, msg_drop_reason_t reason)
void gnet_stats_count_general (gnr_stats_t type, guint32 x)
void gnet_stats_count_dropped_nosize (const gnutella_node_t *n, msg_drop_reason_t reason)
void gnet_stats_count_flowc (gconstpointer head)
void gnet_stats_get (gnet_stats_t *s)
void gnet_stats_tcp_get (gnet_stats_t *s)
void gnet_stats_udp_get (gnet_stats_t *s)

Variables

guint8 stats_lut [256]
gnet_stats_t gnet_stats
gnet_stats_t gnet_tcp_stats
gnet_stats_t gnet_udp_stats
const gchar *const  msg_drop_reason [MSG_DROP_REASON_COUNT]


Define Documentation

#define DROP_STATS gs,
t,
s   ) 
 

Value:

do {                            \
    if (                                                \
        (reason == MSG_DROP_ROUTE_LOST) ||              \
        (reason == MSG_DROP_DUPLICATE) ||               \
        (reason == MSG_DROP_NO_ROUTE)                   \
    )                                                   \
        gnet_stats.general[GNR_ROUTING_ERRORS]++;       \
                                                        \
    gnet_stats.drop_reason[reason][MSG_TOTAL]++;        \
    gnet_stats.drop_reason[reason][t]++;                \
    gnet_stats.pkg.dropped[MSG_TOTAL]++;                \
    gnet_stats.pkg.dropped[t]++;                        \
    gnet_stats.byte.dropped[MSG_TOTAL] += (s);          \
    gnet_stats.byte.dropped[t] += (s);                  \
    gs->pkg.dropped[MSG_TOTAL]++;                       \
    gs->pkg.dropped[t]++;                               \
    gs->byte.dropped[MSG_TOTAL] += (s);                 \
    gs->byte.dropped[t] += (s);                         \
} while (0)


Function Documentation

void gnet_stats_count_dropped gnutella_node_t n,
msg_drop_reason_t  reason
 

void gnet_stats_count_dropped_nosize const gnutella_node_t n,
msg_drop_reason_t  reason
 

void gnet_stats_count_expired const gnutella_node_t n  ) 
 

void gnet_stats_count_flowc gconstpointer  head  ) 
 

void gnet_stats_count_general gnr_stats_t  type,
guint32  x
 

void gnet_stats_count_queued const gnutella_node_t n,
guint8  type,
guint8  hops,
guint32  size
 

void gnet_stats_count_received_header gnutella_node_t n  ) 
 

Called when Gnutella header has been read.

void gnet_stats_count_received_payload const gnutella_node_t n  ) 
 

Called when Gnutella payload has been read.

void gnet_stats_count_sent const gnutella_node_t n,
guint8  type,
guint8  hops,
guint32  size
 

void gnet_stats_get gnet_stats_t s  ) 
 

void gnet_stats_init void   ) 
 

void gnet_stats_tcp_get gnet_stats_t s  ) 
 

void gnet_stats_udp_get gnet_stats_t s  ) 
 

RCSID "$Id:gnet_stats.  c,
v 1.15 2005/11/12 11:13:42 cbiere Exp $" 
 


Variable Documentation

gnet_stats_t gnet_stats [static]
 

gnet_stats_t gnet_tcp_stats [static]
 

gnet_stats_t gnet_udp_stats [static]
 

const gchar* const msg_drop_reason[MSG_DROP_REASON_COUNT] [static]
 

Initial value:

 {
    N_("Bad size"),                         
    N_("Too small"),                        
    N_("Too large"),                        
    N_("Way too large"),                    
    N_("Unknown message type"),             
    N_("Unexpected message"),               
    N_("Message sent with TTL = 0"),        
    N_("Improper hops/ttl combination"),    
    N_("Max TTL exceeded"),                 
    N_("Message throttle"),                 
    N_("Unusable Pong"),                    
    N_("Hard TTL limit reached"),           
    N_("Max hop count reached"),            
    N_("Route lost"),                       
    N_("No route"),                         
    N_("Duplicate message"),                
    N_("Message to banned GUID"),           
    N_("Node shutting down"),               
    N_("TX flow control"),                  
    N_("Query text had no trailing NUL"),   
    N_("Query text too short"),             
    N_("Query had unnecessary overhead"),   
    N_("Message with malformed SHA1"),      
    N_("Message with malformed UTF-8"),     
    N_("Malformed Query Hit"),              
    N_("Bad return address"),               
    N_("Hostile IP address"),               
}

guint8 stats_lut[256] [static]
 


Generated on Sun Feb 12 10:50:02 2006 for Gtk-Gnutella by doxygen 1.3.6