]> git.proxmox.com Git - mirror_frr.git/blobdiff - python/clippy/elf.py
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / python / clippy / elf.py
index 5aaba832a9b44e2bf655f05e84b7f44980d46905..cc442eeda9aa0a64b1c00195cc96319e1e48d8a5 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # FRR libelf wrapper
 #
 # Copyright (C) 2020  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 """
 Wrapping layer and additional utility around _clippy.ELFFile.
@@ -155,6 +142,10 @@ class ELFDissectData(object):
     Common bits for ELFDissectStruct and ELFDissectUnion
     """
 
+    def __init__(self):
+        self._data = None
+        self.elfclass = None
+
     def __len__(self):
         """
         Used for boolean evaluation, e.g. "if struct: ..."
@@ -407,6 +398,8 @@ class ELFDissectUnion(ELFDissectData):
     needed anymore and may be borked now.  Remove this comment when using.
     """
 
+    members = {}
+
     def __init__(self, dataptr, parent=None):
         self._dataptr = dataptr
         self._parent = parent
@@ -440,8 +433,16 @@ class ELFSubset(object):
     def __init__(self):
         super().__init__()
 
+        self.name = None
+        self._obj = None
+        self._elffile = None
+        self.ptrtype = None
+        self.endian = None
         self._pointers = WeakValueDictionary()
 
+    def _wrap_data(self, data, dstsect):
+        raise NotImplementedError()
+
     def __hash__(self):
         return hash(self.name)