⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipfilterlib.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ipFilterLib.html - generated by refgen from ipFilterLib.c --> <title> ipFilterLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>ipFilterLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ipFilterLib</strong> - ip filter hooks library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./ipFilterLib.html#ipFilterLibInit">ipFilterLibInit</a></i>(&nbsp;)</b>  -  initialize ip filter facility<br><b><i><a href="./ipFilterLib.html#ipFilterHookAdd">ipFilterHookAdd</a></i>(&nbsp;)</b>  -  add a routine to receive all internet protocol packets<br><b><i><a href="./ipFilterLib.html#ipFilterHookDelete">ipFilterHookDelete</a></i>(&nbsp;)</b>  -  delete a ip filter hook routine<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides utilities that give direct access to IP packets.Incoming raw IP packets can be examined or processed using the hooks<b><i><a href="./ipFilterLib.html#ipFilterHookAdd">ipFilterHookAdd</a></i>(&nbsp;)</b>. The input hook can be used to receive raw IP packets thatare a part of IP (Internet Protocol) protocols.The filter hook can also be used to build IP traffic monitoring and testingtools.<p>Normally, the network should be accessed through the higher-level socketinterface provided in sockLib.  The routines in <b><a href="./ipFilterLib.html#top">ipFilterLib</a></b> should rarely,if ever, be necessary for applications.<p><p><p>The <b><i><a href="./ipFilterLib.html#ipFilterLibInit">ipFilterLibInit</a></i>(&nbsp;)</b> routine links the ip filtering facility into the VxWorkssystem.  This is performed automatically if <b>INCLUDE_IP_FILTER</b> is definedin <b>configAll.h</b>.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ipFilterLib.html#top">ipFilterLib</a></b>, <i>VxWorks Programmer's Guide: Network</i><hr><a name="ipFilterLibInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ipFilterLibInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ipFilterLibInit</i>(&nbsp;)</strong> - initialize ip filter facility</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void ipFilterLibInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine links the ip filter facility into the VxWorks system.These routines are included automatically if <b>INCLUDE_IP_FILTER</b>is defined in <b>configAll.h</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ipFilterLib.html#top">ipFilterLib</a></b><hr><a name="ipFilterHookAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ipFilterHookAdd</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ipFilterHookAdd</i>(&nbsp;)</strong> - add a routine to receive all internet protocol packets</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ipFilterHookAdd    (    FUNCPTR ipFilterHook /* routine to receive raw ip packets */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a hook routine that will be called for every IPpacket that is received.<p>The calling sequence of the filter hook routine is:<pre>    BOOL ipFilterHook         (         struct ifnet *pIf,        /* interface packet was received on */         struct mbuf **pPtrMbuf,   /* pointer to pointer to an mbuf chain */         struct ip   **pPtrIpHdr,  /* pointer to pointer to ip header */          int          ipHdrLen,    /* ip packet header length */         )</pre>The hook routine should return TRUE if it has handled the input packet andno further action should be taken with it.  If returning TRUE theipFilterHook is responsible for freeing the mbuf chain by callingm_freem(*pPtrMbuf). It should return FALSE if it has not handled theipFilterHook and normal processing (e.g., Internet) should take place.<p>The packet is in a mbuf chain of which a pointer to a pointer is passed asone of the arguments. The pointer to the mbuf should be accessed bydereferencing the pointer to pointer, pPtrMbuf. This mbuf chain will be reused upon return from the hook.  If the hookroutine needs to retain the input packet, it should copy it elsewhere.by using the macro copy_from_mbufs (buffer, *pPtrMbuf, len).copy_from_mbufs is defined "<b>net/mbuf.h</b>"<p>pPtrIpHdr is a pointer to a pointer to a IP header. The pointer to theip header is obtained by dereferencing pPtrIpHdr. The ip header is usedto examine and process the fields in the ip header. The fields ip_len,ip_id and ip_offset in the ip header are converted to the host byte orderfrom the network byte order before a packet is handed to the filter hook.<p>The pPtrMbuf and pPtrIpHdr are reused upon return from the hook if itis returning FALSE.<p>Normally you will not be needing to modify pPtrMbuf or the pPtrIpHdr.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, always.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ipFilterLib.html#top">ipFilterLib</a></b><hr><a name="ipFilterHookDelete"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ipFilterHookDelete</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ipFilterHookDelete</i>(&nbsp;)</strong> - delete a ip filter hook routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void ipFilterHookDelete (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes an ip filter hook.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ipFilterLib.html#top">ipFilterLib</a></b></body></html>

⌨️ 快捷键说明

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