File: set_null.c

package info (click to toggle)
netdiag 0.6-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,084 kB
  • ctags: 1,251
  • sloc: ansic: 15,197; makefile: 281; sh: 26
file content (44 lines) | stat: -rw-r--r-- 1,174 bytes parent folder | download
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()
{
 extern struct registers regis;

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

 if( regis.ip_option ) memset( &ip_protocol_count, 0, sizeof(int)*SN_MAX_IP_PORT+1 );
 if( regis.prot_option ) memset( &protocol_count, 0, sizeof(int)*SN_NUM_PROTOCOLS+1 );
 if( regis.tcp_option ) memset( &tcp_port_count, 0, sizeof(int)*SN_MAX_TCP_PORTS+1 );
 if( regis.udp_option ) memset( &udp_port_count, 0, sizeof(int)*SN_MAX_UDP_PORTS+1 );
 if( regis.sap_option ) memset( &sap_count, 0, sizeof(int)*SN_MAX_SAP+1 );

}