Chinaunix首页 | 论坛 | 博客
  • 博客访问: 204540
  • 博文数量: 51
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 426
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-24 08:05
文章分类

全部博文(51)

文章存档

2015年(3)

2013年(1)

2011年(4)

2010年(8)

2008年(2)

2007年(18)

2006年(15)

我的朋友

分类: 系统运维

2007-06-08 18:03:52

函数描述:op_subq_pk_insert (subq_index, pkptr, pos_index)
功能:把接收到的包加入到相应的队列中;
返回值:OPC_QINS_OK,OPC_QINS_FAIL, OPC_QINS_PK_ERROR,OPC_QINS_SEL_ERROR;
 
说明:         subq: int型,指要插入的队列号;
              pkptr:要排队的队列;
              pos_index:插入方式,共有三种:OPC_QPOS_PRIO,根据优先权插入队列;
                                         OPC_QPOS_HEAD, 插入队头;
                                         OPC_QPOS_TAIL,插入队尾;
             
          注:1、OPC_QPOS_PRIO需要由op_pk_priority_set()来设置,并且要使用op_subq_sort()进行排序才可以使用。
             2、如果pos_index<0,包将插入到队头,如果pos_index>队列中最大包数,则包将插到队尾。
 
举例:
/* Compose a mac frame from all these elements */
mac_frame_ptr = op_pk_create_fmt ("fddi_mac_fr");
op_pk_nfd_set (mac_frame_ptr, "svc_class", svc_class);
op_pk_nfd_set (mac_frame_ptr, "dest_addr", dest_addr);
op_pk_nfd_set (mac_frame_ptr, "src_addr", my_address);
op_pk_nfd_set (mac_frame_ptr, "info", pdu_ptr);
if (svc_class == FDDI_SVC_ASYNC)
{
op_pk_nfd_set (mac_frame_ptr, "tk_class", req_tk_class);
op_pk_nfd_set (mac_frame_ptr, "pri", req_pri);
}
/* Assign the frame control field... */
op_pk_nfd_set (mac_frame_ptr, "fc", FDDI_FC_FRAME);
/* Enqueue the frame at the tail of the queue. */
op_subq_pk_insert (0, mac_frame_ptr, OPC_QPOS_TAIL);
阅读(2885) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-07-10 10:40:42

不知道能交流下吗 我也是做opnet qq 404652232