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

📄 ip_notif_log_support.ex.c

📁 备
💻 C
📖 第 1 页 / 共 5 页
字号:
		"    into the \"Interface Information\" table of\n"
		"    \"IP Multicast Parameters\"\n"
		"    and set its \"Status\" to \"Enabled\".\n"
		" 2. If this node is not a router, enable\n"
		"    multicast using \"IP Host Parameters\"\n"
		"    \"Multicast Mode\" attribute.\n"
		" 3. Ignore this message if you have\n"
		"    intentionally set this attribute to\n"
		"    \"Disabled\".\n"
		"\n",
		op_pk_id (pkptr), op_pk_tree_id (pkptr), intf_name, intf_name, intf_name, intf_name);

	FOUT;
	}

void
ipnl_protwarn_mcast_not_supp_for_pim_join (IpT_Address grp_addr, IpT_Address rp_addr, char* intf_name)
	{
	char 		rp_addr_str [IPC_ADDR_STR_LEN];
	char 		grp_addr_str [IPC_ADDR_STR_LEN];
	
	/** Reports a log message to indicate that a multicast	**/
	/** packet cannot be forwarded to an IP interface		**/
	FIN (ipnl_protwarn_mcast_not_supp_for_pim_join (intf_name));
	
	/* Get a printable version of the RP address.	*/
	ip_address_print (rp_addr_str, rp_addr);
	
	/* Get a printable version of the group address.	*/
	ip_address_print (grp_addr_str, grp_addr);

	op_prg_log_entry_write (
		ip_prot_warning_loghndl,
		"WARNING(S):\n"
		" PIM-SM process has received a multicast join\n"
		" request that cannot be forwarded towards\n"
		" the rendezvous point.\n"
		" Group address:            %s\n"
		" Rendezvous point address: %s\n"
		"\n"
		"ACTION(S):\n"
		" Discarding the packet.\n"
		"\n"
		"POSSIBLE CAUSE(S):\n"
		" Unicast routing table indicates that the join\n"
		" request should be forwarded on interface %s.\n"
		" However, interface %s does not support \n"
		" IP multicasting.\n"
		"\n"
		"SUGGESTION(S):\n"
		" 1. Ensure that multicast is enabled on all\n"
		"    interfaces that are expected to receive\n"
		"    multicast traffic.\n"
		"    Add the interface %s\n"
		"    into the \"Interface Information\" table of\n"
		"    \"IP Multicast Parameters\".\n"
		"    and set its \"Status\" to \"Enabled\".\n"
		" 2. Ignore this message if you have\n"
		"    intentionally set this attribute to\n"
		"    \"Disabled\".\n"
		"\n",
		grp_addr_str, rp_addr_str, intf_name, intf_name, intf_name);

	FOUT;
	}


void
ipnl_reswarn_pktinsert (SimT_Pk_Id pkid, SimT_Pk_Id pktreeid, const char* intf_addr)
	{

	/** Description of the condition flagged by this	**/
	/** notification log message.						**/
	FIN (ipnl_reswarn_pktinsert (pkid, pktreeid, intf_addr));

	op_prg_log_entry_write (
		ip_results_warn_loghndl,
		"WARNING(S):\n"
		" An IP datagram received on interface\n"
		" [%s] could not be inserted into\n"
		" IP's service queue due to insufficient\n"
		" space.\n"
		"\n"
		" The datagram [ID " SIMC_PK_ID_FMT ", Tree ID " SIMC_PK_ID_FMT "] is being\n"
		" discarded.\n"
		"\n"
		"POSSIBLE CAUSE(S):\n"
		" The service queue is full.\n"
		"\n"
		"SUGGESTIONS:\n"
		"1. This condition may indicate insufficient\n"
		"   space in the service queue and/or:\n"
		"2. Insufficient packet processing rate.\n"
		"3. This condition may also result in:\n"
		"   a. Unexpected packet related\n"
		"      statistics, and\n"
		"   b. Unexpected behavior from upper layer\n"
		"      protocols such as TCP. E.g. TCP\n"
		"      retransmissions etc.\n",
		intf_addr, pkid, pktreeid);

	FOUT
	}


void
ipnl_reswarn_slot_pktinsert (SimT_Pk_Id pkid, SimT_Pk_Id pktreeid, const char* intf_addr, int slot_index)
	{

	/** Description of the condition flagged by this	**/
	/** notification log message.						**/
	FIN (ipnl_reswarn_slot_pktinsert (pkid, pktreeid, intf_addr, slot_index));

	op_prg_log_entry_write (
		ip_results_warn_loghndl,
		"WARNING(S):\n"
		" An IP datagram received on interface\n"
		" [%s] and slot no. [%d] could not be\n"
		" inserted into the slot buffer due to\n"
		" insufficient space.\n"
		"\n"
		" The datagram [ID " SIMC_PK_ID_FMT " Tree ID " SIMC_PK_ID_FMT "] is being\n"
		" discarded.\n"
		"\n"
		"POSSIBLE CAUSE(S):\n"
		" The slot buffer has insufficient space.\n"
		"\n"
		"SUGGESTIONS:\n"
		"1. This condition may indicate an unstable\n"
		"   network. For slot # [%d] check the\n"
		"   value of the following attributes:\n"
		"   \"Processor Speed\" & \"Buffer Capacity\"\n"
		"   in the \"Slot Information\" compound\n"
		"   attribute.\n"
		"2. This condition may result in:\n"
		"   a. Unexpected packet related\n"
		"      statistics, and\n"
		"   b. Unexpected behavior from upper layer\n"
		"      protocols such as TCP. E.g. TCP\n"
		"      retransmissions etc.\n",
		intf_addr, slot_index, pkid, pktreeid, slot_index);

	FOUT
	}


