lib/packet: make packet_base.parser abstract method

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Isaku Yamahata 2013-07-01 14:53:32 +09:00 committed by FUJITA Tomonori
parent 43e83726ae
commit 3679d7facc

View File

@ -13,9 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import abc
class PacketBase(object):
"""A base class for a protocol (ethernet, ipv4, ...) header."""
__metaclass__ = abc.ABCMeta
_TYPES = {}
@classmethod
@ -43,6 +46,7 @@ class PacketBase(object):
return self.__class__.__name__
@classmethod
@abc.abstractmethod
def parser(cls, buf):
"""Decode a protocol header.