Commit | Line | Data |
---|---|---|
c4366266 VK |
1 | /* |
2 | ** NetXMS - Network Management System | |
3 | ** SNMP support library | |
65d2c384 | 4 | ** Copyright (C) 2003-2010 Victor Kirhenshtein |
c4366266 VK |
5 | ** |
6 | ** This program is free software; you can redistribute it and/or modify | |
65d2c384 VK |
7 | ** it under the terms of the GNU Lesser General Public License as published by |
8 | ** the Free Software Foundation; either version 3 of the License, or | |
c4366266 VK |
9 | ** (at your option) any later version. |
10 | ** | |
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. | |
15 | ** | |
65d2c384 | 16 | ** You should have received a copy of the GNU Lesser General Public License |
c4366266 VK |
17 | ** along with this program; if not, write to the Free Software |
18 | ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | ** | |
20 | ** File: engine.cpp | |
21 | ** | |
22 | **/ | |
23 | ||
24 | #include "libnxsnmp.h" | |
25 | ||
26 | ||
27 | // | |
28 | // Constructors | |
29 | // | |
30 | ||
31 | SNMP_Engine::SNMP_Engine() | |
32 | { | |
33 | m_idLen = 0; | |
34 | m_engineBoots = 0; | |
35 | m_engineTime = 0; | |
36 | } | |
37 | ||
38 | SNMP_Engine::SNMP_Engine(BYTE *id, int idLen, int engineBoots, int engineTime) | |
39 | { | |
40 | m_idLen = min(idLen, SNMP_MAX_ENGINEID_LEN); | |
41 | memcpy(m_id, id, m_idLen); | |
e0d4b618 VK |
42 | m_engineBoots = engineBoots; |
43 | m_engineTime = engineTime; | |
c4366266 VK |
44 | } |
45 | ||
46 | SNMP_Engine::SNMP_Engine(SNMP_Engine *src) | |
47 | { | |
48 | m_idLen = src->m_idLen; | |
49 | memcpy(m_id, src->m_id, m_idLen); | |
50 | m_engineBoots = src->m_engineBoots; | |
51 | m_engineTime = src->m_engineTime; | |
52 | } | |
53 | ||
54 | ||
55 | // | |
56 | // Destructor | |
57 | // | |
58 | ||
59 | SNMP_Engine::~SNMP_Engine() | |
60 | { | |
61 | } |