void
ipnl_cfgwarn_nonrouting_multihomed (int num_intfs)
	{

	/** Description of the condition flagged by this	**/
	/** notification log message.						**/
	FIN (ipnl_cfgwarn_nonrouting_multihomed (num_intfs));

	op_prg_log_entry_write (
		ip_config_warning_loghndl,
		"WARNING(S):\n"
		"A non-routing node with multiple IP interfaces \n"
		"whose \"IP Default Route\" attribute was not set\n"
		"by the user, has been found.\n"	
		"\n"
		"If this node has only one physical interface, but	\n"
		"one or more tunnel interfaces, then this warning 	\n"
		"may be ignored.\n"
		"\n"	
		"Otherwise, IP will forward non-local unicast\n"
		"datagrams to the first router detected in\n"
		"any of the %d local subnets. Subnets are\n"
		"checked starting at row number zero in the\n"
		"\"IP > IP Routing Parameters > Interface Information\" attribute.\n"
		"\n"
		"This may not be desired behavior."
		"\n"
		"POSSIBLE CAUSE(S):\n"
		"1. Same as above.\n"
		"2. The \"IP Gateway Function\" attribute\n"
		"   is set to \"Disabled\" in error.\n"
		"\n"
		"SUGGESTIONS:\n"
		"1. Check to see if the router that will be\n"
		"   used as a default is the correct one.\n"
		"2. Specify the IP address of the router\n"
		"   interface that you want to be used as\n"
		"	the default gateway. Set the \"IP\n"
		"   Default Route\" attribute accordingly.\n"
		"3. If possible cause #2 is valid, fix it.\n",
		num_intfs);

	FOUT
	}

void
ipnl_proterr_nexthop_error (const char* addr)
	{
	InetT_Address	ipaddr;
	char			nodename [OMSC_HNAME_MAX_LEN] = "Unknown";

	/** Description of the condition flagged by this	**/
	/** notification log message.						**/
	FIN (ipnl_proterr_nexthop_error (addr));

	/* Convert the address string to an IP address
	 * and obtain the name of the node that has an
	 * IP interface with the same address.
	 */
	ipaddr = inet_address_create (addr, InetC_Addr_Family_v4);

	/* Get the hierarchical name of the node.			*/
	ipnl_inet_addr_to_nodename (ipaddr, nodename);

	op_prg_log_entry_write (
		ip_prot_error_loghndl,
		"ERROR(S):\n"
		"A local interface could not be found on\n"
		"which the next hop address %s\n"
		"could be reached.\n"
		"\n"
		"The next hop IP address is an\n"
		"interface on the following node:\n"
		"[%s].\n"
		"\n"
		"POSSIBLE CAUSE(S):\n"
		"1. The user specified value for the \"IP\n"
		"   Default Route\" is incorrect.\n"
		"2. If this is a routing node and dynamic\n"
		"   routing protocols are being used, the\n"
		"   next hop address in the dynamic routing\n"
		"   table is incorrect.\n"
		"\n"
		"SUGGESTIONS:\n"
		"1. Make sure that the value of the \"IP\n"
		"   Default Route\" attr. is part of any\n"
		"   one directly connected subnet by\n"
		"   correlating it with the subnet masks\n"
		"   specified for all the IP interfaces in\n"
		"   this node.\n"
		"2. Debug the configured dynamic routing\n"
		"   protocol to find out why (and how) an\n"
		"   incorrect next hop address is present\n"
		"   in the routing table. Check for messages\n"
		"   from these protocols in the simulation\n"
		"   log.\n",
		addr, nodename);

	/* Destroy the IP address object created earlier.	*/
	inet_address_destroy (ipaddr);

	FOUT
	}

