Ace_Packet_Src_Host_Set()

摘要

设置数据包的源主机名。

语法

Ace_Packet_Src_Host_Set (pk_ptr, hostname)
参数 类型 说明
pk_ptr AceT_Packet * 目标数据包。
hostname const char * 用作源的主机名。

返回类型

void

无返回值。

头文件

ace_client_api.h

示例

/* Get source address. Put address in canonical Ethernet format: */
/* xx:xx:xx:xx:xx:xx. */
op_dlc_src_hostname_get (rec_data, src_hostname);

/* Get destination address. Put address in canonical Ethernet format: */
/* xx:xx:xx:xx:xx:xx. */
op_dlc_dest_hostname_get (rec_data, dest_hostname);

if (strcmp (dest_hostname, ETHERNET_BROADCAST_ADDR) == 0)
	{
	strcpy (dest_hostname, "Broadcast");
	}

/* Set the source and destination hostnames */
Ace_Packet_Src_Host_Set (pk_ptr, src_hostname);
Ace_Packet_Dest_Host_Set (pk_ptr, dest_hostname);

详情

IP 层及其以下各层的解码器使用该函数设置主机名(IP 采用 xxx.xxx.xxx.xxx 形式,以太网采用 xx:xx:xx:xx:xx:xx 形式)。

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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