op_intrpt_ici()

摘要

获取与当前中断相关联的 ICI。

语法

op_intrpt_ici ()
参数 类型 说明
无参数

返回类型

Ici*

指向与当前中断相关联的 ICI 的指针。

当调用进程的当前中断没有相关联的 ICI 时,返回符号常量 OPC_NIL。

示例

摘自:示例模型(models/std/eth_net);进程模型(eth_mac);函数块;函数 eth_mac_llc_pk_accept()。

/* get a handle on the ICI associated with this mac invocation */
iciptr = op_intrpt_ici ();

/* from the ICI, obtain the intended destination address */
op_ici_attr_get (iciptr, “dst_addr”, &dest_addr);

/* create an ethernet frame in which to encapsulate the llc data */
eth_pkptr = op_pk_create_fmt (“ethernet”);
op_pk_nfd_set (eth_pkptr, “data”, llc_pkptr);

/* assign the destination address of the new frame */
op_pk_nfd_set (eth_pkptr, “dst_addr”, dest_addr);

/* assign this station’s address to the source address field */
op_pk_nfd_set (eth_pkptr, “src_addr”, my_address);

详情

进程中断携带多种类型的信息:中断的类型、与中断相关联的标志或代码,以及可选的 ICI。获取 ICI 的指针使接收进程能够提取其内容。如果 ICI 的内容已被完全“处理”(即该 ICI 对接收进程已无用处),则可以通过原语 op_ici_destroy() 回收该 ICI。但是,只有当发起进程为每个传出中断都创建全新的 ICI 时,才应该销毁 ICI;与之相反的做法有时会被采用,即一次性安装单个 ICI 并持续重复使用。

用途

提供了一种让进程获取与当前中断相关联的已接收 ICI 指针的机制。一旦获得该指针,便可通过 op_ici_attr_get_dbl() 之类的内核过程提取 ICI 的内容。

错误

不会捕获任何错误。

参考

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com