void
ipnl_invalid_next_hop_in_pkt_log_write (IpT_Rte_Module_Data* iprmd_ptr, 
	int input_intf_tbl_index, IpT_Dgram_Fields* pk_fd_ptr)
	{
	char					src_addr_str  [IPC_ADDR_STR_LEN];
	char					dest_addr_str [IPC_ADDR_STR_LEN];
	char					next_addr_str [IPC_ADDR_STR_LEN];
	
	/** a packet was received on an interface whose next hop	**/
	/** address did not fall into the same subnet as the		**/
	/** physical interface or any of the subinterfaces of the	**/
	/** interface on which it was received.						**/

	FIN (ipnl_invalid_next_hop_in_pkt_log_write (iprmd_ptr, input_intf_tbl_index, pk_fd_ptr));

	inet_address_print (src_addr_str,  pk_fd_ptr->src_addr);
	inet_address_print (dest_addr_str, pk_fd_ptr->dest_addr);
	inet_address_print (next_addr_str, pk_fd_ptr->next_addr);

	op_prg_log_entry_write (ip_prot_warning_loghndl,
		"WARNING(s):\n"
		" A packet received on the interface %s was dropped		\n"
		" because the next hop address of the packet (%s)		\n"
		" does not fall into the same subnet as the physical	\n"
		" interface or any of the subinterfaces of this 		\n"
		" interface. \n"
		" Source address of the packet: %s. \n"
		" Destination address of the packet: %s. \n"
		"\n"
		"POSSIBLE CAUSE(s):\n"
		"1. Incorrect IP address configuration.\n"
		"2. Dynamic routing protocol misconfiguration.\n"
		"3. Misconfigured static or default routes.\n"
		"\n"
		"SUGGESTION(s):\n"
		"1. Using Net Doctor or otherwise, identify any			\n"
		"   misconfigurations in the network and fix them.		\n"
		"\n"
		"RESULT(s):\n"
		"1. This packet will be dropped without any further		\n"
		"   processing.\n",
		ip_rte_intf_name_get (ip_rte_intf_tbl_access (iprmd_ptr, input_intf_tbl_index)),
		next_addr_str, src_addr_str, dest_addr_str);

	FOUT;	
	}

void
ipnl_proterr_major_port_error (int major_port, IpT_Address next_hop, int out_intf)
	{
	char 		next_hop_str [IPC_ADDR_STR_LEN];
	char		next_hop_nodename [OMSC_OBJNAME_MAX_LEN];
	
	/** Description of the condition flagged by this	**/
	/** notification log message.				**/
	FIN (ipnl_proterr_major_port_error (major_port, next_hop, out_intf));

	/* Get a printable version of the next hop address.	*/
	ip_address_print (next_hop_str, next_hop);

	/* Get the hierarchical name of the node that has	*/
	/* next_hop as an IP interface.				*/
	ipnl_ipaddr_to_nodename (next_hop, next_hop_nodename);

	op_prg_log_entry_write (
		ip_prot_error_loghndl,
		"ERROR(S):\n"
		" The next hop [%s], could not\n"
		" be reached on the major port [%d]\n"
		" specified in the route entry.\n"
		"\n"
		" The next hop address specified in\n"
		" the route entry is the address of\n"
		" an interface on the following node\n"
		" [%s].\n"
		"\n"
		"ACTION(S):\n"
		" Using the out interface [%d] to\n"
		" reach the next hop [%s].\n"
		" Using the default value for minor\n"
		" port (IPC_MINOR_PORT_DEFAULT).\n"
		"\n"
		"POSSIBLE CAUSE(S):\n"
		" The major port value specified\n"
		" in the route entry to reach the\n"
		" next hop address is invalid.\n"
		"\n"
		"SUGGESTION(S):\n"
		" Check the major port specified\n"
		" in the route entry to reach the\n"
		" next hop address [%s].\n",
		next_hop_str, major_port, next_hop_nodename,
		out_intf, next_hop_str, next_hop_str);

	op_prg_mem_free (next_hop_nodename);

	FOUT;
	}

void
ipnl_proterr_major_port_invalid (int major_port, IpT_Rte_Proc_Id src_proto)
        {
        const char*                     src_proto_str = OPC_NIL;
 
        /** Description of the condition flagged by this        **/
        /** notification log message.                           **/
        FIN (ipnl_proterr_major_port_invalid (major_port, src_proto));
 
        /* Obtain the label of the custom routing protocol. */
        src_proto_str = ip_cmn_rte_table_custom_rte_protocol_label_get (src_proto);
 
        op_prg_log_entry_write (
                ip_prot_error_loghndl,
                "ERROR(S):\n"
                " The major port [%d] is invalid\n"
                " on the node.\n"
                "\n"
                "ACTION(S):\n"
                " Dropping the packet.\n"
                "\n"
                "POSSIBLE CAUSE(S):\n"
                " The major port value specified\n"
                " in the route entry does not exist.\n"
                "\n"
                "SUGGESTION(S):\n"
                " Check the major port [%d] specified\n"
                " in the route entry which is added by\n"
                " the custom routing protocol %s.\n"
                " \n",
                major_port, major_port, src_proto_str);
 
        FOUT;
        }


void
ipnl_cfgwarn_mcastrcv (SimT_Pk_Id pkid, SimT_Pk_Id pktreeid, const char* addr)
	{
	static Boolean		this_msg_printed = OPC_FALSE;

	/** Description of the condition flagged by this	**/
	/** notification log message.						**/
	FIN (ipnl_cfgwarn_mcastrcv (pkid, pktreeid, addr))

	if (this_msg_printed == OPC_FALSE)
		{
		this_msg_printed = OPC_TRUE;

		op_prg_log_entry_write (
			ip_config_warning_loghndl,
			"WARNING(S):\n"
			"A multicast IP datagram with address %s\n"
			"has been received at this node.\n"

⌨️ 快捷键说明

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