AGENT++
4.0.3
Main Page
Related Pages
Classes
Files
File List
File Members
include
agent_pp
snmp_textual_conventions.h
Go to the documentation of this file.
1
/*_############################################################################
2
_##
3
_## AGENT++ 4.0 - snmp_textual_conventions.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
22
#ifndef _snmp_textual_convention_h_
23
#define _snmp_textual_convention_h_
24
25
#include <
agent_pp/agent++.h
>
26
#include <
agent_pp/mib.h
>
27
28
#define oidSnmpSetSerialNo "1.3.6.1.6.3.1.1.6.1.0"
29
30
#ifdef AGENTPP_NAMESPACE
31
namespace
Agentpp {
32
#endif
33
34
35
const
index_info
iSnmpAdminString
[1] =
36
{ { sNMP_SYNTAX_OCTETS,
TRUE
, 1, 32 } };
37
38
39
/*---------------------- class snmpDisplayString ---------------------*/
40
50
class
AGENTPP_DECL
SnmpDisplayString
:
public
MibLeaf
{
51
52
public
:
64
SnmpDisplayString
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*);
79
SnmpDisplayString
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*,
bool
);
98
SnmpDisplayString
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*,
bool
,
99
int
,
int
);
100
virtual
~
SnmpDisplayString
();
101
102
virtual
MibEntryPtr
clone();
103
virtual
bool
value_ok(
const
Vbx
&);
104
virtual
int
prepare_set_request(
Request
*,
int
&);
105
protected
:
106
unsigned
int
max_size
;
107
unsigned
int
min_size
;
108
};
109
110
111
/*---------------------- class snmpEngineID ---------------------*/
112
217
class
AGENTPP_DECL
SnmpEngineID
:
public
MibLeaf
{
218
219
public
:
231
SnmpEngineID
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*);
232
254
SnmpEngineID
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*,
int
);
255
259
virtual
~
SnmpEngineID
();
260
261
virtual
MibEntryPtr
clone();
262
virtual
int
prepare_set_request(
Request
*,
int
&);
263
274
static
NS_SNMP
OctetStr create_engine_id(
const
NS_SNMP
OctetStr& userText);
275
286
static
NS_SNMP
OctetStr create_engine_id(
unsigned
short
port);
287
288
};
289
290
291
/*------------------------ class SnmpTagValue -----------------------*/
292
301
class
AGENTPP_DECL
SnmpTagValue
:
public
MibLeaf
{
302
303
public
:
325
SnmpTagValue
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*,
int
);
326
327
SnmpTagValue
(
const
Oidx
&);
328
virtual
~
SnmpTagValue
();
329
330
virtual
MibEntryPtr
clone();
331
virtual
bool
value_ok(
const
Vbx
&);
332
virtual
int
prepare_set_request(
Request
*,
int
&);
333
static
bool
is_delimiter(
char
);
334
};
335
336
337
/*---------------------- class snmpTargetAddrTagList ---------------------*/
338
349
class
AGENTPP_DECL
SnmpTagList
:
public
MibLeaf
{
350
351
public
:
373
SnmpTagList
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*,
int
);
374
375
SnmpTagList
(
const
Oidx
&);
376
virtual
~
SnmpTagList
();
377
378
virtual
MibEntryPtr
clone();
379
virtual
bool
value_ok(
const
Vbx
&);
380
virtual
bool
contains(
const
char
*);
381
};
382
383
384
/*--------------------------- class TestAndIncr -------------------------*/
385
436
class
AGENTPP_DECL
TestAndIncr
:
public
MibLeaf
{
437
438
public
:
439
TestAndIncr
(
const
Oidx
&);
440
virtual
~
TestAndIncr
();
441
442
virtual
long
get_state();
443
virtual
void
set_state(
long
);
444
virtual
int
set
(
const
Vbx
&);
445
virtual
bool
value_ok(
const
Vbx
&);
446
virtual
int
prepare_set_request(
Request
*,
int
&);
447
448
virtual
bool
is_volatile
() {
return
TRUE
; }
449
};
450
451
452
/*--------------------------- class StorageType -------------------------*/
453
475
class
AGENTPP_DECL
StorageType
:
public
MibLeaf
{
476
477
public
:
486
StorageType
(
const
Oidx
&,
int
);
487
493
virtual
bool
row_is_volatile();
494
500
virtual
long
get_state();
501
508
virtual
void
set_state(
long
);
509
510
virtual
MibEntryPtr
clone();
511
virtual
bool
value_ok(
const
Vbx
&);
512
};
513
514
515
/*--------------------------- class StorageTable ------------------------*/
516
527
class
AGENTPP_DECL
StorageTable
:
public
MibTable
{
528
friend
class
Mib
;
// needs access to find_next() and get()
529
friend
class
snmpRowStatus
;
// needs access to _ready_for_service()
530
public
:
531
535
StorageTable
(
const
StorageTable
&);
536
545
StorageTable
(
const
Oidx
&);
546
560
StorageTable
(
const
Oidx
&,
unsigned
int
);
561
573
StorageTable
(
const
Oidx
&,
unsigned
int
,
bool
);
574
593
StorageTable
(
const
Oidx
&,
const
index_info
*,
unsigned
int
);
594
598
virtual
~
StorageTable
();
599
607
virtual
void
add_storage_col(
StorageType
*);
608
617
void
set_storage_type(
MibTableRow
*,
int
);
618
622
virtual
void
reset
();
623
624
protected
:
634
virtual
bool
is_persistent(
MibTableRow
*);
635
636
private
:
637
int
storage_type;
638
};
639
640
/*---------------------- class SnmpInt32MinMax ---------------------*/
641
652
class
AGENTPP_DECL
SnmpInt32MinMax
:
public
MibLeaf
653
{
654
public
:
655
680
SnmpInt32MinMax
(
const
Oidx
&,
mib_access
,
const
int
,
int
,
int
,
int
);
693
SnmpInt32MinMax
(
const
Oidx
&,
mib_access
,
int
,
int
);
694
695
virtual
bool
value_ok(
const
Vbx
&);
696
MibEntryPtr
clone();
697
698
int
get_state();
699
void
set_state(
int
);
700
private
:
701
int
min, max;
702
};
703
704
/*---------------------- class OctetStrMinMax ---------------------*/
705
716
class
AGENTPP_DECL
OctetStrMinMax
:
public
MibLeaf
717
{
718
public
:
719
744
OctetStrMinMax
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*,
int
, u_int, u_int);
757
OctetStrMinMax
(
const
Oidx
&,
mib_access
, u_int, u_int);
758
759
virtual
int
prepare_set_request(
Request
*,
int
&);
760
MibEntryPtr
clone();
761
768
int
get
();
769
770
protected
:
771
unsigned
int
min
, max;
772
};
773
774
/*------------------------ class SnmpSecurityModel -----------------------*/
775
849
class
AGENTPP_DECL
SnmpSecurityModel
:
public
SnmpInt32MinMax
{
850
851
public
:
852
SnmpSecurityModel
(
const
Oidx
&,
mib_access
,
int
,
int
);
853
virtual
~
SnmpSecurityModel
();
854
855
virtual
MibEntryPtr
clone();
856
};
857
858
859
/*------------------------ class SnmpSecurityLevel -----------------------*/
860
884
class
AGENTPP_DECL
SnmpSecurityLevel
:
public
SnmpInt32MinMax
{
885
886
public
:
887
SnmpSecurityLevel
(
const
Oidx
&,
mib_access
,
int
,
int
);
888
virtual
~
SnmpSecurityLevel
();
889
890
virtual
MibEntryPtr
clone();
891
};
892
893
894
/*------------------ class SnmpMessageProcessingModel -------------------*/
895
969
class
AGENTPP_DECL
SnmpMessageProcessingModel
:
public
SnmpInt32MinMax
{
970
971
public
:
972
SnmpMessageProcessingModel
(
const
Oidx
&,
mib_access
,
int
,
int
);
973
virtual
~
SnmpMessageProcessingModel
();
974
975
virtual
MibEntryPtr
clone();
976
};
977
978
/*---------------------- class SnmpAdminString ---------------------*/
979
1041
class
AGENTPP_DECL
SnmpAdminString
:
public
OctetStrMinMax
{
1042
1043
public
:
1055
SnmpAdminString
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*);
1077
SnmpAdminString
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*,
int
);
1103
SnmpAdminString
(
const
Oidx
&,
mib_access
,
NS_SNMP
OctetStr*,
int
,
int
,
int
);
1104
virtual
~
SnmpAdminString
();
1105
1106
virtual
MibEntryPtr
clone();
1107
1114
NS_SNMP
OctetStr
get
();
1115
};
1116
1117
/*---------------------- class TimeStamp ---------------------*/
1118
1129
class
AGENTPP_DECL
TimeStamp
:
public
MibLeaf
1130
{
1131
public
:
1150
TimeStamp
(
const
Oidx
&,
mib_access
,
int
);
1151
virtual
~
TimeStamp
();
1152
1153
virtual
bool
is_volatile
() {
return
TRUE
; }
1154
1155
virtual
MibEntryPtr
clone();
1156
1157
void
update();
1158
};
1159
1160
/*---------------------- class TimeStampTable ---------------------*/
1161
1170
class
AGENTPP_DECL
TimeStampTable
:
public
MibTable
1171
{
1172
public
:
1191
TimeStampTable
(
const
Oidx
&,
const
index_info
*,
unsigned
int
,
1192
TimeStamp
*);
1193
1194
virtual
~
TimeStampTable
();
1195
1196
virtual
void
row_added(
MibTableRow
*,
1197
const
Oidx
&,
MibTable
*);
1198
virtual
void
row_delete(
MibTableRow
*,
1199
const
Oidx
&,
MibTable
*);
1205
virtual
void
updated();
1206
1207
protected
:
1208
TimeStamp
*
lastChange
;
1209
};
1210
1211
/*---------------------- class DateAndTime ---------------------*/
1212
1246
class
AGENTPP_DECL
DateAndTime
:
public
MibLeaf
1247
{
1248
public
:
1268
DateAndTime
(
const
Oidx
&,
mib_access
,
int
);
1269
1273
virtual
~
DateAndTime
();
1274
1275
virtual
MibEntryPtr
clone();
1276
virtual
NS_SNMP
OctetStr get_state();
1277
virtual
void
set_state(
const
NS_SNMP
OctetStr&);
1278
1279
virtual
bool
is_volatile
() {
return
TRUE
; }
1280
1284
void
update();
1285
};
1286
1287
#ifdef AGENTPP_NAMESPACE
1288
}
1289
#endif
1290
1291
#endif
Generated by
1.8.2