+# 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.
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: ..."
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
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)