📄 moip.h
字号:
/*! \file MoIp.h \brief IP僾儘僩僐儖幚憰僋儔僗 僿僢僟 Copyright (c) 2004 Yamami All rights reserved. License=MIT/X Licnese \author Yamami \version $Revision: 1.2 $ \date create:2004/09/20 update:$Date: 2004/10/31 14:29:43 $*/#ifndef _MONA_MOIP_#define _MONA_MOIP_#include <sys/types.h>#include <sys/HashMap.h>#include <monapi.h>#include "MoPacUtl.h"#include "MonesDefine.h"#include "AbstractMonic.h"// Yamami ??偙偺愰尵偙偙偱偄偄丠/*! * \struct IP_HEADER * \brief IP僿僢僟峔憿懱 */typedef struct{ byte verhead; /* 僶乕僕儑儞丄僿僢僟挿丅 */ byte tos; /* TOS. */ word len; /* 僩乕僞儖挿丅 */ word id; /* 幆暿斣崋丅 */ word frag; /* 僼儔僌丄僼儔僌儊儞僩僆僼僙僢僩丅 */ byte ttl; /* Time to Live. */ byte prot; /* 僾儘僩僐儖斣崋丅 */ word chksum; /* 僿僢僟僠僃僢僋僒儉丅 */ dword srcip; /* 憲傝尦IP丅 */ dword dstip; /* 埗愭IP丅 */ char data[0];}IP_HEADER;enum{ IP_HEAD_VERSION=4<<4, IP_HEAD_FRAG_ON= 0x2000, /* 僼儔僌儊儞僩僨乕僞偁傝僼儔僌丅 */ IP_HEAD_FRAG_NOT=0x4000, /* 僼儔僌儊儞僩晄壜僼儔僌丅 */};/*! * \struct TRANS_BUF_INFO * \brief IP憲怣僶僢僼傽峔憿懱 */typedef struct{ char *data[3]; /* 憲怣僼儗乕儉傾僪儗僗丅 */ int size[3]; /* 僨乕僞僼儗乕儉僒僀僘丅 */ word type; /* 僼儗乕儉僞僀僾丅 */ dword ipType; /* IP僾儘僩僐儖僞僀僾丅 */}TRANS_BUF_INFO;/*! MoIp class*/class MoIp{ public: //僐儞僗僩儔僋僞 MoIp(); ~MoIp(); void initIp(AbstractMonic*); int receiveIp(IP_HEADER*); int transIp(TRANS_BUF_INFO*, dword , byte , int ); private: int ipRouting(dword ,dword*); //NIC僪儔僀僶 AbstractMonic* insAbstractNic;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -