Ace_Packet_Src_Host_Set()

Abstract

Sets the source hostname for a packet.

Syntax

Ace_Packet_Src_Host_Set (pk_ptr, hostname)
Argument Type Description
pk_ptr AceT_Packet * Packet of interest.
hostname const char * Host name to be used for the source.

Return Type

void

No return value.

ace_client_api.h

Example

/* 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);

Details

This function is used by the IP layer and lower layers to set the hostname (in xxx.xxx.xxx.xxx form for IP and xx:xx:xx:xx:xx:xx form for Ethernet).

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