File: set_null.c

package info (click to toggle)
netdiag 0.7-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,464 kB
  • ctags: 1,261
  • sloc: ansic: 12,948; makefile: 288; awk: 130; sh: 71
file content (44 lines) | stat: -rw-r--r-- 1,164 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*  set_null.c is part of Statnet */
/* Statnet is protected under the GNU Public License (GPL2). */
/* Author: Jeroen Baekelandt (jeroenb@igwe.vub.ac.be)       */


#include "stat.h"

void
set_null ( struct StatMemStruct *StatMem )
{

  SM_regis.ethercount = 0;
  SM_regis.etherbytes = 0;
  SM_regis.plipcount = 0;
  SM_regis.plipbytes = 0;
  SM_regis.slipcount = 0;
  SM_regis.slipbytes = 0;
  SM_regis.pppcount = 0;
  SM_regis.pppbytes = 0;
  SM_regis.loopcount = 0;
  SM_regis.loopbytes = 0;
  SM_regis.othercount = 0;
  SM_regis.otherbytes = 0;
  SM_regis.aarp = 0;
  SM_regis.rtmprd = 0;
  SM_regis.nbp = 0;
  SM_regis.atp = 0;
  SM_regis.aep = 0;
  SM_regis.rtmpreq = 0;
  SM_regis.zip = 0;
  SM_regis.adsp = 0;
  SM_regis.new_ethernet_count = 0;
  SM_regis.unknown_type = 0;
  SM_regis.unknown_frame_type = 0;
  SM_regis.unknown_sap = 0;

  if (options.ip_option)
    memset (&StatMem->ip_protocol_count, 0, sizeof (int) * SN_MAX_IP_PORT + 1);
  if (options.prot_option)
    memset (StatMem->prot.t_count, 0, sizeof (unsigned int) * StatMem->prot.t_max + 1);
  if (options.sap_option)
    memset (&StatMem->sap_count, 0, sizeof (int) * SN_MAX_SAP + 1);

}