iprcve.c

来自「嵌入式RMON,RMON为Remote monitor的缩写,基于SNMP为网络」· C语言 代码 · 共 56 行

C
56
字号
/* Beholder RMON ethernet network monitor,Copyright (C) 1993 DNPAP group *//* See file COPYING 'GNU General Public Licence' for copyright details   */#include <stdio.h>#include "ip.h"#include "iphdr.h"#include "ipprot.h"#include "iproute.h"#include "ipiface.h"#include "ipreas.h"BOOLEAN IpRcve(MAC_IFACE *iface, CHAIN *chain, MAC_HDR *macHdr){    IP_HDR  ipHdr;    CHAIN   *new, *reas;    IP_PROT *prot;    BOOLEAN success = FALSE;    new = IpHdrDecode(chain, &ipHdr);    if (new != 0)    {        if (IpIfaceIsForMe(ipHdr.dst))        {            if (ipHdr.offset == 0 &&                (ipHdr.flags & IP_FLAG_MORE_FRAGMENTS) != IP_FLAG_MORE_FRAGMENTS)            {                prot = IpProtFind(ipHdr.prot);                if (prot != 0)                    success = prot->Rcve(new, &ipHdr);            }            else            {                if (IpReas(new, &reas, &ipHdr))                {                    prot = IpProtFind(ipHdr.prot);                    if (prot != 0)                        success = prot->Rcve(reas, &ipHdr);                    ChainFree(reas);                }                else                {                    success = TRUE;                }            }        }            if (new != chain)            ChainFree(new);    }      return success;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?