2
* Copyright (C) 1998-2004 Luca Deri <deri@ntop.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
/* ******************************* */
27
void termIPServices(void) {
29
ProtocolsList *proto = myGlobals.ipProtosList;
31
for(i=0; i<myGlobals.numActServices; i++) {
32
if(myGlobals.udpSvc[i] != NULL) {
33
free(myGlobals.udpSvc[i]->name);
34
free(myGlobals.udpSvc[i]);
37
if(myGlobals.tcpSvc[i] != NULL) {
38
if(myGlobals.tcpSvc[i]->name != NULL) {
39
free(myGlobals.tcpSvc[i]->name);
41
free(myGlobals.tcpSvc[i]);
45
free(myGlobals.udpSvc);
46
free(myGlobals.tcpSvc);
48
/* ****************************** */
50
while(proto != NULL) {
51
ProtocolsList *nextProto = proto->next;
53
free(proto->protocolName);
59
/* ******************************* */
61
void termIPSessions(void) {
64
for(j=0; j<myGlobals.numDevices; j++) {
65
if(myGlobals.device[j].tcpSession == NULL) continue;
67
for(i=0; i<MAX_TOT_NUM_SESSIONS; i++) {
68
IPSession *session = myGlobals.device[j].tcpSession[i];
70
while(session != NULL) {
71
IPSession *nextSession;
72
nextSession = session->next;
74
session = nextSession;
78
#ifdef PARM_USE_SESSIONS_CACHE
79
for(i=0; i<myGlobals.sessionsCacheLen; i++)
80
free(myGlobals.sessionsCache[i]);
83
myGlobals.device[j].numTcpSessions = 0;
85
while(myGlobals.device[j].fragmentList != NULL)
86
deleteFragment(myGlobals.device[j].fragmentList, j);
90
/* ************************************************ */
93
if(myGlobals.dnsCacheFile) { gdbm_close(myGlobals.dnsCacheFile); myGlobals.dnsCacheFile = NULL; }
94
if(myGlobals.addressQueueFile) { gdbm_close(myGlobals.addressQueueFile); myGlobals.addressQueueFile = NULL; }
95
if(myGlobals.pwFile) { gdbm_close(myGlobals.pwFile); myGlobals.pwFile = NULL; }
96
if(myGlobals.prefsFile) { gdbm_close(myGlobals.prefsFile); myGlobals.prefsFile = NULL; }
97
if(myGlobals.macPrefixFile) { gdbm_close(myGlobals.macPrefixFile); myGlobals.macPrefixFile = NULL; }