/*#######################################################################
# RDOS operating system
# Copyright (C) 1988-2002, Leif Ekblad
#
# 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. The only exception to this rule
# is for commercial usage in embedded systems. For information on
# usage in commercial embedded systems, contact embedded@rdos.net
#
# 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; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# The author of this program may be contacted at leif@rdos.net
#
# sernet.h
# SERNET protocol translator
#
########################################################################*/

#ifndef _SERNET_H
#define _SERNET_H

#include "anabase.h"

class TSernetProtocolAnalyser : public TProtocolAnalyser
{
public:
	TSernetProtocolAnalyser(const char *MemMapName, int MaxSize);
	virtual ~TSernetProtocolAnalyser();
    
    virtual int GetMsg();
    virtual void ShowMsg();

protected:
    void ShowIpData(unsigned char Protocol, const char *Msg, int Size);
    void ShowSmp(const char *Msg, int Size);
    void ShowArp(const char *Msg, int Size);
    void ShowIp(const char *Msg, int Size);
    void ShowUnknown(int DataType, const char *Msg, int Size);    
	void ShowInitMsg(const char *Msg, int Size);
	void ShowReqMsg(const char *Msg, int Size);
	void ShowReplyMsg(const char *Msg, int Size);
	void ShowDataMsg(const char *Msg, int Size);
	int CheckCrc();
	void ShowAll(const char *Msg, int Size);

    int FCrcTable[256];
};

#endif
