Revision a395aaa8 BGPpysim/util/event_log.py

View differences:

BGPpysim/util/event_log.py
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

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

  
3 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
        """
4 34
        self.time = time
5 35
        self.evType = evType
6 36
        self.evFrom = evFrom
......
9 39
        self.binPref = binPref
10 40

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

Also available in: Unified diff