Sha256: b794715a1d746777f20a0e2039504a571d6ff48a7a077bc464295ebf3b166a43

Contents?: true

Size: 1.5 KB

Versions: 21

Compression:

Stored size: 1.5 KB

Contents

/*
  Copyright (C) 2009-2013 NEC Corporation

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2, as
  published by the Free Software Foundation.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef _STATS_H_
#define _STATS_H_

#include <stdint.h>
#include "ipv4.h"
#include "udp.h"

#define STATS_TP_HASH_SIZE (UINT16_MAX + 1)
#define STATS_TP_HASH_MASK UINT16_MAX

typedef struct tp_stats {
    uint32_t lip;
    uint16_t lport;
    uint32_t rip;
    uint16_t rport;
    uint32_t n_pkts;
    uint64_t n_octets;
    struct tp_stats *next;
} tp_stats;

int stats_init();
int stats_udp_send_uninit();
int stats_udp_recv_uninit();
int stats_tp_uninit();
void stats_udp_send_update(ipv4 *ip, udp *udp);
void stats_udp_recv_update(ipv4 *ip, udp *udp);
int stats_tp_update(tp_stats **st, uint32_t key, ipv4 *ip, udp *udp);
tp_stats *stats_udp_send_get(uint32_t *size);
tp_stats *stats_udp_recv_get(uint32_t *size);
int stats_udp_send_dump();
int stats_udp_recv_dump();
int stats_tp_dump(tp_stats **st, uint32_t hash_size);

#endif /* _STATS_H_ */

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
phut-0.1.0 vendor/phost/src/stats.h
trema-0.4.7 vendor/phost/src/stats.h
trema-0.4.6 vendor/phost/src/stats.h
trema-0.4.5 vendor/phost/src/stats.h
trema-0.4.4 vendor/phost/src/stats.h
trema-0.4.3 vendor/phost/src/stats.h
trema-0.4.2 vendor/phost/src/stats.h
trema-0.4.1 vendor/phost/src/stats.h
trema-0.4.0 vendor/phost/src/stats.h
trema-0.3.21 vendor/phost/src/stats.h
trema-0.3.20 vendor/phost/src/stats.h
trema-0.3.19 vendor/phost/src/stats.h
trema-0.3.18 vendor/phost/src/stats.h
trema-0.3.17 vendor/phost/src/stats.h
trema-0.3.16 vendor/phost/src/stats.h
trema-0.3.15 vendor/phost/src/stats.h
trema-0.3.14 vendor/phost/src/stats.h
trema-0.3.13 vendor/phost/src/stats.h
trema-0.3.12 vendor/phost/src/stats.h
trema-0.3.11 vendor/phost/src/stats.h