forked from willamowius/gnugk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RequireOneNet.h
57 lines (47 loc) · 1.42 KB
/
RequireOneNet.h
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
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* RequireOneNet.h
*
* accounting module for GNU Gatekeeper used for authentication - make sure one side of the call is within our network
*
* Copyright (c) 2016-2018, Jan Willamowius
*
* This work is published under the GNU Public License version 2 (GPLv2)
* see file COPYING for details.
* We also explicitly grant the right to link this code
* with the OpenH323/H323Plus and OpenSSL library.
*
*/
#ifndef __REQUIREONENET_H
#define __REQUIREONENET_H "@(#) $Id$"
#include "gkacct.h"
/** Accounting module to make sure one side of the call is within our network
*/
class RequireOneNet : public GkAcctLogger
{
public:
enum Constants
{
/// events recognized by this module
StatusAcctEvents = AcctStart | AcctStop | AcctUpdate | AcctConnect | AcctAlert
};
RequireOneNet(
/// name from Gatekeeper::Acct section
const char* moduleName,
/// config section name to be used with an instance of this module,
/// pass NULL to use a default section (named "moduleName")
const char* cfgSecName = NULL
);
/// Destroy the accounting logger
virtual ~RequireOneNet();
/// overridden from GkAcctLogger
virtual Status Log(AcctEvent evt, const callptr & call);
private:
RequireOneNet();
/* No copy constructor allowed */
RequireOneNet(const RequireOneNet &);
/* No operator= allowed */
RequireOneNet & operator=(const RequireOneNet &);
private:
list<NetworkAddress> m_myNetworks;
};
#endif /* __REQUIREONENET_H */