⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wait exit execs

📁 opnet网络仿真
💻
字号:
/* Obtain the MAC layer information for the local MAC	*/
/* process from the model-wide registry.				*/
proc_record_handle_list_ptr = op_prg_list_create ();
oms_pr_process_discover (my_objid, proc_record_handle_list_ptr,
	"node objid",	OMSC_PR_OBJID,		my_node_objid,
	"protocol", 	OMSC_PR_STRING,		"mac",
	OPC_NIL);
 
/* If the MAC process regostered itself, then there	*/
/* must be a valid match							*/
record_handle_list_size = op_prg_list_size (proc_record_handle_list_ptr);
	
if (record_handle_list_size !=  1)
	{
	/* An error should be created if there are more	*/
	/* than one WLAN-MAC process in the local node,	*/
	/* or if no match is found.						*/
	op_sim_end ("Error: either zero or several WLAN MAC processes found in the interface", "", "", "");
	}
else
	{
	/*	Obtain a handle on the process record.	*/
	process_record_handle = (OmsT_Pr_Handle) op_prg_list_access (proc_record_handle_list_ptr, 0);
 
	/* Obtain the module objid for the WLAN MAC module. 		*/
	oms_pr_attr_get (process_record_handle, "module objid", OMSC_PR_OBJID, &mac_module_objid);
 
	/* Obtain the stream numbers connected to and from the	*/
	/* WLAN MAC layer process.								*/
	oms_tan_neighbor_streams_find (my_objid, mac_module_objid, &instrm_from_mac, &outstrm_to_mac);
 
	/* Obtain the address handle maintained by the MAC process.	*/
	oms_pr_attr_get (process_record_handle, "address",             OMSC_PR_NUMBER,  &ne_address);
	oms_pr_attr_get (process_record_handle, "auto address handle", OMSC_PR_POINTER, &oms_aa_handle);
 
	/* Set the variable to indicate the MAC address of the	*/
	/* associated MAC layer process.						*/
	mac_address = (int) ne_address;
	}

/* Check if the specified destination address (via the "Destination	*/
/* Address" attribute) is valid or not.								*/

/* Check for broadcast address.										*/
if (destination_address == MAC_BROADCAST)
	{
	/* Do Nothing	*/
	}
else if (destination_address != OMSC_AA_AUTO_ASSIGN)
	{
	/* An explicit destination address has been specified. Check if	*/
	/* it is a valid address.										*/
	if (destination_address == (int) mac_address)
		{
		/* Write a log stating that source node can not be a destination. */
		printf ("\n\nInvalid destination address specification. Changing\n");
		printf ("the specification from its own MAC address (%d) to \"Random\"\n\n", destination_address);

		/* The destination address is set same as the lower layer MAC	*/
		/* address of this node. Ignore the original specification and	*/
		/* and set it to random.										*/
		destination_address = OMSC_AA_AUTO_ASSIGN;
		}
	else
		{
		/* Checks if this is a valid address from the pool of addresses	*/
		/* available.													*/

		dest_addr_okay = oms_aa_dest_addr_check (oms_aa_handle, destination_address);
		if (dest_addr_okay != OPC_TRUE)
			{
			/* Write a log stating that source node can not be a destination. */
			printf ("\n\nInvalid destination address specification. Changing\n");
			printf ("the specification from %d, to \"Random\"\n\n", destination_address);

			/* The specified destination address is invalid. Set it to	*/
			/* random.													*/
			destination_address = OMSC_AA_AUTO_ASSIGN;
			}
		}
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -