| 1 |
/* |
| 2 |
* This file was created to separate notification data storage from |
| 3 |
* the MIB implementation. |
| 4 |
* |
| 5 |
* Portions of this file are copyrighted by: |
| 6 |
* Copyright (c) 2016 VMware, Inc. All rights reserved. |
| 7 |
* Use is subject to license terms specified in the COPYING file |
| 8 |
* distributed with the Net-SNMP package. |
| 9 |
*/ |
| 10 |
|
| 11 |
#ifndef _MIBGROUP_SNMPTARGETADDRENTRY_DATA_H |
| 12 |
#define _MIBGROUP_SNMPTARGETADDRENTRY_DATA_H |
| 13 |
|
| 14 |
/* |
| 15 |
* we use header_generic from the util_funcs module |
| 16 |
*/ |
| 17 |
|
| 18 |
/* |
| 19 |
* Magic number definitions: |
| 20 |
*/ |
| 21 |
#define SNMPTARGETADDRTDOMAIN 1 |
| 22 |
#define SNMPTARGETADDRTADDRESS 2 |
| 23 |
#define SNMPTARGETADDRTIMEOUT 3 |
| 24 |
#define SNMPTARGETADDRRETRYCOUNT 4 |
| 25 |
#define SNMPTARGETADDRTAGLIST 5 |
| 26 |
#define SNMPTARGETADDRPARAMS 6 |
| 27 |
#define SNMPTARGETADDRSTORAGETYPE 7 |
| 28 |
#define SNMPTARGETADDRROWSTATUS 8 |
| 29 |
#define SNMPTARGETSPINLOCK 99 |
| 30 |
#define SNMPTARGETADDRTDOMAINCOLUMN 2 |
| 31 |
#define SNMPTARGETADDRTADDRESSCOLUMN 3 |
| 32 |
#define SNMPTARGETADDRTIMEOUTCOLUMN 4 |
| 33 |
#define SNMPTARGETADDRRETRYCOUNTCOLUMN 5 |
| 34 |
#define SNMPTARGETADDRTAGLISTCOLUMN 6 |
| 35 |
#define SNMPTARGETADDRPARAMSCOLUMN 7 |
| 36 |
#define SNMPTARGETADDRSTORAGETYPECOLUMN 8 |
| 37 |
#define SNMPTARGETADDRROWSTATUSCOLUMN 9 |
| 38 |
|
| 39 |
/* |
| 40 |
* structure definitions |
| 41 |
*/ |
| 42 |
struct targetAddrTable_struct { |
| 43 |
char *nameData; |
| 44 |
size_t nameLen; |
| 45 |
oid tDomain[MAX_OID_LEN]; |
| 46 |
int tDomainLen; |
| 47 |
void *tAddress; |
| 48 |
size_t tAddressLen; |
| 49 |
int timeout; /* Timeout in centiseconds */ |
| 50 |
int retryCount; |
| 51 |
char *tagListData; |
| 52 |
size_t tagListLen; |
| 53 |
char *paramsData; |
| 54 |
size_t paramsLen; |
| 55 |
int storageType; |
| 56 |
int rowStatus; |
| 57 |
struct targetAddrTable_struct *next; |
| 58 |
netsnmp_session *sess; /* a snmp session to the target host */ |
| 59 |
int close_sess; |
| 60 |
time_t sessionCreationTime; |
| 61 |
}; |
| 62 |
|
| 63 |
/* |
| 64 |
* function definitions |
| 65 |
*/ |
| 66 |
|
| 67 |
void init_snmpTargetAddrEntry_data(void); |
| 68 |
void shutdown_snmpTargetAddrEntry_data(void); |
| 69 |
|
| 70 |
struct targetAddrTable_struct *get_addrTable(void); |
| 71 |
struct targetAddrTable_struct *get_addrForName2(const char *name, |
| 72 |
size_t nameLen); |
| 73 |
struct targetAddrTable_struct *snmpTargetAddrTable_create(void); |
| 74 |
struct targetAddrTable_struct *search_snmpTargetAddrTable(oid * baseName, |
| 75 |
size_t nameLen, |
| 76 |
oid * name, |
| 77 |
size_t * length, |
| 78 |
int exact); |
| 79 |
void snmpTargetAddrTable_add(struct targetAddrTable_struct *); |
| 80 |
void snmpTargetAddrTable_remove(struct targetAddrTable_struct *); |
| 81 |
void snmpTargetAddrTable_dispose(struct targetAddrTable_struct *); |
| 82 |
|
| 83 |
#endif /* _MIBGROUP_SNMPTARGETADDRENTRY_DATA_H */ |