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.
Header
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).