AGENT++
4.0.3
Main Page
Related Pages
Classes
Files
File List
File Members
include
agent_pp
notification_originator.h
Go to the documentation of this file.
1
/*_############################################################################
2
_##
3
_## AGENT++ 4.0 - notification_originator.h
4
_##
5
_## Copyright (C) 2000-2013 Frank Fock and Jochen Katz (agentpp.com)
6
_##
7
_## Licensed under the Apache License, Version 2.0 (the "License");
8
_## you may not use this file except in compliance with the License.
9
_## You may obtain a copy of the License at
10
_##
11
_## http://www.apache.org/licenses/LICENSE-2.0
12
_##
13
_## Unless required by applicable law or agreed to in writing, software
14
_## distributed under the License is distributed on an "AS IS" BASIS,
15
_## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
_## See the License for the specific language governing permissions and
17
_## limitations under the License.
18
_##
19
_##########################################################################*/
20
21
#ifndef _notification_originator_h_
22
#define _notification_originator_h_
23
24
#include <
agent_pp/agent++.h
>
25
#include <
agent_pp/mib.h
>
26
27
#define mpV1 0
28
#define mpV2c 1
29
#define mpV3 3
30
31
#ifdef AGENTPP_NAMESPACE
32
namespace
Agentpp {
33
#endif
34
35
36
/*--------------------- class NotificationOriginator ---------------------*/
37
48
class
AGENTPP_DECL
NotificationOriginator
:
public
NotificationSender
{
49
50
public
:
54
NotificationOriginator
();
55
59
virtual
~
NotificationOriginator
();
60
76
void
generate(
Vbx
*,
int
,
const
Oidx
&,
const
Oidx
&,
const
NS_SNMP
OctetStr&);
77
92
void
generate(
Vbx
*,
int
,
const
Oidx
&,
93
unsigned
int
,
const
NS_SNMP
OctetStr&);
94
115
virtual
int
notify(
const
NS_SNMP
OctetStr&,
const
Oidx
&,
116
Vbx
*,
int
,
unsigned
int
=0);
117
137
virtual
bool
add_v1_trap_destination(
const
NS_SNMP
UdpAddress& addr,
138
const
NS_SNMP
OctetStr &name,
139
const
NS_SNMP
OctetStr &tag,
140
const
NS_SNMP
OctetStr &community);
141
virtual
bool
add_v2_trap_destination(
const
NS_SNMP
UdpAddress& addr,
142
const
NS_SNMP
OctetStr &name,
143
const
NS_SNMP
OctetStr &tag,
144
const
NS_SNMP
OctetStr &community);
145
virtual
bool
add_v3_trap_destination(
const
NS_SNMP
UdpAddress& addr,
146
const
NS_SNMP
OctetStr &name,
147
const
NS_SNMP
OctetStr &tag,
148
const
NS_SNMP
OctetStr &secName,
149
const
int
secLevel);
152
#ifdef _SNMPv3
153
159
void
set_local_engine_id(
const
NS_SNMP
OctetStr&
id
)
160
{
if
(localEngineID) {
delete
localEngineID; }
161
localEngineID =
new
NS_SNMP
OctetStr(
id
); }
162
#endif
163
164
protected
:
165
166
class
NotificationOriginatorParams
{
167
public
:
168
NotificationOriginatorParams
(
Vbx
* _vbs,
int
_size,
const
Oidx
& _id,
169
unsigned
int
_timestamp,
170
const
Oidx
& _enterprise,
171
const
NS_SNMP
OctetStr& _contextName) :
172
vbs(_vbs), size(_size), id(_id), timestamp(_timestamp),
173
enterprise(_enterprise), contextName(_contextName)
174
{ target = 0; }
175
176
Vbx
*
vbs
;
177
int
size
;
178
Oidx
id
;
179
unsigned
int
timestamp
;
180
Oidx
enterprise
;
181
NS_SNMP
OctetStr
contextName
;
182
NS_SNMP
OctetStr
securityName
;
183
int
securityModel
;
184
int
securityLevel
;
185
int
mpModel
;
186
#ifdef _SNMPv3
187
NS_SNMP
UTarget* target;
188
#else
189
NS_SNMP
CTarget*
target
;
190
#endif
191
192
private
:
193
NotificationOriginatorParams
();
194
};
195
213
int
generate(
Vbx
*,
int
,
const
Oidx
&,
unsigned
int
,
214
const
Oidx
&,
const
NS_SNMP
OctetStr&);
215
233
bool
check_access(
ListCursor<MibTableRow>
& cur,
NotificationOriginatorParams
& nop);
234
252
int
send_notify(
ListCursor<MibTableRow>
& cur,
NotificationOriginatorParams
& nop,
int
notify);
253
254
#ifdef _SNMPv3
255
NS_SNMP
OctetStr* localEngineID;
256
#endif
257
};
258
#ifdef AGENTPP_NAMESPACE
259
}
260
#endif
261
#endif
Generated by
1.8.2