Statistics
| Branch: | Revision:

iof-tools / BGPpysim / util / event_log.py @ a395aaa8

History | View | Annotate | Download (1.49 KB)

1
#!/usr/bin/python
2

    
3
# This program is free software: you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation, either version 3 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
#
16
# Copyright (C) 2019  Mattia Milani <mattia.milani@studenti.unitn.it> & Lorenzo Ghiro <lorenzo.ghiro@unitn.it>
17

    
18

    
19
class EventLog(object):
20
    """
21
    Class EventLog, used to log events in a given format
22
    """
23

    
24
    def __init__(self, time, evType, evFrom, prefix, as_path, binPref='ND'):
25
        """
26
        Initialization on an eventLog element
27
        :param time: when the event happen
28
        :param evType: type of the event
29
        :param evFrom: who trigger the event
30
        :param prefix: Prefix that trigger the event
31
        :param as_path: Path in the packet of the event
32
        :param binPref: given fabrikant path
33
        """
34
        self.time = time
35
        self.evType = evType
36
        self.evFrom = evFrom
37
        self.prefix = prefix
38
        self.as_path = as_path
39
        self.binPref = binPref
40

    
41
    def to_dict(self):
42
        return self.__dict__