예제 #1
0
/*
**  NAME
**    UpdateWireStats
**
**  DESCRIPTION
**    Simple update of stats for "on the wire".
**
**  FORMAL INPUTS
**    SFBASE * - structure to update
**    int      - length of packet payload in bytes
**
**  FORMAL OUTPUTS
**    none
*/
void UpdateWireStats(SFBASE *sfBase, int len)
{
    sfBase->total_wire_packets++;

    len += 4; /* for the CRC */
    sfBase->total_wire_bytes += len;
   
    if( InlineWasPacketDropped() )
    {
      sfBase->total_blocked_packets++;
      sfBase->total_blocked_bytes += len;
    }
}
예제 #2
0
void UpdateMPLSStats(SFBASE *sfBase, int len)
{
#ifdef MPLS
    sfBase->total_mpls_packets++;

    len += 4; /* for the CRC */
    sfBase->total_mpls_bytes += len;
   
    if( InlineWasPacketDropped() )
    {
        sfBase->total_blocked_mpls_packets++;
        sfBase->total_blocked_mpls_bytes += len;
    }
#endif
}